Subversion Repositories livecd

Rev

Rev 37 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37 Rev 48
Line 26... Line 26...
26
if [ "$RAMSIZE" = "" ]; then RAMSIZE="70%"; fi
26
if [ "$RAMSIZE" = "" ]; then RAMSIZE="70%"; fi
27
 
27
 
28
# I have to set these variables very carefully
28
# I have to set these variables very carefully
29
UNION=/union
29
UNION=/union
30
MEMORY=/memory
30
MEMORY=/memory
31
#MOUNTDIR=mnt
-
 
32
MOUNTDIR=livecd
31
MOUNTDIR=livecd
33
CHANGES=$MEMORY/changes
32
CHANGES=$MEMORY/changes
34
COPY2RAM=$MEMORY/copy2ram
33
COPY2RAM=$MEMORY/copy2ram
35
IMAGES=$MEMORY/images
34
IMAGES=$MEMORY/images
36
INITRAMDISK=$MOUNTDIR/live
35
INITRAMDISK=$MOUNTDIR/live
Line 88... Line 87...
88
 
87
 
89
# mount unionfs or aufs
88
# mount unionfs or aufs
90
lsmod | grep -q ^unionfs
89
lsmod | grep -q ^unionfs
91
if [ $? -eq 0 ]; then  
90
if [ $? -eq 0 ]; then  
92
    mount -t unionfs -o dirs=$CHANGES=rw unionfs $UNION
91
    mount -t unionfs -o dirs=$CHANGES=rw unionfs $UNION
93
    if [ $? -ne 0 ]; then fatal "can't setup union in /union directory"; fi
92
    if [ $? -ne 0 ]; then fatal "can't setup union in $UNION directory"; fi
94
else
93
else
95
    mount -t aufs -o br:$CHANGES=rw aufs $UNION
94
    mount -t aufs -o br:$CHANGES=rw aufs $UNION
96
    if [ $? -ne 0 ]; then fatal "can't setup union (aufs)"; fi
95
    if [ $? -ne 0 ]; then fatal "can't setup union (aufs) in $UNION directory"; fi
97
fi
96
fi
98
 
97
 
99
$DEBUGCMD
98
$DEBUGCMD
100
 
99
 
101
# try to find livecd data directory. If not found, try modprobing
100
# try to find livecd data directory. If not found, try modprobing
Line 151... Line 150...
151
mkdir -p $UNION/dev
150
mkdir -p $UNION/dev
152
mkdir -p $UNION/initrd
151
mkdir -p $UNION/initrd
153
 
152
 
154
$DEBUGCMD
153
$DEBUGCMD
155
 
154
 
-
 
155
# no X? (set runlevel to 3)
-
 
156
if [ "`cmdline_parameter nox`" ]; then
-
 
157
  echo "set runlevel to 3"
-
 
158
  sed sed -i "s/id:.:initdefault:/id:3:initdefault:/" $UNION/etc/inittab
-
 
159
fi
-
 
160
 
-
 
161
$DEBUGCMD
-
 
162
 
156
# Union contains all the files and directories unioned from all modules.
163
# Union contains all the files and directories unioned from all modules.
157
# Change root directory to it, and move initrd's root to /livecd/live/initramdisk
164
# Change root directory to it, and move initrd's root to /livecd/live/initramdisk
158
# Finaly execute /sbin/init to start the distribution.
165
# Finaly execute /sbin/init to start the distribution.
159
echolog "changing root directory..."
166
echolog "changing root directory..."
160
cd $UNION
167
cd $UNION