From d9f5fe86a8428d146bb4489578f8e53a2d100445 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Thu, 10 Sep 2009 15:46:43 +0200 Subject: [PATCH 01/16] Update changelog for release (0.8.29) --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index bc9024a..0ff1604 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +grml-autoconfig (0.8.29) unstable; urgency=low + + [ Ulrich Dangel ] + * modify wget parameter to only try once to download given config. + [Closes: issue732] + + -- Michael Prokop Thu, 10 Sep 2009 15:43:10 +0200 + grml-autoconfig (0.8.28) unstable; urgency=low [ Michael Prokop ] -- 2.1.4 From 811e324061df4f7cf49a7faf61736e23427f3bdf Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 00:56:11 +0200 Subject: [PATCH 02/16] refactored config_netconfig config_netconfig uses new function get_remote_file for getting files from remote host. get_remote_file returns only true if file size is greater then 0 --- autoconfig.functions | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index 3c594cf..13f32f0 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1792,31 +1792,44 @@ config_services(){ } # }}} -# {{{ config files -config_netconfig(){ - if checkbootparam 'netconfig' ; then - CONFIG="$(getbootparam 'netconfig' 2>>$DEBUG)" - CONFIGFILE='/tmp/netconfig.grml' - +# {{{ remote files +get_remote_file() { + [ "$#" -eq 2 ] || ( echo "Error: wrong parameter for get_remote_file()" ; return 1 ) + SOURCE="$1" + TARGET="$2" getconfig() { wget --timeout=10 --dns-timeout=10 --connect-timeout=10 --tries=1 \ - --read-timeout=10 $CONFIG -O $CONFIGFILE && return 0 || return 1 + --read-timeout=10 ${SOURCE} -O ${TARGET} && return 0 || return 1 } - einfo "Trying to get ${WHITE}${CONFIG}${NORMAL}" + einfo "Trying to get ${WHITE}${TARGET}${NORMAL}" counter=10 while ! getconfig && [[ "$counter" != 0 ]] ; do - echo -n "Sleeping for 5 seconds and trying to get config again... " + echo -n "Sleeping for 1 second and trying to get config again... " counter=$(( counter-1 )) echo "$counter tries left" ; sleep 1 done - if [ -r "$CONFIGFILE" ] ; then + if [ -s "$TARGET" ] ; then einfo "Downloading was successfull." ; eend 0 - einfo "md5sum of ${WHITE}${CONFIG}${NORMAL}: " - md5sum $CONFIGFILE ; eend 0 - cd / && einfo "Unpacking ${WHITE}${CONFIGFILE}${NORMAL}:" && /usr/bin/unp $CONFIGFILE $EXTRACTOPTIONS ; eend $? + einfo "md5sum of ${WHITE}${TARGET}${NORMAL}: " + md5sum ${TARGET} ; eend 0 + return 0; else - einfo "Sorry, could not fetch $CONFIG" ; eend 1 + einfo "Sorry, could not fetch ${SOURCE}" ; eend 1 + return 1; + fi +} +# }}} + +# {{{ config files +config_netconfig(){ + if checkbootparam 'netconfig' ; then + CONFIG="$(getbootparam 'netconfig' 2>>$DEBUG)" + CONFIGFILE='/tmp/netconfig.grml' + + if get_remote_file ${CONFIG} ${CONFIGFILE} ; then + cd / && einfo "Unpacking ${WHITE}${CONFIGFILE}${NORMAL}:" && /usr/bin/unp $CONFIGFILE $EXTRACTOPTIONS ; eend $? fi + fi } # }}} -- 2.1.4 From b2d376c8f7805be78101865a423f892ddf074588 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 01:02:06 +0200 Subject: [PATCH 03/16] added new bootparameter netscript introduced new bootpara netscript for downloading and running a executable from a remote host --- autoconfig | 1 + autoconfig.functions | 15 +++++++++++++++ doc/grml-autoconfig.1.txt | 6 ++++++ grml-autoconfig | 2 ++ 4 files changed, 24 insertions(+) diff --git a/autoconfig b/autoconfig index 363fa80..10ea222 100644 --- a/autoconfig +++ b/autoconfig @@ -95,6 +95,7 @@ CONFIG_MOUSE='yes' # show mouse information (expert-mode) CONFIG_MYCONFIG='yes' # check if we want the config floppy CONFIG_MYPATH='yes' # provide setting additional paths via bootoption mypath CONFIG_NETCONFIG='yes' # download configuration archive provided by bootoption netconfig=... +CONFIG_NETSCRIPT='yes' # download and run script/executable provided by bootoption netscript=... CONFIG_NETIPV6='yes' # check for bootparam ipv6 CONFIG_PARTCONF='yes' # do we want partconf to work? CONFIG_PASSWD='yes' # set password via bootparam passwd diff --git a/autoconfig.functions b/autoconfig.functions index 13f32f0..b1f8933 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1834,6 +1834,21 @@ config_netconfig(){ } # }}} +# {{{ remote scripts +config_netscript() { + if checkbootparam 'netscript' ; then + CONFIG="$(getbootparam 'netscript' 2>>$DEBUG)" + SCRIPTFILE='/tmp/netscript.grml' + + if get_remote_file ${CONFIG} ${SCRIPTFILE} ; then + chmod +x ${SCRIPTFILE} + einfo "Running ${WHITE}${SCRIPTFILE}${NORMAL}:" && ${SCRIPTFILE} ; eend $? + fi + + fi +} +# }}} + # {{{ blindsound config_blindsound(){ if checkbootparam 'blind' ; then diff --git a/doc/grml-autoconfig.1.txt b/doc/grml-autoconfig.1.txt index 88dcbdb..86c9c5c 100644 --- a/doc/grml-autoconfig.1.txt +++ b/doc/grml-autoconfig.1.txt @@ -120,6 +120,12 @@ netconfig:: netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz +netscript:: + Use this parameter to download and run a script from specified + destination: Usage example: + + netcript=server.tld/path/to/script => download and run script/executable from server + extract:: Extract specific directories from configuration archive. Notice: This diff --git a/grml-autoconfig b/grml-autoconfig index a53d2c5..b5556d1 100755 --- a/grml-autoconfig +++ b/grml-autoconfig @@ -232,6 +232,8 @@ checkvalue $CONFIG_SERVICES && config_services checkvalue $CONFIG_NETCONFIG && config_netconfig +checkvalue $CONFIG_NETSCRIPT && config_netscript + checkvalue $CONFIG_NETIPV6 && config_ipv6 checkvalue $CONFIG_DEBNET && config_debnet -- 2.1.4 From a83a9b65c777df57422e5e9d915e2425f0d1ef89 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sat, 12 Sep 2009 09:45:32 +0200 Subject: [PATCH 04/16] Update changelog for release (0.8.30) --- debian/changelog | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0ff1604..7ce84ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +grml-autoconfig (0.8.30) unstable; urgency=low + + [ Ulrich Dangel ] + * added new bootparameter netscript: introduced new bootoption + for downloading and running a executable from a remote host + [Closes: issue734] + + -- Michael Prokop Sat, 12 Sep 2009 09:44:30 +0200 + grml-autoconfig (0.8.29) unstable; urgency=low [ Ulrich Dangel ] -- 2.1.4 From d1792371a76a1c03bbe2ebd9bc99271de9952e46 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 03:12:39 +0200 Subject: [PATCH 05/16] refactored unit tests added run_tests script to run all tests invoke run_tests from debian/rules instead of test_parameters.sh --- debian/rules | 2 +- tests/common_tests | 15 +++++++++++ tests/run_tests.sh | 29 ++++++++++++++++++++++ .../{test_parameters.sh => test_bootparameters.sh} | 13 +--------- 4 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 tests/common_tests create mode 100755 tests/run_tests.sh rename tests/{test_parameters.sh => test_bootparameters.sh} (90%) diff --git a/debian/rules b/debian/rules index 2026dce..1cb8462 100755 --- a/debian/rules +++ b/debian/rules @@ -13,7 +13,7 @@ build: build-stamp build-stamp: dh_testdir - (cd tests && ./test_parameters.sh) + (cd tests && ./run_tests.sh) (cd doc && $(MAKE)) touch build-stamp diff --git a/tests/common_tests b/tests/common_tests new file mode 100644 index 0000000..576b7fc --- /dev/null +++ b/tests/common_tests @@ -0,0 +1,15 @@ +#!/bin/zsh + +setopt shwordsplit + +oneTimeSetUp() { + OLDPATH=$PATH + + . ../autoconfig.functions + + export PATH=$OLDPATH +} + + +SHUNIT_PARENT=$1 +. ./shunit2 diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..46c4645 --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,29 @@ +#!/bin/zsh +# Filename: run_tests +# Purpose: run unit tests for grml-autoconfig +# Authors: grml-team (grml.org), (c) Ulrich Dangel +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +################################################################################ + + +GLOBRETVAL=0 + +for FILE in test_*.sh ; do + if [ -x ${FILE} ] ; then + pretty_name="${FILE##test_}" + pretty_name="${pretty_name/.sh/}" + + echo "Running test for: ${pretty_name}" + + ./${FILE} + RETVAL=$? + + [ "$RETVAL" -ne 0 ] && GLOBRETVAL=$RETVAL + fi +done + +exit $GLOBRETVAL + +## END OF FILE ################################################################# +# vim:foldmethod=marker expandtab ai ft=zsh shiftwidth=3 diff --git a/tests/test_parameters.sh b/tests/test_bootparameters.sh similarity index 90% rename from tests/test_parameters.sh rename to tests/test_bootparameters.sh index 5d08f8a..7e61c86 100755 --- a/tests/test_parameters.sh +++ b/tests/test_bootparameters.sh @@ -1,6 +1,5 @@ #!/bin/zsh -setopt shwordsplit test_checkbootparam() { CMDLINE='foo=dingens bar foobar=blub' @@ -51,14 +50,4 @@ test_getbootparam() { } -oneTimeSetUp() { - OLDPATH=$PATH - - . ../autoconfig.functions - - export PATH=$OLDPATH -} - -SHUNIT_PARENT=$0 - -. ./shunit2 +. ./common_tests $0 -- 2.1.4 From eb06481714843a96d65408e822d591b94126e08f Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 03:13:00 +0200 Subject: [PATCH 06/16] Added unittest for test_finddcsdir --- tests/test_dcsdir.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tests/test_dcsdir.sh diff --git a/tests/test_dcsdir.sh b/tests/test_dcsdir.sh new file mode 100755 index 0000000..0f012e8 --- /dev/null +++ b/tests/test_dcsdir.sh @@ -0,0 +1,16 @@ +#!/bin/zsh + + +test_finddcsdir() { + CMDLINE='' + INSTALLED='' + + EXPECTED_PATH='/live/image' + + config_finddcsdir &>/dev/null + + assertEquals 'dcsdir is wrong' ${EXPECTED_PATH} ${DCSDIR} + +} + +. ./common_tests $0 -- 2.1.4 From 96017c7cae64d25550202416ca14783942c0d7b1 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 23:53:32 +0200 Subject: [PATCH 07/16] Add arch to predefined variables in autoconfig.functions --- autoconfig.functions | 1 + 1 file changed, 1 insertion(+) diff --git a/autoconfig.functions b/autoconfig.functions index b1f8933..621ef1f 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -10,6 +10,7 @@ export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin" DEBUG="/dev/null" KERNEL="$(uname -r)" +ARCH="$(uname -m)" umask 022 # old linuxrc version: -- 2.1.4 From 1e3aa3c8b960b89100a913e11e23f46df4ec1516 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 23:56:08 +0200 Subject: [PATCH 08/16] Allow passing sources with variables to get_remote_file Now it is possible to use somethling like netconfig=server.tld/config-$ARCH.tbz Fixed and updated documentation for netscript/netconfig --- autoconfig.functions | 2 +- doc/grml-autoconfig.1.txt | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index 621ef1f..c9e4ff5 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1796,7 +1796,7 @@ config_services(){ # {{{ remote files get_remote_file() { [ "$#" -eq 2 ] || ( echo "Error: wrong parameter for get_remote_file()" ; return 1 ) - SOURCE="$1" + SOURCE=$(eval echo "$1") TARGET="$2" getconfig() { wget --timeout=10 --dns-timeout=10 --connect-timeout=10 --tries=1 \ diff --git a/doc/grml-autoconfig.1.txt b/doc/grml-autoconfig.1.txt index 86c9c5c..5f1b8af 100644 --- a/doc/grml-autoconfig.1.txt +++ b/doc/grml-autoconfig.1.txt @@ -120,12 +120,6 @@ netconfig:: netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz -netscript:: - Use this parameter to download and run a script from specified - destination: Usage example: - - netcript=server.tld/path/to/script => download and run script/executable from server - extract:: Extract specific directories from configuration archive. Notice: This @@ -234,9 +228,21 @@ partconf:: netconfig:: Use this parameter to restore configuration using wget to download a GCA - from the specified destination. Usage example: + from the specified destination. You can also add variables to change the + file name depending on the host configuration. Predefined and useful + variables are $ARCH, $HOSTNAME and $KERNEL. Usage example: netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz + netconfig=server.tld/config-$ARCH.tbz => download config for specified architecture + +netscript:: + Use this parameter to download and run a script from specified destination: + You can also add variables to change the file name depending on the host + configuration. Predefined and useful variables are $ARCH, $HOSTNAME and + $KERNEL. Usage example: + + netcript=server.tld/path/to/script => download and run script/executable from server + netscript=server.tld/script-$HOSTNAME => download and run script/executable for specific host extract:: -- 2.1.4 From 994a5c3deda7de4027912f73fe7bc6d2c73c1421 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sat, 12 Sep 2009 14:05:36 +0200 Subject: [PATCH 09/16] Add support for overriding values via autoconfig.local Adjusted sbin/grml-autoconfig to write changes to this new file Updated documentation --- autoconfig | 16 +++++++++++++++- autoconfig.local | 6 ++++++ debian/rules | 1 + doc/grml-autoconfig.8.txt | 9 +++++++-- sbin/grml-autoconfig | 33 ++++++++++++++++++++++++--------- 5 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 autoconfig.local diff --git a/autoconfig b/autoconfig index 10ea222..2cfb247 100644 --- a/autoconfig +++ b/autoconfig @@ -1,11 +1,17 @@ # Filename: /etc/grml/autoconfig -# Purpose: configuration for grml-autoconfig +# Purpose: global configuration for grml-autoconfig # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. ################################################################################ ################################################################################ +# Notice: Please do not edit this file! Use grml-autoconfig or +# /etc/grml/autoconfig.local instead! +################################################################################ + + +################################################################################ # Notice: you can configure grml-autoconfig via adjusting the following values. # Set them to 'yes' to activate them and to 'no' to deactivate them. # But please notice that some options might require an additional bootparam @@ -117,4 +123,12 @@ CONFIG_VMWARE='yes' # vmware specific stuff (use xorg.conf.vmware) CONFIG_WELCOME='yes' # play welcome sound (audio) CONFIG_WONDERSHAPER='yes' # start wondershaper with options provided via bootparam CONFIG_XSTARTUP='yes' # start X window system via grml-x [only in live-mode] + + +# config for local configuration file + +CONFIG_AUTOCONFIG_LOCAL='/etc/grml/autoconfig.local' + +[ -e ${CONFIG_AUTOCONFIG_LOCAL} ] && . ${CONFIG_AUTOCONFIG_LOCAL} + ## END OF FILE ################################################################# diff --git a/autoconfig.local b/autoconfig.local new file mode 100644 index 0000000..11ffbba --- /dev/null +++ b/autoconfig.local @@ -0,0 +1,6 @@ +# Filename: /etc/grml/autoconfig.local +# Purpose: local configuration for grml-autoconfig +# Authors: grml-team (grml.org), (c) Michael Prokop +# Bug-Reports: see http://grml.org/bugs/ +# License: This file is licensed under the GPL v2. +################################################################################ diff --git a/debian/rules b/debian/rules index 1cb8462..834d890 100755 --- a/debian/rules +++ b/debian/rules @@ -35,6 +35,7 @@ install: build # Add here commands to install the package into debian/grml-autoconfig. install -m 755 grml-autoconfig debian/grml-autoconfig/etc/init.d/grml-autoconfig install -m 644 autoconfig debian/grml-autoconfig/etc/grml/autoconfig + install -m 644 autoconfig.local debian/grml-autoconfig/etc/grml/autoconfig.local install -m 755 autoconfig.functions debian/grml-autoconfig/etc/grml/autoconfig.functions install -m 644 language-functions debian/grml-autoconfig/etc/grml/language-functions install -m 755 sbin/grml-autoconfig debian/grml-autoconfig/usr/sbin/grml-autoconfig diff --git a/doc/grml-autoconfig.8.txt b/doc/grml-autoconfig.8.txt index ef53e16..9a582a6 100644 --- a/doc/grml-autoconfig.8.txt +++ b/doc/grml-autoconfig.8.txt @@ -61,10 +61,15 @@ Dialog interface to the configuration file /etc/grml/autoconfig. */etc/grml/autoconfig*:: -Configuration file for grml-autoconfig framework. You can either edit this -configuration file manually of use the dialog interface +Default configuration file for grml-autoconfig framework. You can override +settings via /etc/grml/autoconfig.local or use the dialog interface /usr/sbin/grml-autoconfig. + */etc/grml/autoconfig.local*:: +User specific configuration file for grml-autoconfig. You can edit it directly +or use the dialog interface /usr/sbin/grml-autoconfig. + + */etc/grml/autoconfig.functions*:: Main functions of the grml-autoconfig. You do not need to configure or execute diff --git a/sbin/grml-autoconfig b/sbin/grml-autoconfig index 0abc8f8..9806ac3 100755 --- a/sbin/grml-autoconfig +++ b/sbin/grml-autoconfig @@ -18,15 +18,19 @@ TMPFILE="$(mktemp)" AUTOCONFIG=/etc/grml/autoconfig [ -r $AUTOCONFIG ] || exit 1 +. $AUTOCONFIG + # helper functions activate_value() { - sed -i "s/$1.*/$1'yes'/" $AUTOCONFIG + check_entry $1 + sed -i "s/$1.*/$1'yes'/" ${CONFIG_AUTOCONFIG_LOCAL} } deactivate_value() { - sed -i "s/$1.*/$1'no'/" $AUTOCONFIG + check_entry $1 + sed -i "s/$1.*/$1'no'/" ${CONFIG_AUTOCONFIG_LOCAL} } check_setting() @@ -34,17 +38,28 @@ check_setting() grep -q $* $TMPFILE && return 0 || return 1 } +check_entry() +{ + if ! grep -q ${1} ${CONFIG_AUTOCONFIG_LOCAL} 2>/dev/null ; then + grep $1 ${AUTOCONFIG} >> ${CONFIG_AUTOCONFIG_LOCAL} + fi +} + +is_set() +{ + [ $1 = 'yes' ] && return 0 || return 1 +} check_current_state() { - grep -q '^CONFIG_DHCP=.*yes' $AUTOCONFIG && DHCPSTATUS=ON || DHCPSTATUS=OFF + is_set $CONFIG_DHCP && DHCPSTATUS=ON || DHCPSTATUS=OFF if [ "$(grep '^auto' /etc/network/interfaces | sed 's/ lo// ; s/auto// ; s/ //g')" != "" ] ; then DHCPSTATUS=OFF fi - grep -q '^CONFIG_FSTAB=.*yes' $AUTOCONFIG && FSTABSTATUS=ON || FSTABSTATUS=OFF - grep -q '^CONFIG_CPU=.*yes' $AUTOCONFIG && CPUSTATUS=ON || CPUSTATUS=OFF - grep -q '^CONFIG_ACPI_APM=.*yes' $AUTOCONFIG && ACPI_APMSTATUS=ON || ACPI_APMSTATUS=OFF - grep -q '^CONFIG_SYSLOG=.*yes' $AUTOCONFIG && SYSLOGSTATUS=ON || SYSLOGSTATUS=OFF - grep -q '^CONFIG_GPM=.*yes' $AUTOCONFIG && GPMSTATUS=ON || GPMSTATUS=OFF + is_set $CONFIG_FSTAB && FSTABSTATUS=ON || FSTABSTATUS=OFF + is_set $CONFIG_CPU && CPUSTATUS=ON || CPUSTATUS=OFF + is_set $CONFIG_ACPI_APM && ACPI_APMSTATUS=ON || ACPI_APMSTATUS=OFF + is_set $CONFIG_SYSLOG && SYSLOGSTATUS=ON || SYSLOGSTATUS=OFF + is_set $CONFIG_GPM && GPMSTATUS=ON || GPMSTATUS=OFF } # main program @@ -57,7 +72,7 @@ interface to activate or deactivate some features. If you do not know what to do at this stage just leave it untouched, the defaults are the recommended values. -All the configuration happens in the file /etc/grml/autoconfig - you can +All the configuration happens in the file /etc/grml/autoconfig.local - you can edit it manually as well. " 0 0 0 \ dhcp "check for network devices and run pump (get ip-address via DHCP)" $DHCPSTATUS \ -- 2.1.4 From 78d833e101193acb7adeb44bee34bd8b387bdd5f Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sun, 13 Sep 2009 00:03:29 +0200 Subject: [PATCH 10/16] Splitted documentation for grml-autoconfig.1 in 2 different files moved documentation for different grml versions in separate files --- doc/grml-autoconfig.1.txt | 244 +--------------------------------------- doc/grml-autoconfig.200905.txt | 116 +++++++++++++++++++ doc/grml-autoconfig.current.txt | 159 ++++++++++++++++++++++++++ 3 files changed, 277 insertions(+), 242 deletions(-) create mode 100644 doc/grml-autoconfig.200905.txt create mode 100644 doc/grml-autoconfig.current.txt diff --git a/doc/grml-autoconfig.1.txt b/doc/grml-autoconfig.1.txt index 5f1b8af..e042f23 100644 --- a/doc/grml-autoconfig.1.txt +++ b/doc/grml-autoconfig.1.txt @@ -52,250 +52,10 @@ to deal with this config framework. Visit link:http://wiki.grml.org/doku.php?id=persistency for further information. [[up-to-200905]] -Behavior up to grml 2009.05 ---------------------------- - -This section applies to all Grml versions older than and including release 2009.05. - -Autoconfiguration -~~~~~~~~~~~~~~~~~ - -By default the booting process tries to mount a device labeled 'GRMLCFG'. This -provides the possibility to restore a configuration (named config.tbz) and -execute a script (named grml.sh) without the need to specify any bootparams. If -you want to disable this feature please take a look at the 'noautoconfig' -bootparam. - -Boot parameters -~~~~~~~~~~~~~~~ - -As you probably know you can adjust boot parameters on the bootprompt. You want -to set some boot parameters permanently? That's possible via adding a directory -named 'bootparams' to the Grml-ISO which has to be located at the root-directory -/bootparams/ (note: the directory is known as /live/image/bootparams/ on a -_running_ grml system then). Place a textfile inside the directory containing -the boot parameters which should be appended to default ones (this corresponds -to booting without any special parameters). If you want to be able to boot from -your Grml-CD you have to create a multisession CD. See the <> for more details how to use it or consider booting from a USB device -(checkout grml2usb). - -The following boot parameters are supported. Use them at the (isolinux) -bootprompt as documented here. - -myconfig:: - - This parameter is for restoring configuration using the file config.tbz - on the specified device. Usage examples: - - myconfig=/dev/sda1 => use file config.tbz from usb-device - myconfig=/dev/fd0 => use file config.tbz from floppy-disk - myconfig=/dev/sda1 file=config_foobar.tbz => use file config_foobar.tbz from usb-device - -home:: - - This parameter is for setting a specific partition as home directory. - Usage examples: - - home=/dev/sda3 => use /dev/sda3 as the homepartition - home=scan => scan through the available partitions and search - for file grml.img - -partconf:: - - This parameter mounts the specified device in read-only mode and tries to - copy all files specified in /etc/grml/partconf to the Grml system. This - provides the possibility to use the configuration of a harddisk - installation. For example using the network configuration (which is - specified in /etc/network) is possible using this boot parameter. Usage - example: - - partconf=/dev/sda2 => try to mount /dev/sda2 and copy files specified - in /etc/grml/partconf to the booted Grml system - -netconfig:: - - Use this parameter to restore configuration using wget to download a - configuration file from specified destination. Usage example: - - netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz - -extract:: - - Extract specific directories from configuration archive. Notice: This - bootparam is useful only with bootparams which are able to extract - configuration archives. - - extract=/home/grml => extract only /home/grml from archive - extract=/etc => extract only /etc from archive - extract=/home/grml/config => extract only $HOME/config from archive - -scripts:: - - This parameter executes a script located in the root-directory /scripts/ on - the Grml media/ISO (note: the directory is known as /live/image/scripts/ on - a _running_ Grml system then). Usage examples: - - scripts => run script [/live/image]/scripts/grml.sh - scripts=foobar.sh => run script foobar.sh in [/live/image]/scripts/ - -config:: - - This parameter restores a configuration using root-directory /config/ on the - Grml media/ISO (note: the directory is known as /live/image/config on a - _running_ Grml system then). Usage examples: - - config => restore configuration using file config.tbz from directory [/live/image]/config/ - config=config_foobar.tbz => restore configuration using file config_foobar.tbz from directory [/live/image]/config/ - -debs:: - - This parameter allows automatic installation of deb packages while booting. - The debian packages have to be located in the root-directory /debs/ on the - Grml media/ISO (note: the directory is known as /live/image/debs/ on a - _running_ Grml system then). Usage examples: - - debs => install all debian packages (suffix .deb) from directory [/live/image]/debs/ - debs=01 => install all debian packages (suffix .deb) starting with 01 in the filename from directory [/live/image]/debs/ - - -noautoconfig:: - - Deactivate automounting. By default the command 'mount' tries to mount a - device with label 'GRMLCFG'. If you specify the noautoconfig bootparam the - automounting will be deactivated. - - noautoconfig => disables auto mounting of label 'GRMLCFG' +include::grml-autoconfig.200905.txt[] [[current-versions]] -Behavior in current Grml versions ---------------------------------- - -This section applies to all Grml versions newer than release 2009.05. - -The central concept of grml-autoconfig is the DCS directory which holds debs, -configuration and scripts which are used during system startup. - -Determination of DCS directory -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The DCS directory defaults to the root directory of the GRML live image. If a -file system labeled GRMLCFG is found, the DCS directory is the root directory of -that file system. Alternatively, the myconfig boot parameter can be used to -directly specify a device which is then taken as DCS directory -(myconfig=/dev/sda1, for example). - -Without any additional boot parameters, the GCA at DCSDIR/config.tbz is -automatically unpacked and DCSDIR/scrips/grml.sh is automaitcally executed on -system startup. The 'noautoconfig' boot parameter disables this automatic -behavior. - -Boot Parameters -~~~~~~~~~~~~~~~ - -The following boot parameters are supported. Use them at the (isolinux) -bootprompt as documented here. - -myconfig:: - - This parameter directly sets DCSDIR to the root directory of the specified - device. Usage examples: - - myconfig=/dev/sda1 => read DCS from usb-device - myconfig=/dev/fd0 => read DCS from floppy-disk - -home:: - - This parameter is for setting a specific partition as home directory. Usage - examples: - - home=/dev/sda3 => use /dev/sda3 as the homepartition - home=scan => scan through the available partitions and search - for file grml.img - -partconf:: - - This parameter mounts the specified device in read-only mode and tries to - copy all files specified in /etc/grml/partconf to the Grml system. This - provides the possibility to use the configuration of a harddisk - installation. For example using the network configuration (which is - specified in /etc/network) is possible using this boot parameter. Usage - example: - - partconf=/dev/sda2 => try to mount /dev/sda2 and copy files specified - in /etc/grml/partconf to the booted Grml system - -netconfig:: - - Use this parameter to restore configuration using wget to download a GCA - from the specified destination. You can also add variables to change the - file name depending on the host configuration. Predefined and useful - variables are $ARCH, $HOSTNAME and $KERNEL. Usage example: - - netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz - netconfig=server.tld/config-$ARCH.tbz => download config for specified architecture - -netscript:: - Use this parameter to download and run a script from specified destination: - You can also add variables to change the file name depending on the host - configuration. Predefined and useful variables are $ARCH, $HOSTNAME and - $KERNEL. Usage example: - - netcript=server.tld/path/to/script => download and run script/executable from server - netscript=server.tld/script-$HOSTNAME => download and run script/executable for specific host - -extract:: - - Extract specific directories from the GCA which needs to be specified by - other means. - - extract=/home/grml => extract only /home/grml from archive - extract=/etc => extract only /etc from archive - extract=/home/grml/config => extract only $HOME/config from archive - -scripts:: - - This parameter executes scripts. If an optional path is given, it is - relative to DCSDIR. If it points to a directory, all scripts inside this - directory are executed. If the path points to a file, this single file is - executed. If no path is given, it defaults to scripts/grml.sh. Usage - examples: - - scripts => run script DCSDIR/scripts/grml.sh - scripts=foobar.sh => run script foobar.sh in DCSDIR - scripts=foobar => run all scripts inside DCSDIR/foobar directory - -config:: - - This parameter restores a configuration using a GCA. If an optional path is - given, it is relative to DCSDIR. If no path is given, it defaults to - DCSDIR/config.tbz. Usage examples: - - config => restore configuration using file DCSDIR/config.tbz - config=config_foobar.tbz => restore configuration using file DCSDIR/config_foobar.tbz - -debs:: - - This parameter allows automatic installation of deb packages while booting. - The path is relative to DCSDIR, not optional and is a shell wildcard. All - Files matching the wildcard are installed in a single dpkg --install call. - For backwards compatibility, if no slash is contained in the path, it is - taken relative to DCSDIR/debs. - - Usage examples: - - debs=*.deb => install all debian packages (suffix .deb) from directory DCSDIR/debs/ - debs=foo/01*.deb => install all debian packages (suffix .deb) starting with 01 in the filename from directory DCSDIR/foo - - -noautoconfig:: - - Deactivate automounting. By default the scripts try to mount a device with - label 'GRMLCFG'. If you specify the noautoconfig bootparam this automounting - will be deactivated. - - noautoconfig => disables auto mounting of label 'GRMLCFG' - +include::grml-autoconfig.current.txt[] Permanently adjust boot parameters ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/grml-autoconfig.200905.txt b/doc/grml-autoconfig.200905.txt new file mode 100644 index 0000000..453a928 --- /dev/null +++ b/doc/grml-autoconfig.200905.txt @@ -0,0 +1,116 @@ +Behavior up to grml 2009.05 +--------------------------- + +This section applies to all Grml versions older than and including release 2009.05. + +Autoconfiguration +~~~~~~~~~~~~~~~~~ + +By default the booting process tries to mount a device labeled 'GRMLCFG'. This +provides the possibility to restore a configuration (named config.tbz) and +execute a script (named grml.sh) without the need to specify any bootparams. If +you want to disable this feature please take a look at the 'noautoconfig' +bootparam. + +Boot parameters +~~~~~~~~~~~~~~~ + +As you probably know you can adjust boot parameters on the bootprompt. You want +to set some boot parameters permanently? That's possible via adding a directory +named 'bootparams' to the Grml-ISO which has to be located at the root-directory +/bootparams/ (note: the directory is known as /live/image/bootparams/ on a +_running_ grml system then). Place a textfile inside the directory containing +the boot parameters which should be appended to default ones (this corresponds +to booting without any special parameters). If you want to be able to boot from +your Grml-CD you have to create a multisession CD. See the <> for more details how to use it or consider booting from a USB device +(checkout grml2usb). + +The following boot parameters are supported. Use them at the (isolinux) +bootprompt as documented here. + +myconfig:: + + This parameter is for restoring configuration using the file config.tbz + on the specified device. Usage examples: + + myconfig=/dev/sda1 => use file config.tbz from usb-device + myconfig=/dev/fd0 => use file config.tbz from floppy-disk + myconfig=/dev/sda1 file=config_foobar.tbz => use file config_foobar.tbz from usb-device + +home:: + + This parameter is for setting a specific partition as home directory. + Usage examples: + + home=/dev/sda3 => use /dev/sda3 as the homepartition + home=scan => scan through the available partitions and search + for file grml.img + +partconf:: + + This parameter mounts the specified device in read-only mode and tries to + copy all files specified in /etc/grml/partconf to the Grml system. This + provides the possibility to use the configuration of a harddisk + installation. For example using the network configuration (which is + specified in /etc/network) is possible using this boot parameter. Usage + example: + + partconf=/dev/sda2 => try to mount /dev/sda2 and copy files specified + in /etc/grml/partconf to the booted Grml system + +netconfig:: + + Use this parameter to restore configuration using wget to download a + configuration file from specified destination. Usage example: + + netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz + +extract:: + + Extract specific directories from configuration archive. Notice: This + bootparam is useful only with bootparams which are able to extract + configuration archives. + + extract=/home/grml => extract only /home/grml from archive + extract=/etc => extract only /etc from archive + extract=/home/grml/config => extract only $HOME/config from archive + +scripts:: + + This parameter executes a script located in the root-directory /scripts/ on + the Grml media/ISO (note: the directory is known as /live/image/scripts/ on + a _running_ Grml system then). Usage examples: + + scripts => run script [/live/image]/scripts/grml.sh + scripts=foobar.sh => run script foobar.sh in [/live/image]/scripts/ + +config:: + + This parameter restores a configuration using root-directory /config/ on the + Grml media/ISO (note: the directory is known as /live/image/config on a + _running_ Grml system then). Usage examples: + + config => restore configuration using file config.tbz from directory [/live/image]/config/ + config=config_foobar.tbz => restore configuration using file config_foobar.tbz from directory [/live/image]/config/ + +debs:: + + This parameter allows automatic installation of deb packages while booting. + The debian packages have to be located in the root-directory /debs/ on the + Grml media/ISO (note: the directory is known as /live/image/debs/ on a + _running_ Grml system then). Usage examples: + + debs => install all debian packages (suffix .deb) from directory [/live/image]/debs/ + debs=01 => install all debian packages (suffix .deb) starting with 01 in the filename from directory [/live/image]/debs/ + + +noautoconfig:: + + Deactivate automounting. By default the command 'mount' tries to mount a + device with label 'GRMLCFG'. If you specify the noautoconfig bootparam the + automounting will be deactivated. + + noautoconfig => disables auto mounting of label 'GRMLCFG' + + diff --git a/doc/grml-autoconfig.current.txt b/doc/grml-autoconfig.current.txt new file mode 100644 index 0000000..3266839 --- /dev/null +++ b/doc/grml-autoconfig.current.txt @@ -0,0 +1,159 @@ +Behavior in current Grml versions +--------------------------------- + +This section applies to all Grml versions newer than release 2009.05. + +The central concept of grml-autoconfig is the DCS directory which holds debs, +configuration and scripts which are used during system startup. + +Determination of DCS directory +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The DCS directory defaults to the root directory of the GRML live image. If a +file system labeled GRMLCFG is found, the DCS directory is the root directory of +that file system. Alternatively, the myconfig boot parameter can be used to +directly specify a device which is then taken as DCS directory +(myconfig=/dev/sda1, for example). + +Without any additional boot parameters, the GCA at DCSDIR/config.tbz is +automatically unpacked and DCSDIR/scrips/grml.sh is automaitcally executed on +system startup. The 'noautoconfig' boot parameter disables this automatic +behavior. + +Boot Parameters +~~~~~~~~~~~~~~~ + +The following boot parameters are supported. Use them at the (isolinux) +bootprompt as documented here. + +myconfig:: + + This parameter directly sets DCSDIR to the root directory of the specified + device. Usage examples: + + myconfig=/dev/sda1 => read DCS from usb-device + myconfig=/dev/fd0 => read DCS from floppy-disk + +home:: + + This parameter is for setting a specific partition as home directory. Usage + examples: + + home=/dev/sda3 => use /dev/sda3 as the homepartition + home=scan => scan through the available partitions and search + for file grml.img + +partconf:: + + This parameter mounts the specified device in read-only mode and tries to + copy all files specified in /etc/grml/partconf to the Grml system. This + provides the possibility to use the configuration of a harddisk + installation. For example using the network configuration (which is + specified in /etc/network) is possible using this boot parameter. Usage + example: + + partconf=/dev/sda2 => try to mount /dev/sda2 and copy files specified + in /etc/grml/partconf to the booted Grml system + +netconfig:: + + Use this parameter to restore configuration using wget to download a GCA + from the specified destination. You can also add variables to change the + file name depending on the host configuration. Predefined and useful + variables are $ARCH, $HOSTNAME and $KERNEL. Usage example: + + netconfig=server.tld/path/to/config.tbz => restore configuration using wget to download file config.tbz + netconfig=server.tld/config-$ARCH.tbz => download config for specified architecture + +netscript:: + Use this parameter to download and run a script from specified destination: + You can also add variables to change the file name depending on the host + configuration. Predefined and useful variables are $ARCH, $HOSTNAME and + $KERNEL. Usage example: + + netcript=server.tld/path/to/script => download and run script/executable from server + netscript=server.tld/script-$HOSTNAME => download and run script/executable for specific host + +extract:: + + Extract specific directories from the GCA which needs to be specified by + other means. + + extract=/home/grml => extract only /home/grml from archive + extract=/etc => extract only /etc from archive + extract=/home/grml/config => extract only $HOME/config from archive + +scripts:: + + This parameter executes scripts. If an optional path is given, it is + relative to DCSDIR. If it points to a directory, all scripts inside this + directory are executed. If the path points to a file, this single file is + executed. If no path is given, it defaults to scripts/grml.sh. Usage + examples: + + scripts => run script DCSDIR/scripts/grml.sh + scripts=foobar.sh => run script foobar.sh in DCSDIR + scripts=foobar => run all scripts inside DCSDIR/foobar directory + +config:: + + This parameter restores a configuration using a GCA. If an optional path is + given, it is relative to DCSDIR. If no path is given, it defaults to + DCSDIR/config.tbz. Usage examples: + + config => restore configuration using file DCSDIR/config.tbz + config=config_foobar.tbz => restore configuration using file DCSDIR/config_foobar.tbz + +debs:: + + This parameter allows automatic installation of deb packages while booting. + The path is relative to DCSDIR, not optional and is a shell wildcard. All + Files matching the wildcard are installed in a single dpkg --install call. + For backwards compatibility, if no slash is contained in the path, it is + taken relative to DCSDIR/debs. + + Usage examples: + + debs=*.deb => install all debian packages (suffix .deb) from directory DCSDIR/debs/ + debs=foo/01*.deb => install all debian packages (suffix .deb) starting with 01 in the filename from directory DCSDIR/foo + + +noautoconfig:: + + Deactivate automounting. By default the scripts try to mount a device with + label 'GRMLCFG'. If you specify the noautoconfig bootparam this automounting + will be deactivated. + + noautoconfig => disables auto mounting of label 'GRMLCFG' + + +Permanently adjust boot parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +As you probably know you can adjust boot parameters on the bootprompt. You want +to set some boot parameters permanently? That's possible via adding a directory +named 'bootparams' to the Grml ISO which has to be located at the root-directory +/bootparams/ (note: the directory is known as /live/image/bootparams/ on a +_running_ Grml system then). Place a textfile inside the directory containing +the boot parameters which should be appended to default ones (this corresponds +to booting without any special parameters). + + mkdir bootparams + echo lang=de > bootparams/my_bootparams + +Then burn a multisession CD where directory bootparams is located in the root +directory of the CD. + +[NOTE] +Not all boot parameters can be used via /bootparams/. This is a limitation of +the way the kernel and userspace retrieve boot parameters. Boot parameter +regarding the kernel definitely do *NOT* work. Boot parameter related to +grml-autoconfig (the main part of the boot process in Grml running in userspace, +being all the stuff after startup of udev) are expected to work. Boot parameter +related to initrd/initramfs (the part between 'Searching for GRML file' and +startup of udev) are *NOT* covered by /bootparams/ as well yet. + +TIP: the application k3b (not available on the live-CD but available through the +Debian repositories) provides an easy to use interface for doing the +multisession task. + -- 2.1.4 From c2c3ad77788ea9ec12cc2eb1998481492a532f76 Mon Sep 17 00:00:00 2001 From: Ulrich Dangel Date: Sun, 13 Sep 2009 00:13:18 +0200 Subject: [PATCH 11/16] Updated changelog for 0.8.28 --- debian/changelog | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0ff1604..9d1ff5b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +grml-autoconfig (0.8.30) UNRELEASED; urgency=low + + [ Ulrich Dangel ] + * Introduced autconfig.local for local modifications + [Closes: issue326] + * Added ARCH as predefinded variable to autoconfig.functions + * Extended netconfig/netscript to expand variables in url. + Example: netscript=server/script-$ARCH.sh + * Added unittest for finddcsdir + + -- Ulrich Dangel Sun, 13 Sep 2009 00:06:02 +0200 + grml-autoconfig (0.8.29) unstable; urgency=low [ Ulrich Dangel ] -- 2.1.4 From f21f38e48993f754f976e5e6a7bddc2f60b6cbfb Mon Sep 17 00:00:00 2001 From: Julian Langschaedel Date: Thu, 17 Sep 2009 08:02:57 +0200 Subject: [PATCH 12/16] config_x_startup() locate /bin/X no /usr/X11R6/bin/X found in squeeze --- autoconfig.functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoconfig.functions b/autoconfig.functions index c9e4ff5..53a8774 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1887,7 +1887,7 @@ config_x_startup(){ # make sure we start X only if startx is used *before* a nostartx option # so it's possible to disable automatic X startup using nostart if checkbootparam 'startx' && ! echo "$CMDLINE" | grep -q 'startx.*nostartx' ; then - if [ -x /usr/X11R6/bin/X ] ; then + if [ -x $(which X) ] ; then if [ -z "$INSTALLED" ] ; then WINDOWMANAGER="$(getbootparam 'startx' 2>>$DEBUG)" if [ -z "$WINDOWMANAGER" ] ; then -- 2.1.4 From dfd74e94420abcee9588656b83dbf5b1f914bcf1 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 21 Sep 2009 18:36:45 +0200 Subject: [PATCH 13/16] Update changelog --- debian/changelog | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d1ff5b..addc214 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -grml-autoconfig (0.8.30) UNRELEASED; urgency=low +grml-autoconfig (0.8.30) unstable; urgency=low [ Ulrich Dangel ] * Introduced autconfig.local for local modifications @@ -8,7 +8,11 @@ grml-autoconfig (0.8.30) UNRELEASED; urgency=low Example: netscript=server/script-$ARCH.sh * Added unittest for finddcsdir - -- Ulrich Dangel Sun, 13 Sep 2009 00:06:02 +0200 + [ Michael Prokop ] + * Don't use /usr/X11R6/bin/X anymore, since Debian/squeeze doesn't + provide it any longer. Thanks for the patch to Julian Langschaedel. + + -- Michael Prokop Mon, 21 Sep 2009 18:35:18 +0200 grml-autoconfig (0.8.29) unstable; urgency=low -- 2.1.4 From 419b0e3e4bee8867847321351a06b9fb935efdb3 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 21 Sep 2009 18:58:20 +0200 Subject: [PATCH 14/16] Fix wrong changelog version --- debian/changelog | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index addc214..0158d8b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -grml-autoconfig (0.8.30) unstable; urgency=low +grml-autoconfig (0.8.31) unstable; urgency=low [ Ulrich Dangel ] * Introduced autconfig.local for local modifications @@ -12,6 +12,15 @@ grml-autoconfig (0.8.30) unstable; urgency=low * Don't use /usr/X11R6/bin/X anymore, since Debian/squeeze doesn't provide it any longer. Thanks for the patch to Julian Langschaedel. + -- Michael Prokop Mon, 21 Sep 2009 18:57:16 +0200 + +grml-autoconfig (0.8.30) unstable; urgency=low + + [ Ulrich Dangel ] + * added new bootparameter netscript: introduced new bootoption + for downloading and running a executable from a remote host + [Closes: issue734] + -- Michael Prokop Mon, 21 Sep 2009 18:35:18 +0200 grml-autoconfig (0.8.29) unstable; urgency=low -- 2.1.4 From bc8e3d7ffa255f345891e97c52174f48eef58c52 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 28 Sep 2009 21:00:46 +0200 Subject: [PATCH 15/16] config_finddcsdir: some minor message display improvements --- autoconfig.functions | 22 ++++++++++++++-------- debian/changelog | 8 ++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/autoconfig.functions b/autoconfig.functions index 53a8774..acf2def 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1958,7 +1958,7 @@ else if checkbootparam 'myconfig' ; then DCSDEVICE="$(getbootparam 'myconfig' 2>>$DEBUG)" if [ -z "$DCSDEVICE" ]; then - einfo "No device for bootoption myconfig provided." ; eend 1 + eerror "Error: No device for bootoption myconfig provided." ; eend 1 fi # [ -z "$DCSDEVICE" ] elif checkvalue $CONFIG_MYCONFIG; then # checkbootparam myconfig einfo "Searching for device(s) labeled with GRMLCFG. (Disable this via boot option: noautoconfig)" ; eend 0 @@ -1971,30 +1971,36 @@ else fi fi DCSDEVICE=$(blkid -t LABEL=GRMLCFG | head -1 | awk -F: '{print $1}') + eoutdent fi - if [ -n "$DCSDEVICE" ]; then + + # if not specified/present then assume default: + if [ -z "$DCSDEVICE" ]; then + DCSDIR="/live/image" + else + eindent einfo "debs, config, scripts are read from $DCSDEVICE." ; eend 0 DCSDIR="$(< /proc/mounts awk -v DCSDEV=$DCSDEVICE '{if ($1 == DCSDEV) { print $2 }}')" if [ -n "$DCSDIR" ]; then - einfo "$DCSDEVICE already mounted on $DCSDIR"; eend 0 + ewarn "$DCSDEVICE already mounted on $DCSDIR"; eend 0 else [ -d /mnt/grml ] || mkdir /mnt/grml umount /mnt/grml 1>>$DEBUG 2>&1 # make sure it is not mounted mount -o ro -t auto $DCSDEVICE /mnt/grml ; RC="$?" if [[ $RC == 0 ]]; then einfo "Successfully mounted $DCSDEVICE to /mnt/grml (readonly)." ; eend 0 - eindent + else + eerror "Error: mounting $DCSDEVICE to /mnt/grml (readonly) failed." ; eend 1 fi DCSDIR="/mnt/grml" fi - else - DCSDIR="/live/image" + eoutdent fi fi fi -if [ -n "$DCSDIR" ]; then - einfo "Debs, config, scripts will be read from $DCSDIR." ; eend 0 +if [ -n "$DCSDIR" -a "$DCSDIR" != "/live/image" ] ; then + einfo "Debs, config, scripts (if present) will be read from $DCSDIR." ; eend 0 elif checkbootparam 'debs' || checkbootparam 'config' || checkbootparam 'scripts'; then einfo "Debs, config, scripts will be read from the live image directly." ; eend 0 fi diff --git a/debian/changelog b/debian/changelog index 0158d8b..49677e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +grml-autoconfig (0.8.32) unstable; urgency=low + + * config_finddcsdir: some minor message display improvements + (fix indention levels, display $DCSDIR only if non-default) + * unicode_start command: do not redirect stderr to debug file + + -- Michael Prokop Mon, 28 Sep 2009 20:59:57 +0200 + grml-autoconfig (0.8.31) unstable; urgency=low [ Ulrich Dangel ] -- 2.1.4 From f02d319421ed7e8513fc361ed9ed27a9a22be05f Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Mon, 28 Sep 2009 21:02:55 +0200 Subject: [PATCH 16/16] unicode_start command: do not redirect stderr to debug file --- autoconfig.functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoconfig.functions b/autoconfig.functions index acf2def..21b7bee 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -297,7 +297,7 @@ config_language(){ if [ -r /etc/default/locale ] ; then if grep -q "LANG=.*UTF" /etc/default/locale ; then einfo "Setting up unicode environment." - unicode_start 2>>$DEBUG ; eend $? + unicode_start ; eend $? fi fi -- 2.1.4