Advertisement
Guest User

Untitled

a guest
Feb 6th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.91 KB | None | 0 0
  1. Installation of : slitaz-loram-cdrom-1.5
  2. ================================================================================
  3. Copying slitaz-loram-cdrom-1.5... [ OK ]
  4. Extracting slitaz-loram-cdrom-1.5... 16 blocks
  5. Extracting the pseudo fs... (lzma) 12 blocks
  6. Installing slitaz-loram-cdrom... [ OK ]
  7. Removing all tmp files... [ OK ]
  8. patching file /etc/init.d/rcS
  9. patching file /etc/init.d/rcS
  10. ----
  11. 'tazlito gen-distro' will create a loram-cdrom flavor
  12. while this package is installed.
  13. ----
  14. You will build a live CD with /usr mounted read-only.
  15. You can install aufs or funionfs to have read-write access into /usr with:
  16.  
  17. # tazpkg get-install aufs
  18. or
  19. # tazpkg get-install funionfs
  20.  
  21. ================================================================================
  22. slitaz-loram-cdrom (1.5) is installed.
  23.  
  24. root@slitaz:/home/tux#
  25.  
  26. --- /etc/init.d/rcS.original Mon Feb 6 15:40:42 2012
  27. +++ /etc/init.d/rcS Mon Feb 6 15:41:15 2012
  28. @@ -74,6 +74,14 @@
  29. /bin/mount -a
  30.  
  31. # Store boot messages to log files.
  32. +
  33. +# Build ramdisk if root=/dev/cdrom (from slitaz-loram-cdrom package)
  34. + if [ -L /root ]; then
  35. + mount -t tmpfs ramdisk /tmp
  36. + mkdir -p /tmp/log/lighttpd /tmp/run /tmp/lock
  37. + chown www.www /tmp/log/lighttpd
  38. + fi
  39. +
  40. /bin/dmesg > /var/log/dmesg.log &
  41. vcsa2txt < /dev/vcsa1 | awk 'BEGIN {s=0} /^Processing|^.witching/ {s=1} { if (s) print }' >/var/log/boot.log
  42. script -a -q -c '/etc/init.d/rcS logged' /var/log/boot.log
  43. @@ -148,6 +156,92 @@
  44. status
  45. done
  46. fi
  47. +
  48. +# Try to release the cdrom (from slitaz-loram-cdrom package)
  49. + release_cdrom()
  50. + {
  51. + FREEMEM=$(free | awk '{ n = $NF } END { print n }')
  52. + if [ $FREEMEM -gt $(du -s $FS | awk '{ print $1+40000 }') ]; then
  53. + if ! grep -q " keep-loram" /proc/cmdline &&
  54. + [ -d $FS -o $FREEMEM -gt $(du -s $FS | \
  55. + awk '{ print ($1*4)+40000 }') ]; then
  56. + echo -n "Extracting loram..."
  57. + . /etc/tazlito/loram.extract /cdrom
  58. + if status; then
  59. + umount /cdrom
  60. + rmdir /cdrom
  61. + yes y | tazpkg remove slitaz-loram-cdrom > /dev/null
  62. + return 0
  63. + fi
  64. + fi
  65. + cp -a $FS /.usr.fs
  66. + status
  67. + echo -n "Releasing CD-ROM..."
  68. + umount /cdrom
  69. + FS=/.usr.fs
  70. + if [ -d $FS ]; then
  71. + rm -f /$usr
  72. + mv $FS /usr
  73. + fi
  74. + fi
  75. + return 1
  76. + }
  77. +
  78. +# Mount /usr (from slitaz-loram-cdrom package)
  79. + if [ -d /cdrom ]; then
  80. + DEVICE=/dev/cdrom
  81. + DIR=
  82. + if grep -q " loram=" /proc/cmdline; then
  83. + DIR=`cat /proc/cmdline | sed 's/.* loram=\([^ ]*\).*/\1/'`
  84. + DEVICE=${DIR%,*}
  85. + DIR=/${DIR#*,}
  86. + fi
  87. + if ! /bin/mount -r $DEVICE /cdrom; then
  88. + if echo $DEVICE | grep -Eq "/dev/sd|UUID=|LABEL="; then
  89. + USBDELAY=`cat /sys/module/usb_storage/parameters/delay_use`
  90. + USBDELAY=$((1+$USBDELAY))
  91. + echo "$DEVICE is potentially a USB device: sleep for $USBDELAY seconds"
  92. + sleep $USBDELAY
  93. + fi
  94. + if ! /bin/mount -r $DEVICE /cdrom; then
  95. + DEVICE=""
  96. + fi
  97. + fi
  98. + while [ -n "$DEVICE" ]; do
  99. + if [ -d /.usr.rw ]; then
  100. + echo -n "Mounting /usr read-write... "
  101. + usr=.usr.ro
  102. + else
  103. + echo -n "Mounting /usr read-only... "
  104. + usr=usr
  105. + fi
  106. + FS=/cdrom$DIR/usr.cromfs
  107. + if [ -f $FS ]; then
  108. + release_cdrom && break
  109. + /bin/cromfs-driver $FS /$usr -o ro,dev,suid,allow_other
  110. + elif [ -f /cdrom$DIR/usr.sqfs ]; then
  111. + FS=/cdrom$DIR/usr.sqfs
  112. + release_cdrom && break
  113. + mount -o loop,ro -t squashfs $FS /$usr
  114. + elif [ -L /$usr ]; then
  115. + FS=/cdrom$DIR/usr
  116. + release_cdrom && break
  117. + true
  118. + else
  119. + umount /cdrom
  120. + false
  121. + fi
  122. + status
  123. + if [ -d /.usr.rw ]; then
  124. + if [ -x /bin/funionfs ]; then
  125. + /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
  126. + else
  127. + /bin/mount -t aufs -o br:/.usr.rw:/.usr.ro none /usr
  128. + fi
  129. + fi
  130. + break
  131. + done
  132. + fi
  133.  
  134. # Handle kernel cmdline parameter config=<device>,<path> to source a
  135. # disk init script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement