diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-05-18 11:11:50 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-05-18 11:11:50 -0300 |
commit | c91c0006e000f9951f0b80b92b8f00584c0317d6 (patch) | |
tree | d4c4e4341b99685d0fbd26fb0f2337e9edb9db4b /src/core/procedures | |
parent | 68d9ca947a2544bb76d550de2837d6e9548fe695 (diff) | |
parent | f2348ba05300118b1475441e6f75be3995603c49 (diff) |
Merge branch 'master' of https://projects.archlinux.org/git/aif
Diffstat (limited to 'src/core/procedures')
-rw-r--r-- | src/core/procedures/automatic | 27 | ||||
-rw-r--r-- | src/core/procedures/base | 45 | ||||
-rw-r--r-- | src/core/procedures/interactive | 27 | ||||
-rw-r--r-- | src/core/procedures/partial-disks | 18 |
4 files changed, 63 insertions, 54 deletions
diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index ba533fa..407a35b 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -29,7 +29,7 @@ process_args () else usage exit 5 - fi + fi } @@ -61,9 +61,9 @@ worker_configure () worker_select_source () { - var_PKG_SOURCE_TYPE=${SOURCE:-cd} - var_FILE_URL=${FILE_URL:-file:///src/core/pkg} - var_SYNC_URL=${SYNC_URL:-} + var_PKG_SOURCE_TYPE=${SOURCE:-cd} + var_FILE_URL=${FILE_URL:-file:///src/core/pkg} + var_SYNC_URL=${SYNC_URL:-} } worker_prepare_disks () @@ -82,7 +82,6 @@ worker_prepare_disks () inform "Partitions and filesystems made successfully" # TODO: fstab? auto-add to fstab with libs? auto mkdir's on target_dir? - true } worker_package_list () @@ -91,13 +90,13 @@ worker_package_list () var_TARGET_GROUPS=$TARGET_GROUPS var_TARGET_PACKAGES_EXCLUDE=$TARGET_PACKAGES_EXCLUDE [ -z "$var_TARGET_PACKAGES" -a -z "$var_TARGET_GROUPS" ] && var_TARGET_GROUPS=base + true } worker_install_packages () { - target_prepare_pacman core extra community - installpkg + target_prepare_pacman core extra community && installpkg } @@ -110,11 +109,11 @@ worker_set_clock () worker_install_bootloader () { - get_grub_map - grub-install $var_GRUB_DEVICE --root-directory=/mnt - # check if we have a seperate bootdev (/boot) - # ToDo: This is double-work, find a better place! - # See comment in generate_grub_menulst and interactive_grub - bootdev=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1) - generate_grub_menulst + get_grub_map || return 1 + grub-install $var_GRUB_DEVICE --root-directory=/mnt || return 1 + # check if we have a seperate bootdev (/boot) + # ToDo: This is double-work, find a better place! + # See comment in generate_grub_menulst and interactive_grub + bootdev=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1) + generate_grub_menulst || return 1 } diff --git a/src/core/procedures/base b/src/core/procedures/base index 059930f..6f8ed0c 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -44,6 +44,7 @@ worker_intro () then die_error "User aborted base profile execution" fi + true } @@ -81,8 +82,12 @@ worker_runtime_repositories () do repo=${var_RUNTIME_REPOSITORIES[$(($i*2))]} location=${var_RUNTIME_REPOSITORIES[$(($i*2+1))]} - list_pacman_repos runtime | grep -q $repo || add_pacman_repo runtime $repo "$location" + if ! list_pacman_repos runtime | grep -q $repo + then + add_pacman_repo runtime $repo "$location" || return 1 + fi done + return 0 } @@ -90,23 +95,30 @@ worker_runtime_packages () { for pkg in $var_RUNTIME_PACKAGES do - $PACMAN -Sy --noconfirm --needed $pkg + $PACMAN -Sy --noconfirm --needed $pkg || return 1 done + return 0 } worker_set_clock () { local default=no - while true; do - ask_option $default "Date/time configuration" '' required \ - "1" "Select region and timezone" \ - "2" "Set time and date" \ - "3" "Return to Main Menu" || return 1 - [ "$ANSWER_OPTION" = 1 ] && execute worker interactive_timezone && default=2 - [ "$ANSWER_OPTION" = 2 ] && check_depend worker interactive_timezone && execute worker interactive_time && default=3 - [ "$ANSWER_OPTION" = 3 ] && break - done + while true; do + ask_option $default "Date/time configuration" '' required \ + "1" "Select region and timezone" \ + "2" "Set time and date" \ + "3" "Return to Main Menu" || return 1 + case $ANSWER_OPTION in + "1") execute worker interactive_timezone && default=2 || return 1 ;; + "2") if check_depend worker interactive_timezone + then + execute worker interactive_time && default=3 || return 1 + fi ;; + "3") break ;; + esac + done + return 0 } @@ -124,8 +136,7 @@ worker_interactive_time () worker_prepare_disks () { - partition # use lib-archboot function by default - get_possible_fs + partition && get_possible_fs # in official installer: autoprepare or diy first partitions, then mountpoints } @@ -139,18 +150,16 @@ worker_package_list () worker_install_packages () { - target_prepare_pacman core - installpkg + target_prepare_pacman core && installpkg } worker_configure_system () { - preconfigure_target - postconfigure_target + preconfigure_target && postconfigure_target } -worker_install_bootlader () +worker_install_bootloader () { true } diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index ebcc1e1..5dc5322 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -42,7 +42,7 @@ start_process () default=1 while true do - mainmenu + mainmenu done } @@ -74,7 +74,7 @@ mainmenu() "8") check_depend worker configure_system && execute worker install_bootloader && default=9 ;; "9") execute worker msg_report ;; *) execute worker abort_installer;; - esac + esac } @@ -86,8 +86,7 @@ worker_configure_system() worker_prepare_disks() { - get_possible_fs - interactive_prepare_disks + get_possible_fs && interactive_prepare_disks } @@ -106,15 +105,17 @@ worker_select_source () select_source_extras_menu () { local default=no - while true; do - ask_option $default "NET (HTTP/FTP) Installation" "Make sure the network is ok and you've selected a mirror before continuing the installer" required \ - "1" "${workertitles['runtime_network']}" \ - "2" "Select mirror" \ - "3" "Return to Main Menu" || return 1 - [ "$ANSWER_OPTION" = 1 ] && execute worker runtime_network && default=2 - [ "$ANSWER_OPTION" = 2 ] && interactive_select_mirror && default=3 - [ "$ANSWER_OPTION" = 3 ] && break - done + while true; do + ask_option $default "NET (HTTP/FTP) Installation" "Make sure the network is ok and you've selected a mirror before continuing the installer" required \ + "1" "${workertitles['runtime_network']}" \ + "2" "Select mirror" \ + "3" "Return to Main Menu" || return 1 + case $ANSWER_OPTION in + "1") execute worker runtime_network && default=2 || return 1 ;; + "2") interactive_select_mirror && default=3 || return 1 ;; + "3") break ;; + esac + done return 0 } diff --git a/src/core/procedures/partial-disks b/src/core/procedures/partial-disks index 8f17e33..c79914b 100644 --- a/src/core/procedures/partial-disks +++ b/src/core/procedures/partial-disks @@ -6,14 +6,14 @@ var_ARGS_USAGE="-o process/rollback: Operation: process the blockdevice layer or process_args () { - if [ "$1" = '-o' ] - then - [ "$2" != process -a "$2" != rollback ] && die_error "You must specify 'process' or 'rollback'" - OPERATION=$2 - else - usage - exit 5 - fi + if [ "$1" = '-o' ] + then + [ "$2" != process -a "$2" != rollback ] && die_error "You must specify 'process' or 'rollback'" + OPERATION=$2 + else + usage + exit 5 + fi } @@ -29,4 +29,4 @@ start_process () then rollback_filesystems fi -}
\ No newline at end of file +} |