final fixes for next release

This commit is contained in:
Tobias Powalowski 2010-07-15 21:24:55 +02:00
parent 5f053b8219
commit 9633f7dbe2
2 changed files with 25 additions and 10 deletions

View file

@ -108,7 +108,7 @@ chroot_umount()
# package_installation # package_installation
install_packages() { install_packages() {
if [ "$INSTMODE" = "media" ]; then if [ "$MODE" = "media" ]; then
PKGFILE=/tmp/.pkglist PKGFILE=/tmp/.pkglist
cp $PKGARG/packages.txt $PKGFILE cp $PKGARG/packages.txt $PKGFILE
if [ ! -f $PKGFILE ]; then if [ ! -f $PKGFILE ]; then

View file

@ -1904,6 +1904,18 @@ find_btrfs_raid_devices() {
fi fi
} }
find_btrfs_raid_bootloader_devices() {
btrfs_scan
BTRFS_COUNT=1
if [ "$(blkid -c /dev/null $bootdev -o value -s TYPE)" = "btrfs" ]; then
BTRFS_DEVICES=""
for i in $(btrfs filesystem show $bootdev | cut -d " " -f 11); do
BTRFS_DEVICES="$BTRFS_DEVICES#$i"
BTRFS_COUNT=$(($BTRFS_COUNT+1))
done
fi
}
# find btrfs subvolume # find btrfs subvolume
find_btrfs_subvolume() { find_btrfs_subvolume() {
if [ "$DETECT_CREATE_FILESYSTEM" = "no" ]; then if [ "$DETECT_CREATE_FILESYSTEM" = "no" ]; then
@ -2115,7 +2127,7 @@ choose_btrfs_subvolume () {
# boot on btrfs subvolume is not supported # boot on btrfs subvolume is not supported
check_btrfs_boot_subvolume() { check_btrfs_boot_subvolume() {
if [ "$MP" = "/boot" -a "$FSTYPE" = "btrfs" -a ! "$BTRFS_SUBVOLUME" = "NONE" ] ; then if [ "$MP" = "/boot" -a "$FSTYPE" = "btrfs" -a ! "$BTRFS_SUBVOLUME" = "NONE" ] ; then
DIALOG --msgbox "ERROR: /boot on a btrfs subvolume is not supported by any bootloader yet!" 8 65 DIALOG --msgbox "ERROR: \n/boot on a btrfs subvolume is not supported by any bootloader yet!" 8 65
FILESYSTEM_FINISH="no" FILESYSTEM_FINISH="no"
fi fi
} }
@ -3042,7 +3054,7 @@ common_bootloader_checks() {
} }
# look for a separately-mounted /boot partition # look for a separately-mounted /boot partition
check_bootpart () { check_bootpart() {
subdir="" subdir=""
bootdev=$(mount | grep $DESTDIR/boot | cut -d' ' -f 1) bootdev=$(mount | grep $DESTDIR/boot | cut -d' ' -f 1)
if [ "$bootdev" = "" ]; then if [ "$bootdev" = "" ]; then
@ -3167,9 +3179,6 @@ finish_syslinux () {
DIALOG --msgbox "$SYSLINUX was successfully installed." 0 0 DIALOG --msgbox "$SYSLINUX was successfully installed." 0 0
} }
### TODO:
# - raid not supported at all in btrfs mode
# install extlinux bootloader # install extlinux bootloader
doextlinux () { doextlinux () {
bootdev="" bootdev=""
@ -3198,6 +3207,11 @@ doextlinux () {
fi fi
fi fi
# extlinux cannot boot from btrfs raid # extlinux cannot boot from btrfs raid
find_btrfs_raid_bootloader_devices
if [ $BTRFS_COUNT -ge 3 ]; then
DIALOG --msgbox "Error:\n$SYSLINUX cannot boot from any btrfs raid." 0 0
return 1
fi
common_syslinux || return 1 common_syslinux || return 1
chroot_mount chroot_mount
chroot $DESTDIR $SYSLINUX_PROGRAM --install /boot >$LOG 2>&1 chroot $DESTDIR $SYSLINUX_PROGRAM --install /boot >$LOG 2>&1
@ -3250,7 +3264,8 @@ dolilo() {
if [ "$(parted -sl | grep "Partition Table: gpt")" ]; then if [ "$(parted -sl | grep "Partition Table: gpt")" ]; then
DIALOG --defaultno --yesno "Warning:\nSetup detected GUID (gpt) partition table.\n\nLilo doesn't support booting from GUID (gpt) partition table.\n\nDo you want to install lilo to an other device, which contains a msdos partition table?" 0 0 || return 1 DIALOG --defaultno --yesno "Warning:\nSetup detected GUID (gpt) partition table.\n\nLilo doesn't support booting from GUID (gpt) partition table.\n\nDo you want to install lilo to an other device, which contains a msdos partition table?" 0 0 || return 1
fi fi
abort_btrfs_bootpart check_bootpart
abort_btrfs_bootpart || return 1
# Try to auto-configure LILO... # Try to auto-configure LILO...
if ! [ "$PART_ROOT" = "" ]; then if ! [ "$PART_ROOT" = "" ]; then
if [ "$NAME_SCHEME_PARAMETER" = "UUID" -o "$NAME_SCHEME_PARAMETER" = "LABEL" ]; then if [ "$NAME_SCHEME_PARAMETER" = "UUID" -o "$NAME_SCHEME_PARAMETER" = "LABEL" ]; then
@ -3344,7 +3359,7 @@ dogrub() {
# try to auto-configure GRUB... # try to auto-configure GRUB...
if [ "$PART_ROOT" != "" ]; then if [ "$PART_ROOT" != "" ]; then
check_bootpart check_bootpart
abort_btrfs_bootpart abort_btrfs_bootpart || return 1
# check if raid device, devicemapper or dmraid is used on /boot partition # check if raid device, devicemapper or dmraid is used on /boot partition
if [ "$(echo $bootdev | grep /dev/md)" ]; then if [ "$(echo $bootdev | grep /dev/md)" ]; then
if [ "$(mdadm --detail $bootdev | grep Level | sed -e 's#.*:\ ##g')" = "raid1" ]; then if [ "$(mdadm --detail $bootdev | grep Level | sed -e 's#.*:\ ##g')" = "raid1" ]; then
@ -3519,7 +3534,7 @@ dogrub2(){
# try to auto-configure GRUB2... # try to auto-configure GRUB2...
if [ "$PART_ROOT" != "" ]; then if [ "$PART_ROOT" != "" ]; then
check_bootpart check_bootpart
abort_btrfs_bootpart abort_btrfs_bootpart || return 1
# check if raid, raid partition, dmraid or device devicemapper is used # check if raid, raid partition, dmraid or device devicemapper is used
if [ "$(echo $bootdev | grep /dev/md)" -o "$(echo $bootdev | grep /dev/mapper)" ]; then if [ "$(echo $bootdev | grep /dev/md)" -o "$(echo $bootdev | grep /dev/mapper)" ]; then
# boot from lvm and raid devices is supported # boot from lvm and raid devices is supported