From 4e6d93cff3ed3287cd2766ac2f1c8c8836fb31f8 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 22 Jul 2013 22:13:53 -0400 Subject: [PATCH] fix(sys-kernel/bootengine): Use new update-bootengine script in postinst All the nasties have been polished and hidden away in a new script. --- ...r13.ebuild => bootengine-0.0.1-r14.ebuild} | 0 .../bootengine/bootengine-0.0.1.ebuild | 32 +++++-------------- .../bootengine/bootengine-9999.ebuild | 30 ++++------------- 3 files changed, 15 insertions(+), 47 deletions(-) rename sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/{bootengine-0.0.1-r13.ebuild => bootengine-0.0.1-r14.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r13.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r14.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r13.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-kernel/bootengine/bootengine-0.0.1-r14.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 ecd2978a30..259913f4d4 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 @@ -2,7 +2,7 @@ # Distributed under the terms of the GNU General Public License v2 EAPI="4" -CROS_WORKON_COMMIT="54c9130e08fcae8918d88b56a01b3e3d49d08531" +CROS_WORKON_COMMIT="0223391810a5553c9d2e394e5e838551d23b61a9" CROS_WORKON_PROJECT="coreos/bootengine" CROS_WORKON_LOCALNAME="bootengine" CROS_WORKON_OUTOFTREE_BUILD=1 @@ -37,33 +37,17 @@ RDEPEND="${DEPEND}" src_install() { insinto /usr/lib/dracut/modules.d/ - doins -r ${S}/dracut/80gptprio $modules_dir + doins -r dracut/80gptprio + dosbin update-bootengine } # We are bad, we want to get around the sandbox. So do the creation of the # 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 || die - mount --bind /dev ${ROOT}/dev || die - mount --bind /sys ${ROOT}/sys || die - mount --bind /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 || die - - umount ${ROOT}/proc || die - umount ${ROOT}/dev || die - umount ${ROOT}/sys || die - umount ${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/ || die - cp ${cpio} ${ROOT}/usr/share/bootengine/ || die - rm ${cpio} || die + if [[ -n "${ROOT}" ]]; then + ${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} || die + else + update-bootengine || die + fi } 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 6f30ba5e1d..2a65b33980 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 @@ -36,33 +36,17 @@ RDEPEND="${DEPEND}" src_install() { insinto /usr/lib/dracut/modules.d/ - doins -r ${S}/dracut/80gptprio $modules_dir + doins -r dracut/80gptprio + dosbin update-bootengine } # We are bad, we want to get around the sandbox. So do the creation of the # 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 || 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 || die - - 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/ || die - cp ${cpio} ${ROOT}/usr/share/bootengine/ || die - rm ${cpio} || die + if [[ -n "${ROOT}" ]]; then + ${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} || die + else + update-bootengine || die + fi }