mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-30 10:01:32 +02:00
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:
parent
30e47c03fd
commit
4e6d93cff3
@ -2,7 +2,7 @@
|
|||||||
# Distributed under the terms of the GNU General Public License v2
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
EAPI="4"
|
EAPI="4"
|
||||||
CROS_WORKON_COMMIT="54c9130e08fcae8918d88b56a01b3e3d49d08531"
|
CROS_WORKON_COMMIT="0223391810a5553c9d2e394e5e838551d23b61a9"
|
||||||
CROS_WORKON_PROJECT="coreos/bootengine"
|
CROS_WORKON_PROJECT="coreos/bootengine"
|
||||||
CROS_WORKON_LOCALNAME="bootengine"
|
CROS_WORKON_LOCALNAME="bootengine"
|
||||||
CROS_WORKON_OUTOFTREE_BUILD=1
|
CROS_WORKON_OUTOFTREE_BUILD=1
|
||||||
@ -37,33 +37,17 @@ RDEPEND="${DEPEND}"
|
|||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
insinto /usr/lib/dracut/modules.d/
|
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
|
# 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,
|
# cpio image in pkg_postinst() where we are free to mount filesystems, chroot,
|
||||||
# and other fun stuff.
|
# and other fun stuff.
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
mount -t proc proc ${ROOT}/proc || die
|
if [[ -n "${ROOT}" ]]; then
|
||||||
mount --bind /dev ${ROOT}/dev || die
|
${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} || die
|
||||||
mount --bind /sys ${ROOT}/sys || die
|
else
|
||||||
mount --bind /run ${ROOT}/run || die
|
update-bootengine || die
|
||||||
|
fi
|
||||||
# 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
|
|
||||||
}
|
}
|
||||||
|
@ -36,33 +36,17 @@ RDEPEND="${DEPEND}"
|
|||||||
|
|
||||||
src_install() {
|
src_install() {
|
||||||
insinto /usr/lib/dracut/modules.d/
|
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
|
# 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,
|
# cpio image in pkg_postinst() where we are free to mount filesystems, chroot,
|
||||||
# and other fun stuff.
|
# and other fun stuff.
|
||||||
pkg_postinst() {
|
pkg_postinst() {
|
||||||
mount -t proc proc ${ROOT}/proc || die
|
if [[ -n "${ROOT}" ]]; then
|
||||||
mount --rbind /dev ${ROOT}/dev || die
|
${ROOT}/usr/sbin/update-bootengine -m -c ${ROOT} || die
|
||||||
mount --rbind /sys ${ROOT}/sys || die
|
else
|
||||||
mount --rbind /run ${ROOT}/run || die
|
update-bootengine || die
|
||||||
|
fi
|
||||||
# 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
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user