From 91e7648aa72e429c8f2b727823d38c4009182208 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 29 Mar 2009 22:44:52 +0200 Subject: fix for hanging timezone dialogs --- src/core/libs/lib-ui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 50d087a..c3ac12a 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -423,7 +423,7 @@ _dia_ask_timezone () { REGIONS="" SET_ZONE="" - for i in $(grep ^[A-Z] /usr/share/zoneinfo/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do + for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do REGIONS="$REGIONS $i -" done while [ "$SET_ZONE" != "1" ]; do @@ -432,7 +432,7 @@ _dia_ask_timezone () region=ANSWER_OPTION if [ $? -eq 0 ]; then ZONES="" - for i in $(grep ^[A-Z] /usr/share/zoneinfo/zone.tab | grep $region/ | cut -f 3 | sed -e "s#$region/##g"| sort -u); do + for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | grep $region/ | cut -f 3 | sed -e "s#$region/##g"| sort -u); do ZONES="$ZONES $i -" done ask_option no "Please select a timezone" '' required $ZONES -- cgit v1.2.3 From aed471dbb18874a2fd3cbc8a9193cda4211ef027 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 29 Mar 2009 22:51:04 +0200 Subject: fix for broken region getting --- src/core/libs/lib-ui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index c3ac12a..22a9033 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -426,10 +426,10 @@ _dia_ask_timezone () for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do REGIONS="$REGIONS $i -" done - while [ "$SET_ZONE" != "1" ]; do + while true; do SET_REGION="" ask_option no "Please select a region" '' required $REGIONS - region=ANSWER_OPTION + region=$ANSWER_OPTION if [ $? -eq 0 ]; then ZONES="" for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | grep $region/ | cut -f 3 | sed -e "s#$region/##g"| sort -u); do -- cgit v1.2.3 From 238c38a9ac14e0bc2f891a51b8a2f1a3bbc66aa3 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 29 Mar 2009 22:56:20 +0200 Subject: return condition fix --- src/core/libs/lib-ui.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 22a9033..d3c3948 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -422,12 +422,10 @@ _dia_ask_string () _dia_ask_timezone () { REGIONS="" - SET_ZONE="" for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do REGIONS="$REGIONS $i -" done while true; do - SET_REGION="" ask_option no "Please select a region" '' required $REGIONS region=$ANSWER_OPTION if [ $? -eq 0 ]; then @@ -437,7 +435,7 @@ _dia_ask_timezone () done ask_option no "Please select a timezone" '' required $ZONES zone=$ANSWER_OPTION - [ $? -gt 0 ] && ANSWER_TIMEZONE="$region/$zone" && return + [ $? -eq 0 ] && ANSWER_TIMEZONE="$region/$zone" && return fi done } -- cgit v1.2.3 From a6052f5c0739b5acdba0e736b7e320f339df126d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 30 Mar 2009 20:56:39 +0200 Subject: no need for tzselect anymore. yeay --- src/core/libs/lib-ui.sh | 58 ++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index d3c3948..59a04bc 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -160,6 +160,30 @@ _getavaildisks() } +# ask for a timezone. +# this is pretty similar to how tzselect looks, but we support dia+cli + we don't actually change the clock +ask_timezone () +{ + REGIONS="" + for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do + REGIONS="$REGIONS $i -" + done + while true; do + ask_option no "Please select a region" '' required $REGIONS + region=$ANSWER_OPTION + if [ $? -eq 0 ]; then + ZONES="" + for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | grep $region/ | cut -f 3 | sed -e "s#$region/##g"| sort -u); do + ZONES="$ZONES $i -" + done + ask_option no "Please select a timezone" '' required $ZONES + zone=$ANSWER_OPTION + [ $? -eq 0 ] && ANSWER_TIMEZONE="$region/$zone" && return + fi + done +} + + # ask the user to make a selection from a certain group of things # $1 question # shift;shift; $@ list of options. first tag, then item then ON/OFF. if item == ^ or - it will not be shown in cli mode. @@ -237,13 +261,6 @@ ask_string () } -ask_timezone () -{ - [ "$var_UI_TYPE" = dia ] && { _dia_ask_timezone "$@" ; return $? ; } - [ "$var_UI_TYPE" = cli ] && { _cli_ask_timezone "$@" ; return $? ; } -} - - # ask a yes/no question. # $1 question # $2 default answer yes/no (optional) @@ -419,27 +436,6 @@ _dia_ask_string () } -_dia_ask_timezone () -{ - REGIONS="" - for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | cut -f 3 | sed -e 's#/.*##g'| sort -u); do - REGIONS="$REGIONS $i -" - done - while true; do - ask_option no "Please select a region" '' required $REGIONS - region=$ANSWER_OPTION - if [ $? -eq 0 ]; then - ZONES="" - for i in $(grep '^[A-Z]' /usr/share/zoneinfo/zone.tab | grep $region/ | cut -f 3 | sed -e "s#$region/##g"| sort -u); do - ZONES="$ZONES $i -" - done - ask_option no "Please select a timezone" '' required $ZONES - zone=$ANSWER_OPTION - [ $? -eq 0 ] && ANSWER_TIMEZONE="$region/$zone" && return - fi - done -} - _dia_ask_yesno () { @@ -609,12 +605,6 @@ _cli_ask_string () } -_cli_ask_timezone () -{ - ANSWER_TIMEZONE=`tzselect` -} - - _cli_ask_yesno () { [ -z "$2" ] && echo -n "$1 (y/n): " -- cgit v1.2.3 From f3d44bb5f33bf927ef62bb0e6223e8312b9c4358 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 30 Mar 2009 21:13:40 +0200 Subject: do hwclock (only) at the right time, optimize hwclock code, make UTC default (fixes FS#13752 - Make hwclock in UTC a "good idea" --- src/core/libs/lib-misc.sh | 19 ++++++++++--------- src/core/libs/lib-ui-interactive.sh | 5 ++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 1acebac..e09f3c8 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -102,19 +102,20 @@ cleanup_runtime () } +# $1 UTC or localtime (hardwareclock) dohwclock() { - infofy "Syncing hardwareclock to systemclock ..." - if [ "$HARDWARECLOCK" = "UTC" ]; then - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --utc" - else - HWCLOCK_PARAMS="$HWCLOCK_PARAMS --localtime" - fi - + infofy "Resetting hardware clock adjustment file" [ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock if [ ! -f /var/lib/hwclock/adjtime ]; then - echo "0.0 0 0.0" > /var/lib/hwclock/adjtime # what the hell is this for??? + echo "0.0 0 0.0" > /var/lib/hwclock/adjtime + fi + + infofy "Syncing hardwareclock to systemclock ..." + if [ "$1" = "UTC" ]; then + hwclock --utc + else + hwclock --localtime fi - hwclock $HWCLOCK_PARAMS #tpowa does it without, but i would add --noadjtime here } target_configure_initial_keymap_font () diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index cb80c11..129b2cd 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -77,17 +77,16 @@ interactive_timezone () { TIMEZONE=$ANSWER_TIMEZONE infofy "Setting Timezone to $TIMEZONE" [ -e /etc/localtime ] && rm -f /etc/localtime #why do we do this?? tpowa? - dohwclock } interactive_time () { # utc or localtime? - ask_option no "Clock configuration" "Is your hardware clock in UTC or local time?" required "UTC" " " "localtime" " " || return 1 + ask_option UTC "Clock configuration" "Is your hardware clock in UTC or local time? UTC is recommended" required "UTC" " " "localtime" " " || return 1 HARDWARECLOCK=$ANSWER_OPTION - dohwclock + dohwclock $HARDWARECLOCK if which ntpdate >/dev/null && ask_yesno "'ntpdate' was detected on your system.\n\nDo you want to use 'ntpdate' for syncing your clock,\nby using the internet clock pool?\n(You need a working internet connection for doing this!)" yes #TODO: only propose if network ok. then -- cgit v1.2.3 From 940dde541435a9af38dc2c4c8a1f498dd21e5308 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 30 Mar 2009 21:56:17 +0200 Subject: note --- src/core/libs/lib-ui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 59a04bc..8b614bb 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -161,7 +161,7 @@ _getavaildisks() # ask for a timezone. -# this is pretty similar to how tzselect looks, but we support dia+cli + we don't actually change the clock +# this is pretty similar to how tzselect looks, but we support dia+cli + we don't actually change the clock + we don't show a date/time and ask whether it's okay. that comes later. ask_timezone () { REGIONS="" -- cgit v1.2.3 From 84424e82e5407315d2cedfe33c45629ffd8b56d8 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Mon, 30 Mar 2009 21:57:13 +0200 Subject: fix hwclock calls for systohc and hctosys, fix /etc/localtime, show nice dialog with 'ok', 'manual date setting' and ntp using --- src/core/libs/lib-misc.sh | 8 ++++-- src/core/libs/lib-ui-interactive.sh | 55 +++++++++++++++++++++++-------------- 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index e09f3c8..1e8df8e 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -103,18 +103,20 @@ cleanup_runtime () # $1 UTC or localtime (hardwareclock) +# $2 direction (systohc or hctosys) dohwclock() { + # TODO: we probably only need to do this once and then actually use adjtime on next invocations infofy "Resetting hardware clock adjustment file" [ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock if [ ! -f /var/lib/hwclock/adjtime ]; then echo "0.0 0 0.0" > /var/lib/hwclock/adjtime fi - infofy "Syncing hardwareclock to systemclock ..." + infofy "Syncing clocks ($2), hc being $1 ..." if [ "$1" = "UTC" ]; then - hwclock --utc + hwclock --$2 --utc else - hwclock --localtime + hwclock --$2 --localtime fi } diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 129b2cd..9884cb5 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -76,7 +76,6 @@ interactive_timezone () { ask_timezone || return 1 TIMEZONE=$ANSWER_TIMEZONE infofy "Setting Timezone to $TIMEZONE" - [ -e /etc/localtime ] && rm -f /etc/localtime #why do we do this?? tpowa? } @@ -85,32 +84,48 @@ interactive_time () { # utc or localtime? ask_option UTC "Clock configuration" "Is your hardware clock in UTC or local time? UTC is recommended" required "UTC" " " "localtime" " " || return 1 HARDWARECLOCK=$ANSWER_OPTION - - dohwclock $HARDWARECLOCK - - if which ntpdate >/dev/null && ask_yesno "'ntpdate' was detected on your system.\n\nDo you want to use 'ntpdate' for syncing your clock,\nby using the internet clock pool?\n(You need a working internet connection for doing this!)" yes #TODO: only propose if network ok. - then - if ntpdate pool.ntp.org >/dev/null + [ -e /etc/localtime ] && rm -f /etc/localtime + + while true; do + dohwclock $HARDWARECLOCK hctosys + current=`date` + default=no + [ -n "$NEXTITEM" ] && default="$NEXTITEM" + EXTRA= + #TODO: only propose if network ok + which ntpdate >/dev/null && EXTRA="'ntp' 'Set time and date using ntp'" + + ask_option $default "Date/time configuration" "According to your settings and your hardwareclock, the date should now be $current. If this is incorrect, you can correct this now" required \ + $EXTRA "manual" "Set time and date manually" \ + "return" "Looks good. back to main menu" + if [ "$ANSWER_OPTION" = ntp ] then - notify "Synced clock with internet pool successfully.\n\nYour current time is now:\n$(date)" - else - show_warning 'Ntp failure' "An error has occured, time was not changed!" - fi - fi - - # display and ask to set date/time - ask_datetime - + if ntpdate pool.ntp.org >/dev/null + then + notify "Synced clock with internet pool successfully." + NEXTITEM=3 + else + show_warning 'Ntp failure' "An error has occured, time was not changed!" + fi + fi + if [ "$ANSWER_OPTION" = manual ] + then + ask_datetime + if date -s "$ANSWER_DATETIME" + then + dohwclock $HARDWARECLOCK systohc && NEXTITEM=3 + else + show_warning "Date/time setting failed" "Something went wrong when doing date -s $ANSWER_DATETIME" + fi + fi + [ "$ANSWER_OPTION" = return ] && break + done if [ "$TIMEZONE" != "" -a -e "/usr/share/zoneinfo/$TIMEZONE" ] then /bin/rm -f /etc/localtime /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime fi - - # save the time - date -s "$ANSWER_DATETIME" || show_warning "Date/time setting failed" "Something went wrong when doing date -s $ANSWER_DATETIME" - dohwclock } -- cgit v1.2.3 From 3a526624887050e3107988daca6c39a854a62000 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Tue, 31 Mar 2009 21:51:27 +0200 Subject: dont show which output + syntax fix --- src/core/libs/lib-ui-interactive.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 9884cb5..5a8a076 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -93,11 +93,10 @@ interactive_time () { [ -n "$NEXTITEM" ] && default="$NEXTITEM" EXTRA= #TODO: only propose if network ok - which ntpdate >/dev/null && EXTRA="'ntp' 'Set time and date using ntp'" + which ntpdate &>/dev/null && EXTRA="'ntp' 'Set time and date using ntp'" ask_option $default "Date/time configuration" "According to your settings and your hardwareclock, the date should now be $current. If this is incorrect, you can correct this now" required \ - $EXTRA "manual" "Set time and date manually" \ - "return" "Looks good. back to main menu" + $EXTRA "manual" "Set time and date manually" "return" "Looks good. back to main menu" if [ "$ANSWER_OPTION" = ntp ] then if ntpdate pool.ntp.org >/dev/null -- cgit v1.2.3 From ccbeca41d9662d16e6e12982c2b17a0f624d2a8d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 11:37:24 +0200 Subject: clearer, more up to date howto --- HOWTO | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/HOWTO b/HOWTO index 4b446fe..d296ae4 100644 --- a/HOWTO +++ b/HOWTO @@ -3,25 +3,36 @@ * 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. -* 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!! +There are 3 aif packages available: +> supported: + * aif (extra repo): "binary" package, containing latest stable release. this is used by default on the official arch media +> unsupported: 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 for power users. + * aif-experimental-git: latest development code. Code is tested here and if ok, merged into master. Use at own risk!! -So, assuming you want to upgrade the aif package on an installation cd, to say aif-experimental-git from AUR, you would: + + +So, if you want to upgrade the aif package on an installation cd.. + +> aif package from extra: + ---------------------- + * pacman -Sy aif + + + +> aif git package from AUR: (for example aif-experimental-git. aif-git is the same procedure) + ------------------------------------------------------------------------------------------ 1) Boot from the installcd 2) Open 2 shells, one as user root, one as regular user (arch) -3) Copy paste the code below. +3) Execute the code below. # root shell: -/arch/setup. # fake ftp install so it lets you run the network configure script - -Alternatively, if you have a recent version of AIF installed and it comes with the partial-network procedure, you can execute that to set up your network. +aif -p partial-configure-network # if you have a recent enough aif version installed that comes with this procedure. +/arch/setup. # alternatively, use the old installer. fake ftp install so it lets you run the network configure script, then exit the installer -# when network works, quit installer pacman -Sy git fakeroot # You need about 192MB ram for this! 128MB is not enough. # arch shell @@ -41,4 +52,4 @@ aif -p #you can skip networking. Notes: * For more info see README or aif -h. -* Since you configured the network before starting aif, you need to reconfigure it in aif if you want the 'auto-update rc.conf' functionality. \ No newline at end of file +* Since you configured the network before starting aif, you need to reconfigure it in aif if you want the 'auto-update rc.conf' functionality. -- cgit v1.2.3 From f58e55548d8c9d42efd744bf1a3d8ea2303106eb Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 12:18:01 +0200 Subject: todo updates --- TODO | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 1a87c65..c3f8ff2 100644 --- a/TODO +++ b/TODO @@ -1,6 +1,12 @@ See also the FIXME's and TODO's in the code, and http://bugs.archlinux.org/toplevel/proj6 CURRENT ISSUES: +* consider syslog as logging backend +* add support for TARGET_PACKAGES_EXCLUDE to filter out packages from a group +* more vars for automatic profile: hostname (check that adding to /etc/hosts can be done procedure-independently), +LOCALE, HARDWARECLOCK, TIMEZONE, KEYMAP, MODULES, DAEMONS, network config? (or take the config from runtime) +* what to do with /etc/groups, passwd, modprobe.conf, mkinitcpio.conf, rc.local etc with automatic procedure? configure through automatic profile or let user check out files from svn or so? +* depend statements for automatic profiles (+ example) * use traps and initiate rollback when user wants to abort. see also http://www.davidpashley.com/articles/writing-robust-shell-scripts.html * differentiate between framework and installer in src/aif.sh, some things should be in base * check everywhere that if users cancels something, we return 1, empty string behavior etc @@ -41,7 +47,7 @@ CURRENT ISSUES: 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 -* core/quickinst: figure out what needs to be done and do it. +* support setting mount options for fs'es (to go into fstab) in at least automatic procedures. interactive > you can edit fstab right.. * right at the end of package installation something happens :/ also at configure system, before generation of locales -- cgit v1.2.3 From c9aa3f0e3c496e02fa81cef17ff97607dd1c6b7e Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 12:42:02 +0200 Subject: fix for next item in datetime menu --- src/core/procedures/base | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/procedures/base b/src/core/procedures/base index 6d99421..e3ff45c 100644 --- a/src/core/procedures/base +++ b/src/core/procedures/base @@ -102,6 +102,7 @@ worker_runtime_packages () worker_set_clock () { + NEXTITEM= while true; do default=no [ -n "$NEXTITEM" ] && default="$NEXTITEM" -- cgit v1.2.3 From 254504decd68cbbd30c14eaacc4a821c08628524 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 12:54:29 +0200 Subject: fix for nextitem and also hopefully for ntp stuff --- src/core/libs/lib-ui-interactive.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 5a8a076..1c58e8d 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -86,17 +86,19 @@ interactive_time () { HARDWARECLOCK=$ANSWER_OPTION [ -e /etc/localtime ] && rm -f /etc/localtime + NEXTITEM= while true; do dohwclock $HARDWARECLOCK hctosys current=`date` default=no [ -n "$NEXTITEM" ] && default="$NEXTITEM" - EXTRA= + EXTRA_1= + EXTRA_2= #TODO: only propose if network ok - which ntpdate &>/dev/null && EXTRA="'ntp' 'Set time and date using ntp'" + which ntpdate &>/dev/null && EXTRA_1='ntp' && EXTRA_2='Set time and date using ntp' ask_option $default "Date/time configuration" "According to your settings and your hardwareclock, the date should now be $current. If this is incorrect, you can correct this now" required \ - $EXTRA "manual" "Set time and date manually" "return" "Looks good. back to main menu" + $EXTRA_1 $EXTRA_2 "manual" "Set time and date manually" "return" "Looks good. back to main menu" if [ "$ANSWER_OPTION" = ntp ] then if ntpdate pool.ntp.org >/dev/null -- cgit v1.2.3 From 49060262210fa1c610d25695336c08b8d4948fd0 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 13:25:16 +0200 Subject: fix for ntp stuff take 2 --- src/core/libs/lib-ui-interactive.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 1c58e8d..4020bd9 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -92,13 +92,12 @@ interactive_time () { current=`date` default=no [ -n "$NEXTITEM" ] && default="$NEXTITEM" - EXTRA_1= - EXTRA_2= #TODO: only propose if network ok - which ntpdate &>/dev/null && EXTRA_1='ntp' && EXTRA_2='Set time and date using ntp' + EXTRA=() + type ntpdate &>/dev/null && EXTRA=('ntp' 'Set time and date using ntp') ask_option $default "Date/time configuration" "According to your settings and your hardwareclock, the date should now be $current. If this is incorrect, you can correct this now" required \ - $EXTRA_1 $EXTRA_2 "manual" "Set time and date manually" "return" "Looks good. back to main menu" + "${EXTRA[@]}" "manual" "Set time and date manually" "return" "Looks good. back to main menu" if [ "$ANSWER_OPTION" = ntp ] then if ntpdate pool.ntp.org >/dev/null -- cgit v1.2.3 From fc5c21f44abdf6dc6fccb18248803c961c0ff0c5 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 13:31:38 +0200 Subject: actually saving the clock to hardware might be useful.. --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 4020bd9..360a7c5 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -103,7 +103,7 @@ interactive_time () { if ntpdate pool.ntp.org >/dev/null then notify "Synced clock with internet pool successfully." - NEXTITEM=3 + dohwclock $HARDWARECLOCK systohc && NEXTITEM=3 else show_warning 'Ntp failure' "An error has occured, time was not changed!" fi -- cgit v1.2.3 From be327b9710a668c8c0b8cd553cdeca7705447788 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 15:22:15 +0200 Subject: bash function naming syntax fix --- src/core/libs/lib-ui.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 8b614bb..32f9184 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -50,7 +50,7 @@ show_warning () debug 'UI' "show_warning '$1': $2 ($type)" if [ "$var_UI_TYPE" = dia ] then - _dia_DIALOG --title "$1" --exit-label "Continue" --${type}box "$2" 0 0 || die_error "dialog could not show --${type}box $2. often this means a file does not exist" + _dia_dialog --title "$1" --exit-label "Continue" --${type}box "$2" 0 0 || die_error "dialog could not show --${type}box $2. often this means a file does not exist" else echo "WARNING: $1" [ "${type}" = msg ] && echo -e "$2" @@ -67,7 +67,7 @@ notify () debug 'UI' "notify: $@" if [ "$var_UI_TYPE" = dia ] then - _dia_DIALOG --msgbox "$@" 0 0 + _dia_dialog --msgbox "$@" 0 0 else echo -e "$@" fi @@ -94,7 +94,7 @@ infofy () #TODO: when using successive things, the screen can become full and yo str=`cat $DIA_SUCCESSIVE_ITEMS-$successive` fi [ "$succ_last" = 1 ] && rm $DIA_SUCCESSIVE_ITEMS-$successive - _dia_DIALOG --infobox "$str" 0 0 + _dia_dialog --infobox "$str" 0 0 else echo -e "$1" fi @@ -302,7 +302,7 @@ follow_progress () # # parameters: see dialog(1) # returns: whatever dialog did -_dia_DIALOG() +_dia_dialog() { dialog --backtitle "$TITLE" --aspect 15 "$@" return $? @@ -322,7 +322,7 @@ _dia_ask_checklist () list="$list $1 $2 $3" shift 3 done - _dia_DIALOG --checklist "$str" 0 0 0 $list 2>$ANSWER + _dia_dialog --checklist "$str" 0 0 0 $list 2>$ANSWER ret=$? ANSWER_CHECKLIST=`cat $ANSWER` debug 'UI' "_dia_ask_checklist: user checked ON: $ANSWER_CHECKLIST" @@ -355,7 +355,7 @@ _dia_ask_number () [ -n $2 ] && str2="min $2" [ -n $3 -a $3 != '0' ] && str2="$str2 max $3" [ -n "$str2" ] && str="$str ( $str2 )" - _dia_DIALOG --inputbox "$str" 0 0 $4 2>$ANSWER + _dia_dialog --inputbox "$str" 0 0 $4 2>$ANSWER ret=$? ANSWER_NUMBER=`cat $ANSWER` if [[ $ANSWER_NUMBER = *[^0-9]* ]] #TODO: handle exit state @@ -394,7 +394,7 @@ _dia_ask_option () shift 4 CANCEL_LABEL=Cancel [ $TYPE == optional ] && CANCEL_LABEL='Skip' - _dia_DIALOG $DEFAULT --cancel-label $CANCEL_LABEL --colors --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT $EXTRA_INFO" 0 0 0 "$@" 2>$ANSWER + _dia_dialog $DEFAULT --cancel-label $CANCEL_LABEL --colors --title " $DIA_MENU_TITLE " --menu "$DIA_MENU_TEXT $EXTRA_INFO" 0 0 0 "$@" 2>$ANSWER ret=$? ANSWER_OPTION=`cat $ANSWER` debug 'UI' "dia_ask_option: ANSWER_OPTION: $ANSWER_OPTION, returncode (skip/cancel): $ret ($DIA_MENU_TITLE)" @@ -414,7 +414,7 @@ _dia_ask_password () type_u= fi - _dia_DIALOG --passwordbox "Enter your $type_l password" 8 65 "$2" 2>$ANSWER + _dia_dialog --passwordbox "Enter your $type_l password" 8 65 "$2" 2>$ANSWER ret=$? [ -n "$type_u" ] && read ${type_u}_PASSWORD < $ANSWER [ -z "$type_u" ] && read PASSWORD < $ANSWER @@ -427,7 +427,7 @@ _dia_ask_password () _dia_ask_string () { exitcode=${3:-1} - _dia_DIALOG --inputbox "$1" 0 0 "$2" 2>$ANSWER + _dia_dialog --inputbox "$1" 0 0 "$2" 2>$ANSWER ret=$? ANSWER_STRING=`cat $ANSWER` debug 'UI' "_dia_ask_string: user entered $ANSWER_STRING" @@ -455,7 +455,7 @@ _dia_follow_progress () { title=$1 logfile=$2 - FOLLOW_PID=`_dia_DIALOG --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null` + FOLLOW_PID=`_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null` } -- cgit v1.2.3 From bfa28ff93026688bc5dc97666442977623579b7f Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 15:26:17 +0200 Subject: syntax on editor checking fix --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 360a7c5..8beb6fb 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -792,7 +792,7 @@ EOF # ... notify "Before installing GRUB, you must review the configuration file. You will now be put into the editor. After you save your changes and exit the editor, you can install GRUB." - [ "$EDITOR" ] || interactive_get_editor + [ -n "$EDITOR" ] || interactive_get_editor $EDITOR $grubmenu DEVS=$(finddisks 1 _) -- cgit v1.2.3 From 3ea556956d10dc98f65a27436493af5e3ef35e26 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sat, 4 Apr 2009 15:26:35 +0200 Subject: stderr output fix --- src/core/libs/lib-blockdevices-filesystems.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index c1316f0..7cdd477 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -207,7 +207,7 @@ findpartitions() { # taken from setup get_grub_map() { - rm $TMP_DEV_MAP #TODO: this doesn't exist? is this a problem? ASKDEV + rm $TMP_DEV_MAP &>/dev/null #TODO: this doesn't exist? is this a problem? ASKDEV infofy "Generating GRUB device map...\nThis could take a while.\n\n Please be patient." $var_TARGET_DIR/sbin/grub --no-floppy --device-map $TMP_DEV_MAP >/tmp/grub.log 2>&1 < Date: Tue, 7 Apr 2009 22:28:59 +0200 Subject: fix for FS#13835 - following the output of a process is broken - FUCK YEAH --- src/core/libs/lib-ui.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 32f9184..fcc1663 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -455,7 +455,9 @@ _dia_follow_progress () { title=$1 logfile=$2 - FOLLOW_PID=`_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null` + _dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>$RUNTIME_DIR/aif-follow-pid + FOLLOW_PID=`cat $RUNTIME_DIR/aif-follow-pid` + rm $RUNTIME_DIR/aif-follow-pid } -- cgit v1.2.3 From c19ef714b029977a2113f9b79bc76cfab512ae28 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 8 Apr 2009 19:15:06 +0200 Subject: a cleaner way to fix FS#13835 - following the output of a process is broken --- src/core/libs/lib-ui.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index fcc1663..4b854e3 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -455,9 +455,7 @@ _dia_follow_progress () { title=$1 logfile=$2 - _dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>$RUNTIME_DIR/aif-follow-pid - FOLLOW_PID=`cat $RUNTIME_DIR/aif-follow-pid` - rm $RUNTIME_DIR/aif-follow-pid + FOLLOW_PID=`_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null | head -n 1` } -- cgit v1.2.3 From 31f0417d93ece43cbddb8ada12301f8112d5e351 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 8 Apr 2009 22:07:11 +0200 Subject: sorry i was wrong in the previous commit. restoring first fix... --- src/core/libs/lib-ui.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 4b854e3..c039a71 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -455,7 +455,18 @@ _dia_follow_progress () { title=$1 logfile=$2 - FOLLOW_PID=`_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null | head -n 1` + + _dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>$RUNTIME_DIR/aif-follow-pid + FOLLOW_PID=`cat $RUNTIME_DIR/aif-follow-pid` + rm $RUNTIME_DIR/aif-follow-pid + + # I wish something like this would work. anyone who can explain me why it doesn't get's to be aif contributor of the month. + # FOLLOW_PID=`_dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 2>&1 >/dev/null | head -n 1` + + # Also this doesn't work: + # _dia_dialog --title "$1" --no-kill --tailboxbg "$2" 0 0 &>/dev/null & + # FOLLOW_PID=$! + } -- cgit v1.2.3