summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpyther@pyther.net <pyther@pyther.net>2011-02-27 17:11:23 -0500
committerDieter Plaetinck <dieter@plaetinck.be>2011-02-28 21:32:53 +0100
commit26bcfae6ec36cf6d01d97e23add278a8aed131a5 (patch)
tree6f72eb9b57a2dc9ee657ebcc2bb95042a57ffe42
parent5a5cd0a56317cd4f8bf6478d4bbaf8f23e63b256 (diff)
Prompt user to pick a bootloader in interactive_select_packages
This gives two advantages: 1) assurance the right package gets installed (and more explicit for user) 2) no need to ask for a bootloader again later in the process. Signed-off-by: Dieter Plaetinck <dieter@plaetinck.be>
-rw-r--r--src/core/libs/lib-blockdevices-filesystems.sh1
-rw-r--r--src/core/libs/lib-ui-interactive.sh27
2 files changed, 19 insertions, 9 deletions
diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh
index a52dcca..01e91e9 100644
--- a/src/core/libs/lib-blockdevices-filesystems.sh
+++ b/src/core/libs/lib-blockdevices-filesystems.sh
@@ -93,6 +93,7 @@ get_possible_fs () {
done
}
+supported_bootloaders=('grub')
# procedural code from quickinst functionized and fixed.
# there were functions like this in the setup script too, with some subtle differences. see below
diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh
index 08d1f70..89e62bd 100644
--- a/src/core/libs/lib-ui-interactive.sh
+++ b/src/core/libs/lib-ui-interactive.sh
@@ -709,12 +709,13 @@ device type label size type create? mountpoint options label params" required "$
# params: none
# returns: 1 on error
interactive_select_packages() {
+ local needed_pkgs=()
# set up our install location if necessary and sync up so we can get package lists
target_prepare_pacman || { show_warning 'Pacman preparation failure' "Pacman preparation failed! Check $LOG for errors."; return 1; }
repos=`list_pacman_repos target`
- notify "Package selection is split into two stages. First you will select package groups that contain packages you may be interested in. Then you will be presented with a full list of packages for each group, allowing you to fine-tune.\n\n
+ notify "Package selection is split into three stages. First, you will select a bootloader. Then, you will select package groups that contain packages that you may be interested in. Lastly, you will be presented with a full list of packages for each group, allowing you to fine-tune.\n\n
Note that right now the packages (and groups) selection is limited to the repos available at this time ($repos). Once you have your Arch system up and running, you have access to more repositories and packages.\n\n
If any previous configuration you've done until now (like fancy filesystems) require extra packages, we've already preselected them for your convenience"
@@ -724,6 +725,14 @@ If any previous configuration you've done until now (like fancy filesystems) req
grouplist+=(${i} - OFF)
done
+ ask_option no "Choose bootloader" "Which bootloader would you like to use?" optional \
+ "grub" "GRUB bootloader"
+
+ bootloader=$ANSWER_OPTION
+
+ # Make sure selected bootloader is a supported_bootloader and mark bootloader for installation
+ check_is_in $bootloader "${supported_bootloaders[@]}" && needed_pkgs+=("$bootloader")
+
ask_checklist "Select Package groups\nDo not deselect base unless you know what you're doing!" 0 "${grouplist[@]}" || return 1
grouplist=("${ANSWER_CHECKLIST[@]}")
@@ -842,15 +851,15 @@ interactive_runtime_network() {
return 0
}
+# bootloader is global variable that gets set in interactive_select_packages
interactive_install_bootloader () {
- ask_option Grub "Choose bootloader" "Which bootloader would you like to use? Grub is the Arch default." required \
- "Grub" "Use the GRUB bootloader (default)" \
- "None" "\Zb\Z1Warning\Z0\ZB: you must install your own bootloader!" || return 1
-
- bl=`tr '[:upper:]' '[:lower:]' <<< "$ANSWER_OPTION"`
- [ "$bl" != grub ] && return 0
- GRUB_OK=0
- interactive_grub
+ if [[ $bootloader = grub ]]; then
+ GRUB_OK=0
+ interactive_grub || return 1
+ else
+ show_warning 'No Bootloader' 'You did not select a bootloader. No bootloader will be installed.'
+ fi
+ return 0
}
interactive_grub() {