From ce3afefeb9728619a06989a67e7ffd5ed299ecf8 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 11:47:18 +0100 Subject: softcode architecture + some small misc stuff in yaourt lib --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index f7f4ecb..543495a 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -864,7 +864,7 @@ interactive_select_mirror() { ask_option no "Mirror selection" "Select an FTP/HTTP mirror" $MIRRORS "Custom" "_" || return 1 local _server=$ANSWER_OPTION if [ "${_server}" = "Custom" ]; then - ask_string "Enter the full URL to core repo." "ftp://ftp.archlinux.org/core/os/i686" || return 1 + ask_string "Enter the full URL to core repo." "ftp://ftp.archlinux.org/core/os/$var_ARCH" || return 1 var_SYNC_URL=$ANSWER_STRING else # Form the full URL for our mirror by grepping for the server name in -- cgit v1.2.3-54-g00ecf From 2423504e4e99c3be0403655f2461e58daef38af3 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 17:30:23 +0100 Subject: support comments --- src/core/libs/lib-pacman.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index f318aa8..26fb90e 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -97,7 +97,7 @@ list_pacman_repos () [ "$1" != runtime -a "$1" != target ] && die_error "list_pacman_repos needs target/runtime argument" [ "$1" = target ] && conf=/tmp/pacman.conf [ "$1" = runtime ] && conf=/etc/pacman.conf - grep '\[.*\]' $conf | grep -v options | sed 's/\[//g' | sed 's/\]//g' + grep '\[.*\]' $conf | grep -v options | grep -v '^#' | sed 's/\[//g' | sed 's/\]//g' } -- cgit v1.2.3-54-g00ecf From 0c714356dc7f78892ca413ce1895d7d9dfa83c5c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 20 Dec 2008 18:47:34 +0100 Subject: fix for incorrect shebangs --- src/core/libs/lib-blockdevices-filesystems.sh | 2 +- src/core/libs/lib-misc.sh | 2 +- src/core/libs/lib-pacman.sh | 2 +- src/core/libs/lib-software.sh | 2 +- src/core/libs/lib-ui-interactive.sh | 2 +- src/core/libs/lib-ui.sh | 2 +- src/core/procedures/interactive | 2 +- src/core/procedures/quickinst | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index fad1171..bb44295 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # FORMAT DEFINITIONS: diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 29e4c2e..f45c5c9 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # run a process in the background, and log it's stdout and stderr to a specific logfile diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 26fb90e..d613052 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # taken and slightly modified from the quickinst script. # don't know why one should need a static pacman because we already have a working one on the livecd. diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index 6b4a1a8..9cbc34d 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash TMP_MKINITCPIO_LOG=$RUNTIME_DIR/mkinitcpio.log TMP_PACMAN_LOG=$RUNTIME_DIR/pacman.log diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 543495a..5fb1aa6 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash #TODO: get backend code out of here!! diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index ac73b3e..2315394 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # TODO: implement 'retry until user does it correctly' everywhere # TODO: at some places we should check if $1 etc is only 1 word because we often depend on that # TODO: standardize. eg everything $1= question/title, $2=default diff --git a/src/core/procedures/interactive b/src/core/procedures/interactive index d4c3cf6..1a89408 100644 --- a/src/core/procedures/interactive +++ b/src/core/procedures/interactive @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash depend_procedure core base # esp for auto_{network,locale,fstab}, intro and set_clock workers diff --git a/src/core/procedures/quickinst b/src/core/procedures/quickinst index 73c1f46..b95bfa4 100644 --- a/src/core/procedures/quickinst +++ b/src/core/procedures/quickinst @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash depend_procedure core base # This is a port of the original /arch/quickinst script. -- cgit v1.2.3-54-g00ecf From b1ab860219eec51f9bb1cf786e6f570309f52df7 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 29 Dec 2008 18:33:57 +0100 Subject: ext4 support --- TODO | 1 - src/core/libs/lib-blockdevices-filesystems.sh | 2 ++ src/core/libs/lib-ui-interactive.sh | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/core/libs') diff --git a/TODO b/TODO index 22d421b..d983611 100644 --- a/TODO +++ b/TODO @@ -43,7 +43,6 @@ BETA PHASE: try to get aif on the (beta) installcd as an experimental, alternati skip that check or something. Alternatively, maybe just show which steps are done successfully in the main menu * support maybe ntp to set clock * auto-configure mkinitcpio.conf for dm_crypt and lvm -* ext4 support (once we have 2.6.28 or higher on install cd) PRODUCTION PHASE: be the primary installer. deprecate /arch/setup and /arch/quickinst * fix everything even more diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index bb44295..bf5fee3 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -649,6 +649,7 @@ process_filesystem () reiserfs) yes | mkreiserfs $part $opts >$LOG 2>&1; ret=$? ;; ext2) mke2fs "$part" $opts >$LOG 2>&1; ret=$? ;; ext3) mke2fs -j $part $opts >$LOG 2>&1; ret=$? ;; + ext4) mkfs.ext4 $part $opts >$LOG 2>&1; ret=$? ;; vfat) mkfs.vfat $part $opts >$LOG 2>&1; ret=$? ;; swap) mkswap $part $opts >$LOG 2>&1; ret=$? ;; dm_crypt) [ -z "$fs_params" ] && fs_params='-c aes-xts-plain -y -s 512'; @@ -721,6 +722,7 @@ get_filesystem_program () [ $1 = swap ] && echo mkswap && return 0 [ $1 = ext2 ] && echo mkfs.ext2 && return 0 [ $1 = ext3 ] && echo mkfs.ext3 && return 0 + [ $1 = ext4 ] && echo mkfs.ext4 && return 0 [ $1 = reiserfs ] && echo mkreiserfs && return 0 [ $1 = xfs ] && echo mkfs.xfs && return 0 [ $1 = jfs ] && echo mkfs.jfs && return 0 diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 5fb1aa6..c013e61 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -117,6 +117,7 @@ interactive_autoprepare() FSOPTS= which `get_filesystem_program ext2` &>/dev/null && FSOPTS="$FSOPTS ext2 Ext2" which `get_filesystem_program ext3` &>/dev/null && FSOPTS="$FSOPTS ext3 Ext3" + which `get_filesystem_program ext4` &>/dev/null && FSOPTS="$FSOPTS ext4 Ext4" which `get_filesystem_program reiserfs` &>/dev/null && FSOPTS="$FSOPTS reiserfs Reiser3" which `get_filesystem_program xfs` &>/dev/null && FSOPTS="$FSOPTS xfs XFS" which `get_filesystem_program jfs` &>/dev/null && FSOPTS="$FSOPTS jfs JFS" @@ -266,6 +267,7 @@ interactive_filesystem () # swap raw/lvm-lv/dm_crypt no no no no no no # ext 2 raw/lvm-lv/dm_crypt optional optional no no optional no # ext 3 raw/lvm-lv/dm_crypt optional optional no no optional no + # ext 4 raw/lvm-lv/dm_crypt optional optional no no optional no # reiserFS raw/lvm-lv/dm_crypt optional optional no no optional no # xfs raw/lvm-lv/dm_crypt optional optional no no optional no # jfs raw/lvm-lv/dm_crypt optional optional no no optional no @@ -281,6 +283,7 @@ interactive_filesystem () [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program swap` &>/dev/null && FSOPTS="$FSOPTS swap Swap" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext2` &>/dev/null && FSOPTS="$FSOPTS ext2 Ext2" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext3` &>/dev/null && FSOPTS="$FSOPTS ext3 Ext3" + [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program ext4` &>/dev/null && FSOPTS="$FSOPTS ext4 Ext4" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program reiserfs` &>/dev/null && FSOPTS="$FSOPTS reiserfs Reiser3" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program xfs` &>/dev/null && FSOPTS="$FSOPTS xfs XFS" [ $part_type = raw -o $part_type = lvm-lv -o $part_type = dm_crypt ] && which `get_filesystem_program jfs` &>/dev/null && FSOPTS="$FSOPTS jfs JFS" -- cgit v1.2.3-54-g00ecf From 044a0eb90aae3cf1820d9f1c6154e2dfe5472a14 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 30 Dec 2008 13:07:45 +0100 Subject: small code cleanup + todo updates --- TODO | 6 ++---- src/core/libs/lib-blockdevices-filesystems.sh | 2 +- src/core/libs/lib-ui-interactive.sh | 7 ++----- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'src/core/libs') diff --git a/TODO b/TODO index efe7f42..78547d4 100644 --- a/TODO +++ b/TODO @@ -30,11 +30,9 @@ ALPHA PHASE: get some people to test and suggest ideas, while fixing bugs and re * 'keep in mind trottled' geen separate screen * cool, network setting coping into target/rc.conf seems to work wih aif. at least for dhcp.. it even asks nicely * split up lib-ui as sep project, make a generic 'LIF' project,.. -bugs in experimental: * in usage, procedure specific opts points to parent profile when using inheritance -* -i , -d etc options not handled ? -* package installation works fine, however it tries to die instead of 'package installation complete' -* it can't die because the --textbox fails in show_warning +* we may have an issue with ftp based installation where package installation works fine, however it tries to die instead of 'package installation complete' but it can't die because the --textbox fails in show_warning +* ( only in experimental?) grub sedding doesn't work. default config remains BETA PHASE: try to get aif on the (beta) installcd as an experimental, alternative installer. * find a way to not have to preload libs and stuff, only load them when needed. -> faster start of install program diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index bf5fee3..29ae2ab 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -649,7 +649,7 @@ process_filesystem () reiserfs) yes | mkreiserfs $part $opts >$LOG 2>&1; ret=$? ;; ext2) mke2fs "$part" $opts >$LOG 2>&1; ret=$? ;; ext3) mke2fs -j $part $opts >$LOG 2>&1; ret=$? ;; - ext4) mkfs.ext4 $part $opts >$LOG 2>&1; ret=$? ;; + ext4) mkfs.ext4 $part $opts >$LOG 2>&1; ret=$? ;; #TODO: installer.git uses mke2fs -t ext4 -O dir_index,extent,uninit_bg , which is best? vfat) mkfs.vfat $part $opts >$LOG 2>&1; ret=$? ;; swap) mkswap $part $opts >$LOG 2>&1; ret=$? ;; dm_crypt) [ -z "$fs_params" ] && fs_params='-c aes-xts-plain -y -s 512'; diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index c013e61..01de0cc 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -709,11 +709,8 @@ interactive_install_grub() { bootdev=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1) if [ "$grubdev" != "" -o "$bootdev" != "" ]; then subdir= - if [ "$bootdev" != "" ]; then - grubdev=$(mapdev $bootdev) - else - subdir="/boot" - fi + [ -n "$bootdev" != "" ] && grubdev=$(mapdev $bootdev) || subdir="/boot" + # keep the file from being completely bogus if [ "$grubdev" = "DEVICE NOT FOUND" ]; 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." -- cgit v1.2.3-54-g00ecf From b86bf8691c4f0fba765a0c432c49bc94571f91f9 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 31 Dec 2008 12:15:53 +0100 Subject: runfile should be hidden --- src/core/libs/lib-misc.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index f45c5c9..bd59ce0 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -14,7 +14,7 @@ run_background () debug "run_background called. identifier: $1, command: $2, logfile: $3" ( \ - touch $RUNTIME_DIR/$1-running + touch $RUNTIME_DIR/.$1-running debug "run_background starting $1: $2 >>$3 2>&1" [ -f $3 ] && echo -e "\n\n\n" >>$3 echo "STARTING $1 . Executing $2 >>$3 2>&1\n" >> $3; @@ -23,7 +23,7 @@ run_background () read $var_exit <<< $? #TODO: bash complains about 'not a valid identifier' debug "run_background done with $1: exitcode (\$$1_exitcode): "${!var_exit}" .Logfile $3" #TODO ${!var_exit} doesn't show anything --> maybe fixed now echo >> $3 - rm -f $RUNTIME_DIR/$1-running + rm -f $RUNTIME_DIR/.$1-running ) & sleep 2 @@ -36,7 +36,7 @@ wait_for () { [ -z "$1" ] && die_error "wait_for needs an identifier to known on which command to wait!" - while [ -f $RUNTIME_DIR/$1-running ] + while [ -f $RUNTIME_DIR/.$1-running ] do #TODO: follow_progress dialog mode = nonblocking (so check and sleep is good), cli mode (tail -f )= blocking? (so check is probably not needed as it will be done) sleep 1 @@ -66,4 +66,4 @@ check_is_in () cleanup_runtime () { rm -rf $RUNTIME_DIR/.dia* &>/dev/null -} \ No newline at end of file +} -- cgit v1.2.3-54-g00ecf From de61605d525c06cbb19813d08e809994ac779728 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 24 Jan 2009 19:05:58 +0100 Subject: todo updates --- TODO | 1 + src/core/libs/lib-pacman.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/libs') diff --git a/TODO b/TODO index 7eed72d..62ab451 100644 --- a/TODO +++ b/TODO @@ -57,6 +57,7 @@ PRODUCTION PHASE: be the primary installer. deprecate /arch/setup and /arch/qui * core/interactive: do pacman -Sy in the background during early phases, to lessen the wait period before selecting packages * write bash completion thing for aif modules/procedures * add dmraid/mdadm support -> patches welcome. i don't care about this. +* check if it would be useful to support kickstart config files. we can look at quickstart for that http://dev.gentoo.org/~agaffney/quickstart.php SOMEDAY/MAYBE/RANDOM THOUGHTS: * the quickinst assumes the user did some stuff by himself and does some diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index d613052..89c3638 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -86,7 +86,7 @@ done [ ! -d "${var_TARGET_DIR}/var/lib/pacman" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/lib/pacman" infofy "Refreshing package database..." - $PACMAN_TARGET -Sy >$LOG 2>&1 || return 1 + $PACMAN_TARGET -Sy >$LOG 2>&1 || return 1 #TODO: make sure this also goes into the logfile. actually we should do this for many commands. return 0 } -- cgit v1.2.3-54-g00ecf From 774e055061e9fefc362c214e19b6c5bd72a93e6d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 24 Jan 2009 19:19:05 +0100 Subject: bugfix for broken pacman db because we sync for target, not for runtime --- src/core/libs/lib-ui-interactive.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 01de0cc..3e61c2a 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -579,7 +579,7 @@ interactive_select_packages() { # show group listing for group selection, base is ON by default, all others are OFF local _catlist="base ^ ON" - for i in $($PACMAN -Sg | sed "s/^base$/ /g"); do + for i in $($PACMAN_TARGET -Sg | sed "s/^base$/ /g"); do _catlist="${_catlist} ${i} - OFF" done @@ -588,10 +588,10 @@ interactive_select_packages() { # assemble a list of packages with groups, marking pre-selected ones # - local _pkgtmp="$($PACMAN -Sl core | awk '{print $2}')" # all packages in core repository + local _pkgtmp="$($PACMAN_TARGET -Sl core | awk '{print $2}')" # all packages in core repository local _pkglist='' - $PACMAN -Si $_pkgtmp | awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }' > $ANSWER + $PACMAN_TARGET -Si $_pkgtmp | awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }' > $ANSWER while read pkgname pkgcat; do # check if this package is in a selected group # slightly ugly but sorting later requires newlines in the variable -- cgit v1.2.3-54-g00ecf From 8bec371c9fbc6bb8c7d1efed8a8538ea2c842a3d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 14:14:18 +0100 Subject: slightly better way to get disk size with fdisk --- src/core/libs/lib-blockdevices-filesystems.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 29ae2ab..3b43541 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -739,6 +739,8 @@ get_filesystem_program () # $2 standard SI for 1000*n, IEC for 1024*n (optional. defaults to SI) # --> Note that if you do SI on a partition, you get the size of the entire disk, so for now you need IEC for single partitions # output will be in $BLOCKDEVICE_SIZE in MB/MiB +# WARNING: hdparm works - by design - only for ide/sata. not scsi et al +# TODO: clean up all disk size related stuff. see http://bugs.archlinux.org/task/12949 get_blockdevice_size () { [ -b "$1" ] || die_error "get_blockdevice_size needs a blockdevice as \$1 ($1 given)" @@ -749,8 +751,9 @@ get_blockdevice_size () BLOCKDEVICE_SIZE=$(hdparm -I $1 | grep -F '1000*1000' | sed "s/^.*:[ \t]*\([0-9]*\) MBytes.*$/\1/") elif [ "$standard" = IEC ] then - blocks=`fdisk -s $1` || show_warning "Fdisk problem" "Something failed when trying to do fdisk -s $1" - #NOTE: on some interwebs they say 1 block = 512B, on other internets they say 1 block = 1kiB. 1kiB seems to work for me. don't sue me if it doesn't for you - BLOCKDEVICE_SIZE=$(($blocks/1024)) + #NOTE: unreliable method: on some interwebs they say 1 block = 512B, on other internets they say 1 block = 1kiB. 1kiB seems to work for me. don't sue me if it doesn't for you + #blocks=`fdisk -s $1` || show_warning "Fdisk problem" "Something failed when trying to do fdisk -s $1" + #BLOCKDEVICE_SIZE=$(($blocks/1024)) + BLOCKDEVICE_SIZE=$((`fdisk -l $1 | sed -n '2p' | cut -d' ' -f5`/1024)) fi } -- cgit v1.2.3-54-g00ecf From d860efe097ff76c511b5fdf53dc2c90752e2b85b Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 15:03:06 +0100 Subject: fix FS#13045 - add joe editor --- src/core/libs/lib-ui-interactive.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 3e61c2a..851e990 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -876,17 +876,21 @@ interactive_select_mirror() { echo "Using mirror: $var_SYNC_URL" >$LOG } -# geteditor(). taken from original setup code. +# geteditor(). # prompts the user to choose an editor # sets EDITOR global variable # interactive_get_editor() { - ask_option no "Text editor selection" "Select a Text Editor to Use" \ - "1" "nano (easier)" \ - "2" "vi" + unset EDITOR_OPTS + which nano &>/dev/null && EDITOR_OPTS+=("nano" "nano (easier)") + which joe &>/dev/null && EDITOR_OPTS+=("joe" "joe's editor") + which vi &>/dev/null && EDITOR_OPTS+=("vi" "vi (advanced)") + ask_option no "Text editor selection" "Select a Text Editor to Use" "${EDITOR_OPTS[@]}" + #TODO: this code could be a little bit cleaner. case $ANSWER_OPTION in - "1") EDITOR="nano" ;; - "2") EDITOR="vi" ;; - *) EDITOR="nano" ;; + "nano") EDITOR="nano" ;; + "joe") EDITOR="joe" ;; + "vi") EDITOR="vi" ;; + *) EDITOR="nano" ;; esac } -- cgit v1.2.3-54-g00ecf From 39e42a15a8e1c5ea1b4a61874de4f4834cb64e68 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 18:06:31 +0100 Subject: port of FS#13237 - Copying manual network configuration to rc.conf --- src/core/libs/lib-network.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-network.sh b/src/core/libs/lib-network.sh index ab91069..9ed96b2 100644 --- a/src/core/libs/lib-network.sh +++ b/src/core/libs/lib-network.sh @@ -13,18 +13,18 @@ target_configure_network() PROXY_HTTP="$2" PROXY_FTP="$3" if [ "$1" = fixed ]; then - sed -i "s#eth0=\"eth0#$INTERFACE=\"$INTERFACE#g" ${var_TARGET_DIR}/etc/rc.conf - sed -i "s# 192.168.0.2 # $IPADDR #g" ${var_TARGET_DIR}/etc/rc.conf - sed -i "s# 255.255.255.0 # $SUBNET #g" ${var_TARGET_DIR}/etc/rc.conf - sed -i "s# 192.168.0.255\"# $BROADCAST\"#g" ${var_TARGET_DIR}/etc/rc.conf - sed -i "s#eth0)#$INTERFACE)#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#eth0=\"eth0#$INTERFACE=\"$INTERFACE#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#$INTERFACE 192.168.0.2#$INTERFACE $IPADDR#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#netmask 255.255.255.0#netmask $SUBNET#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#broadcast 192.168.0.255#broadcast $BROADCAST#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#INTERFACES=(eth0)#INTERFACES=($INTERFACE)#g" ${var_TARGET_DIR}/etc/rc.conf if [ "$GW" != "" ]; then - sed -i "s#gw 192.168.0.1#gw $GW#g" ${var_TARGET_DIR}/etc/rc.conf - sed -i "s#!gateway#gateway#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#gw 192.168.0.1#gw $GW#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#!gateway#gateway#g" ${var_TARGET_DIR}/etc/rc.conf fi echo "nameserver $DNS" >> ${var_TARGET_DIR}/etc/resolv.conf else - sed -i "s#eth0=\"eth0.*#$INTERFACE=\"dhcp\"#g" ${var_TARGET_DIR}/etc/rc.conf + sed -i "s#eth0=\"eth0.*#$INTERFACE=\"dhcp\"#g" ${var_TARGET_DIR}/etc/rc.conf fi if [ "$PROXY_HTTP" != "" ]; then -- cgit v1.2.3-54-g00ecf From ccc552ef115d3d7fcd5f92121ba9838e9b199361 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 18:43:11 +0100 Subject: port of FS#12944 - Pacman mirrorlist installer edits --- src/core/libs/lib-pacman.sh | 2 +- src/core/libs/lib-ui-interactive.sh | 9 ++++----- src/core/procedures/base | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 89c3638..4497074 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -78,7 +78,7 @@ do then add_pacman_repo target ${repo} "Include = $var_MIRRORLIST" else - add_pacman_repo target ${repo} "Server = ${serverurl}" + add_pacman_repo target ${repo} "Server = ${serverurl/\/\$repo\//\/$repo\/}" # replace literal '/$repo/' in the serverurl string by "/$repo/" where $repo is our variable. fi done # Set up the necessary directories for pacman use diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 851e990..343ecc4 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -865,13 +865,12 @@ interactive_select_mirror() { local _server=$ANSWER_OPTION if [ "${_server}" = "Custom" ]; then ask_string "Enter the full URL to core repo." "ftp://ftp.archlinux.org/core/os/$var_ARCH" || return 1 - var_SYNC_URL=$ANSWER_STRING + var_SYNC_URL=${ANSWER_STRING/\/core\///\$repo/} #replace '/core/' by '/$repo/' else # Form the full URL for our mirror by grepping for the server name in - # our mirrorlist and pulling the full URL out. Substitute 'core' in - # for the repository name, and ensure that if it was listed twice we - # only return one line for the mirror. - var_SYNC_URL=$(egrep -o "${_server}.*" "${var_MIRRORLIST}" | sed 's/\$repo/core/g' | head -n1) + # our mirrorlist and pulling the full URL out. + # Ensure that if it was listed twice we only return one line for the mirror. + var_SYNC_URL=$(egrep -o "${_server}.*" "${var_MIRRORLIST}" | head -n1) fi echo "Using mirror: $var_SYNC_URL" >$LOG } diff --git a/src/core/procedures/base b/src/core/procedures/base index 6aa7767..c22a01c 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -8,7 +8,7 @@ var_RUNTIME_PACKAGES= var_PKG_FILE=$RUNTIME_DIR/package-list # not used by default in base/interactive. can be used by custom procedures or profiles for the automatic procedure var_MIRRORLIST="/etc/pacman.d/mirrorlist" var_UI_TYPE="cli" # set to cli or dia for dialog -var_ARCH=`uname -m` #i686 or x86_64 +var_ARCH=`uname -m` #i686 or x86_64. NOTE: this assumes you want to install the same arch as the installation environment you're using. maybe we could decouple those someday.. [ -z "$var_ARCH" ] && die_error "Could not determine your architecture" ###### Phases ( can be overridden by more specific procedures) ###### @@ -67,7 +67,7 @@ worker_select_source () { var_PKG_SOURCE_TYPE='cd' var_FILE_URL="file:///src/core/pkg" - var_SYNC_URL= + var_SYNC_URL= # optional, points to a repository string something like ftp://ftp.belnet.be/mirror/archlinux.org/$repo/os/i686 (eg the same format as what you find in /etc/pacman.conf) # if you override to use ftp (or ask user and he chooses ftp) don't forget to configure the network and to select_mirrors } -- cgit v1.2.3-54-g00ecf From 6b2a02c6099da06aeddc4a0595121943fada07c6 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 14 Feb 2009 23:20:27 +0100 Subject: tried to make aif FHS/hier compliant + updated howto/readme --- HOWTO | 25 ++++++++++++++----------- README | 11 ++++++----- TODO | 3 +-- src/aif.sh | 18 ++++++++++++------ src/core/libs/lib-misc.sh | 3 ++- src/runtime/whatsthis.txt | 1 - 6 files changed, 35 insertions(+), 26 deletions(-) delete mode 100644 src/runtime/whatsthis.txt (limited to 'src/core/libs') diff --git a/HOWTO b/HOWTO index ed46272..e2c714a 100644 --- a/HOWTO +++ b/HOWTO @@ -1,16 +1,20 @@ -### This howto explains how to install aif on an installcd that does not have the aif package installed yet ### -### You can also use this if you want to use another version than what's available on the installcd) ### +### This howto explains how to install/upgrade aif on an arch system / arch installation cd ### -1) Boot from the installcd - -2) Open 2 shells, one as user root, one as regular user (arch) +* an installation cd is in essence just an arch system, it just has the aif package installed. you can install aif on any system without problems. +* install cd's from 2009.02 and up have aif on board, so probably you don't need to do anything at all. -3) Decide on a package. See http://aur.archlinux.org/packages.php?K=aif for available packages +* there is a "binary" package in extra, containing a recent release +* there are 2 source packages in AUR, one for each branch in git. ( see http://aur.archlinux.org/packages.php?K=aif ) - aif-git: latest code from the git master (stable) branch: recommended! - aif-experimental-git: latest development code. Code is tested here and if ok, merged into master. Use at own risk!! -I assume you'll pick aif-git. -4) Copy paste the code below. +So, assuming you want to upgrade the aif package on an installation cd, to say aif-experimental-git from AUR, you would: + +1) Boot from the installcd + +2) Open 2 shells, one as user root, one as regular user (arch) + +3) Copy paste the code below. # root shell: /arch/setup. # fake ftp install so it lets you run the network configure script @@ -29,12 +33,11 @@ makepkg # root shell: pacman -U /home/arch/aif-git/aif*.pkg.tar.gz - 4) Fire it up! (as root) -/arch/aif -p #you can skip networking. +aif -p #you can skip networking. -For more info see README or /arch/aif -h. +For more info see README or aif -h. diff --git a/README b/README index caaadd7..71d4064 100644 --- a/README +++ b/README @@ -10,7 +10,7 @@ Homepage: http://github.com/Dieterbe/aif ** --> Intro / Current state of things <-- ** -AIF is included on the 2009-01 Arch install CD's as an experimental alternative for the old installer (/arch/setup). +AIF is included on the 2009.02 Arch install CD's as an experimental alternative for the old installer (/arch/setup). AIF is based on the old installer, but the code has been madly refactored, reorganized, cleaned up and in some places replaced. AIF comes by default with these procedures: @@ -67,10 +67,11 @@ The goal of AIF is not (yet): Basically aif.sh is put in /arch (together with the default installer scripts), while all other aif-related files belong in /home/arch/aif * aif.sh -> /arch/aif -* docs -> /home/arch/aif/docs/ -* core module -> /home/arch/aif/core -* user modules -> /home/arch/aif/user/ (put your own modules here) -* runtime files -> /home/arch/aif/runtime (package list etc go here) +* docs -> /usr/share/aif/docs +* core module -> /usr/lib/aif/core +* user modules -> /usr/lib/aif/user/ (put your own modules here) +* runtime files -> /tmp/aif (package list etc go here) +* logs -> /var/log/aif A module can have 2 directories: libs, and procedures. diff --git a/TODO b/TODO index a0526bd..c747210 100644 --- a/TODO +++ b/TODO @@ -43,8 +43,8 @@ ALPHA PHASE: BETA PHASE: +* ext4 default options? -O dir_index,extent,uninit_bg ? * find a way to not have to preload libs and stuff, only load them when needed. -> faster start of install program -* fix everything * if dhcpd already runs for $reason, the installer will try again @ configure network and fail. i tried killall dhcpd, killall -9 dhcpd first but that didn't help: it can't kill the process or something... I can also add something like for iface in `moo` (or only the one selected iface); do ifconfig $iface down; @@ -55,7 +55,6 @@ skip that check or something. Alternatively, maybe just show which steps are do * auto-configure mkinitcpio.conf for dm_crypt and lvm PRODUCTION PHASE: be the primary installer. deprecate /arch/setup and /arch/quickinst -* fix everything even more * bribe devs * core/interactive: do pacman -Sy in the background during early phases, to lessen the wait period before selecting packages * write bash completion thing for aif modules/procedures diff --git a/src/aif.sh b/src/aif.sh index fad2e40..783e7c9 100755 --- a/src/aif.sh +++ b/src/aif.sh @@ -1,10 +1,14 @@ #!/bin/bash + ###### Set some default variables ###### TITLE="Arch Linux Installation Framework" LOG="/dev/tty7" -RUNTIME_DIR=/home/arch/aif/runtime -LOGFILE=$RUNTIME_DIR/aif.log +LIB_CORE=/usr/lib/aif/core +LIB_USER=/usr/lib/aif/user +RUNTIME_DIR=/tmp/aif +LOG_DIR=/var/log/aif +LOGFILE=$LOG_DIR/aif.log ###### Miscalleaneous functions ###### @@ -19,10 +23,10 @@ usage () -h Help: show usage (optional)\n If the procedurename starts with 'http://' it will be wget'ed. Otherwise it's assumed to be a procedure in the VFS tree If the procedurename is prefixed with '/' it will be loaded from user module .\n -For more info, see the README which you can find in /home/arch/aif/docs\n -Available procedures on the filesystem: -`find /home/arch/aif/core/procedures -type f`\n -`find /home/arch/aif/user/*/procedures -type f 2>/dev/null`" +For more info, see the README which you can find in /usr/share/aif/docs\n +Available procedures: +`find $LIB_CORE/procedures -type f | sed 's#$LIB_CORE##'`\n +`find $LIB_USER/*/procedures -type f 2>/dev/null | sed 's#$LIB_USER##'`" [ -n "$procedure" ] && msg="$msg\nProcedure ($procedure) specific options:\n$var_ARGS_USAGE" echo -e "$msg" @@ -40,6 +44,7 @@ notify () log () { + mkdir -p $LOG_DIR || die_error "Cannot create log directory" str="[LOG] `date +"%Y-%m-%d %H:%M:%S"` $@" echo -e "$str" > $LOG [ "$LOG_TO_FILE" = 1 ] && echo -e "$str" >> $LOGFILE @@ -48,6 +53,7 @@ log () debug () { + mkdir -p $LOG_DIR || die_error "Cannot create log directory" str="[DEBUG] $@" if [ "$DEBUG" = "1" ] then diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index bd59ce0..01c291f 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -62,8 +62,9 @@ check_is_in () } -# cleans up file in the runtime directory who can be deleted +# cleans up file in the runtime directory who can be deleted, make dir first if needed cleanup_runtime () { + mkdir -p $RUNTIME_DIR || die_error "Cannot create $RUNTIME_DIR" rm -rf $RUNTIME_DIR/.dia* &>/dev/null } diff --git a/src/runtime/whatsthis.txt b/src/runtime/whatsthis.txt deleted file mode 100644 index 5a22a0e..0000000 --- a/src/runtime/whatsthis.txt +++ /dev/null @@ -1 +0,0 @@ -aif will put files it uses during runtime here. (no source code goes here) \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 01f787976ff52b9579e97604272664627a64c53c Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 15 Feb 2009 12:07:56 +0100 Subject: syntax fix for grub code causing wrong menu.lst --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 343ecc4..8fdc5dc 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -709,7 +709,7 @@ interactive_install_grub() { bootdev=$(mount | grep $var_TARGET_DIR/boot | cut -d' ' -f 1) if [ "$grubdev" != "" -o "$bootdev" != "" ]; then subdir= - [ -n "$bootdev" != "" ] && grubdev=$(mapdev $bootdev) || subdir="/boot" + [ -n "$bootdev" ] && grubdev=$(mapdev $bootdev) || subdir="/boot" # keep the file from being completely bogus if [ "$grubdev" = "DEVICE NOT FOUND" ]; then -- cgit v1.2.3-54-g00ecf From dc264c36fdfc6dbd076517c43034dfc44eb01b97 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 15 Feb 2009 13:01:10 +0100 Subject: add --noconfirm when installing packages --- TODO | 3 +-- src/core/libs/lib-software.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/core/libs') diff --git a/TODO b/TODO index c747210..8b306af 100644 --- a/TODO +++ b/TODO @@ -31,13 +31,12 @@ ALPHA PHASE: * split up lib-ui as sep project, make a generic 'LIF' project, set $DISTRO somewhere and use that everywhere... * in usage, procedure specific opts points to parent profile when using inheritance * we may have an issue with ftp based installation where package installation works fine, however it tries to die instead of 'package installation complete' but it can't die because the --textbox fails in show_warning -* ( only in experimental?) grub sedding sometimes does, and sometimes doesn't work. default config remains (eg /dev/hda3), sometimes an incorrect UUID is generated +* ( only in experimental?) grub sedding sometimes does, and sometimes doesn't work. default config remains (eg /dev/hda3) * debug "categories" (ui, disk,flowcontrol,...) so you can grep (-v) on what you want + make sure enough+correct debugging is everywhere * the old installer asked a lot of questions before actually configuring the system, eg like 'do you need support for booting from nfs/softraid/lvm2/encrypted, custom dst file?' etc.\ do we still need this? why (not)?, and a select tag thingie would be nicer imho * refactor all pacman stuff (modularize/functionize etc) * in lvm VG editor you can press "cancel" (when 'new' is selected, maybe otherwise too) and create a new LV which will get a block entry, but no fs entry on the VG block! -* add noconfirm ofzo dinges when installing packages, zoda hij nie zaagt voor dep cycles * aif : na "mijn" partitielayout: bij grub ( nog voor text editor op menu.lst) zegt iets ( op foreground van ncurses) Can't remove.. ik denk zelfs 'Grub: Can't remove..' en daarna een gewone entry, geen uuid's gewoon /dev/sda3 ro * port from /arch/setup: grub install chroot thing (waiting for ticket), 2 patches from foutrelis @ http://bugs.archlinux.org/task/12949 diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index 9cbc34d..726d20f 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -26,7 +26,7 @@ run_mkinitcpio() installpkg() { notify "Package installation will begin now. You can watch the output in the progress window. Please be patient." target_special_fs on - run_background pacman-installpkg "$PACMAN_TARGET -S $TARGET_PACKAGES" $TMP_PACMAN_LOG #TODO: There may be something wrong here. See http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=f504e9ecfb9ecf1952bd8dcce7efe941e74db946 ASKDEV (Simo) + run_background pacman-installpkg "$PACMAN_TARGET --noconfirm -S $TARGET_PACKAGES" $TMP_PACMAN_LOG #TODO: There may be something wrong here. See http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=f504e9ecfb9ecf1952bd8dcce7efe941e74db946 ASKDEV (Simo) follow_progress " Installing... Please Wait " $TMP_PACMAN_LOG wait_for pacman-installpkg -- cgit v1.2.3-54-g00ecf