Magellan Linux

Diff of /alx-src/trunk/tinyalxconfig-ng/init.d/alxsettings

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 532 by niro, Sun Jun 22 22:26:47 2008 UTC revision 533 by niro, Sat Jun 28 09:47:39 2008 UTC
# Line 11  Line 11 
11  #%before:  #%before:
12  #%after:  #%after:
13    
14  # $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/init.d/alxsettings,v 1.23 2008-06-22 22:26:47 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/tinyalxconfig-ng/init.d/alxsettings,v 1.24 2008-06-28 09:47:39 niro Exp $
15    
16  # checks first if the client was already configured and if it has an valid serial  # checks first if the client was already configured and if it has an valid serial
17  # if not it runs the autoconfiguration script  # if not it runs the autoconfiguration script
# Line 253  get_system_serial() Line 253  get_system_serial()
253   echo "ALX_IFACE=${ALX_IFACE}" >> /etc/alxconfig-ng/state/state   echo "ALX_IFACE=${ALX_IFACE}" >> /etc/alxconfig-ng/state/state
254  }  }
255    
   
 check_is_configured()  
 {  
  if [ -f /etc/alxconfig-ng/state/configured ]  
  then  
  export ALX_CONFIGURED=true  
  else  
  export ALX_CONFIGURED=false  
  fi  
 }  
   
   
256  # imports current settings to the database resolved by the hardware detection  # imports current settings to the database resolved by the hardware detection
257  import_settings_to_db()  import_settings_to_db()
258  {  {
# Line 447  update_settings_in_db() Line 435  update_settings_in_db()
435   evaluate_retval   evaluate_retval
436  }  }
437    
 # imports current settings to the local system resolved by the hardware detection  
 # we only need the network settings  
 import_settings_local()  
 {  
  # note: networking is always 'dhcp' if hw was autodetected  
  # note: default_domain/hostname is set in config.rc  
   
  # to be safe, we do some sanity checks  
  [[ -z ${ALX_DEFAULT_DOMAIN} ]] && ALX_DEFAULT_DOMAIN=localdomain  
  [[ -z ${ALX_DEFAULT_HOSTNAME} ]] && ALX_DEFAULT_HOSTNAME=magellan-alx  
   
  # vars used by hwdetect  
  local NETCARD_FULLNAME NETCARD_DRIVER MOUSE_FULLNAME MOUSE_DEVICE SOUND_FULLNAME  
  local SOUND_DRIVER XSERVER XMODULE XDESC FLOPPY_FULLNAME FLOPPY_DEVICE FLOPPY_DRIVER  
  local MOUSETYPE XMOUSETYPE FULLNAME DEVICE  
   
  # get setting from hwdetect  
  source /etc/sysconfig/hwsetup/knoppix  
   
  echo  
  echo -e ${COLMAGENTA}"Importing detected settings to local system"${COLDEFAULT}  
   
  # set system state to 'already configured'  
  touch /etc/alxconfig-ng/state/configured  
   
  # if only an recheck was forced than abort now  
  [[ ${ALX_FORCED_RECHECK} = true ]] && return 0  
   
  # create a fresh fluxbox directory  
  [ -d ${ALX_UNPRIV_HOME}/.fluxbox ] && rm -rf ${ALX_UNPRIV_HOME}/.fluxbox  
  install -d ${ALX_UNPRIV_HOME}/.fluxbox  
   
  # now generate fluxbox config files  
   
  # fluxbox theme  
  [[ ! -d /usr/share/fluxbox/styles ]] && install -d /usr/share/fluxbox/styles  
  cat ${ALX_SKELETONS}/fluxbox/themes/${ALX_DEFAULT_THEME} > /usr/share/fluxbox/styles/default  
   
  # fluxbox main config  
  cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init  
   
  # fluxbox autostart  
  cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps  
   
  # fluxbox menu header  
  cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu  
   
  # now fix it with proper messages :P  
  local ver="$(< /etc/mageversion)"  
  sed -i "s:@CHANGEME@:alx-${ver}  #${ALX_SERIAL}:g" ${ALX_UNPRIV_HOME}/.fluxbox/menu  
   
  # add a newline (maybe there is no crlf in the header)  
  echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu  
   
  # fluxbox menu footer  
  cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu  
   
  # add a newline (maybe there is no crlf in the footer)  
  echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu  
   
  # setup some standart icons (sysinfo.lnk)  
  # basic config  
  cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc-${ALX_DEFAULT_THEME} > ${ALX_UNPRIV_HOME}/.xtdeskrc  
   
  # clean desktop icon location  
  [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop  
  install -d ${ALX_UNPRIV_HOME}/.xtdesktop  
   
  # last but not least gen a icon with some sys informations  
  local sysinfo  
  local osversion  
  local xres  
  local yres  
   
  osversion="$(< /etc/mageversion)"  
  sysinfo="Hostname: ${ALX_DEFAULT_HOSTNAME} Serial: #${ALX_SERIAL} OS: alx-${osversion} Kernel: $(uname -r)"  
   
  # at first boot we got always a resolution of 1024x768-16@60  
  # middle of the screen  
  # (no txt - length required, xtdesk manage that itself)  
  xres="$((1024 / 2))"  
  # default y pos (full yres -22 !)  
  #yres="$((768 - 22 ))"  
  # place it at top  
  yres="-5"  
   
  generate_icon \  
  --name "${sysinfo}" \  
  --command "exit 0" \  
  --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \  
  --dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \  
  --xres "${xres}" \  
  --yres "${yres}" \  
  --icon-width "1" \  
  --icon-height "1"  
   
  # check for Xorg or kdrive (use Xvesa)  
  if [[ -x /usr/bin/Xorg ]]  
  then  
  ln -snf Xorg /usr/bin/X  
  ln -snf startx-xorg /usr/bin/startx  
   
  elif [[ -x /usr/bin/Xvesa ]]  
  then  
  ln -snf Xvesa /usr/bin/X  
  ln -snf startx-kdrive /usr/bin/startx  
  fi  
   
  # set correct permissions  
  chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}  
  chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox  
  chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox  
  chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop  
  chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc  
  chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc  
 }  
   
438  # start|stop  # start|stop
439  preliminary_network()  preliminary_network()
440  {  {
# Line 664  case $1 in Line 535  case $1 in
535   else   else
536   import_settings_to_db   import_settings_to_db
537   fi   fi
  import_settings_local  
538    
539   # here we should also exchange the ssh keys   # here we should also exchange the ssh keys
540   # or the system cannot be rebooted after   # or the system cannot be rebooted after
# Line 674  case $1 in Line 544  case $1 in
544    
545   # now setup system configuration   # now setup system configuration
546   # alx_setup_or_whatever_it_will_be_called()   # alx_setup_or_whatever_it_will_be_called()
547   [[ ${ALX_HW_DETECT} = false ]] && update_system_settings   update_system_settings
548    
549   # stop at last the preliminary networking (dhcp)   # stop at last the preliminary networking (dhcp)
550   preliminary_network stop   preliminary_network stop

Legend:
Removed from v.532  
changed lines
  Added in v.533