Commit 0e5e1215 authored by Anton Midyukov's avatar Anton Midyukov Committed by Michael Shigorin

tar2fs: switch case for $BOOTLOADER

This allows one not to hope that only the packages of the desired loader will be installed.
parent 07559bc9
...@@ -255,13 +255,13 @@ echo "** end of boot.conf" ...@@ -255,13 +255,13 @@ echo "** end of boot.conf"
popd popd
# for u-boot # Setup bootloader
if [ "$BOOTLOADER" = "uboot" ]; then case "$BOOTLOADER" in
uboot)
EXTLINUX_CONF="$ROOTFS/boot/extlinux/extlinux.conf" EXTLINUX_CONF="$ROOTFS/boot/extlinux/extlinux.conf"
sed -i "s/LABEL=ROOT/$ROOTDEV/g" "$EXTLINUX_CONF" sed -i "s/LABEL=ROOT/$ROOTDEV/g" "$EXTLINUX_CONF"
fi ;;
lilo)
if [ -x "$ROOTFS"/sbin/lilo ]; then
# configure and install bootloader # configure and install bootloader
REGEXP='^.*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$' REGEXP='^.*: ([0-9]+) cylinders, ([0-9]+) heads, ([0-9]+) sectors/track*$'
set -- $(sfdisk -g "$LOOPDEV" | grep -E "$REGEXP" | sed -r "s@$REGEXP@\1 \2 \3@") set -- $(sfdisk -g "$LOOPDEV" | grep -E "$REGEXP" | sed -r "s@$REGEXP@\1 \2 \3@")
...@@ -292,13 +292,16 @@ image=/boot/vmlinuz ...@@ -292,13 +292,16 @@ image=/boot/vmlinuz
boot=$BLOCKDEV boot=$BLOCKDEV
$LILO_COMMON $LILO_COMMON
EOF EOF
elif [ -x "$ROOTFS"/usr/sbin/grub-efi-autoupdate ]; then ;;
grub-efi)
chroot "$ROOTFS" grub-mkconfig -o /boot/grub/grub.cfg chroot "$ROOTFS" grub-mkconfig -o /boot/grub/grub.cfg
chroot "$ROOTFS" grub-install chroot "$ROOTFS" grub-install
elif [ -x "$ROOTFS"/usr/sbin/grub-autoupdate ]; then ;;
grub)
chroot "$ROOTFS" grub-mkconfig -o /boot/grub/grub.cfg chroot "$ROOTFS" grub-mkconfig -o /boot/grub/grub.cfg
chroot "$ROOTFS" grub-install --target=i386-pc "$LOOPDEV" chroot "$ROOTFS" grub-install --target=i386-pc "$LOOPDEV"
fi ;;
esac
if [ -n "$SUDO_USER" ]; then if [ -n "$SUDO_USER" ]; then
chown "$SUDO_USER:$(id -g "$SUDO_USER")" "$IMG" ||: chown "$SUDO_USER:$(id -g "$SUDO_USER")" "$IMG" ||:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment