From 0fb27baedd40895f6ab82017c3a3e137ee488955 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 4 Nov 2016 15:42:46 +0100 Subject: [PATCH] Drop deprecated features Those are all very outdated functions which either have no purpose on nowadays systems or shouldn't have any users anymore: * config_configfs * config_distcc * config_fast * config_fix_passwd * config_fwtimeout * config_fwtimeout * config_ipv6 * config_ld_mod * config_modem * config_modules * config_mouse * config_small * config_tohd * config_wondershaper * fix_unionfs --- autoconfig | 14 -- autoconfig.functions | 359 +-------------------------------------------------- grml-autoconfig | 30 ----- 3 files changed, 1 insertion(+), 402 deletions(-) diff --git a/autoconfig b/autoconfig index d892779..7f8e44a 100644 --- a/autoconfig +++ b/autoconfig @@ -51,54 +51,40 @@ CONFIG_AUTOMOUNT='yes' # automounting of device labeled GRMLCFG CONFIG_BLANKING='yes' # check for bootoption noblank to disable console blanking CONFIG_CONFIG='yes' # do we want config unpacking to work? CONFIG_CONSOLE='yes' # activate mgetty when using console=... as bootparam -CONFIG_CONFIGFS='yes' # automatically mount configfs CONFIG_BRLTTY='yes' # automatically start brltty if a brltty option is specified in /proc/cmdline CONFIG_DEBOOTSTRAP='yes' # support automatic installation of Debian via grml-deboostrap CONFIG_DEBNET='yes' # search for /etc/network/interfaces on partitions and set up network afterwards CONFIG_DEBS='yes' # check for bootoption debs for installing .debs CONFIG_DEBUG='yes' # activate start of shells during startup at several stages CONFIG_DISPLAY_SSH_FINGERPRINTS='yes' # display SSH server key fingerprints -CONFIG_DISTCC='yes' # activate and setup distcc through bootparam distcc=$NETWORK,$INTERFACE CONFIG_DISTRI='yes' # support some customization via bootoption distri CONFIG_DMRAID='yes' # support for dmraid CONFIG_EXTRACT='yes' # specify which (only in combination with bootparam myconfig/netconfig useful) -CONFIG_FAST='yes' # skip startup of w3m on tty1 CONFIG_FINDDCSDIR='yes' # search for a debs, config, scripts directory -CONFIG_FIX_PASSWD='yes' # fix unionfs-problem with passwd -CONFIG_FIX_UNIONFS='yes' # fix/workaround for unionfs -CONFIG_FWTIMEOUT='yes' # set timeout for firmware loading CONFIG_HOMEDIR='yes' # check for persistent homedir option CONFIG_HOSTNAME='yes' # set hostname to 'grml' on systems running from CD CONFIG_KERNEL='yes' # display information on running kernel CONFIG_LANGUAGE='yes' # allow language specification via commandline -CONFIG_LD_MOD='yes' # run ldconfig and depmod on systems running from harddisk; remove /etc/grml.first.boot for forcing CONFIG_LOG='yes' # DEBUG=/dev/null or logfile int /tmp/... CONFIG_LVM='yes' # logical volume setup CONFIG_MIXER='yes' # set audio volumes [only in live-cd mode relevant, except for bootoption nosound] -CONFIG_MODEM='yes' # check for AC'97 Modem Controller modem -CONFIG_MODULES='yes' # load modules specified in /etc/grml/modules -CONFIG_MOUSE='yes' # show mouse information (expert-mode) CONFIG_MYCONFIG='yes' # check if we want the GRMLCFG device 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 CONFIG_SCRIPTS='yes' # execute scripts from the scripts option CONFIG_SERVICES='yes' # check for services to run, provided via bootparam -CONFIG_SMALL='yes' # use a less "bloat" /etc/inittab for small computer with less RAM CONFIG_STATS='yes' # Report stats to stats server CONFIG_SSH='yes' # check for bootparam ssh CONFIG_SWRAID='yes' # check for software raid devices [only in live-mode] CONFIG_TESTCD='yes' # CD checker CONFIG_TIME='yes' # set clock, check for bootparam utc/gmt [only in live-mode] CONFIG_TIMEZONE='yes' # get bootparam 'tz' and set it as /etc/localtime [only in live-mode] -CONFIG_TOHD='yes' # bootoption tohd=... CONFIG_VIRTUALBOX_SHARED_FOLDERS='yes' # set up shared folders in VirtualBox environment CONFIG_VNC='yes' # check for bootparam vnc 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] diff --git a/autoconfig.functions b/autoconfig.functions index 23574ef..735ba00 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -227,24 +227,6 @@ fi } # }}} -# {{{ set firmware timeout via bootparam -config_fwtimeout(){ - if checkbootparam 'fwtimeout' ; then - TIMEOUT="$(getbootparam 'fwtimeout' 2>>$DEBUG)" - einfo "Bootoption fwtimeout found. (Re)Loading firmware_class module." - rmmod firmware_class >>$DEBUG 2>&1 - modprobe firmware_class ; eend $? - fi - if [ -z "$TIMEOUT" ] ; then - TIMEOUT="100" # linux kernel default: 10 - fi - if [ -f /sys/class/firmware/timeout ] ; then - einfo "Setting timeout for firmware loading to ${TIMEOUT}." - echo $TIMEOUT > /sys/class/firmware/timeout ; eend $? - fi -} -# }}} - ### {{{ language configuration / localization config_language(){ @@ -466,23 +448,6 @@ config_userlocal() { } # }}} -# {{{ mount configfs -config_configfs() { - einfo "Mounting configfs" - CONFIGFS_DIR=/sys/kernel/config/ - modprobe configfs 2>/dev/null 1>&2 - if ! [ -d "$CONFIGFS_DIR" ] ; then - eindent - einfo "$CONFIGFS_DIR does not exist, can't mount directory" - eend 1 - eoutdent - else - mount -t configfs configfs "$CONFIGFS_DIR" 2>/dev/null 1>&2 - eend $? - fi -} -# }}} - # {{{ Set clock (Local time is more often used than GMT, so it is default) config_time(){ # don't touch the files if running from harddisk: @@ -545,23 +510,6 @@ config_kernel(){ } # }}} -# {{{ ld.so.cache + depmod -config_ld_mod(){ -if [ -n "$INSTALLED" ]; then - if ! [ -r /etc/grml.first.boot ] ; then - einfo "Running from HD for the first time, regenerate ld.so.cache and modules.dep:" - eindent -# Regenerate ld.so.cache and module dependencies on HD - einfo "Running ldconfig" ; ldconfig ; eend $? - einfo "Running depmod" ; depmod -a ; eend $? - touch /etc/grml.first.boot - eend 0 - eoutdent - fi -fi -} -# }}} - # {{{ timezone config_timezone(){ # don't touch the files if running from harddisk: @@ -588,63 +536,6 @@ config_timezone(){ } # }}} -# small computer / nearly no ram {{{ -config_small(){ - -RAM=$(/usr/bin/gawk '/MemTotal/{print $2}' /proc/meminfo) -# MEM=$(/usr/bin/gawk 'BEGIN{m=0};/MemFree|Cached|SwapFree/{m+=$2};END{print m}' /proc/meminfo) -eindent - -if checkbootparam 'small'; then - einfo "Information: ${RAM} kB of RAM available." ; eend 0 - einfo "Bootoption small detected. Activating small system." - if [ -r /etc/inittab.small ] ; then - mv /etc/inittab /etc/inittab.normal - mv /etc/inittab.small /etc/inittab - else - sed -i 's/^9/#&/' /etc/inittab - sed -i 's/^10/#&/' /etc/inittab - sed -i 's/^11/#&/' /etc/inittab - sed -i 's/^12/#&/' /etc/inittab - fi - /sbin/telinit q ; eend $? -else - if checkgrmlsmall ; then - if [[ $RAM -lt 25000 ]] ; then - ewarn "Information: ${RAM} kB of RAM available." ; eend 1 - ewarn "At least 32MB of RAM should be available for grml-small." ; eend 1 - ewarn "Use the bootoption small to save some more MB of memory usage." ; eend 0 - ewarn "Dropping you into a rescue shell. To continue booting exit the shell." ; eend 0 - /bin/zsh --login - else - einfo "Information: ${RAM} kB of RAM available." ; eend 0 - fi - else - if [[ $RAM -lt 58000 ]] ; then - ewarn "Information: ${RAM} kB of RAM available." ; eend 1 - ewarn "At least 64MB of RAM should be available for grml." ; eend 1 - ewarn "Use the bootoption small to save some more MB of memory usage." ; eend 0 - ewarn "Dropping you into a rescue shell. To continue booting exit the shell." ; eend 0 - /bin/zsh --login - else - einfo "Information: ${RAM} kB of RAM available." ; eend 0 - fi - fi -fi -eoutdent -} -# }}} - -# skip startup of w3m {{{ -config_fast(){ -if checkbootparam 'fast'; then - ewarn "Bootoption fast detected. Skipping startup of grml-quickconfig." - sed -i '/1:/s#/usr/share/grml-scripts/run-welcome#/bin/zsh#' /etc/inittab - /sbin/telinit q ; eend $? -fi -} -# }}} - # activate serial console {{{ config_console(){ if checkbootparam 'console'; then @@ -701,15 +592,6 @@ fi } # }}} -# {{{ copy passwd-lockfile to ramdisk (fix unionfs-behaviour) -# otherwise we will get: passwd: Authentication token lock busy -config_fix_passwd(){ - if [ -z "$INSTALLED" ] ; then - touch /etc/.pwd.lock - fi -} -# }}} - # {{{ CD Checker config_testcd(){ if checkbootparam 'testcd' ; then @@ -942,43 +824,6 @@ fi # -z $INSTALLED } # }}} -# {{{ Mouse -config_mouse(){ -if [ -n "$MOUSE_DEVICE" ] ; then - einfo "Detecting mouse: ${MOUSE_FULLNAME} at ${MOUSE_DEVICE}" ; eend $? -fi -} -# }}} - -# {{{ IPv6 configuration -# Load IPv6 kernel module and print IP adresses -config_ipv6(){ -if checkbootparam 'ipv6'; then - einfo "Enabling IPv6 as requested on boot commandline (sleeping for 2 seconds)" - modprobe ipv6 - # we probably need some time until stateless autoconfiguration has happened - sleep 2 - NETDEVICES="$(awk -F: '/eth.:|tr.:|wlan.:/{print $1}' /proc/net/dev 2>>$DEBUG)" - for DEVICE in `echo "$NETDEVICES"`; do - eindent - einfo "$DEVICE:" - ADDRESSES="$(ifconfig $DEVICE | awk '/.*inet6 addr:.*/{print $3}')" - COUNT="$(ifconfig $DEVICE | awk '/.*inet6 addr:.*/{ sum += 1};END {print sum }')" - eindent - for ADDR in `echo "$ADDRESSES"` ; do - einfo "$ADDR" - done - if [ "$COUNT" -eq "0" ] ; then - einfo "(none)" ; eend 1 - fi - eoutdent - eoutdent - done - eend 0 -fi -} -# }}} - # {{{ CPU-detection config_cpu(){ if checkbootparam 'nocpu'; then @@ -1306,54 +1151,7 @@ config_mixer () { } # }}} -# {{{ modem detection -config_modem(){ -if checkbootparam 'nomodem'; then - ewarn "Skipping check for AC97 modem controller as requested on boot commandline." ; eend 0 -else - if [ -x /etc/init.d/sl-modem-daemon ] ; then - if lspci | grep Intel | grep -q "AC'97 Modem Controller" ; then - einfo "AC97 modem controller detected. Start it running 'Start sl-modem-daemon'." - eend 0 - fi - fi -fi -} -# }}} - -# {{{ wondershaper -config_wondershaper(){ - if checkbootparam 'wondershaper' ; then - WONDER="$(getbootparam 'wondershaper' 2>>$DEBUG)" - CMD=wondershaper - DEVICE="" - DOWNSTREAM="" - UPSTREAM="" - if [ -n "$WONDER" ]; then - # Extra options - DEVICE="${WONDER%%,*}" - R="${WONDER#*,}" - if [ -n "$R" -a "$R" != "$WONDER" ]; then - WONDER="$R" - DOWNSTREAM="${WONDER%%,*}" - R="${WONDER#*,}" - if [ -n "$R" -a "$R" != "$WONDER" ]; then - WONDER="$R" - UPSTREAM="${WONDER%%,*}" - R="${WONDER#*,}" - fi - fi - fi - [ -n "$DEVICE" ] && CMD="$CMD $DEVICE" - [ -n "$DOWNSTREAM" ] && CMD="$CMD $DOWNSTREAM" - [ -n "$UPSTREAM" ] && CMD="$CMD $UPSTREAM" - einfo "Starting wondershaper (${CMD}) in background." - ( sh -c $CMD & ) && eend 0 - fi -} -# }}} - -# {{{ syslog-ng +# {{{ syslog service config_syslog(){ if checkbootparam 'nosyslog'; then ewarn "Not starting syslog daemon as requested on boot commandline." ; eend 0 @@ -1507,14 +1305,6 @@ config_stats() { } # }}} -# {{{ fix/workaround for unionfs -fix_unionfs(){ - if [ -z "$INSTALLED" ]; then - touch /var/cache/apt/*cache.bin - fi -} -# }}} - # {{{ start X window system via grml-x config_x_startup(){ # make sure we start X only if startx is used *before* a nostartx option @@ -1773,112 +1563,6 @@ fi } # }}} -# {{{ distcc -config_distcc(){ -if checkbootparam 'distcc' ; then - OPTIONS="$(getbootparam 'distcc' 2>>$DEBUG)" - if [ -n "$OPTIONS" ]; then - NET="" - INTERFACE="" - if [ -n "$OPTIONS" ]; then - NET="${OPTIONS%%,*}" - R="${OPTIONS#*,}" - if [ -n "$R" -a "$R" != "$OPTIONS" ]; then - OPTIONS="$R" - INTERFACE="${OPTIONS%%,*}" - R="${OPTIONS#*,}" - fi - fi - fi - CONFIG=/etc/default/distcc - sed -i "s#^STARTDISTCC=.*#STARTDISTCC=YES#" $CONFIG - sed -i "s#^ALLOWEDNETS=.*#ALLOWEDNETS=$NET#" $CONFIG - - if [ -n "$INTERFACE" ] ; then - IP=$(LANG=C ifconfig $INTERFACE | gawk -F: /"inet addr"/'{print $2}' | gawk '{print $1}') - - counter=10 - while [ -z "$IP" ] && [[ "$counter" != 0 ]] ; do - counter=$(( counter-1 )) - ewarn "No ip address for $INTERFACE found. Sleeping for 3 seconds. $counter tries left." - sleep 3 - IP=$(LANG=C ifconfig $INTERFACE | gawk -F: /"inet addr"/'{print $2}' | gawk '{print $1}') - done - fi - - if [ -n "$IP" ] ; then - sed -i "s#^LISTENER=.*#LISTENER=$IP#" $CONFIG - - einfo "Bootoption distcc found. Preparing setup for distcc daemon." - eindent - id distccd >/dev/null 2>&1 || \ - ( - einfo "Creating distcc user" ; \ - adduser --quiet --system --ingroup nogroup --home / --no-create-home distccd ; eend $? - ) - - einfo "Starting distcc for network ${NET}, listening on ${IP}." - /etc/init.d/distcc start >/dev/null ; eend $? - eoutdent - else - eerror "No ip address for $INTERFACE found. distcc can not be used without it." ; eend 1 - fi -fi - -if checkbootparam 'gcc'; then - GCC="$(getbootparam 'gcc' 2>>$DEBUG)" - eindent - einfo "Pointing /usr/bin/gcc to /usr/bin/gcc-${GCC}." - eoutdent - rm -f /usr/bin/gcc - ln -s /usr/bin/gcc-${GCC} /usr/bin/gcc ; eend $? -fi - -if checkbootparam 'gpp'; then - GPP="$(getbootparam 'gpp' 2>>$DEBUG)" - eindent - einfo "Pointing /usr/bin/g++ to /usr/bin/g++-${GPP}." - if [ -x /usr/bin/g++-${GPP} ] ; then - rm -f /usr/bin/g++ - ln -s /usr/bin/g++-${GPP} /usr/bin/g++ ; eend $? - fi - einfo "Pointing /usr/bin/cpp to /usr/bin/cpp-${GPP}." - if [ -x /usr/bin/cpp-${GPP} ] ; then - rm -f /usr/bin/cpp - ln -s /usr/bin/cpp-${GPP} /usr/bin/cpp ; eend $? - fi - eoutdent -fi - -} -# }}} - -# {{{ load modules -# Notice: use it only on live-cd system, if running from harddisk please -# add modules to /etc/modules and activate /etc/init.d/module-init-tools -# in /etc/runlevel.conf -config_modules(){ -MODULES_FILE=/etc/grml/modules -if checkbootparam 'nomodules' ; then - ewarn "Skipping loading of modules defined in ${MODULES_FILE} as requested." ; eend 0 -elif [ -z "$INSTALLED" ]; then - if [ -r $MODULES_FILE ] ; then - einfo "Loading modules specified in ${MODULES_FILE}:" - eindent - grep '^[^#]' $MODULES_FILE | \ - while read module args; do - [ "$module" ] || continue - einfo "${module}" - modprobe $module $args ; eend $? - done - eoutdent - else - ewarn "File $MODULES_FILE does not exist. Skipping loading of specific modules." ; eend 1 - fi -fi -} -# }}} - # {{{ SW-RAID config_swraid(){ [ -n "$INSTALLED" ] && return 0 @@ -2063,47 +1747,6 @@ fi } # }}} -# {{{ tohd= bootoption -config_tohd() -{ - if checkbootparam 'tohd' ; then - local TARGET="$(getbootparam 'tohd' 2>>$DEBUG)" - if [ -z "$TARGET" ] ; then - eerror "Error: tohd specified without any partition, can not continue." ; eend 1 - eerror "Please use something like tohd=/dev/sda9." ; eend 1 - return 1 - fi - - if ! [ -b "$TARGET" ] ; then - eerror "Error: $TARGET is not a valid block device, sorry." ; eend 1 - return 1 - fi - - if grep -q $TARGET /proc/mounts ; then - eerror "$TARGET already mounted, skipping execution of tohd therefore." - eend 1 - return 1 - fi - - local MOUNTDIR=$(mktemp -d) - - if mount -o rw "$TARGET" "$MOUNTDIR" ; then - einfo "Copyring live system to $TARGET - this might take a while" - rsync -a --progress ${LIVECD_PATH}/live $MOUNTDIR - sync - umount "$MOUNTDIR" - eend $? - einfo "Booting with \"grml bootfrom=$TARGET\" should work now." ; eend 0 - else - eerror "Error when trying to mount $TARGET, sorry."; eend 1 - return 1 - fi - - rmdir "$MOUNTDIR" - fi -} -# }}} - # {{{ debootstrap: automatic installation config_debootstrap(){ diff --git a/grml-autoconfig b/grml-autoconfig index 224adf6..b98c747 100755 --- a/grml-autoconfig +++ b/grml-autoconfig @@ -84,26 +84,14 @@ checkvalue $CONFIG_LANGUAGE && config_language checkvalue $CONFIG_LOG && config_log -checkvalue $CONFIG_FWTIMEOUT && config_fwtimeout - -checkvalue $CONFIG_FIX_PASSWD && config_fix_passwd - checkvalue $CONFIG_HOSTNAME && config_hostname -checkvalue $CONFIG_CONFIGFS && config_configfs - checkvalue $CONFIG_TIME && config_time checkvalue $CONFIG_KERNEL && config_kernel -checkvalue $CONFIG_SMALL && config_small - -checkvalue $CONFIG_LD_MOD && config_ld_mod - checkvalue $CONFIG_TIMEZONE && config_timezone -checkvalue $CONFIG_FAST && config_fast - checkvalue $CONFIG_SWRAID && config_swraid checkvalue $CONFIG_DMRAID && config_dmraid @@ -115,16 +103,12 @@ echo "0" > /proc/sys/kernel/printk checkvalue $CONFIG_TESTCD && config_testcd -checkvalue $CONFIG_MODULES && config_modules - checkvalue $CONFIG_BRLTTY && config_brltty checkvalue $CONFIG_ACPI && config_acpi checkvalue $CONFIG_FSTAB && config_fstab -checkvalue $CONFIG_MOUSE && config_mouse - checkvalue $CONFIG_CPU && config_cpu checkvalue $CONFIG_SSH && config_ssh @@ -149,12 +133,6 @@ checkvalue $CONFIG_PARTCONF && config_partconf checkvalue $CONFIG_MIXER && config_mixer -checkvalue $CONFIG_MODEM && config_modem - -checkvalue $CONFIG_WONDERSHAPER && config_wondershaper - -checkvalue $CONFIG_GPM && config_gpm - checkvalue $CONFIG_SERVICES && config_services checkvalue $CONFIG_DEBNET && config_debnet @@ -165,26 +143,18 @@ checkvalue $CONFIG_NETCONFIG && config_netconfig checkvalue $CONFIG_NETSCRIPT && config_netscript -checkvalue $CONFIG_NETIPV6 && config_ipv6 - checkvalue $CONFIG_STATS && config_stats checkvalue $CONFIG_CONSOLE && config_console -checkvalue $CONFIG_FIX_UNIONFS && fix_unionfs - checkvalue $CONFIG_VIRTUALBOX_SHARED_FOLDERS && config_virtualbox_shared_folders checkvalue $CONFIG_MYPATH && config_mypath -checkvalue $CONFIG_DISTCC && config_distcc - checkvalue $CONFIG_DISTRI && config_distri checkvalue $CONFIG_BLANKING && config_blanking -checkvalue $CONFIG_TOHD && config_tohd - checkvalue $CONFIG_DEBOOTSTRAP && config_debootstrap checkvalue $CONFIG_XSTARTUP && config_x_startup -- 2.1.4