From 0c2b96ed5a6a3afb091e7e5ff93771e6dea478f8 Mon Sep 17 00:00:00 2001 From: "pyther@pyther.net" Date: Tue, 8 Feb 2011 07:10:51 -0500 Subject: Moved kernel parameter generation into get_kernel_parameters The function now stores parameters into var kernel_parameters. The new function does not set the kernel name (vmlinuz). This must now be done in the bootloader configuration code. Signed-off-by: Dieter Plaetinck --- src/core/libs/lib-ui-interactive.sh | 131 +++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 60 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 829556a..e0ad6c9 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -1045,79 +1045,33 @@ generate_grub_menulst() { fi fi # Now that we have our grub-legacy root device (grubdev). - # keep the file from being completely bogus + # keep the file from being completely bogus [ "$grubdev" = "DEVICE NOT FOUND" ] && grubdev= if [ -z "$grubdev" ]; then - notify "Your root boot device could not be autodetected by setup. Ensure you adjust the 'root (hd0,0)' line in your GRUB config accordingly." - grubdev="(hd0,0)" - fi - # remove default entries by truncating file at our little tag (#-*) - sed -i -e '/#-\*/q' $grubmenu + notify "Your root boot device could not be autodetected by setup. Ensure you adjust the 'root (hd0,0)' line in your GRUB config accordingly." + grubdev="(hd0,0)" + fi - # find label or uuid of the root partition - case $PART_ACCESS in - label) - local _label="$(getlabel $_rootpart)" - if [ -n "${_label}" ]; then - _rootpart="/dev/disk/by-label/${_label}" - fi - ;; - uuid) - local _uuid="$(getuuid $_rootpart)" - if [ -n "${_uuid}" ]; then - _rootpart="/dev/disk/by-uuid/${_uuid}" - fi - ;; - esac + # remove default entries by truncating file at our little tag (#-*) + sed -i -e '/#-\*/q' $grubmenu - # handle dmraid/mdadm,lvm,dm_crypt etc. replace entries where needed automatically - kernel="kernel $subdir/vmlinuz26 root=${_rootpart} ro" - if get_anchestors_mount ';/;' - then - if echo "$ANSWER_DEVICES" | sed -n '1p' | grep -q 'dm_crypt$' && echo "$ANSWER_DEVICES" | sed -n '2p' | grep -q 'raw$' - then - debug 'FS' 'Grub kernel line? Found / on dm_crypt on raw' - raw_device=`echo "$ANSWER_DEVICES" | sed -n '2p' | cut -d ' ' -f1` - crypt_device=`echo "$ANSWER_DEVICES" | sed -n '1p' | cut -d ' ' -f1` - kernel="kernel $subdir/vmlinuz26 root=$crypt_device cryptdevice=$raw_device:`basename $crypt_device` ro" - elif echo "$ANSWER_DEVICES" | sed -n '1p' | grep -q 'lvm-lv$' && echo "$ANSWER_DEVICES" | sed -n '4p' | grep -q 'dm_crypt$' && echo "$ANSWER_DEVICES" | sed -n '5p' | grep -q 'raw$' - then - debug 'FS' 'Grub kernel line? Found / on lvm on dm_crypt on raw' - lv_device=`echo "$ANSWER_DEVICES" | sed -n '1p' | cut -d ' ' -f1` - crypt_device=`echo "$ANSWER_DEVICES" | sed -n '4p' | cut -d ' ' -f1` - raw_device=`echo "$ANSWER_DEVICES" | sed -n '5p' | cut -d ' ' -f1` - kernel="kernel $subdir/vmlinuz26 root=$lv_device cryptdevice=$raw_device:`basename $crypt_device` ro" - elif echo "$ANSWER_DEVICES" | sed -n '1p' | grep -q 'dm_crypt$' && echo "$ANSWER_DEVICES" | sed -n '2p' | grep -q 'lvm-lv$' && echo "$ANSWER_DEVICES" | sed -n '5p' | grep -q 'raw$' - then - debug 'FS' 'Grub kernel line? Found / on dm_crypt on lvm on raw' - crypt_device=`echo "$ANSWER_DEVICES" | sed -n '1p' | cut -d ' ' -f1` - lv_device=`echo "$ANSWER_DEVICES" | sed -n '2p' | cut -d ' ' -f1` - kernel="kernel $subdir/vmlinuz26 root=$crypt_device cryptdevice=$lv_device:`basename $crypt_device` ro" - elif echo "$ANSWER_DEVICES" | sed -n '1p' | grep -q 'raw$' - then - debug 'FS' 'Grub kernel line? Found / on raw' - elif echo "$ANSWER_DEVICES" | sed -n '1p' | grep -q 'lvm-lv$' && echo "$ANSWER_DEVICES" | sed -n '4p' | grep -q 'raw$' - then - debug 'FS' 'Grub kernel line? Found / on lvm on raw' - else - debug 'FS' 'Grub kernel line? Could not figure this one out' - show_warning "Disk setup detection" "Are you using some really fancy dm_crypt/lvm/softraid setup?\nI could not figure it out, so the kernel line will be the default: you'll probably need to edit it.\nPlease file a bug for this and supply all files from /tmp/aif/" - fi - else - show_warning "Disk setup detection" "Could not find out where your / is. Did you setup filesystems/blockdevices? manual/autoprepare? If yes, please file a bug and tell us about this" - fi - cat >>$grubmenu <>$grubmenu <