Subversion Repositories livecd

Rev

Rev 150 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 160
Line 3... Line 3...
3
# Original version from http://www.linux-live.org/
3
# Original version from http://www.linux-live.org/
4
#
4
#
5
# modified by Urs Beyerle, PSI
5
# modified by Urs Beyerle, PSI
6
# - to allow LiveCD mounted over NFS
6
# - to allow LiveCD mounted over NFS
7
# - add support for LiveCD on SATA devices
7
# - add support for LiveCD on SATA devices
-
 
8
# - to allow LiveCD mounted over CIFS
8
 
9
 
9
export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin
10
export PATH=.:/:/usr/sbin:/usr/bin:/sbin:/bin
10
. liblinuxlive
11
. liblinuxlive
11
 
12
 
12
 
13
 
Line 34... Line 35...
34
IMAGES=$MEMORY/images
35
IMAGES=$MEMORY/images
35
INITRAMDISK=$MOUNTDIR/live
36
INITRAMDISK=$MOUNTDIR/live
36
 
37
 
37
# set NFSROOT if nfsroot= in boot parameter 
38
# set NFSROOT if nfsroot= in boot parameter 
38
NFSROOT="`cmdline_value nfsroot`"
39
NFSROOT="`cmdline_value nfsroot`"
-
 
40
NFS_OPTS="`cmdline_value nfs_opts`"
-
 
41
 
-
 
42
# cifs boot parameters
-
 
43
CIFSROOT="`cmdline_value cifsroot`"
-
 
44
CIFS_OPTS="`cmdline_value cifs_opts`"
39
 
45
 
40
# we need cdrom support, isofs support, unionfs/aufs support, etc
46
# we need cdrom support, isofs support, unionfs/aufs support, etc
41
modprobe_essential_modules
47
modprobe_essential_modules
42
 
48
 
43
# disable DMA if nodma parameter is used
49
# disable DMA if nodma parameter is used
44
setup_dma
50
setup_dma
45
 
51
 
46
$DEBUGCMD
52
$DEBUGCMD
47
 
53
 
48
# if NFSROOT is set:
54
# if NFSROOT is set:
49
echolog "check for nfsroot"
55
echolog "check for nfsroot or cifsroot"
50
if [ "$NFSROOT" != "" ]; then
56
if [ "$NFSROOT" != "" ]; then
51
 
57
 
52
   # load network modules, if NFSROOT is set
-
 
53
   echolog "nfsroot: $NFSROOT"
58
   echolog "nfsroot: $NFSROOT"
54
   load_network_modules
59
   $DEBUGCMD
55
 
60
 
-
 
61
   # load network modules, if NFSROOT is set
-
 
62
   echolog "load network modules"
-
 
63
   load_network_modules
56
   $DEBUGCMD
64
   $DEBUGCMD
57
 
65
 
58
   # get DHCP lease
66
   # get DHCP lease
59
   get_dhcp_lease
67
   get_dhcp_lease
60
   
-
 
61
   $DEBUGCMD
68
   $DEBUGCMD
62
 
69
 
63
    # we need nfs modules loaded, if NFSROOT is set
70
    # we need nfs modules loaded, if NFSROOT is set
64
    modprobe_nfs_modules
71
    modprobe_nfs_modules
65
 
72
 
-
 
73
# if CIFSROOT is set
-
 
74
elif [ "$CIFSROOT" != "" ]; then
-
 
75
 
-
 
76
   echolog "cifsroot: $CIFSROOT"
-
 
77
   $DEBUGCMD
-
 
78
 
-
 
79
   # load network modules, if CIFSROOT is set
-
 
80
   echolog "load network modules"
-
 
81
   load_network_modules
-
 
82
   $DEBUGCMD
-
 
83
 
-
 
84
   # get DHCP lease
-
 
85
   get_dhcp_lease
-
 
86
   $DEBUGCMD
-
 
87
 
-
 
88
    # we need cifs modules loaded, if CIFSROOT is set
-
 
89
    modprobe_cifs_modules
-
 
90
 
66
fi
91
fi
67
 
92
 
68
$DEBUGCMD
93
$DEBUGCMD
69
 
94
 
70
# $UNION will be used as a root directory, livecd modules will be added soon.
95
# $UNION will be used as a root directory, livecd modules will be added soon.
Line 168... Line 193...
168
echolog "changing root directory..."
193
echolog "changing root directory..."
169
cd $UNION
194
cd $UNION
170
mkdir -p $INITRAMDISK
195
mkdir -p $INITRAMDISK
171
 
196
 
172
umount /sys # we won't need it anymore
197
umount /sys # we won't need it anymore
-
 
198
 
173
if [ ! -e $UNION/dev/console ]; then mknod $UNION/dev/console c 5 1; fi
199
# if [ ! -e $UNION/dev/console ]; then mknod $UNION/dev/console c 5 1; fi
-
 
200
 
-
 
201
# Copy all dev files (found by mdev) to unioned dev directory
-
 
202
# so at least disk devices exist (your Linux may need them).
-
 
203
# Two exceptions, do not copy pty* and tty* devs.
-
 
204
if [ ! -e /dev/console ]; then mknod /dev/console c 5 1; fi
-
 
205
cp -fdR /dev . 2>/dev/null
174
 
206
 
175
if [ -x $UNION/usr/sbin/chroot ];
207
if [ -x $UNION/usr/sbin/chroot ];
176
  then CHROOT=/usr/sbin/chroot
208
  then CHROOT=/usr/sbin/chroot
177
  else CHROOT=/usr/bin/chroot
209
  else CHROOT=/usr/bin/chroot
178
fi
210
fi