init-install: Fix grub menuentry gen after poky upgrade

After upgrading to poky pyro, generation of grub2 menuentry in grub2
became broken. Our init-install.sh script, origianlly coming from an old
poky version, was modified in poky
c2e63957d5abaa4bb10507da5ba16f01112d0bf5 to adapt to the fact that
/etc/grub.d/40_custom was not there anymore. We need to do the same,
otherwise the menyentry is not appended to the grub config and the
installed image won't boot correctly.
This commit is contained in:
Pau Espin 2018-04-05 12:56:37 +02:00
parent 63092f6c83
commit 1b0ec652ab
2 changed files with 8 additions and 11 deletions

View File

@ -184,21 +184,18 @@ password $BOOTUSER $BOOTPASSWD
EOF
fi
if [ -f /etc/grub.d/40_custom ] ; then
if [ -f /etc/grub.d/00_header ] ; then
echo "Preparing custom grub2 menu..."
cat /etc/grub.d/40_custom >> $GRUBCFG
cat >>$GRUBCFG << EOF
menuentry "Linux" {
set root=(hd0,1)
linux /vmlinuz root=$rootfs $rootwait ro $kernel_cmdline_console $kernel_cmdline_video_mode $kernel_cmdline_vga_mode net.ifnames=0 panic=60 quiet
}
EOF
if [ -n "${BOOTPASSWD}" ] && [ -n "${BOOTUSER}" ]; then
sed -i "s/\(menuentry\)\(.*\)\({\)/\1\2--unrestricted \3/g" $GRUBCFG
fi
sed -i "s@__ROOTFS__@$rootfs $rootwait@g" $GRUBCFG
sed -i "s/__VIDEO_MODE__/$kernel_cmdline_video_mode/g" $GRUBCFG
sed -i "s/__VGA_MODE__/$kernel_cmdline_vga_mode/g" $GRUBCFG
sed -i "s/__CONSOLE__/$kernel_cmdline_console/g" $GRUBCFG
sed -i "s/quiet/net.ifnames=0 panic=60 quiet/g" $GRUBCFG
sed -i "s/rw/ro/g" $GRUBCFG
sed -i "/#/d" $GRUBCFG
sed -i "/exec tail/d" $GRUBCFG
chmod 0444 $GRUBCFG
fi

View File

@ -1,6 +1,6 @@
SYSMOCOM := "${@os.path.dirname(d.getVar('FILE', True))}"
FILESEXTRAPATHS_prepend := "${SYSMOCOM}/files:"
PRINC = "4"
PRINC = "5"
RDEPENDS_${PN} += "e2fsprogs-e2fsck e2fsprogs-resize2fs"