Merge "Extend/fix support for extlinux bootloader"
This commit is contained in:
commit
7214ca1196
@ -22,16 +22,22 @@ set -o pipefail
|
|||||||
|
|
||||||
source $_LIB/img-functions
|
source $_LIB/img-functions
|
||||||
|
|
||||||
# Dig up the initrd and kernel to use.
|
if [ -d $TARGET_ROOT/boot/extlinux ] ; then
|
||||||
if [ -d $TARGET_ROOT/boot/syslinux ] ; then
|
CONF=$TARGET_ROOT/boot/extlinux/extlinux.conf
|
||||||
select_boot_kernel_initrd $TARGET_ROOT
|
elif [ -d $TARGET_ROOT/boot/syslinux ] ; then
|
||||||
|
CONF=$TARGET_ROOT/boot/syslinux/syslinux.cfg
|
||||||
|
else
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
cat > $TARGET_ROOT/boot/syslinux/syslinux.cfg<<_EOF_
|
# Dig up the initrd and kernel to use.
|
||||||
|
select_boot_kernel_initrd $TARGET_ROOT
|
||||||
|
|
||||||
|
sudo sh -c "cat > $CONF <<_EOF_
|
||||||
DEFAULT linux
|
DEFAULT linux
|
||||||
|
|
||||||
LABEL linux
|
LABEL linux
|
||||||
KERNEL $KERNEL
|
KERNEL /boot/$KERNEL
|
||||||
APPEND ro root=LABEL=cloudimg-rootfs console=tty0 console=ttyS0,115200
|
APPEND ro root=LABEL=cloudimg-rootfs console=tty0 console=ttyS0,115200 nofb nomodeset vga=normal
|
||||||
INITRD $RAMDISK
|
INITRD /boot/$RAMDISK
|
||||||
_EOF_
|
_EOF_"
|
||||||
fi
|
|
||||||
|
@ -16,19 +16,34 @@ function install_extlinux {
|
|||||||
|
|
||||||
echo "Installing Extlinux..."
|
echo "Installing Extlinux..."
|
||||||
|
|
||||||
MBR=/usr/share/syslinux/mbr.bin
|
# Find and install mbr.bin
|
||||||
if [ ! -f $MBR ]; then
|
for MBR in /usr/share/syslinux/mbr.bin /usr/lib/syslinux/mbr.bin \
|
||||||
MBR=/usr/lib/syslinux/mbr.bin
|
/usr/lib/extlinux/mbr.bin /usr/lib/EXTLINUX/mbr.bin ; do
|
||||||
if [ ! -f $MBR ]; then
|
if [ -f $MBR ]; then
|
||||||
echo "mbr.bin (from SYSLINUX) not found."
|
break
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
if [ ! -f $MBR ]; then
|
||||||
|
echo "mbr.bin (from EXT/SYSLINUX) not found."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dd if=$MBR of=$BOOT_DEV
|
dd if=$MBR of=$BOOT_DEV
|
||||||
|
|
||||||
mkdir -p /boot/syslinux
|
# Find any pre-created extlinux install directory
|
||||||
extlinux --install /boot/syslinux
|
for EXTDIR in /boot/extlinux /boot/syslinux ; do
|
||||||
|
if [ -d $EXTDIR ] ; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ ! -d $EXTDIR ] ; then
|
||||||
|
# No install directory found so default to /boot/syslinux
|
||||||
|
EXTDIR=/boot/syslinux
|
||||||
|
mkdir -p $EXTDIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Finally install extlinux
|
||||||
|
extlinux --install $EXTDIR
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_grub2 {
|
function install_grub2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user