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-misc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/libs/lib-misc.sh') 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 -- 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/lib-misc.sh') 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 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/lib-misc.sh') 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