fix(sys-kernel/bootengine): Use new update-bootengine script in postinst

All the nasties have been polished and hidden away in a new script.
This commit is contained in:
Michael Marineau 2013-07-22 22:13:53 -04:00
parent 30e47c03fd
commit 4e6d93cff3
3 changed files with 15 additions and 47 deletions

View File

@ -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
}

View File

@ -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
}