Magellan Linux

Diff of /trunk/mkinitrd-magellan/livecd/linuxrc.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1295 by niro, Thu Dec 16 01:24:51 2010 UTC revision 1296 by niro, Fri May 27 14:42:36 2011 UTC
# Line 61  DOPATA=yes Line 61  DOPATA=yes
61  FORCED_ROOTFS=""  FORCED_ROOTFS=""
62  INITEXEC="/sbin/init"  INITEXEC="/sbin/init"
63  BREAK_ENABLED=no  BREAK_ENABLED=no
64    UNIONFS=no
65    UNIONFS_FILE=""
66    CLOOPMOUNTDIR="/sysroot/mnt/cloop"
67    
68  ## starts here ##  ## starts here ##
69    
# Line 92  do Line 95  do
95   rootfs=*) FORCED_ROOTFS="${i#*=}";;   rootfs=*) FORCED_ROOTFS="${i#*=}";;
96   init=*) INITEXEC="${i#*=}";;   init=*) INITEXEC="${i#*=}";;
97   break) BREAK_ENABLED=yes ;;   break) BREAK_ENABLED=yes ;;
98     unionfs) UNIONFS=yes;;
99     unionfs_file=*) UNIONFS_FILE="${i#*=}";;
100   esac   esac
101  done  done
102    
# Line 171  else Line 176  else
176   echo -e "Mounting squashfs system image ..."   echo -e "Mounting squashfs system image ..."
177   echo   echo
178   [ ! -e /dev/loop0 ] && mknod /dev/loop0 b 7 0   [ ! -e /dev/loop0 ] && mknod /dev/loop0 b 7 0
179   mount -o loop,ro -t squashfs /sysroot/mnt/cdrom/livecdrootfs.sqsh /sysroot/mnt/cloop   mount -o loop,ro -t squashfs /sysroot/mnt/cdrom/livecdrootfs.sqsh "${CLOOPMOUNTDIR}"
180    
181     # mount unionfs if enabled
182     if [[ ${UNIONFS} = yes ]]
183     then
184     echo -e "Mounting writeable cdbuffer (unionfs) ..."
185    
186     # default setting
187     CLOOPMOUNTDIR="/sysroot/mnt/unionfs"
188     [[ -z ${UNIONFS_FILE} ]] && UNIONFS_FILE="/sysroot/mnt/cdrom/unionfs"
189    
190     [[ ! -d /sysroot/mnt/unionfs ]] && install -d /sysroot/mnt/unionfs
191     mount -t unionfs dirs=${UNIONFS_FILE}=rw:/sysroot/mnt/cloop=ro ${CLOOPMOUNTDIR}
192     fi
193    
194   # symlinking cloop rootfs to /mnt as newroot   # symlinking cloop rootfs to /mnt as newroot
195   cd /sysroot   cd /sysroot
196    
197   for x in bin sbin lib lib64 boot usr opt   for x in bin sbin lib lib64 boot usr opt
198   do   do
199   [ -d mnt/cloop/${x} ] && ln -s mnt/cloop/${x} ${x}   [ -d ${CLOOPMOUNTDIR/\/sysroot\//}/${x} ] && ln -s ${CLOOPMOUNTDIR/\/sysroot\//}/${x} ${x}
200   done   done
201   mkdir -p initrd proc tmp sys var/tmp dev media   mkdir -p initrd proc tmp sys var/tmp dev media
202    
# Line 190  else Line 208  else
208   # busybox needs this one   # busybox needs this one
209   [ ! -e /sysroot/dev/tty5 ] && mknod /sysroot/dev/tty5 c 4 5   [ ! -e /sysroot/dev/tty5 ] && mknod /sysroot/dev/tty5 c 4 5
210    
211   (cd /sysroot/mnt/cloop; cp -a etc root home var /sysroot)   (cd ${CLOOPMOUNTDIR}; cp -a etc root home var /sysroot)
212    
213   # ensure the right permissions   # ensure the right permissions
214   chmod 1777 /sysroot/tmp   chmod 1777 /sysroot/tmp

Legend:
Removed from v.1295  
changed lines
  Added in v.1296