From 53c5b70b5a136d3029d338c0355d7b9f09de70ca Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sun, 21 Jul 2013 22:30:37 -0400 Subject: [PATCH] fix(sys-kernel/bootengine): All commands in postinst should be fatal. If /dev fails to mount we better not continue, that's a sure fire way to wind up with a directory named dev/null. --- ...r10.ebuild => bootengine-0.0.1-r11.ebuild} | 0 .../bootengine/bootengine-0.0.1.ebuild | 23 +++++++------- .../bootengine/bootengine-9999.ebuild | 30 +++++++++---------- 3 files changed, 27 insertions(+), 26 deletions(-) rename sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/{bootengine-0.0.1-r10.ebuild => bootengine-0.0.1-r11.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r10.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r11.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r10.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r11.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1.ebuild index 13fe3d5eb3..96622ea614 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1.ebuild @@ -30,25 +30,26 @@ src_install() { # cpio image in pkg_postinst() where we are free to mount filesystems, chroot, # and other fun stuff. pkg_postinst() { - mount -t proc proc ${ROOT}/proc - mount --rbind /dev ${ROOT}/dev - mount --rbind /sys ${ROOT}/sys - mount --rbind /run ${ROOT}/run + mount -t proc proc ${ROOT}/proc || die + mount --rbind /dev ${ROOT}/dev || die + mount --rbind /sys ${ROOT}/sys || die + mount --rbind /run ${ROOT}/run || die # The keyboard tables are all still being included, which we need to # figure out how to remove someday. - chroot ${ROOT} dracut --force --no-kernel --nofscks --fstab --no-compress /tmp/bootengine.cpio + chroot ${ROOT} dracut --force --no-kernel --nofscks \ + --fstab --no-compress /tmp/bootengine.cpio || die - umount --recursive ${ROOT}/proc - umount --recursive ${ROOT}/dev - umount --recursive ${ROOT}/sys - umount --recursive ${ROOT}/run + umount --recursive ${ROOT}/proc || die + umount --recursive ${ROOT}/dev || die + umount --recursive ${ROOT}/sys || die + umount --recursive ${ROOT}/run || die # as we are not in src_install() insinto and doins do not work here, so # manually copy the file around cpio=${ROOT}/tmp/bootengine.cpio chmod 644 ${cpio} || die - mkdir -p ${ROOT}/usr/share/bootengine/ + mkdir -p ${ROOT}/usr/share/bootengine/ || die cp ${cpio} ${ROOT}/usr/share/bootengine/ || die - rm ${cpio} + rm ${cpio} || die } diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-9999.ebuild index 284bae6f7c..f4a45dde1f 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-9999.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-9999.ebuild @@ -14,7 +14,7 @@ SRC_URI="" LICENSE="BSD" SLOT="0" -KEYWORDS="~amd64 ~arm ~x86" +KEYWORDS="~amd64 ~x86" DEPEND=" sys-apps/kexec-tools @@ -29,26 +29,26 @@ src_install() { # cpio image in pkg_postinst() where we are free to mount filesystems, chroot, # and other fun stuff. pkg_postinst() { - mount -t proc proc ${ROOT}/proc - mount --rbind /dev ${ROOT}/dev - mount --rbind /sys ${ROOT}/sys - mount --rbind /run ${ROOT}/run + mount -t proc proc ${ROOT}/proc || die + mount --rbind /dev ${ROOT}/dev || die + mount --rbind /sys ${ROOT}/sys || die + mount --rbind /run ${ROOT}/run || die - # --host-only "should" mean that we only include the stuff that this build - # root needs. The keyboard tables are all still being included, which we - # need to figure out how to remove someday. - chroot ${ROOT} dracut --force --no-kernel --nofscks --fstab --no-compress /tmp/bootengine.cpio + # The keyboard tables are all still being included, which we need to + # figure out how to remove someday. + chroot ${ROOT} dracut --force --no-kernel --nofscks \ + --fstab --no-compress /tmp/bootengine.cpio || die - umount --recursive ${ROOT}/proc - umount --recursive ${ROOT}/dev - umount --recursive ${ROOT}/sys - umount --recursive ${ROOT}/run + umount --recursive ${ROOT}/proc || die + umount --recursive ${ROOT}/dev || die + umount --recursive ${ROOT}/sys || die + umount --recursive ${ROOT}/run || die # as we are not in src_install() insinto and doins do not work here, so # manually copy the file around cpio=${ROOT}/tmp/bootengine.cpio chmod 644 ${cpio} || die - mkdir -p ${ROOT}/usr/share/bootengine/ + mkdir -p ${ROOT}/usr/share/bootengine/ || die cp ${cpio} ${ROOT}/usr/share/bootengine/ || die - rm ${cpio} + rm ${cpio} || die }