From 86ffa132801ca83a3a7ec618c63e4d6de7d5a18a Mon Sep 17 00:00:00 2001 From: "pyther@pyther.net" Date: Sat, 5 Mar 2011 23:10:44 -0500 Subject: Clearify types of devices that find_usable_devices returns Signed-off-by: Dieter Plaetinck --- src/core/libs/lib-blockdevices-filesystems.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 5b078a7..cb30a2e 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -244,8 +244,10 @@ finddisks() { } -# find usable blockdevices, both partionable or not (i.e. partitions themselves) -# $1 extra things to echo for each partition (optional) (backslash escapes will get interpreted) +# find usable blockdevices: RAID + LVM volumes, partitioned and unpartitioned devices +# Exclude devices/partitions that are part of a RAID or LVM volume +# Exclude root block devices (ex. sda) that are partitioned +# $1 extra things to echo for each device (optional) (backslash escapes will get interpreted) find_usable_blockdevices() { shopt -s nullglob -- cgit v1.2.3-54-g00ecf From 9f1137e7787fdf3b9fb8b2a7bdd9b7abf6380d09 Mon Sep 17 00:00:00 2001 From: "pyther@pyther.net" Date: Sat, 5 Mar 2011 23:29:23 -0500 Subject: Return non-zero return code for generate_grub_menulst Signed-off-by: Dieter Plaetinck --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 8281bc0..53bf6b9 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -1135,7 +1135,7 @@ EOF # $2 - Bootloader Configuration Files interactive_bootloader_menu() { if [[ $1 = grub ]]; then - generate_grub_menulst + generate_grub_menulst || return fi grep -q '^/dev/mapper' $TMP_FSTAB && local helptext=" /dev/mapper/ users: Pay attention to the kernel line!" -- cgit v1.2.3-54-g00ecf From 55190c0c81fc76f8b2b3983e790f2c7aacf4e69f Mon Sep 17 00:00:00 2001 From: "pyther@pyther.net" Date: Sat, 5 Mar 2011 23:09:59 -0500 Subject: List root block devices instead of usable partitions (GRUB MBR Install) Signed-off-by: Dieter Plaetinck --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 53bf6b9..29453cb 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -905,7 +905,7 @@ interactive_grub() { # Create and edit the grub menu.lst interactive_bootloader_menu "grub" $grubmenu - DEVS="$(find_usable_blockdevices '_ ')" + DEVS="$(finddisks '_ ')" if [ "$DEVS" = " " ]; then notify "No hard drives were found" return 1 -- cgit v1.2.3-54-g00ecf From d7bedef1389ab0275c9059b476be1fbf8b300654 Mon Sep 17 00:00:00 2001 From: "pyther@pyther.net" Date: Sun, 6 Mar 2011 09:53:12 -0500 Subject: Provide Syslinux as a possible bootloader interactive_syslinux depends on the syslinux-install_update script that is in the Arch syslinux package. Signed-off-by: Dieter Plaetinck --- src/core/libs/lib-blockdevices-filesystems.sh | 3 +- src/core/libs/lib-ui-interactive.sh | 118 +++++++++++++++++++++++++- src/core/procedures/base | 1 + 3 files changed, 119 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index cb30a2e..13160c9 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -94,7 +94,8 @@ get_possible_fs () { true } -supported_bootloaders=('grub') +syslinux_supported_fs=('ext2' 'ext3' 'ext4' 'btrfs' 'vfat') +supported_bootloaders=('syslinux' '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 29453cb..563dc2b 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -2,7 +2,9 @@ # A library which allows you to do backend stuff by using user interfaces # Global Variables -grubmenu="/boot/grub/menu.lst" # be sure to override this if you have it somewhere else +# Be sure to override these if you have the configuration file elsewhere +grubmenu="/boot/grub/menu.lst" +syslinuxmenu="/boot/syslinux/syslinux.cfg" # check if a worker has completed successfully. if not -> tell user he must do it + return 1 # if ok -> don't warn anything and return 0 @@ -737,7 +739,8 @@ If any previous configuration you've done until now (like fancy filesystems) req done ask_option no "Choose bootloader" "Which bootloader would you like to use?" optional \ - "grub" "GRUB bootloader" + "grub" "GRUB bootloader" \ + "syslinux" "Syslinux bootloader (${syslinux_supported_fs[*]})" bootloader=$ANSWER_OPTION @@ -867,6 +870,8 @@ interactive_install_bootloader () { if [[ $bootloader = grub ]]; then GRUB_OK=0 interactive_grub || return 1 + elif [[ $bootloader = syslinux ]]; then + interactive_syslinux || return 1 else show_warning 'No Bootloader' 'You did not select a bootloader. No bootloader will be installed.' fi @@ -1131,11 +1136,120 @@ EOF fi } +interactive_syslinux() { + debug FS "starting interactive_syslinux" + + # Find and Store the device that has the root filesystem + get_device_with_mount '/' || return 1 + PART_ROOT="$ANSWER_DEVICE" + + # Gets boot device + get_device_with_mount '/boot' + bootdev="$ANSWER_DEVICE" + + # Check to see if /boot or / (root) has a valid FS type and set bootpart + # bootpart == device with /boot dir + if [[ $bootdev ]]; then + filesystem="$(awk '/ \/boot /{print $4}' $TMP_FILESYSTEMS)" + debug FS "$bootdev - FS type: $filesystem" + + local bootpart="$bootdev" + else + filesystem="$(awk '/ \/ /{print $4}' $TMP_FILESYSTEMS)" + debug FS "$PART_ROOT - FS type: $filesystem" + + local bootpart="$PART_ROOT" + fi + + if ! check_is_in "$filesystem" "${syslinux_supported_fs[@]}"; then + show_warning "Invalid FS" "Error: Syslinux does not support $filesystem.\n\nThe following filesystems are supported:\n ${syslinux_supported_fs[@]}" + return 1 + fi + + # remove default entries by truncating file at our little tag (#-*) + sed -i -e '/#-\*/q' "$syslinuxmenu" + + # Generate menu and prompt user to edit it + interactive_bootloader_menu "syslinux" "$syslinuxmenu" + + if device_is_raid "$bootpart"; then + debug FS "Software RAID detected" + local onraid=true + fi + + debug FS "Installing Syslinux ($var_TARGET_DIR/usr/sbin/syslinux-install_update -i -c /mnt)" + inform "Installing Syslinux..." + if ! "$var_TARGET_DIR/usr/sbin/syslinux-install_update" -i -c /mnt >$LOG 2>&1; then + debug FS "FAILED: syslinux-install_update -i -c /mnt failed" + show_warning "FAILED" "syslinux-install_update -i -c /mnt failed" + return 1 + fi + + if ask_yesno "Set boot flag(s) and install the Syslinux MBR?" yes; then + inform "Setting Boot Flag(s)...\nThis could take a while. Please be patient.\n\n" syslinuxprog + if "$var_TARGET_DIR/usr/sbin/syslinux-install_update" -a -c /mnt >$LOG 2>&1; then + debug FS "Successfully set boot flag(s)" + else + debug FS "Failde to set boot flag(s). syslinux-install_update -a failed with Error Code - $?" + show_warning "FAILED" "Failed to set boot flag(s). MBR not installed" && return 1 + fi + + inform "Installing Syslinux MBR..." syslinuxprog + if "$var_TARGET_DIR/usr/sbin/syslinux-install_update" -m -c /mnt >$LOG 2>&1; then + debug FS "Successfully installed MBR(s)" + else + debug FS "Failed to install MBR. syslinux-install_update -m failed with Error Code - $?" + show_warning "FAILED" "Failed to install the MBR!" && return 1 + fi + fi + notify "Syslinux Installation Successful" +} + +generate_syslinux_menu () { + get_kernel_parameters || return + + cat >>$syslinuxmenu < Date: Thu, 10 Mar 2011 19:53:31 +0100 Subject: cleanup --- src/core/libs/lib-software.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index bb84621..3ff8305 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -18,8 +18,7 @@ target_run_mkinitcpio() } -# installpkg(). taken from setup. modified bigtime -# performs package installation to the target system +# perform package installation to the target system installpkg() { ALL_PACKAGES= [ -n "$var_TARGET_GROUPS" ] && ALL_PACKAGES=`list_packages group "$var_TARGET_GROUPS" | awk '{print $2}'` -- cgit v1.2.3-54-g00ecf From 6aea100fbea59d73e07e2a6f031e2e4510def3e2 Mon Sep 17 00:00:00 2001 From: "pyther@pyther.net" Date: Sun, 13 Mar 2011 14:42:34 -0400 Subject: Fix code so bootloader package is selected for install Signed-off-by: Dieter Plaetinck --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 563dc2b..38a626e 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -756,7 +756,7 @@ If any previous configuration you've done until now (like fancy filesystems) req # build the list of options, sorted primarily by group, then by packagename (this is already). marking where appropriate local pkglist=() - needed_pkgs=("${needed_pkgs_fs[@]}") + needed_pkgs+=("${needed_pkgs_fs[@]}") while read pkgname pkgver pkggroup pkgdesc; do mark=OFF if check_is_in "$pkggroup" "${grouplist[@]}" || check_is_in $pkgname "${needed_pkgs[@]}"; then -- cgit v1.2.3-54-g00ecf From f48e72a9d4793c7fa93dc9e7232c3d80ee4c6e1d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 3 Apr 2011 22:40:23 +0200 Subject: bugfix: make sure device_is_raid always receives a valid blockdevice --- src/core/libs/lib-ui-interactive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 38a626e..1600cef 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -898,9 +898,9 @@ interactive_grub() { # the partition with seperate /boot or to $PART_ROOT. # So that bootdev is always our real partition with /boot.... bootdev=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1) - # check if bootdev or PART_ROOT is on a md raid array + # check if PART_ROOT (or bootdev, if it is a blockdevice) is on a md raid array # This dialog is only shown when we detect / or /boot on a raid device. - if device_is_raid $bootdev || device_is_raid $PART_ROOT; then + if device_is_raid $PART_ROOT || ( [ -n "$bootdev" ] && device_is_raid "$bootdev" ); then ask_yesno "Do you have your system installed on software raid?\nAnswer 'YES' to install grub to another hard disk." no if [ $? -eq 0 ]; then onraid=true -- cgit v1.2.3-54-g00ecf From ea7010cef98714545b24999588c33661ad7f8efa Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 24 Apr 2011 13:14:59 +0200 Subject: stop_installer(): when no exit code given, exit 0 This prevents the exit code of the last command (i.e. the test case) "leaking" to the exit call. --- src/core/libs/lib-flowcontrol.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-flowcontrol.sh b/src/core/libs/lib-flowcontrol.sh index 4f3bbfa..9bf3fa4 100755 --- a/src/core/libs/lib-flowcontrol.sh +++ b/src/core/libs/lib-flowcontrol.sh @@ -212,11 +212,11 @@ start_installer () # use this function to stop the installation procedure. -# $1 exit code (optional) +# $1 exit code (optional, defaults to 0) stop_installer () { log "-------------- STOPPING INSTALLATION ----------" cleanup_runtime [ "$var_UI_TYPE" = dia ] && clear - exit $1 + exit ${1:-0} } -- cgit v1.2.3-54-g00ecf From cfeaf0e3b7d8c2b75cf66361e330906f4fed5f7d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 24 Apr 2011 13:22:12 +0200 Subject: make AIF exit with the exitcode of the last failing phase --- src/aif.sh | 2 +- src/core/libs/lib-flowcontrol.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/aif.sh b/src/aif.sh index a372932..dfaec5c 100755 --- a/src/aif.sh +++ b/src/aif.sh @@ -146,4 +146,4 @@ start_installer start_process -stop_installer +stop_installer $? diff --git a/src/core/libs/lib-flowcontrol.sh b/src/core/libs/lib-flowcontrol.sh index 9bf3fa4..0e336f4 100755 --- a/src/core/libs/lib-flowcontrol.sh +++ b/src/core/libs/lib-flowcontrol.sh @@ -170,10 +170,12 @@ depend_procedure () start_process () { - execute phase preparation - execute phase basics - execute phase system - execute phase finish + ret=0 + execute phase preparation || ret=$? + execute phase basics || ret=$? + execute phase system || ret=$? + execute phase finish || ret=$? + return $ret } -- cgit v1.2.3-54-g00ecf From 3c9483c433ec200a8cb35cb978ae4d9e9c994f3c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 7 May 2011 23:19:17 +0200 Subject: bugfix: deal correctly with /etc/localtime. Fixes FS#24119 * always execute copy_timezone_file (), whether the user changed the timezone or not, and no matter which procedure we're running. (specifically automatic procedure!) if $TIMEZONE is set, it will create /etc/localtime appropriately on the live system * make target_localtime () - executed through postconfigure_target () - compatible with the case where no /etc/localtime file exists. --- src/core/libs/lib-misc.sh | 8 ++++++++ src/core/libs/lib-ui-interactive.sh | 23 ++++++++++++++++------- src/core/procedures/automatic | 4 ++-- src/core/procedures/base | 4 +++- 4 files changed, 29 insertions(+), 10 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 2dee841..f9fd06a 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -165,6 +165,14 @@ target_configure_time () { ${var_TARGET_DIR}/etc/rc.conf } +target_localtime () { + if [ -f /etc/localtime ] + then + cp /etc/localtime ${var_TARGET_DIR}/etc/localtime || return 1 + fi + return 0 +} + # apped string after last line matching regex in a file. # $1 regex # $2 string (can contain "\n", "\t" etc) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 1600cef..05dd234 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -44,7 +44,7 @@ postconfigure_target () { local failed=() target_run_mkinitcpio || failed+=('mkinitcpio creation') target_locale-gen || failed+=('locale generation') - cp /etc/localtime ${var_TARGET_DIR}/etc/localtime || failed+=('localtime copying') + target_localtime || failed+=('localtime copying') [ ${#failed[@]} -gt 0 ] && warn_failed 'Postconfigure' "${failed[@]}" && return 1 return 0 } @@ -122,14 +122,23 @@ interactive_configure_system() interactive_timezone () { ask_timezone || return 1 TIMEZONE=$ANSWER_TIMEZONE - inform "Setting Timezone to $TIMEZONE" - if [ -n "$TIMEZONE" -a -e "/usr/share/zoneinfo/$TIMEZONE" ] + return 0 +} + +# this should be executed, whether the user changed $TIMEZONE or not +copy_timezone_file () { + if [ -z "$TIMEZONE" ] then - # This changes probably also the systemtime (UTC->$TIMEZONE)! - # localtime users will have a false time after that! - /bin/rm -f /etc/localtime || return 1 - /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime || return 1 + debug UI-INTERACTIVE "\$TIMEZONE is empty, not creating/updating /etc/localtime" + return 0 fi + debug UI-INTERACTIVE "Setting Timezone to $TIMEZONE" + local file="/usr/share/zoneinfo/$TIMEZONE" + [ -e "$file" ] || die_error "No such timezone file: $file, did you choose a non-existing timezone?" + # This changes probably also the systemtime (UTC->$TIMEZONE)! + # localtime users will have a false time after that! + /bin/rm -f /etc/localtime || return 1 + /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime || return 1 return 0 } diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index 407a35b..ce773e1 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -102,8 +102,8 @@ worker_install_packages () worker_set_clock () { - #TODO implement this - true + # uses $TIMEZONE, clock itself remains untouched. + copy_timezone_file } diff --git a/src/core/procedures/base b/src/core/procedures/base index 4e41c81..dba70d1 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -105,13 +105,14 @@ worker_runtime_packages () worker_set_clock () { local default=no + local timezone_file_copied=0 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 ;; + "1") execute worker interactive_timezone && copy_timezone_file && timezone_file_copied=1 && default=2 || return 1 ;; "2") if check_depend worker interactive_timezone then execute worker interactive_time && default=3 || return 1 @@ -119,6 +120,7 @@ worker_set_clock () "3") break ;; esac done + [ $timezone_file_copied -eq 1 ] || copy_timezone_file || return 1 return 0 } -- cgit v1.2.3-54-g00ecf From 281b49fd3dd0984805a9dc435d1a2c36c675eb4d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 17 May 2011 22:12:31 +0200 Subject: btrfs: ask for mountpoint This commit supports using a btrfs directly. Despite recommendations and strong suggestions to somehow prevent users from doing this (and using subvolumes instead) - see http://mailman.archlinux.org/pipermail/arch-releng/2010-December/001341.html - it's taking way to long for code to support this to go into AIF. It's now the users' choice to choose what they want and deal with the consequences. --- src/core/libs/lib-blockdevices-filesystems.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 13160c9..212253d 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -73,7 +73,7 @@ fs_on[lvm-pv]=${fs_on_lvm_pv[@]} fs_on[lvm-vg]=${fs_on_lvm_vg[@]} fs_on[dm_crypt]=${fs_on_dm_crypt[@]} -fs_mountable=(ext2 ext3 ext4 nilfs2 xfs jfs vfat reiserfs) +fs_mountable=(btrfs ext2 ext3 ext4 nilfs2 xfs jfs vfat reiserfs) fs_label_mandatory=('lvm-vg' 'lvm-lv' 'dm_crypt') fs_label_optional=('swap' 'ext2' 'ext3' 'ext4' 'reiserfs' 'nilfs2' 'xfs' 'jfs' 'vfat') -- cgit v1.2.3-54-g00ecf From 1146b9e13b0db8d8d4c0d52c155a64b56eb37a78 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 19 May 2011 11:29:14 +0200 Subject: fix typo --- src/core/libs/lib-blockdevices-filesystems.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 212253d..7d7a826 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -576,7 +576,7 @@ process_filesystems () done < $TMP_FILESYSTEMS [ $open_items -eq 0 ] && break done - [ $open_items -eq 1 ] && show_warning "Filesystem/blockdevice processor problem" "Warning: Could not create all needed filesystems. Either the underlying blockdevices didn't became available in 10 iterations, or process_filesystem failed" && returncode=1 + [ $open_items -eq 1 ] && show_warning "Filesystem/blockdevice processor problem" "Warning: Could not create all needed filesystems. Either the underlying blockdevices didn't appear in 10 iterations, or process_filesystem failed" && returncode=1 -- cgit v1.2.3-54-g00ecf From 7ea398ed600bc2c4d8a1d1487911f5db52f42c93 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 5 Jul 2011 21:21:50 -0400 Subject: lib-network: syntax cleanup quote where necessary and use bash syntax. Signed-off-by: Dave Reisner --- src/core/libs/lib-network.sh | 46 +++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 24 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-network.sh b/src/core/libs/lib-network.sh index 03d5361..5e8c5fc 100644 --- a/src/core/libs/lib-network.sh +++ b/src/core/libs/lib-network.sh @@ -8,52 +8,50 @@ target_configure_network() { # networking setup could have happened in a separate process (eg partial-configure-network), # so check if the settings file was created to be sure - if [ -f $RUNTIME_DIR/aif-network-settings ]; then + if [[ -f "$RUNTIME_DIR/aif-network-settings" ]]; then debug NETWORK "Configuring network settings on target system according to installer settings" - source $RUNTIME_DIR/aif-network-settings 2>/dev/null || return 1 + source "$RUNTIME_DIR/aif-network-settings" 2>/dev/null || return 1 IFO=${INTERFACE_PREV:-eth0} # old iface: a previously entered one, or the arch default IFN=${INTERFACE:-eth0} # new iface: a specified one, or the arch default # comment out any existing uncommented entries, whether specified by us, or arch defaults. - for var in eth0 $IFO INTERFACES gateway ROUTES - do - sed -i "s/^$var=/#$var=/" ${var_TARGET_DIR}/etc/rc.conf || return 1 + for var in eth0 $IFO INTERFACES gateway ROUTES; do + sed -i "s/^$var=/#$var=/" "${var_TARGET_DIR}/etc/rc.conf" || return 1 done - sed -i "s/^nameserver/#nameserver/" ${var_TARGET_DIR}/etc/resolv.conf || return 1 - if [ -f ${var_TARGET_DIR}/etc/profile.d/proxy.sh ] + sed -i "s/^nameserver/#nameserver/" "${var_TARGET_DIR}/etc/resolv.conf" || return 1 + if [[ -f "${var_TARGET_DIR}/etc/profile.d/proxy.sh" ]] then - sed -i "s/^export/#export/" ${var_TARGET_DIR}/etc/profile.d/proxy.sh || return 1 + sed -i "s/^export/#export/" "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 fi - if [ "$DHCP" = 0 ] ; then + if (( ! DHCP )); then local line="$IFN=\"$IFN ${IPADDR:-192.168.0.2} netmask ${SUBNET:-255.255.255.0} broadcast ${BROADCAST:-192.168.0.255}\"" - append_after_last "/$IFO\|eth0/" "$line" ${var_TARGET_DIR}/etc/rc.conf || return 1 + append_after_last "/$IFO\|eth0/" "$line" "${var_TARGET_DIR}/etc/rc.conf" || return 1 - if [ -n "$GW" ]; then - append_after_last "/gateway/" "gateway=\"default gw $GW\"" ${var_TARGET_DIR}/etc/rc.conf || return 1 - append_after_last "/ROUTES/" "ROUTES=(gateway)" ${var_TARGET_DIR}/etc/rc.conf || return 1 + if [[ $GW ]]; then + append_after_last "/gateway/" "gateway=\"default gw $GW\"" "${var_TARGET_DIR}/etc/rc.conf" || return 1 + append_after_last "/ROUTES/" "ROUTES=(gateway)" "${var_TARGET_DIR}/etc/rc.conf" || return 1 fi - if [ -n "$DNS" ] - then - echo "nameserver $DNS" >> ${var_TARGET_DIR}/etc/resolv.conf || return 1 + if [[ $DNS ]]; then + echo "nameserver $DNS" >> "${var_TARGET_DIR}/etc/resolv.conf" || return 2 fi else - append_after_last "/$IFO\|eth0/" "$IFN=\"dhcp\"" ${var_TARGET_DIR}/etc/rc.conf || return 1 + append_after_last "/$IFO\|eth0/" "$IFN=\"dhcp\"" "${var_TARGET_DIR}/etc/rc.conf" || return 1 fi - append_after_last "/$IFO\|eth0/" "INTERFACES=($IFN)" ${var_TARGET_DIR}/etc/rc.conf || return 1 + append_after_last "/$IFO\|eth0/" "INTERFACES=($IFN)" "${var_TARGET_DIR}/etc/rc.conf" || return 1 - if [ -n "$PROXY_HTTP" ]; then - echo "export http_proxy=$PROXY_HTTP" >> ${var_TARGET_DIR}/etc/profile.d/proxy.sh || return 1 - chmod a+x ${var_TARGET_DIR}/etc/profile.d/proxy.sh || return 1 + if [[ $PROXY_HTTP ]]; then + echo "export http_proxy=$PROXY_HTTP" >> "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 + chmod a+x "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 fi - if [ -n "$PROXY_FTP" ]; then - echo "export ftp_proxy=$PROXY_FTP" >> ${var_TARGET_DIR}/etc/profile.d/proxy.sh || return 1 - chmod a+x ${var_TARGET_DIR}/etc/profile.d/proxy.sh || return 1 + if [[ $PROXY_FTP ]]; then + echo "export ftp_proxy=$PROXY_FTP" >> "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 + chmod a+x "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 fi else debug NETWORK "Skipping Host Network Configuration - aif-network-settings not found" -- cgit v1.2.3-54-g00ecf From 43a6e277b5b73a6141f2b222d0b826f1d37013d6 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 5 Jul 2011 21:33:35 -0400 Subject: lib-network: revamp for iproute2 syntax This is a vast simplification of the setup and doesn't insert default values since there's no "on/off" array as there was with the net-tools setup. If nothing is defined, its not added to the config. Signed-off-by: Dave Reisner --- src/core/libs/lib-network.sh | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-network.sh b/src/core/libs/lib-network.sh index 5e8c5fc..3e7914b 100644 --- a/src/core/libs/lib-network.sh +++ b/src/core/libs/lib-network.sh @@ -14,36 +14,30 @@ target_configure_network() source "$RUNTIME_DIR/aif-network-settings" 2>/dev/null || return 1 - IFO=${INTERFACE_PREV:-eth0} # old iface: a previously entered one, or the arch default IFN=${INTERFACE:-eth0} # new iface: a specified one, or the arch default - # comment out any existing uncommented entries, whether specified by us, or arch defaults. - for var in eth0 $IFO INTERFACES gateway ROUTES; do - sed -i "s/^$var=/#$var=/" "${var_TARGET_DIR}/etc/rc.conf" || return 1 - done sed -i "s/^nameserver/#nameserver/" "${var_TARGET_DIR}/etc/resolv.conf" || return 1 - if [[ -f "${var_TARGET_DIR}/etc/profile.d/proxy.sh" ]] - then + if [[ -f "${var_TARGET_DIR}/etc/profile.d/proxy.sh" ]]; then sed -i "s/^export/#export/" "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 fi + sed -i "s/^\(interface\)=/\1=$IFN/" "${var_TARGET_DIR}/etc/rc.conf" || return 1 if (( ! DHCP )); then - local line="$IFN=\"$IFN ${IPADDR:-192.168.0.2} netmask ${SUBNET:-255.255.255.0} broadcast ${BROADCAST:-192.168.0.255}\"" - append_after_last "/$IFO\|eth0/" "$line" "${var_TARGET_DIR}/etc/rc.conf" || return 1 + sed -i "s/^\(address\)=/\1=$IPADDR/;s/^\(netmask\)=/\1=$SUBNET/" "${var_TARGET_DIR}/etc/rc.conf" + + if [[ $BROADCAST ]]; then + sed -i "s/^\(broadcast\)=/\1=$BROADCAST/" "${var_TARGET_DIR}/etc/rc.conf" || return 1 + fi if [[ $GW ]]; then - append_after_last "/gateway/" "gateway=\"default gw $GW\"" "${var_TARGET_DIR}/etc/rc.conf" || return 1 - append_after_last "/ROUTES/" "ROUTES=(gateway)" "${var_TARGET_DIR}/etc/rc.conf" || return 1 + sed -i "s/^\(gateway\)=/\1=$GW/" "${var_TARGET_DIR}/etc/rc.conf" || return 1 fi + if [[ $DNS ]]; then echo "nameserver $DNS" >> "${var_TARGET_DIR}/etc/resolv.conf" || return 2 fi - else - append_after_last "/$IFO\|eth0/" "$IFN=\"dhcp\"" "${var_TARGET_DIR}/etc/rc.conf" || return 1 fi - append_after_last "/$IFO\|eth0/" "INTERFACES=($IFN)" "${var_TARGET_DIR}/etc/rc.conf" || return 1 - if [[ $PROXY_HTTP ]]; then echo "export http_proxy=$PROXY_HTTP" >> "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 chmod a+x "${var_TARGET_DIR}/etc/profile.d/proxy.sh" || return 1 -- cgit v1.2.3-54-g00ecf From e39b5f055011a12890988b768b0329990c79f964 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 24 Jul 2011 16:12:31 -0400 Subject: fix references to kernel26.img and vmlinuz26 Signed-off-by: Dave Reisner --- src/core/libs/lib-software.sh | 2 +- src/core/libs/lib-ui-interactive.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index bb84621..d93cfad 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -8,7 +8,7 @@ target_run_mkinitcpio() { target_special_fs on - run_controlled mkinitcpio "chroot $var_TARGET_DIR /sbin/mkinitcpio -p kernel26" $TMP_MKINITCPIO_LOG "Rebuilding initcpio images ..." + run_controlled mkinitcpio "chroot $var_TARGET_DIR /sbin/mkinitcpio -p linux" $TMP_MKINITCPIO_LOG "Rebuilding initcpio images ..." target_special_fs off diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 8281bc0..93f89d6 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -1073,14 +1073,14 @@ generate_grub_menulst() { # (0) Arch Linux title Arch Linux root $grubdev -kernel $subdir/vmlinuz26 $kernel_parameters -initrd $subdir/kernel26.img +kernel $subdir/vmlinuz-linux $kernel_parameters +initrd $subdir/initramfs-linux.img # (1) Arch Linux title Arch Linux Fallback root $grubdev -kernel $subdir/vmlinuz26 $kernel_parameters -initrd $subdir/kernel26-fallback.img +kernel $subdir/vmlinuz-linux $kernel_parameters +initrd $subdir/initramfs-linux-fallback.img # (2) Windows #title Windows -- cgit v1.2.3-54-g00ecf From 13c8c0813328eb8f52b03b3c53a32f1f40558021 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Thu, 4 Aug 2011 21:27:38 +0200 Subject: remove support for tcp_wrappers in accordance to Arch Linux policy See http://www.archlinux.org/news/dropping-tcp_wrappers-support --- doc/official_installation_guide_en | 22 ---------------------- src/core/libs/lib-ui-interactive.sh | 2 -- 2 files changed, 24 deletions(-) (limited to 'src/core') diff --git a/doc/official_installation_guide_en b/doc/official_installation_guide_en index 3e34bfc..321f0a4 100644 --- a/doc/official_installation_guide_en +++ b/doc/official_installation_guide_en @@ -504,8 +504,6 @@ In many cases, the Arch Linux [Wiki][46] and * /etc/modprobe.d/modprobe.conf * /etc/resolv.conf * /etc/hosts - * /etc/hosts.deny - * /etc/hosts.allow * /etc/locale.gen * /etc/pacman.d/mirrorlist * /etc/pacman.conf @@ -696,26 +694,6 @@ Some services, postfix for example, will bomb otherwise. If you don't know what you're doing, leave this file alone until you read man hosts. -**/etc/hosts.deny** - -This file denies network services access. By default all network services are -denied. - - - ALL: ALL: DENY - - - -**/etc/hosts.allow** - -This file allows network services access. Enter the services you want to allow -here. eg. to allow all machines to connect via ssh: - - - sshd: ALL: ALLOW - - - **/etc/locale.gen** This file contains a list of all supported locales and charsets available to diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 1ae4d6f..2238d45 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -74,8 +74,6 @@ interactive_configure_system() "/etc/modprobe.d/modprobe.conf" "Kernel Modules" "/etc/resolv.conf" "DNS Servers" "/etc/hosts" "Network Hosts" - "/etc/hosts.deny" "Denied Network Services" - "/etc/hosts.allow" "Allowed Network Services" "/etc/locale.gen" "Glibc Locales" "/etc/pacman.conf" "Pacman.conf" "$var_MIRRORLIST" "Pacman Mirror List" -- cgit v1.2.3-54-g00ecf