source: /cluster/svnroot/bccd-ng/trunk/trees/KNOPPIX/boot/isolinux/minirt/linuxrc @ 3174

Last change on this file since 3174 was 3174, checked in by skylar, 10 years ago

merging in home dir changes (#620,#625)

  • Property svn:executable set to *
File size: 31.7 KB
Line 
1#!/static/sh
2#
3# KNOPPIX General Startup Script
4# (C) Klaus Knopper <knoppix@knopper.net>
5# License: GPL V2.
6#
7# This script needs some of the builtin ash commands (if, test, ...)
8# mount/umount, insmod/rmmod are also a builtin in ash-knoppix.
9#
10
11# Just informational: This is a CD or DVD edition
12MEDIUM="CD"
13
14# hardcoded configurable options
15# Default maximum size of dynamic ramdisk in kilobytes
16RAMSIZE=1000000
17# End of options
18
19# Don't allow interrupt signals
20trap "" 1 2 3 11 15
21
22MODULE_DIRS="/cdrom/KNOPPIX/modules /cdrom2/KNOPPIX/modules /modules"
23
24# "Safe" SCSI modules in the right order for autoprobe
25# Warning: The sym53c8xx.ko and g_NCR* cause a kernel Oops if no such adapter
26# is present.
27#
28# NB: It looks like that ncr53c8xx.ko is more stable than 53c7,8xx.ko for
29# a ncr53c810 controller (at least on my installation box it's more
30# immune to SCSI timeouts)
31# Removed 53c7,8xx -> crashes if no device attached.
32# Removed AM53C974 -> crashes tmscsim if adapter found
33# Added initio.ko on request (untested)
34#SCSI_MODULES="aic7xxx.ko aic7xxx_old.ko BusLogic.ko \
35#ncr53c8xx.ko NCR53c406a.ko \
36#initio.ko mptscsih.ko \
37#advansys.ko aha1740.ko aha1542.ko aha152x.ko \
38#atp870u.ko dtc.ko eata.ko fdomain.ko gdth.ko \
39#megaraid.ko pas16.ko pci2220i.ko pci2000.ko psi240i.ko \
40#qlogicfas.ko qlogicfc.ko qlogicisp.ko \
41#seagate.ko t128.ko tmscsim.ko u14-34f.ko ultrastor.ko wd7000.ko \
42#a100u2w.ko 3w-xxxx.ko"
43# Obsoleted by /proc/pci lookups
44
45# Misc functions
46
47
48# Dynamic program loader
49# /KNOPPIX is already mounted when this is used.
50ARCH=`/bbin/uname -m`
51if [ "$ARCH" = "i686" ] || [ "$ARCH" = "i586" ] || [ "$ARCH" = "i486" ] || [ $"ARCH" = "i386" ]; then
52        DYNLOADER="/KNOPPIX/lib/ld-linux.so.2"
53elif [ "$ARCH" = "x86_64" ]; then
54        DYNLOADER="/KNOPPIX/lib64/ld-linux-x86-64.so.2"
55else
56        echo "No architecture!"
57        exit 2
58fi
59
60# Builin filesystems
61BUILTIN_FS="iso9660 ext2 reiserfs vfat ntfs"
62
63mountit(){
64# Usage: mountit src dst "options"
65# Uses builtin mount of ash.knoppix
66for fs in $BUILTIN_FS; do
67 if test -b $1; then
68  options="$3"
69  case "$fs" in
70   vfat)
71    # We REALLY need this for Knoppix on DOS-filesystems
72    shortname="shortname=winnt"
73    [ -n "$options" ] && options="$options,$shortname" || options="-o $shortname"
74    ;;
75   ntfs)
76    ntfsopts="force,silent,umask=0,no_def_opts,allow_other,streams_interface=windows"
77    [ -n "$options" ] && ntfsopts="$options,$ntfsopts" || ntfsopts="-o $ntfsopts"
78    test -x /static/ntfs-3g && /static/ntfs-3g $1 $2 $ntfsopts >/dev/null 2>&1 && return 0
79    ;;
80  esac
81  mount -t $fs $options $1 $2 >/dev/null 2>&1 && return 0
82 fi
83done
84return 1
85}
86
87FOUND_SCSI=""
88FOUND_KNOPPIX=""
89INTERACTIVE=""
90
91# Clean input/output
92exec >/dev/console </dev/console 2>&1
93
94# Reset fb color mode
95RESET="]R"
96# ANSI COLORS
97# Erase to end of line
98CRE=" [K"
99# Clear and reset Screen
100CLEAR="c"
101# Normal color
102NORMAL="[0;39m"
103# RED: Failure or error message
104RED="[1;31m"
105# GREEN: Success message
106GREEN="[1;32m"
107# YELLOW: Descriptions
108YELLOW="[1;33m"
109# BLUE: System mesages
110BLUE="[1;34m"
111# MAGENTA: Found devices or drivers
112MAGENTA="[1;35m"
113# CYAN: Questions
114CYAN="[1;36m"
115# BOLD WHITE: Hint
116WHITE="[1;37m"
117
118# Clear screen with colormode reset
119# echo "$CLEAR$RESET"
120# echo "$CLEAR"
121# Just go to the top of the screen
122# echo -n "[H[J"
123echo ""
124# Be verbose
125echo "${WHITE}Welcome to the ${CYAN}K${MAGENTA}N${YELLOW}O${WHITE}P${RED}P${GREEN}I${BLUE}X${WHITE} live GNU/Linux on ${MEDIUM}"'!'"${NORMAL}"
126echo ""
127echo ""
128
129# We only need the builtin commands, busybox and /static at this point
130PATH=/static:/bbin
131export PATH
132
133umask 022
134
135# Mount /proc and /dev/pts
136mount -t proc /proc /proc
137
138# Set debugging if needed
139/bbin/grep -q '[[:space:]*]-x[[:space:]]*' /proc/cmdline
140if test $? -eq 0; then
141        set -x
142fi
143
144# Disable kernel messages while probing modules in autodetect mode
145echo "0" > /proc/sys/kernel/printk
146
147# Kernel 2.6
148mount -t sysfs /sys /sys >/dev/null 2>&1
149
150# Read boot command line with builtin cat command (shell read function fails in Kernel 2.4.19-rc1)
151CMDLINE="$(cat /proc/cmdline)"
152
153# Check if we are in interactive startup mode
154case "$CMDLINE" in *BOOT_IMAGE=expert\ *) INTERACTIVE="yes"; :>/interactive; ;; esac
155case "$CMDLINE" in *modules-disk*) INTERACTIVE="yes"; ;; esac
156case "$CMDLINE" in *BOOT_IMAGE=debug\ *|*\ debug*) DEBUG="yes"; ;; esac
157# Does the user want to skip scsi detection?
158NOSCSI=""
159case "$CMDLINE" in *noscsi*|*nobootscsi*) NOSCSI="yes"; ;; esac
160case "$CMDLINE" in *nousb*|*nobootusb*) NOUSB="yes"; ;; esac
161case "$CMDLINE" in *nofirewire*|*nobootfirewire*) NOFIREWIRE="yes"; ;; esac
162NOCD=""
163case "$CMDLINE" in *fromhd*) NOCD="yes"; ;; esac
164case "$CMDLINE" in *fromdvd*) FROMDVD="yes"; ;; esac
165case "$CMDLINE" in *idecd*|*atapicd*) IDECD="yes"; ;; esac
166case "$CMDLINE" in *noideraid*) NOIDERAID="yes"; ;; esac
167USB2="ehci-hcd"
168case "$CMDLINE" in *nousb2*) USB2=""; ;; esac
169
170KNOPPIX_DIR="KNOPPIX"
171KNOPPIX_NAME="KNOPPIX"
172case "$CMDLINE" in *knoppix_dir=*) KNOPPIX_DIR="$knoppix_dir"; ;; esac
173case "$CMDLINE" in *knoppix_name=*) KNOPPIX_NAME="$knoppix_name"; ;; esac
174
175# Print kernel info
176read a b KERNEL relax >/dev/null 2>&1 </proc/version
177echo "${GREEN}Running Linux Kernel ${YELLOW}$KERNEL${GREEN}.${NORMAL}"
178
179# Get total ramsize, and available real ram in kB. We need this later.
180# Note that FREEMEM is incorrect, we should add MemCached,
181# but the difference should be minimal at this point.
182TOTALMEM=64000
183FREEMEM=32000
184while read info amount kb; do
185 case "$info" in
186   MemTotal:)   test "$amount" -gt "0" >/dev/null 2>&1 && TOTALMEM="$amount";;
187   MemFree:)    test "$amount" -gt "0" >/dev/null 2>&1 && FREEMEM="$amount";;
188 esac
189done </proc/meminfo
190
191# Print meminfo.
192echo "${CRE}${BLUE}Total Memory available: ${YELLOW}${TOTALMEM}kB${BLUE}, Memory free: ${YELLOW}${FREEMEM}kB${BLUE}.${NORMAL}"
193
194# New in Knoppix 5.1: cloop preload cache
195# Default values
196case "$MEDIUM" in
197 *[Cc][Dd]*) CLOOP_PRELOAD="preload=64" ;;
198 *[Dd][Vv][Dd]*) CLOOP_PRELOAD="preload=128" ;;
199 *) CLOOP_PRELOAD="preload=32" ;;
200esac
201
202# cloop improves seek performance when caching the directory index
203# (first few MB) of each cloop file.
204# Default values depending on ramsize, override with cloop_preload=numblocks at boot.
205if test "$TOTALMEM" -lt 128000; then
206 # up to 128MB: No preload.
207 CLOOP_PRELOAD=""
208elif test "$TOTALMEM" -lt 256000; then
209 # less than 256MB: About 4MB preload w/ blocksize 128k
210 CLOOP_PRELOAD="preload=32"
211elif test "$TOTALMEM" -lt 512000; then
212 # less than 512MB: About 8MB preload w/ blocksize 128k
213 CLOOP_PRELOAD="preload=64"
214elif test "$TOTALMEM" -lt 1024000; then
215 # less than 1GB: About 16MB preload w/ blocksize 128k
216 CLOOP_PRELOAD="preload=128"
217else
218 # 1GB Ram or more
219 # About 32MB w/ blocksize 128k
220 CLOOP_PRELOAD="preload=256"
221fi
222
223case "$CMDLINE" in *\ nocache*|*\ nocloop_preload*|*\ nopreload*) CLOOP_PRELOAD="" ;; esac
224
225[ -n "$cloop_preload" ] && CLOOP_PRELOAD="preload=$cloop_preload"
226
227# Run a shell if in debug mode
228stage=1
229rundebugshell(){
230if [ -n "$DEBUG" ]; then
231echo "${CRE}${BLUE}Starting intermediate Shell stage $stage as requested by \"debug\" option.${NORMAL}"
232echo "${CRE}${BLUE}Type \"exit\" to continue with normal bootup.${NORMAL}"
233[ -x /static/ash ] && /static/ash || /bin/bash
234fi
235}
236
237# Mount module disk
238mountmodules(){
239TYPE="$1"; shift
240echo -n "${CRE}${CYAN}Please insert ${TYPE} modules disk and hit Return. ${NORMAL}"
241read a
242echo -n "${CRE}${BLUE}Mounting ${TYPE} modules disk... ${NORMAL}"
243# We always mount over /modules (because it's there ;-)
244if mountit /dev/fd0 /modules "-o ro"; then
245echo "${GREEN}OK.${NORMAL}"
246return 0
247fi
248echo "${RED}NOT FOUND.${NORMAL}"
249return 1
250}
251
252# Unmount module disk
253umountmodules(){
254TYPE="$1"; shift
255echo -n "${CRE}${BLUE}Unmounting ${TYPE} modules disk... ${NORMAL}"
256umount /modules 2>/dev/null
257echo "${GREEN}DONE.${NORMAL}"
258}
259
260# Ask user for modules
261askmodules(){
262TYPE="$1"; shift
263echo "${BLUE}${TYPE} modules available:${WHITE}"
264c=""; for m in "$@"; do
265if test -r "/modules/$m"; then
266test -z "$c"  && { echo -n "    $m"; c="1"; } || { echo "               $m"; c=""; }
267fi
268done
269[ -n "$c" ] && echo ""
270echo "${CYAN}Load ${TYPE} Modules?${NORMAL}"
271echo "${CYAN}[Enter full filename(s) (space-separated), Return for autoprobe, ${WHITE}n${CYAN} for none] ${NORMAL}"
272echo -n "${CYAN}insmod module(s)> ${NORMAL}"
273read MODULES
274case "$MODULES" in n|N) MODULES=""; ;; y|"")  MODULES="$*"; ;; esac
275}
276
277# Try to load the given module with optional parameters
278# module can be a full path or a module.ko name
279# (in which case $MODULE_DIRS is searched).
280# loadmodule module options...
281loadmodule() {
282 MODULE="$1"; shift
283 INSMOD=""
284 # Find insmod in CURRENT file system configuration
285 for p in $MODULE_DIRS /static; do
286  checkfor="$p/insmod"
287  if test -x "$checkfor"; then
288   INSMOD="$checkfor"; break
289  fi
290 done
291 # At last resort, try builtin insmod
292 test -z "$INSMOD" && INSMOD="insmod" # builtin insmod
293 LOAD=""
294 for p in $MODULE_DIRS; do
295  for ext in "" ".ko" ".o"; do
296   checkfor="$p/$MODULE$ext"
297   if test -r "$checkfor"; then
298    LOAD="$checkfor"
299    break 2
300   fi
301  done
302 done
303 test -n "$LOAD" || return 1
304 # Fork a new process to avoid crashing our main shell
305 echo "$INSMOD -f $LOAD" "$@" | /static/ash
306 return $?
307}
308
309# Load many modules at once
310# loadmodules TYPE(comment) module ...
311loadmodules(){
312 TYPE="$1"; shift
313 test -n "$INTERACTIVE" && echo "6" > /proc/sys/kernel/printk
314 for m in "$@"; do
315  echo -n "${CRE}${BLUE}Probing ${TYPE}... ${MAGENTA}$m${NORMAL}"
316  if loadmodule "$m" >/dev/null 2>&1; then
317   case "$TYPE" in scsi|SCSI) FOUND_SCSI="yes"; ;; esac
318  fi
319 done
320 test -n "$INTERACTIVE" && echo "0" > /proc/sys/kernel/printk
321 echo -n "${CRE}"
322}
323
324unloadmodule() {
325 MODULE="$1"
326 RMMOD=""
327 # Find rmmod in CURRENT file system configuration
328 for p in $MODULE_DIRS /static; do
329  checkfor="$p/rmmod"
330  if test -x "$checkfor"; then
331   RMMOD="$checkfor"; break
332  fi
333 done
334 # At last resort, try builtin rmmod
335 test -z "$RMMOD" && RMMOD="rmmod" # builtin rmmod
336 # For a new process to avoid crashing our main shell
337 echo "$RMMOD" "$MODULE" | /static/ash
338 return $?
339}
340
341# Check for SCSI, use modules on bootfloppy first
342ISA_SCSI="aha1740.ko aha1542.ko aha152x.ko pas16.ko psi240i.ko qlogicfas.ko qlogicfc.ko seagate.ko t128.ko u14-34f.ko wd7000.ko"
343SCSI_PROBE="$ISA_SCSI"
344# Trying to do kind of /proc/pci hardware detection
345# SCSI detection using /sys/devices
346for d in /sys/devices/*/*; do
347 if test -r "$d"/class -a -r "$d"/vendor -a -r "$d"/device; then
348  read CLASS  < "$d"/class 2>/dev/null
349  case "$CLASS" in 0x0100*)
350   read VENDOR < "$d"/vendor 2>/dev/null
351   read DEVICE < "$d"/device 2>/dev/null
352   case "$VENDOR:$DEVICE" in
353    *1000:*00[0-2]?) SCSI_PROBE="$SCSI_PROBE sym53c8xx.ko" ;;
354    *1000:*040?|*1000:*196?|*101e:*196?|*1028:*000[ef]|*1028:*0013) SCSI_PROBE="$SCSI_PROBE megaraid_mbox.ko" ;;
355    *1000:*04[1-9]?|*1028:*0015) SCSI_PROBE="$SCSI_PROBE megaraid_sas.ko" ;;
356    *1001:*9100|*1101:*) SCSI_PROBE="$SCSI_PROBE initio.ko" ;;
357    *9004:*|*9005:*00??) SCSI_PROBE="$SCSI_PROBE aic7xxx.ko" ;;
358    *1011:*|*1028:*000[1-9a]|*9005:*02[08]?) SCSI_PROBE="$SCSI_PROBE aacraid.ko" ;;
359    *1014:*002e|*1014:*01bd|*9005:*0250) SCSI_PROBE="$SCSI_PROBE ips.ko" ;;
360    *1014:*0[1-2]8?|*1069:*|*9005:*0503) SCSI_PROBE="$SCSI_PROBE ipr.ko" ;;
361    *1022:*) SCSI_PROBE="$SCSI_PROBE tmscsim.ko" ;;
362    *1044:*) SCSI_PROBE="$SCSI_PROBE dpt_i2o.ko" ;;
363    *1077:*1???) SCSI_PROBE="$SCSI_PROBE qla1280.ko" ;;
364    *1077:*21??) SCSI_PROBE="$SCSI_PROBE qla2xxx.ko qla2100.ko" ;;
365    *1077:*22??) SCSI_PROBE="$SCSI_PROBE qla2xxx.ko qla2200.ko" ;;
366    *1077:*23[0-1]?) SCSI_PROBE="$SCSI_PROBE qla2xxx.ko qla2300.ko" ;;
367    *1077:*232?) SCSI_PROBE="$SCSI_PROBE qla2xxx.ko qla2322.ko" ;;
368    *1077:*24??) SCSI_PROBE="$SCSI_PROBE qla2xxx.ko" ;;
369    *1077:*63??) SCSI_PROBE="$SCSI_PROBE qla2xxx.ko qla6312.ko" ;;
370    *10df:*) SCSI_PROBE="$SCSI_PROBE lpfc.ko" ;;
371    *10fc:*|*1145:*) SCSI_PROBE="$SCSI_PROBE nsp32.ko" ;;
372    *1101:*) SCSI_PROBE="$SCSI_PROBE a100u2w.ko" ;;
373    *1119:*|*8086:*) SCSI_PROBE="$SCSI_PROBE gdth.ko" ;;
374    *1191:*) SCSI_PROBE="$SCSI_PROBE atp870u.ko" ;;
375    *134a:*) SCSI_PROBE="$SCSI_PROBE dmx3191d.ko" ;;
376    *1de1:*) SCSI_PROBE="$SCSI_PROBE dc395x.ko" ;;
377    *9005:*8???) SCSI_PROBE="$SCSI_PROBE aic79xx.ko" ;;
378    *104b:*) SCSI_PROBE="$SCSI_PROBE BusLogic.ko" ;;
379    *1[0d]e1:*) SCSI_PROBE="$SCSI_PROBE dc395x.ko" ;;
380    *1000:*00[34]?) SCSI_PROBE="$SCSI_PROBE mptscsih.ko" ;;
381    *10cd:*) SCSI_PROBE="$SCSI_PROBE advansys.ko" ;;
382    *1191:*) SCSI_PROBE="$SCSI_PROBE atp870u.ko" ;;
383    *134a:*) SCSI_PROBE="$SCSI_PROBE dtc.ko" ;;
384    *1d44:*) SCSI_PROBE="$SCSI_PROBE eata.ko" ;;
385    *1036:*) SCSI_PROBE="$SCSI_PROBE fdomain.ko" ;;
386    *1256:*4201) SCSI_PROBE="$SCSI_PROBE pci2220i.ko" ;;
387    *1256:*5201) SCSI_PROBE="$SCSI_PROBE pci2000.ko" ;;
388    *1022:*) SCSI_PROBE="$SCSI_PROBE tmscsim.ko" ;;
389    *6356:*) SCSI_PROBE="$SCSI_PROBE ultrastor.ko" ;;
390    *13c1:*) SCSI_PROBE="$SCSI_PROBE 3w-xxxx.ko" ;;
391   esac
392   ;;
393  esac
394 fi
395done
396
397# Load fuse, we may need it to access ntfs filesystems
398loadmodule fuse >/dev/null 2>&1
399
400if test -n "$INTERACTIVE"; then
401 # Let the user select interactively
402 askmodules SCSI $(cd /modules; echo *.ko)
403else
404 # these are the autoprobe-safe modules
405 MODULES="$SCSI_PROBE"
406fi
407test -z "$NOSCSI" && test -n "$MODULES" && loadmodules SCSI $MODULES
408# End of SCSI check
409
410# Check for IDE-Raid devices
411if test -z "$NOIDERAID"; then
412 ( { loadmodule ataraid.ko && loadmodule silraid.ko; } || loadmodule medley.ko || loadmodule pdcraid.ko ) >/dev/null 2>&1
413fi
414# End of IDE-Raid check
415
416# Check for USB, use modules on bootfloppy first
417if test -z "$NOUSB"; then
418 echo -n "${CRE}${BLUE}Checking for USB...${NORMAL}"
419 if loadmodule usbcore.ko >/dev/null 2>&1; then
420  FOUNDUSB=""
421  for i in $USB2 uhci-hcd ohci-hcd; do
422   loadmodule $i >/dev/null 2>&1 && FOUNDUSB="yes"
423  done
424  if test -n "$FOUNDUSB"; then
425   loadmodule usb-libusual.ko >/dev/null 2>&1
426   loadmodule ff-memless.ko >/dev/null 2>&1
427   loadmodule ff-memless.ko >/dev/null 2>&1
428   loadmodule usbhid.ko >/dev/null 2>&1
429   loadmodule ub.ko >/dev/null 2>&1 || loadmodule usb-storage.ko >/dev/null 2>&1
430  else
431   # For an unknown reason, unloading usbcore hangs sometimes
432   # rmmod usbcore >/dev/null 2>&1
433   true
434  fi
435 fi
436 echo -n "${CRE}"
437fi
438# End of USB check
439
440for KO in $(/bbin/find /modules/*/kernel/drivers/net/ -type f -name "*.ko"); do \
441        MODULE=$(/bbin/basename ${KO}|/bbin/sed -e 's!\.ko$!!g')
442        /bbin/modprobe ${MODULE}
443        RC=$?
444        #echo ${MODULE} ${RC}
445done
446
447echo "ATTEMPTING TO DETECT MODE...";
448echo "IFCONFIG"
449ifconfig -a
450MACADDR=`ifconfig -a | awk '/HWaddr/ {print $5}'`
451echo "Mac Addresses Detected: $MACADDR";
452CUSTOM_MAC=`echo -e "$MACADDR" | awk '/^02:/ {print}'`;
453if [  "" != "$CUSTOM_MAC"  ];  then
454                echo "CUSTOM_MAC: $CUSTOM_MAC"
455        echo "CUSTOM MAC DETECTED, BOOTING INTO TEST MODE";
456        echo 'export BCCD_MODE=test' >> $newhome/.bash_profile;
457        touch /testmode
458
459else
460                echo "NO CUSTOM MAC DETECTED";
461        echo "BOOTING INTO INTERACTIVE MODE";
462        echo 'export BCCD_MODE=interactive' >> $newhome/.bash_profile;
463        touch /interactivemode
464fi
465
466# Check for Firewire, use modules on bootfloppy first
467if test -z "$NOFIREWIRE"; then
468 echo -n "${CRE}${BLUE}Checking for Firewire...${NORMAL}"
469 if loadmodule ieee1394.ko >/dev/null 2>&1; then
470  FOUNDFIREWIRE=""
471  for i in ohci1394.ko; do
472   echo -n "${CRE}${BLUE}Loading $i...${NORMAL}"
473   loadmodule "$i" >/dev/null 2>&1 && FOUNDFIREWIRE="yes"
474  done
475  if test -n "$FOUNDFIREWIRE"; then
476   echo -n "${CRE}${BLUE}Loading sbp2.ko...${NORMAL}"
477   loadmodule sbp2.ko serialize_io=1 >/dev/null 2>&1
478  else
479   # For an unknown reason, unloading ieee1394 hangs sometimes
480   # echo -n "${CRE}${BLUE}Unloading ieee1394...${NORMAL}"
481   # rmmod ieee1394 >/dev/null 2>&1
482   true
483  fi
484 fi
485 echo -n "${CRE}"
486fi
487# End of FIREWIRE check
488
489# Unfortunately, hotpluggable devices tend to need some time in order to register
490if test -n "$FOUNDUSB" -o -n "$FOUNDFIREWIRE"; then
491 echo -n "${CRE}${BLUE}Scanning for USB/Firewire devices... ${NORMAL}"
492 if test -n "$FOUNDFIREWIRE"; then
493  # Wait for driver to register
494  sleep 2
495  # Kernel 2.6 does this automatically
496  case "$(cat /proc/version 2>/dev/null)" in *version\ 2.6.*) ;; *) for host in 0 1 2 3 4 5 6 7; do for channel in 0 1; do for id in 0 1 2 3 4 5 6 7; do echo "scsi add-single-device $host $channel $id 0" >/proc/scsi/scsi 2>/dev/null; done; done; done ;; esac
497 fi
498 sleep 6
499 echo "${BLUE}Done.${NORMAL}"
500fi
501
502# Check for misc modules in expert mode
503if test -n "$INTERACTIVE"; then
504 another=""; answer=""
505 while test "$answer" != "n" -a "$answer" != "N"; do
506  echo -n "${CYAN}Do you want to load additional modules from$another floppy disk? [${WHITE}Y${CYAN}/n] ${NORMAL}"
507  another=" another"
508  read answer
509  case "$answer" in n*|N*) break; ;; esac
510  if mountmodules new; then
511   askmodules new $(cd /modules; echo *.ko)
512   test -n "$MODULES" && loadmodules new $MODULES
513   umountmodules current
514  fi
515 done
516fi
517# All interactively requested modules should be loaded now.
518
519# Give USB-Storage devices some more time to register
520if test -d /proc/scsi/usb-storage; then
521 echo -n "${CRE}${BLUE}Allowing slow USB-devices some more time to register...${NORMAL}"
522 ash -c "sleep 6"
523 echo "${BLUE}Ok.${NORMAL}"
524fi
525
526# Check for ide-scsi supported CD-Roms et al.
527test -r /proc/scsi/scsi && FOUND_SCSI="yes"
528
529# Disable kernel messages again
530echo "0" > /proc/sys/kernel/printk
531
532# We now enable DMA right here, for faster reading/writing from/to IDE devices
533# in FROMHD or TORAM mode
534case "$CMDLINE" in *\ nodma*) ;; *)
535 for d in $(cd /proc/ide 2>/dev/null && echo hd[a-z]); do
536 if test -d /proc/ide/$d; then
537  MODEL="$(cat /proc/ide/$d/model 2>/dev/null)"
538  test -z "$MODEL" && MODEL="[GENERIC IDE DEVICE]"
539  echo "${BLUE}Enabling DMA acceleration for: ${MAGENTA}$d      ${YELLOW}[${MODEL}]${NORMAL}"
540  echo "using_dma:1" >/proc/ide/$d/settings
541 fi
542 done
543 ;;
544esac
545
546stage=1
547rundebugshell
548
549# Now that the right SCSI driver is (hopefully) loaded, try to find CDROM
550DEVICES="/dev/hd?"
551test -n "$FOUND_SCSI" -a -z "$NOCD" && DEVICES="/dev/scd? /dev/scd?? $DEVICES"
552test -n "$FOUNDUSB$FOUNDFIREWIRE" -a -z "$NOCD" && DEVICES="/dev/sr? $DEVICES"
553# New: Also try parallel port CD-Roms [for Mike].
554DEVICES="$DEVICES /dev/pcd?"
555# New: also check HD partitions for a KNOPPIX/KNOPPIX image
556test -n "$FOUND_SCSI" -a -z "$NOSCSI" && DEVICES="$DEVICES /dev/sd? /dev/sd?[1-9] /dev/sd?[1-9][0-9]"
557DEVICES="$DEVICES /dev/ub?[1-9] /dev/ub?[1-9][0-9] /dev/ub? /dev/hd?[1-9] /dev/hd?[1-9][0-9]"
558case "$CMDLINE" in *fromhd=/dev/*) DEVICES="$fromhd"; ;; esac
559for i in $DEVICES; do
560 echo -n "${CRE}${BLUE}Looking for ${MEDIUM} in: ${MAGENTA}$i${NORMAL}   "
561 if mountit $i /cdrom "-o ro" >/dev/null 2>&1; then
562  if test -r /cdrom/$KNOPPIX_DIR/$KNOPPIX_NAME; then
563   echo -n "${CRE}${GREEN}Accessing KNOPPIX ${MEDIUM} at ${MAGENTA}$i${GREEN}...${NORMAL}"
564   FOUND_KNOPPIX="$i"
565   break
566  fi
567  umount /cdrom
568 fi
569done
570
571# Harddisk-installed script part version has been removed
572# (KNOPPIX can be booted directly from HD now).
573
574mount_knoppix()
575{
576 if test -n "$FOUND_KNOPPIX" -a -r "$1/$KNOPPIX_DIR/$KNOPPIX_NAME"; then
577  # Recheck for modules dir.
578  # If /cdrom/boot/modules is gone, try /cdrom/KNOPPIX/modules
579  # DEBUG
580  # echo "6" > /proc/sys/kernel/printk
581  loadmodule cloop.ko file="$1/$KNOPPIX_DIR/$KNOPPIX_NAME" $CLOOP_PRELOAD || \
582    loadmodule cloop.ko file="$1/$KNOPPIX_DIR/$KNOPPIX_NAME"
583  mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX=""
584  # Allow multi-image KNOPPIX mounts
585  if [ -n "$FOUND_KNOPPIX" -a -x "$DYNLOADER" -a -x losetup ]; then
586   echo ""
587   echo -n "${CRE} ${GREEN}Found primary KNOPPIX compressed image at ${MAGENTA}$1/$KNOPPIX_DIR/$KNOPPIX_NAME${GREEN}.${NORMAL}"
588   for c in 1 2 3 4 5 6 7; do
589    if test -r "$1/$KNOPPIX_DIR/$KNOPPIX_NAME$c"; then
590     if "$DYNLOADER" --library-path /KNOPPIX/lib64 losetup "/dev/cloop$c" "$1/$KNOPPIX_DIR/$KNOPPIX_NAME$c"; then
591      if "$DYNLOADER" --library-path /KNOPPIX/lib64 mkdir -m 755 -p "/KNOPPIX$c"; then
592       if mountit "/dev/cloop$c" "/KNOPPIX$c" "-o ro"; then
593        echo ""
594        echo -n "${CRE} ${GREEN}Found additional KNOPPIX compressed image at ${MAGENTA}$1/$KNOPPIX_DIR/$KNOPPIX_NAME$c${GREEN}.${NORMAL}"
595       else
596        "$DYNLOADER" --library-path /KNOPPIX/lib64 rmdir "/KNOPPIX$c" 2>/dev/null
597       fi
598      else
599       "$DYNLOADER" --library-path /KNOPPIX/lib64 losetup -d "/dev/cloop$c" 2>/dev/null
600      fi
601     fi
602    fi
603   done
604   /bbin/ln -snf /KNOPPIX/sbin /sbin && hash -r
605  fi
606 fi
607}
608
609remount_knoppix()
610{
611 if test -r $TARGET/$KNOPPIX_DIR/$KNOPPIX_NAME; then
612  umount /KNOPPIX
613  for c in 0 1 2 3 4 5 6 7; do
614   umount "/$KNOPPIX_NAME$c" >/dev/null 2>&1
615  done
616  unloadmodule cloop # release CD
617  umount $SOURCE  # unmount CD
618  [ -n "$SOURCE2" ] && umount $SOURCE2  # umount possible loop-device
619  mount_knoppix $TARGET
620 else
621  echo "${CRE}${RED}Warning: Changing to $TARGET failed.${NORMAL}"
622  return 1
623 fi
624 return 0
625}
626
627boot_from()
628{
629 # preparations
630 /bin/mkdir $TARGET
631 SOURCE_DEV=$(echo $CMDLINE | /usr/bin/tr ' ' '\n' | /bin/sed -n '/bootfrom=/s/.*=//p' | /usr/bin/tail -1)
632 LOOP_DEV=$(echo $SOURCE_DEV | /usr/bin/gawk -F/ '{ print $1 "/" $2 "/" $3 }')
633 ISO_PATH=$(echo $SOURCE_DEV | /bin/sed "s|$LOOP_DEV||g" )
634 case "$ISO_PATH" in /*.[iI][sS][oO]) ;; *) ISO_PATH="" ;; esac
635 LOOP_SOURCE=""
636
637 # load filesystems
638 for i in reiserfs jbd ext3 ntfs fuse; do
639  modprobe $i >/dev/null 2>&1
640 done
641 FS="reiserfs ext3 ntfs"
642 
643 if [ -n "$ISO_PATH" ]; then
644  LOOP_SOURCE="$TARGET.loop"
645  LOOP_SOURCE2="$LOOP_SOURCE"
646  TARGET_DEV="$LOOP_SOURCE$ISO_PATH"
647  /bin/mkdir $LOOP_SOURCE
648  modprobe loop
649  # Try out own mount first.
650  mountit $LOOP_DEV $LOOP_SOURCE "-o ro"
651  if [ "$?" != "0" ]; then
652   for i in $FS; do
653    case "$i" in ntfs) PLAIN="-i" ;; *) PLAIN="" ;; esac
654    mount $PLAIN -o ro -t $i $LOOP_DEV $LOOP_SOURCE >/dev/null 2>&1 && break
655   done
656  fi
657  test "$?" = "0" || LOOP_SOURCE=""
658  mount -n -o loop $LOOP_SOURCE2$ISO_PATH $TARGET >/dev/null 2>&1
659 else
660  TARGET_DEV="$SOURCE_DEV"
661  mountit $SOURCE_DEV $TARGET "-o ro"
662  if [ "$?" != "0" ]; then
663   for i in $FS; do
664    case "$i" in ntfs) PLAIN="-i" ;; *) PLAIN="" ;; esac
665    /bbin/mount $PLAIN -n -o ro -t $i $SOURCE_DEV $TARGET >/dev/null 2>&1
666   done
667  fi
668 fi
669 if [ "$?" != "0" ]; then
670  [ -n "$LOOP_SOURCE" ] && { /bin/umount $LOOP_SOURCE || umount $LOOP_SOURCE; } >/dev/null 2>&1
671  echo -n "${CRE}${RED}Accessing KNOPPIX ${MEDIUM} failed. ${MAGENTA}$TARGET_DEV${RED} is not mountable.${NORMAL}"
672  sleep 2
673  return 1
674 fi
675 if test -r $TARGET/$KNOPPIX_DIR/$KNOPPIX_NAME ; then
676  echo -n "${CRE}${GREEN}Accessing KNOPPIX ${MEDIUM} at ${MAGENTA}$TARGET_DEV${GREEN}...${NORMAL}"
677 else
678  echo -n "${CRE}${RED}Accessing KNOPPIX ${MEDIUM} failed. Could not find $KNOPPIX_DIR/$KNOPPIX_NAME on ${MAGENTA}$TARGET_DEV${RED}.${NORMAL}"
679  [ -n "$LOOP_SOURCE" ] && { /bin/umount -l $LOOP_SOURCE || umount $LOOP_SOURCE; } >/dev/null 2>&1
680  umount $TARGET
681  sleep 2
682  return 1
683 fi
684 # remount the CD
685 remount_knoppix
686}
687
688copy_to()
689{
690 /bbin/busybox ash
691 # preparations
692 /bbin/mkdir $TARGET
693 COPY="$SOURCE/$KNOPPIX_DIR"
694 # look if we copy to hd or to ram
695 SIZE="$(/bbin/du -s $COPY | /bbin/awk '{print int($1*1.1)}')"
696 test -n "$SIZE" || SIZE="800000"
697 case "$1" in
698  ram)
699   TARGET_DEV="/dev/shm"
700   TARGET_DEV_DESC="ramdisk"
701   FOUNDSPACE="$(/bbin/awk '/MemTotal/{print $2}' /proc/meminfo)"
702   /bbin/mount -n -t tmpfs -o size=${SIZE}k $TARGET_DEV $TARGET
703  ;;
704  hd)
705   TARGET_DEV=$(echo $CMDLINE | /bbin/tr ' ' '\n' | /bin/sed -n '/tohd=/s/.*=//p' | /usr/bin/tail -1)
706   TARGET_DEV_DESC="$TARGET_DEV"
707
708   # load filesystems
709   for i in reiserfs jbd ext3 ntfs fuse; do
710    modprobe $i >/dev/null 2>&1
711   done
712 
713   FS="ext3 ext2 reiserfs vfat ntfs fuse"
714   cp -au /KNOPPIX/dev/fuse /dev/ >/dev/null 2>&1
715   MOUNTED=""
716   for filesystem in $FS; do
717    if mount -o rw -t "$filesystem" "$TARGET_DEV" "$TARGET" >/dev/null 2>&1; then
718     MOUNTED="true"
719     break
720    fi
721   done
722   if test -z "$MOUNTED"; then
723    echo -n "${CRE}${RED}Copying KNOPPIX ${MEDIUM} failed. ${MAGENTA}$TARGET_DEV_DESC${RED} is not mountable.${NORMAL}"
724    sleep 2
725    return 1
726   fi
727   # check for enough free space
728   USED_SPACE=0
729   test -r $TARGET/$KNOPPIX_DIR/$KNOPPIX_NAME && USED_SPACE=$(/bbin/du -s $TARGET/$KNOPPIX_DIR/$KNOPPIX_NAME | /bbin/awk '{ print $1 }')
730   FOUNDSPACE="$(/KNOPPIX/bin/df -k $TARGET | /KNOPPIX/usr/bin/tail -1 | /bbin/awk '{ print $4+int('$USED_SPACE') }')"
731  ;;
732  *)
733   return 1
734  ;;
735 esac
736 # sanity check
737 if [ $FOUNDSPACE -lt $SIZE ]; then
738  echo -n "${CRE}${RED}Copying KNOPPIX ${MEDIUM} failed. Not enough free space on ${MAGENTA}${TARGET_DEV_DESC}${RED}. Found: ${MAGENTA}${FOUNDSPACE}k${RED} Need: ${MAGENTA}${SIZE}k${RED} ${NORMAL}"
739  sleep 2
740  umount $TARGET
741  return 1
742 fi
743 # do the real copy
744 echo "${CRE}${GREEN}Copying KNOPPIX ${MEDIUM} to ${MAGENTA}$TARGET_DEV_DESC${GREEN}... Please be patient. ${NORMAL}"
745 if [ -z "$COPY_COMMAND" -a -x /KNOPPIX/usr/bin/rsync ]; then
746  # first cp the small files
747  /lib/ld-2.7.so /KNOPPIX/usr/bin/rsync -a --exclude="$KNOPPIX_DIR/$KNOPPIX_NAME*" $COPY $TARGET # Copy Knoppix to $TARGET
748  # then the big files with nice progress meter
749  /lib/ld-2.7.so /KNOPPIX/usr/bin/rsync -a --progress --include="$KNOPPIX_DIR/$KNOPPIX_NAME*" --include="$KNOPPIX_DIR/" --exclude="*" $COPY $TARGET
750 else
751  "$COPY_COMMAND" $COPY $TARGET
752 fi
753 if [ "$?" -ne "0" ]; then
754  echo -n "${CRE}${RED}Copying KNOPPIX ${MEDIUM} failed. ${MAGENTA}$TARGET_DEV_DESC${RED} possibly has not enough space left.${NORMAL}"
755  sleep 2
756  return 1
757 fi
758 # remount r/o
759 case "$filesystem" in
760  ntfs) umount "$TARGET" ; sleep 2 ; { mountit "$TARGET_DEV" "$TARGET" "-o ro" || mount -i -t ntfs -o ro "$TARGET_DEV" "$TARGET"; } ;;
761     *) mount -n -o remount,ro "$TARGET" ;;
762 esac
763 remount_knoppix
764}
765
766mount_knoppix /cdrom
767
768COPYTO=""
769BOOTFROM=""
770DO_REMOUNT=""
771REAL_TARGET=""
772UNIONFS=""
773
774case "$CMDLINE" in *toram*) DO_REMOUNT="yes"; COPYTO="ram"; ;; esac
775case "$CMDLINE" in *tohd=*) DO_REMOUNT="yes"; COPYTO="hd"; ;; esac
776case "$CMDLINE" in *bootfrom=*) DO_REMOUNT="yes"; BOOTFROM="yes" ;; esac
777 
778# Remount later after copying/isoloading/driverloading?
779# pre-test if everything succeeded
780if  test -n "$DO_REMOUNT" -a -n "$FOUND_KNOPPIX"; then
781 # copy library cache
782 cat /KNOPPIX/etc/ld.so.cache > /etc/ld.so.cache
783 echo ""
784
785 SOURCE="/cdrom"
786 TARGET="/cdrom2"
787 
788 # first copy_to, then boot_from
789 if [ -n "$COPYTO" ]; then
790  copy_to $COPYTO && REAL_TARGET="$TARGET"
791 fi
792 if [ -n "$BOOTFROM" ]; then
793  boot_from
794  if [ "$?" -eq "0" ]; then
795   # set new source / target paths
796   REAL_TARGET="$TARGET"
797   SOURCE2="$LOOP_SOURCE"
798   SOURCE="/cdrom2"
799   TARGET="/cdrom3"
800  fi
801 fi
802fi
803 
804# Final test if everything succeeded.
805if test -n "$FOUND_KNOPPIX"; then
806 # copy library cache
807 cat /KNOPPIX/etc/ld.so.cache > /etc/ld.so.cache
808 echo ""
809 UNIONFS=""
810 loadmodule aufs.ko 2>/dev/null && UNIONFS="yes"
811 dmesg|grep -iq aufs && UNIONFS="yes"
812 # Enable kernel messages
813 echo "6" > /proc/sys/kernel/printk
814 # Set paths
815 echo -n "${CRE}${BLUE}Setting paths...${NORMAL}"
816 PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/bbin:."
817 export PATH
818 # Make space: We don't need the modules anymore from here.
819 rm -rf /modules
820 # Debian weirdness
821 cp -a /KNOPPIX/etc/alternatives /etc/ 2>/dev/null
822 # Replace /sbin
823 rm -f /sbin
824 /bbin/ln -sf /KNOPPIX/sbin /sbin
825 # From here, we should have all essential commands available.
826 hash -r
827 # Did we remount the source media ?
828 if  test -n "$REAL_TARGET"; then
829  /bbin/mount -n --move $REAL_TARGET /cdrom # move it back and go on to normal boot
830 fi
831 # Clean up /
832 rm -rf /modules /static
833 # New in Kernel 2.4.x: tmpfs with variable ramdisk size.
834 # We check for available memory anyways and limit the ramdisks
835 # to a reasonable size.
836 # Be verbose
837 # Now we need to use a little intuition for finding a ramdisk size
838 # that keeps us from running out of space, but still doesn't crash the
839 # machine due to lack of Ram
840 # Minimum size of additional ram partitions
841 MINSIZE=20000
842 # At least this much memory minus 30% should remain when home and var are full.
843 MINLEFT=16000
844 # Maximum ramdisk size
845 MAXSIZE="$(expr $TOTALMEM - $MINLEFT)"
846 # Default ramdisk size for ramdisk
847 RAMSIZE="$(expr $TOTALMEM / 5)"
848 # Create additional dynamic ramdisk.
849 test -z "$RAMSIZE" -o "$RAMSIZE" -lt "$MINSIZE" && RAMSIZE="$MINSIZE"
850 mkdir -p /ramdisk
851 # tmpfs/varsize version, can use swap
852 RAMSIZE=$(expr $RAMSIZE \* 4)
853 echo -n "${CRE}${BLUE}Creating ${YELLOW}/ramdisk${BLUE} (dynamic size=${RAMSIZE}k) on ${MAGENTA}shared memory${BLUE}...${NORMAL}"
854 # We need /bbin/mount here for the -o size= option
855 /bbin/mount -t tmpfs -o "size=${RAMSIZE}k,mode=755" /ramdisk /ramdisk
856 mkdir -p /ramdisk/tmp
857 chmod 1777 /ramdisk/tmp
858 /bbin/mv /tmp /tmp.old && /bbin/ln -s /ramdisk/tmp /tmp && /bbin/rm -rf /tmp.old
859 echo "${BLUE}Done.${NORMAL}"
860 stage=2
861 rundebugshell
862 echo -n "${CRE}${BLUE}Creating unified filesystem and symlinks on ramdisk...${NORMAL}"
863 mkdir -p /UNIONFS
864 UNION="/ramdisk"
865 # Add all KNOPPIX images to the union
866 for c in "" 1 2 3 4 5 6 7; do
867  [ -d "/KNOPPIX$c" ] && UNION="$UNION:/KNOPPIX$c"
868 done
869 echo "UNIONFS: $UNIONFS UNION: $UNION"
870 # Do the actual mount
871 if test -n "$UNIONFS" && /bbin/mount -t aufs -o "br:$UNION" /UNIONFS /UNIONFS; then
872  # We now have aufs, copy some data from the initial ramdisk first
873  cp -a /etc/fstab /etc/auto.mnt /etc/filesystems /etc/mtab /UNIONFS/etc/
874  # /dev is a special case, it is now normally handled via udev
875  UNIONDEV=""
876  case "$CMDLINE" in *noudev*) UNIONDEV="dev"; ;; esac
877  for i in home bin boot etc $UNIONDEV sbin var lib opt root usr; do # Move directories to union
878   if test -d /$i; then
879    mv /$i /$i.old && \
880    /bbin/ln -snf /UNIONFS/$i /$i && \
881    rm -rf /$i.old
882   else
883    /bbin/ln -snf /UNIONFS/$i /$i
884   fi
885  done
886  for i in $(cd /UNIONFS; echo *); do # Create links for new stuff on /UNIONFS
887   test "$i" = "home" -o "$i" = "tmp" && continue
888   test -L "/$i" || test -d "/$i" || test -f "/$i" || /bbin/ln -snf "/UNIONFS/$i" /$i
889  done
890 else
891  echo -n "${CRE}${RED}ERROR: CANNOT UNITE READ-ONLY MEDIA AND INITIAL RAMDISK!${NORMAL}"
892  halt -f -n
893 fi
894 echo ""
895 echo "${GREEN}>> Read-only ${MEDIUM} system successfully merged with read-write /ramdisk.${NORMAL}"
896 # CUPS wants writable files. :-/
897 cp -a /KNOPPIX/etc/cups/*.conf /etc/cups/ 2>/dev/null
898 # resolv.conf must be writable as well
899 cp -a /KNOPPIX/etc/dhcpc/resolv.conf /etc/dhcpc/ 2>/dev/null
900 # Create empty utmp and wtmp
901 :> /var/run/utmp
902 :> /var/run/wtmp
903 # Make SURE that these are files, not links!
904 rm -rf /etc/ftpusers /etc/passwd /etc/shadow /etc/gshadow /etc/group \
905        /etc/ppp /etc/isdn /etc/ssh /etc/ioctl.save \
906        /etc/inittab /etc/network /etc/sudoers \
907        /etc/init /etc/localtime /etc/dhcpc /etc/pnm2ppa.conf 2>/dev/null
908 cp -a /KNOPPIX/etc/ftpusers /KNOPPIX/etc/passwd /KNOPPIX/etc/shadow /etc/gshadow /KNOPPIX/etc/group \
909       /KNOPPIX/etc/ppp /KNOPPIX/etc/isdn /KNOPPIX/etc/ssh \
910       /KNOPPIX/etc/inittab /KNOPPIX/etc/network /KNOPPIX/etc/sudoers \
911       /KNOPPIX/sbin/init /KNOPPIX/etc/dhcpc /etc/ 2>/dev/null
912 # Extremely important, init crashes on shutdown if this is only a link
913 :> /etc/ioctl.save
914 :> /etc/pnm2ppa.conf
915 # Must exist for samba to work
916 [ -d /var/lib/samba ] && :> /var/lib/samba/unexpected.tdb
917 # Kernel 2.6.9 bug?
918 chmod 1777 /tmp /var/tmp
919 # Diet libc bug workaround
920 /bin/cp -f /KNOPPIX/etc/localtime /etc/localtime
921 echo "${BLUE}Done.${NORMAL}"
922 # Mount devpts, should be done much later
923 # mount -t devpts /dev/pts /dev/pts 2>/dev/null
924 # Clean up /etc/mtab (and - just in case - make a nice entry for looped ISO)
925 /bin/egrep " /KNOPPIX[0-9]* | /cdrom " /proc/mounts | sed 's|/dev/loop0 /cdrom \(.*\) 0 0|'$LOOP_SOURCE$ISO_PATH' /cdrom/ \1,loop=/dev/loop0 0 0|g' >> /etc/mtab
926 # Now tell kernel where the real modprobe lives
927 echo "/sbin/modprobe" > /proc/sys/kernel/modprobe
928 # Change root device from /dev/fd0 to /dev/ram0
929 echo "0x100" > /proc/sys/kernel/real-root-dev
930 stage=3
931 rundebugshell
932 # Give control to the init process.
933 echo "${CRE}${BLUE}Starting init process.${NORMAL}"
934 rm -f /linuxrc
935 exit 0
936else
937 echo "${CRE}${RED}Can't find KNOPPIX filesystem, sorry.${NORMAL}"
938 echo "${RED}Dropping you to a (very limited) shell.${NORMAL}"
939 echo "${RED}Press reset button to quit.${NORMAL}"
940 echo ""
941 echo "Additional builtin commands avaliable:"
942 echo " cat        mount     umount"
943 echo " insmod     rmmod     lsmod"
944 echo ""
945 PS1="knoppix# "
946 export PS1
947 echo "6" > /proc/sys/kernel/printk
948 # Allow signals
949 trap 1 2 3 11 15
950 exec /static/ash
951fi
Note: See TracBrowser for help on using the repository browser.