From 596a5da2234158800ae88af34ef2e78961ab2721 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 17 Jul 2013 14:42:31 -0700 Subject: [PATCH] feat(coreos-base/bootengine) properly build the cpio image with out breaking /dev This fixes the "create /dev/null" bug and builds the cpio image successfully that the boot kernel needs to install. --- ...1-r2.ebuild => bootengine-0.0.1-r3.ebuild} | 0 .../bootengine/bootengine-0.0.1.ebuild | 29 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) rename sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/{bootengine-0.0.1-r2.ebuild => bootengine-0.0.1-r3.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1-r3.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1-r2.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1-r3.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1.ebuild index cc23325675..2cd098cc70 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/bootengine/bootengine-0.0.1.ebuild @@ -23,12 +23,33 @@ DEPEND=" src_install() { insinto /usr/lib/dracut/modules.d/ doins -r ${S}/dracut/80gptprio $modules_dir +} - chroot ${ROOT} dracut --force --no-kernel --fstab --no-compress /tmp/bootengine.cpio +# 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 + mount --rbind /dev ${ROOT}/dev + mount --rbind /sys ${ROOT}/sys + mount --rbind /run ${ROOT}/run + # --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 --host-only --force --no-kernel --fstab --no-compress /tmp/bootengine.cpio + + umount ${ROOT}/proc + umount ${ROOT}/dev/pts # trust me, it's there, unmount it. + umount ${ROOT}/dev + umount ${ROOT}/sys + umount ${ROOT}/run + + # 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 - - insinto /usr/share/bootengine/ - doins ${cpio} + chmod 644 ${cpio} + mkdir ${ROOT}/usr/share/bootengine/ + cp ${cpio} ${ROOT}/usr/share/bootengine/ rm ${cpio} }