home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 October / Enter 10 2006.iso / boot / isolinux / initrd / in / usr / lib / setup / SeTconfig < prev    next >
Encoding:
Text File  |  2006-07-10  |  4.9 KB  |  165 lines

  1. #!/bin/sh
  2. TMP=/var/log/setup/tmp
  3. if [ ! -d $TMP ]; then
  4.   mkdir -p $TMP
  5. fi
  6. T_PX="`cat $TMP/SeTT_PX`"
  7. ROOT_DEVICE="`cat $TMP/SeTrootdev`"
  8. if [ ! -d $T_PX/bin -a ! -d $T_PX/etc ]; then # if there no Linux here, exit
  9.   exit
  10. fi
  11.  
  12. # Check for disk full error:
  13. . /usr/lib/setup/SeTfull
  14.  
  15. # These next lines are intended to clean up any permissions
  16. # problems that could be caused by a bad package.  We don't
  17. # intend to make any bad packages here, but it never hurts
  18. # to be safe. :^)
  19. ( cd $T_PX ; chmod 755 ./ )
  20. ( cd $T_PX ; chmod 755 ./var )
  21. if [ -d $T_PX/usr/src/linux ]; then
  22.   chmod 755 $T_PX/usr/src/linux
  23. fi
  24. if [ ! -d $T_PX/proc ]; then
  25.   mkdir $T_PX/proc
  26.   chown root.root $T_PX/proc
  27. fi
  28. chmod 1777 $T_PX/tmp
  29. if [ ! -d $T_PX/var/spool/mail ]; then
  30.   mkdir -p $T_PX/var/spool/mail
  31.   chmod 755 $T_PX/var/spool
  32.   chown root.mail $T_PX/var/spool/mail
  33.   chmod 1777 $T_PX/var/spool/mail
  34. fi 
  35.  
  36. # Load keyboard map (if any) when booting
  37. if [ -r $TMP/SeTkeymap ]; then
  38.   MAPNAME="`cat $TMP/SeTkeymap`"
  39.   echo "#!/bin/sh" > $T_PX/etc/rc.d/rc.keymap
  40.   echo "# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps." \
  41.   >> $T_PX/etc/rc.d/rc.keymap
  42.   echo "source /etc/rc.d/functions.sh" >> $T_PX/etc/rc.d/rc.keymap  
  43.   echo "export TEXTDOMAINDIR=/etc/rc.messages" >> $T_PX/etc/rc.d/rc.keymap  
  44.   echo "export TEXTDOMAIN=inits_keymap" >> $T_PX/etc/rc.d/rc.keymap  
  45.   echo "setlang" >> $T_PX/etc/rc.d/rc.keymap  
  46.   echo >> $T_PX/etc/rc.d/rc.keymap  
  47.   echo "if [ -x /usr/bin/loadkeys ]; then" >> $T_PX/etc/rc.d/rc.keymap
  48.   echo "msg=\"\`gettext \"Loading keyboard map\"\`\"" >> $T_PX/etc/rc.d/rc.keymap
  49.   echo "status /usr/bin/loadkeys $MAPNAME" >> $T_PX/etc/rc.d/rc.keymap
  50.   echo "fi" >> $T_PX/etc/rc.d/rc.keymap
  51.   
  52.   chmod 755 $T_PX/etc/rc.d/rc.keymap
  53. fi
  54.  
  55. # Only ask if we want to skip configuring if we suspect the user should
  56. # skip the step:
  57. if [ -r $T_PX/etc/fstab ]; then
  58.   dialog --title "`gettext SeTconfig "CONFIGURE THE SYSTEM"`" --yesno "`gettext SeTconfig "Now we can configure your \
  59. Linux system.  If this is a new installation, you MUST configure it now or it \
  60. will not boot correctly.  However, if you are just adding software to an \
  61. existing system, you can back out to the main menu and skip this step.  \
  62. You want to CONFIGURE your system, right?"`" 0 0
  63.   if [ ! $? = 0 ]; then
  64.     exit
  65.   fi
  66. else
  67.   dialog --title "`gettext SeTconfig "DONE INSTALLING PACKAGES"`" --infobox  \
  68. "`gettext SeTconfig "Preparing to configure your new Linux system..."`" 3 54
  69.   sleep 4
  70. fi
  71.  
  72. if [ -x $T_PX/sbin/ldconfig ]; then
  73. dialog --title "`gettext SeTconfig "Searching for system libs"`" --infobox  \
  74. "`gettext SeTconfig "Building libraries database..."`" 3 54
  75. chroot $T_PX /sbin/ldconfig
  76. sleep 3
  77. fi
  78.  
  79. if [ -x  $T_PX/usr/bin/gdk-pixbuf-update-loaders ]; then
  80.   chroot $T_PX /usr/bin/gdk-pixbuf-update-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
  81. fi
  82.  
  83. if [ -x $T_PX/sbin/depmod ]; then
  84. dialog --title "`gettext SeTconfig "Searching for kernel modules"`" --infobox  \
  85. "`gettext SeTconfig "Building kernel modules dependency file..."`" 3 54
  86. chroot $T_PX /sbin/depmod -a
  87. sleep 3
  88. fi
  89.  
  90. if [ -x $T_PX/usr/bin/fc-cache ]; then
  91. dialog --title "`gettext SeTconfig "FONTCONFIG UPDATE"`" --infobox \
  92. "`gettext SeTconfig "Please wait while we generate font.cache-1 files with fc-cache.  \
  93. For best results, fc-cache should be run whenever fonts are \
  94. added to the system."`" 5 68
  95.  
  96. chroot $T_PX /usr/bin/fc-cache -f 1> /dev/null 2> /dev/null
  97. fi
  98.  
  99.  
  100. if [ -x $T_PX/usr/bin/update-desktop-database ] ; then
  101. chroot $T_PX /usr/bin/update-desktop-database &>/dev/null
  102. fi
  103.  
  104. while [ 1 ] ; do
  105. ( . /usr/lib/setup/SeTinitrd )
  106. if [ -f /mnt/boot/initrd -o -f /mnt/boot/initrd.new ]; then
  107. dialog --title "Done" --msgbox "`gettext SeTconfig "You can find your initrd image in a '/boot' directory on your target partition."`" 6 60
  108.      break
  109. else
  110. dialog --title "ERROR" --yesno "`gettext SeTconfig "UNABLE TO MAKE INITRD IMAGE !!! Your system will NOT boot without initrd !!! Do you want to setup initrd again? (RECOMMENDED)."`" 7 60
  111.     if [ $? = 0 ] ; then
  112.     continue
  113.     else    
  114.     break
  115.     fi    
  116. fi
  117. done
  118. ( . /usr/lib/setup/SeTbootloader )
  119.  
  120. chroot $T_PX mount proc -t proc /proc &>/dev/null
  121. chroot $T_PX mount sys -t sysfs /sys &>/dev/null
  122.  
  123. #if [ -x $T_PX/sbin/makebootdisk ]; then
  124. #chroot $T_PX /sbin/makebootdisk
  125. #fi
  126.  
  127. #if [ -x $T_PX/sbin/modemdeviceconfig ]; then
  128. #chroot $T_PX /sbin/modemdeviceconfig
  129. #fi
  130.  
  131. if [ -x $T_PX/usr/sbin/mouseconfig ]; then
  132. chroot $T_PX /usr/sbin/mouseconfig
  133. fi
  134.  
  135. if [ -x $T_PX/sbin/netconfig ]; then
  136. chroot $T_PX /sbin/netconfig
  137. fi
  138.  
  139. if [ -x $T_PX/sbin/services-setup ]; then
  140. chroot $T_PX /sbin/services-setup
  141. fi
  142.  
  143. if [ -x $T_PX/usr/sbin/timeconfig ]; then
  144. chroot $T_PX /usr/sbin/timeconfig
  145. fi
  146.  
  147. if [ -x $T_PX/sbin/loginmanagersetup ]; then
  148. chroot $T_PX /sbin/loginmanagersetup
  149. fi
  150.  
  151. if [ -x $T_PX/usr/bin/xwmconfig ]; then
  152. chroot $T_PX /usr/bin/xwmconfig
  153. fi
  154.  
  155. chroot $T_PX umount /proc &>/dev/null
  156. chroot $T_PX umount /sys &>/dev/null
  157.  
  158. ( . /usr/lib/setup/SeTXorg )
  159. ( . /usr/lib/setup/SeTrunlevel )
  160. ( . /usr/lib/setup/SeTlocale )
  161.  
  162. # Set root password:
  163. /usr/lib/setup/SeTusers
  164.  
  165.