--- alx-src/trunk/alxconfig-ng/init.d/alxsettings 2005/10/11 12:10:15 368 +++ alx-src/branches/alxconf-060/init.d/alxsettings 2011/04/14 19:29:35 1800 @@ -37,6 +37,7 @@ source /usr/lib/alxconfig-ng/functions/config_x11 source /usr/lib/alxconfig-ng/functions/config_auth source /usr/lib/alxconfig-ng/functions/config_ssh_auth +source /usr/lib/alxconfig-ng/functions/config_versions # check if mysql is available [ -x /usr/bin/mysql ] && MYSQL_ALX=true @@ -93,6 +94,9 @@ # exchange ssh rsa keys HOME=/root config_ssh_auth + + # import version info + config_version } get_system_serial() @@ -139,7 +143,7 @@ else # abort on non valid serial ALX_STATE="invalid serial" - echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state + echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state show_invalid_serial_msg exit 1 fi @@ -150,6 +154,8 @@ if [[ ${ALX_FORCED_RECHECK} = true ]] then echo -e ${COLMAGENTA}"Hardware autodetection forced by system-administrator"${COLDEFAULT} + # always disable CONFD_NETWORKING here + export ALX_CONFD_NETWORKING="false" else echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} fi @@ -205,7 +211,7 @@ fi # write current state to temp file - echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state + echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state [ -f /hardware-auto-detection ] && rm /hardware-auto-detection # now export ALX_FORCED_RECHECK=true @@ -230,8 +236,8 @@ # set ALX_STATE to ok so everybody knows that everything was ok ALX_STATE=ok - echo "ALX_SERIAL=${ALX_SERIAL}" > /etc/alxconfig-ng/serial - echo "ALX_REG_DATE=${CUR_MTIME}" >> /etc/alxconfig-ng/serial + echo "ALX_SERIAL=\"${ALX_SERIAL}\"" > /etc/alxconfig-ng/serial + echo "ALX_REG_DATE=\"${CUR_MTIME}\"" >> /etc/alxconfig-ng/serial evaluate_retval else @@ -250,8 +256,8 @@ fi # write current state to temp file - echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state - echo "ALX_IFACE=${ALX_IFACE}" >> /etc/alxconfig-ng/state/state + echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state + echo "ALX_IFACE=\"${ALX_IFACE}\"" >> /etc/alxconfig-ng/state/state } @@ -377,14 +383,14 @@ module, resolution, depth, - monitorid + refresh_rate ) values( '${ALX_SERIAL}', '${XMODULE}', '1024x768', '16', - '0' + '60' );"; ) evaluate_retval @@ -427,6 +433,14 @@ echo -e " Screensaver settings ..." mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')" + # version info + local alx_os + local alx_utils + alx_os="$(< /etc/mageversion)" + alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" + alx_utils="${alx_utils/alxconfig-ng-alx-}" + mysqldo "insert into client_version(serial,os,utils) values('${ALX_SERIAL}','${alx_os}','${alx_utils}')" + evaluate_retval } @@ -509,7 +523,7 @@ module='${XMODULE}', resolution='1024x768', depth='16', - monitorid='0' + refresh_rate='60' where serial=${ALX_SERIAL};" evaluate_retval @@ -517,6 +531,14 @@ echo -e " Input settings ..." mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};" evaluate_retval + + # version info + local alx_os + local alx_utils + alx_os="$(< /etc/mageversion)" + alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" + alx_utils="${alx_utils/alxconfig-ng-alx-}" + mysqldo "update client_version set os='${alx_os}', utils='${alx_utils}' where serial=${ALX_SERIAL};" } # imports current settings to the local system resolved by the hardware detection @@ -546,9 +568,11 @@ #[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH} #echo "${NETCARD_DRIVER}" > ${SETTINGSPATH}/modules - # set an device alias for modprobe.conf + # set an device alias for modprobe.conf and modules.conf [ ! -d /etc/modules.d ] && install -d /etc/modules.d + [ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modules.d/net.eth0 + echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0 # regenerate modprobe.conf [ -x $(which modules-update) ] && modules-update || echo "cannot regen modprobe.conf" @@ -558,6 +582,9 @@ # set system state to 'already configured' touch /etc/alxconfig-ng/state/configured + # install slim desktopmanager configuration + config_display_manager + # if only an recheck was forced than abort now [[ ${ALX_FORCED_RECHECK} = true ]] && return 0 @@ -645,6 +672,7 @@ preliminary_network() { local module + local modulesconf if [ -f /etc/alxconfig-ng/state/configured ] then @@ -655,6 +683,18 @@ module=$(cat ${SETTINGSPATH}/modules) modprobe ${module} fi + + # check modprobe.conf + if [[ $(kernel_major_version) = 2.4 ]] + then + modulesconf="/etc/modules.conf" + else + modulesconf="/etc/modprobe.conf" + fi + if [[ -z $(grep eth0 ${modulesconf}) ]] + then + /sbin/modules-update force + fi else # vars used by hwdetect local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME @@ -707,6 +747,7 @@ if ps -A|grep dhcpcd > /dev/null then dhcpcd -z &> /dev/null + sleep 1 fi evaluate_retval ;;