From 3f9b08eedc8588ebd9b047c238679afe8539970e Mon Sep 17 00:00:00 2001 From: Zhang Xiao Date: Thu, 31 Aug 2023 13:42:40 +0800 Subject: [PATCH] debian: initramfs-ostree: add support to skip eject operation In special cases, the installation media does not support "eject" operation. Add "skip-eject" option on parameter INSTPOST to avoid "eject" operation. Test Plan: Pass: build-pkgs -c -p initramfs-ostree Story: 2010643 Task: 48708 Change-Id: Ic2c0bf491780cd99d9e584ea7a80e7dc04b4fb70 Signed-off-by: Zhang Xiao --- ...all.sh-skip-eject-operation-through-.patch | 39 +++++++++++++++++++ ostree/initramfs-ostree/debian/patches/series | 1 + 2 files changed, 40 insertions(+) create mode 100644 ostree/initramfs-ostree/debian/patches/0016-init-ostree-install.sh-skip-eject-operation-through-.patch diff --git a/ostree/initramfs-ostree/debian/patches/0016-init-ostree-install.sh-skip-eject-operation-through-.patch b/ostree/initramfs-ostree/debian/patches/0016-init-ostree-install.sh-skip-eject-operation-through-.patch new file mode 100644 index 000000000..baa9f80d0 --- /dev/null +++ b/ostree/initramfs-ostree/debian/patches/0016-init-ostree-install.sh-skip-eject-operation-through-.patch @@ -0,0 +1,39 @@ +From c87892bae32dfc4fbb2cbb0fb4479f947e1d5a42 Mon Sep 17 00:00:00 2001 +From: Zhang Xiao +Date: Mon, 28 Aug 2023 19:43:11 -0700 +Subject: [PATCH] init-ostree-install.sh: skip eject operation through INSTPOST + +In special cases the installation media does not support "eject" +operation. Add "skip-eject" option on parameter INSTPOST to avoid +"eject" operation. + +Signed-off-by: Zhang Xiao +--- + init-ostree-install.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/init-ostree-install.sh b/init-ostree-install.sh +index 6494253..0f523bc 100644 +--- a/init-ostree-install.sh ++++ b/init-ostree-install.sh +@@ -58,6 +58,7 @@ OPTIONAL: + instpost=halt - Halt at the end of install vs reboot + instpost=exit - exit at the end of install vs reboot + instpost=shell - shell at the end of install vs reboot ++ instpost=skip-eject - Do not eject boot media at the end of install + instos=OSTREE_OS_NAME - Use alternate OS name vs @OSTREE_OSNAME@ + instsbd=1 - Turn on the skip-boot-diff configuration + instsf=1 - Skip fat partition format +@@ -1734,7 +1735,9 @@ echo 3 > /proc/sys/vm/drop_caches + # Eject installer ISO image if available + isodev=$(blkid --label ${ISO_INSTLABEL} -o device) + if [ $? -eq 0 ]; then +- eject $isodev ++ if [ "$INSTPOST" != "skip-eject" ] ; then ++ eject $isodev ++ fi + fi + + if [ "$INSTPOST" = "halt" ] ; then +-- +2.40.0 diff --git a/ostree/initramfs-ostree/debian/patches/series b/ostree/initramfs-ostree/debian/patches/series index 153fbfbc3..9ddeb7faa 100644 --- a/ostree/initramfs-ostree/debian/patches/series +++ b/ostree/initramfs-ostree/debian/patches/series @@ -13,3 +13,4 @@ 0013-Rsync-the-ostree-repo-before-pulling.patch 0014-init-ostree-install.sh-support-boot-option-inst.ks-f.patch 0015-Support-driver-switch-in-installer.patch +0016-init-ostree-install.sh-skip-eject-operation-through-.patch