Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Installation of : slitaz-loram-cdrom-1.5
- ================================================================================
- Copying slitaz-loram-cdrom-1.5... [ OK ]
- Extracting slitaz-loram-cdrom-1.5... 16 blocks
- Extracting the pseudo fs... (lzma) 12 blocks
- Installing slitaz-loram-cdrom... [ OK ]
- Removing all tmp files... [ OK ]
- patching file /etc/init.d/rcS
- patching file /etc/init.d/rcS
- ----
- 'tazlito gen-distro' will create a loram-cdrom flavor
- while this package is installed.
- ----
- You will build a live CD with /usr mounted read-only.
- You can install aufs or funionfs to have read-write access into /usr with:
- # tazpkg get-install aufs
- or
- # tazpkg get-install funionfs
- ================================================================================
- slitaz-loram-cdrom (1.5) is installed.
- root@slitaz:/home/tux#
- --- /etc/init.d/rcS.original Mon Feb 6 15:40:42 2012
- +++ /etc/init.d/rcS Mon Feb 6 15:41:15 2012
- @@ -74,6 +74,14 @@
- /bin/mount -a
- # Store boot messages to log files.
- +
- +# Build ramdisk if root=/dev/cdrom (from slitaz-loram-cdrom package)
- + if [ -L /root ]; then
- + mount -t tmpfs ramdisk /tmp
- + mkdir -p /tmp/log/lighttpd /tmp/run /tmp/lock
- + chown www.www /tmp/log/lighttpd
- + fi
- +
- /bin/dmesg > /var/log/dmesg.log &
- vcsa2txt < /dev/vcsa1 | awk 'BEGIN {s=0} /^Processing|^.witching/ {s=1} { if (s) print }' >/var/log/boot.log
- script -a -q -c '/etc/init.d/rcS logged' /var/log/boot.log
- @@ -148,6 +156,92 @@
- status
- done
- fi
- +
- +# Try to release the cdrom (from slitaz-loram-cdrom package)
- + release_cdrom()
- + {
- + FREEMEM=$(free | awk '{ n = $NF } END { print n }')
- + if [ $FREEMEM -gt $(du -s $FS | awk '{ print $1+40000 }') ]; then
- + if ! grep -q " keep-loram" /proc/cmdline &&
- + [ -d $FS -o $FREEMEM -gt $(du -s $FS | \
- + awk '{ print ($1*4)+40000 }') ]; then
- + echo -n "Extracting loram..."
- + . /etc/tazlito/loram.extract /cdrom
- + if status; then
- + umount /cdrom
- + rmdir /cdrom
- + yes y | tazpkg remove slitaz-loram-cdrom > /dev/null
- + return 0
- + fi
- + fi
- + cp -a $FS /.usr.fs
- + status
- + echo -n "Releasing CD-ROM..."
- + umount /cdrom
- + FS=/.usr.fs
- + if [ -d $FS ]; then
- + rm -f /$usr
- + mv $FS /usr
- + fi
- + fi
- + return 1
- + }
- +
- +# Mount /usr (from slitaz-loram-cdrom package)
- + if [ -d /cdrom ]; then
- + DEVICE=/dev/cdrom
- + DIR=
- + if grep -q " loram=" /proc/cmdline; then
- + DIR=`cat /proc/cmdline | sed 's/.* loram=\([^ ]*\).*/\1/'`
- + DEVICE=${DIR%,*}
- + DIR=/${DIR#*,}
- + fi
- + if ! /bin/mount -r $DEVICE /cdrom; then
- + if echo $DEVICE | grep -Eq "/dev/sd|UUID=|LABEL="; then
- + USBDELAY=`cat /sys/module/usb_storage/parameters/delay_use`
- + USBDELAY=$((1+$USBDELAY))
- + echo "$DEVICE is potentially a USB device: sleep for $USBDELAY seconds"
- + sleep $USBDELAY
- + fi
- + if ! /bin/mount -r $DEVICE /cdrom; then
- + DEVICE=""
- + fi
- + fi
- + while [ -n "$DEVICE" ]; do
- + if [ -d /.usr.rw ]; then
- + echo -n "Mounting /usr read-write... "
- + usr=.usr.ro
- + else
- + echo -n "Mounting /usr read-only... "
- + usr=usr
- + fi
- + FS=/cdrom$DIR/usr.cromfs
- + if [ -f $FS ]; then
- + release_cdrom && break
- + /bin/cromfs-driver $FS /$usr -o ro,dev,suid,allow_other
- + elif [ -f /cdrom$DIR/usr.sqfs ]; then
- + FS=/cdrom$DIR/usr.sqfs
- + release_cdrom && break
- + mount -o loop,ro -t squashfs $FS /$usr
- + elif [ -L /$usr ]; then
- + FS=/cdrom$DIR/usr
- + release_cdrom && break
- + true
- + else
- + umount /cdrom
- + false
- + fi
- + status
- + if [ -d /.usr.rw ]; then
- + if [ -x /bin/funionfs ]; then
- + /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
- + else
- + /bin/mount -t aufs -o br:/.usr.rw:/.usr.ro none /usr
- + fi
- + fi
- + break
- + done
- + fi
- # Handle kernel cmdline parameter config=<device>,<path> to source a
- # disk init script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement