Commit 37dce2b2 authored by Anton Midyukov's avatar Anton Midyukov

tar2fs: create /boot partition with ext4, if extlinux.conf and '/' is not ext4

parent cf1e1664
......@@ -80,6 +80,21 @@ if [ "$BOOTLOADER" == grub-efi -o "$BOOTTYPE" == EFI ]; then
ROOTPART="2"
fi
# tested to work: ext[234], jfs
# NB: xfs doesn't have a spare sector for the bootloader
ROOTFSTYPE="${4:-ext4}"
if [ -f "$ROOTFS/boot/extlinux/extlinux.conf" ] && [ "$ROOTFSTYPE" != ext4 ]; then
if [ -n "$EFIPART" ]; then
BOOTPART="2"
ROOTPART="3"
else
BOOTPART="1"
ROOTPART="2"
fi
BOOTFSTYPE="ext4"
fi
PARTTABLE="$7"
if [ -z "$PARTTABLE" ]; then
if [ "$BOOTLOADER" == grub-efi ]; then
......@@ -148,10 +163,6 @@ ROOTSIZE="$((${ROOTSIZE:-$DEFSIZE} + $MB - 1))" # for ceil rounding to MB
ROOTSIZEM="$(($ROOTSIZE / $MB))"
BOOTSIZEM="$((($SIZE_FACTOR * $BOOT_SIZE_FACTOR * $BOOTSIZE + $MB - 1) / $MB))"
# tested to work: ext[234], jfs
# NB: xfs doesn't have a spare sector for the bootloader
ROOTFSTYPE="${4:-ext4}"
# single root partition hardwired so far,
# add another image for home/data/swap if needed
ROOTDEV="$BLOCKDEV$ROOTPART"
......@@ -369,11 +380,19 @@ popd
if [ -f "$ROOTFS/boot/extlinux/extlinux.conf" ]; then
sed -i "s/LABEL=ROOT/$ROOTDEV/g" "$ROOTFS/boot/extlinux/extlinux.conf"
if [ "$PARTTABLE" == gpt ]; then
if [ -n "$BOOTPART" ]; then
parting set "$BOOTPART" legacy_boot on
else
parting set "$ROOTPART" legacy_boot on
fi
fi
if [ "$PARTTABLE" == msdos ]; then
if [ -n "$BOOTPART" ]; then
parting set "$BOOTPART" boot on
else
parting set "$ROOTPART" boot on
fi
fi
fi
# Setup bootloader
......
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