wok rev 1884

slitaz-loram*: add aufs support
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Dec 17 15:09:01 2008 +0000 (2008-12-17)
parents dad369eb3126
children d5139637d409
files slitaz-loram-cdrom/receipt slitaz-loram-cdrom/stuff/loram.rootfs slitaz-loram/receipt slitaz-loram/stuff/loram.rootfs
line diff
     1.1 --- a/slitaz-loram-cdrom/receipt	Wed Dec 17 14:47:20 2008 +0000
     1.2 +++ b/slitaz-loram-cdrom/receipt	Wed Dec 17 15:09:01 2008 +0000
     1.3 @@ -24,11 +24,11 @@
     1.4      i=$(($i-1))
     1.5      tag=$(grep "$tag" $1/etc/init.d/rcS)
     1.6      if [ "$2" = "-R" ]; then
     1.7 -    	line="-$(($i-49)),51 +$(($i-49)),2"
     1.8 +    	line="-$(($i-53)),55 +$(($i-53)),2"
     1.9  	i="-"
    1.10      else
    1.11          grep -q 'from slitaz-loram-cdrom package' $1/etc/init.d/rcS && return
    1.12 -    	line="-$i,2 +$i,51"
    1.13 +    	line="-$i,2 +$i,55"
    1.14  	i="+"
    1.15      fi
    1.16      patch -p0 <<EOF
    1.17 @@ -54,7 +54,7 @@
    1.18  $i# Mount /usr (from slitaz-loram-cdrom package)
    1.19  $i if [ -d /cdrom ]; then
    1.20  $i	mount -o ro -t iso9660 /dev/cdrom /cdrom
    1.21 -$i	if [ -d /.usr.rw -a -x /bin/funionfs ]; then
    1.22 +$i	if [ -d /.usr.rw ]; then
    1.23  $i		echo -n "Mounting /usr read-write... "
    1.24  $i		usr=.usr.ro
    1.25  $i	else
    1.26 @@ -80,8 +80,12 @@
    1.27  $i		false
    1.28  $i	fi
    1.29  $i	status 
    1.30 -$i	if [ -d /.usr.rw -a -x /bin/funionfs ]; then
    1.31 -$i		/bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
    1.32 +$i	if [ -d /.usr.rw ]; then
    1.33 +$i		if [ -x /bin/funionfs ]; then
    1.34 +$i			/bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
    1.35 +$i		else
    1.36 +$i			/bin/mount -t aufs -o br:/.usr.ro:/.usr.rw none /usr
    1.37 +$i		fi
    1.38  $i	fi
    1.39  $i fi
    1.40  $i
    1.41 @@ -130,12 +134,14 @@
    1.42  post_install()
    1.43  {
    1.44      set_patch "$1"
    1.45 -    if [ ! -x $1/bin/funionfs ]; then
    1.46 +    if [ ! -x $1/bin/funionfs -a ! -d $1/var/lib/tazpkg/installed/aufs ]; then
    1.47          cat <<EOF
    1.48  ----
    1.49  You will build a live CD with /usr mounted read-only.
    1.50 -You can install funionfs to have read-write access into /usr with:
    1.51 +You can install aufs or funionfs to have read-write access into /usr with:
    1.52  
    1.53 +# tazpkg get-install aufs
    1.54 +or
    1.55  # tazpkg get-install funionfs
    1.56  
    1.57  EOF
     2.1 --- a/slitaz-loram-cdrom/stuff/loram.rootfs	Wed Dec 17 14:47:20 2008 +0000
     2.2 +++ b/slitaz-loram-cdrom/stuff/loram.rootfs	Wed Dec 17 15:09:01 2008 +0000
     2.3 @@ -27,10 +27,12 @@
     2.4  done
     2.5  echo "$(du -hs ./usr/.moved | cut -f1) have been moved into /usr"
     2.6  usr=usr
     2.7 -if [ -x bin/funionfs -o -x usr/bin/mkcromfs ]; then
     2.8 +if [ -x bin/funionfs -o -d /var/lib/tazpkg/installed/aufs ]; then
     2.9    usr=.usr.ro
    2.10    mkdir .usr.ro .usr.rw
    2.11 -  ln -s /.usr.ro/lib/$(cd usr/lib ; ls libfuse.so.2.*) lib/libfuse.so.2
    2.12 +fi
    2.13 +if [ -x bin/funionfs -o -x usr/bin/mkcromfs ]; then
    2.14 +  ln -s /$usr/lib/$(cd usr/lib ; ls libfuse.so.2.*) lib/libfuse.so.2
    2.15  fi
    2.16  if [ -x usr/bin/mkcromfs ]; then
    2.17    usr/bin/mkcromfs -qq -f 262144 -b 16384 usr ../rootcd/usr.cromfs
     3.1 --- a/slitaz-loram/receipt	Wed Dec 17 14:47:20 2008 +0000
     3.2 +++ b/slitaz-loram/receipt	Wed Dec 17 15:09:01 2008 +0000
     3.3 @@ -25,11 +25,11 @@
     3.4      i=$(($i-1))
     3.5      tag=$(grep "$tag" $1/etc/init.d/rcS)
     3.6      if [ "$2" = "-R" ]; then
     3.7 -    	line="-$(($i-21)),23 +$(($i-21)),2"
     3.8 +    	line="-$(($i-25)),27 +$(($i-25)),2"
     3.9  	i="-"
    3.10      else
    3.11          grep -q 'from slitaz-loram package' $1/etc/init.d/rcS && return
    3.12 -    	line="-$i,2 +$i,23"
    3.13 +    	line="-$i,2 +$i,27"
    3.14  	i="+"
    3.15      fi
    3.16      patch -p0 <<EOF
    3.17 @@ -48,12 +48,16 @@
    3.18  $i		echo -n "only... "
    3.19  $i	fi
    3.20  $i	if [ -f /.usr.cromfs ]; then
    3.21 -$i		/bin/cromfs-driver \$FS /\$usr -o ro,dev,suid,allow_other
    3.22 +$i		/bin/cromfs-driver /.usr.cromfs /\$usr -o ro,dev,suid,allow_other
    3.23  $i	else
    3.24  $i		/bin/mount -o loop,ro -t squashfs /.usr.sqfs /\$usr
    3.25  $i	fi
    3.26  $i	if [ -d /.usr.rw ]; then
    3.27 -$i		/bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
    3.28 +$i		if [ -x bin/funionfs ]; then
    3.29 +$i			/bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other -o suid,dev NONE /usr
    3.30 +$i		else
    3.31 +$i			/bin/mount -t aufs -o br:/.usr.ro:/.usr.rw none /usr
    3.32 +$i		fi
    3.33  $i	fi
    3.34  $i	status
    3.35  $i fi
    3.36 @@ -78,12 +82,14 @@
    3.37  post_install()
    3.38  {
    3.39      set_patch "$1"
    3.40 -    if [ ! -x $1/bin/funionfs ]; then
    3.41 +    if [ ! -x $1/bin/funionfs -a ! -d $1/var/lib/tazpkg/installed/aufs ]; then
    3.42          cat <<EOF
    3.43  ----
    3.44  You will build a live CD with /usr mounted read-only.
    3.45 -You can install funionfs to have read-write access into /usr with:
    3.46 +You can install aufs or funionfs to have read-write access into /usr with:
    3.47  
    3.48 +# tazpkg get-install aufs
    3.49 +or
    3.50  # tazpkg get-install funionfs
    3.51  
    3.52  EOF
     4.1 --- a/slitaz-loram/stuff/loram.rootfs	Wed Dec 17 14:47:20 2008 +0000
     4.2 +++ b/slitaz-loram/stuff/loram.rootfs	Wed Dec 17 15:09:01 2008 +0000
     4.3 @@ -22,15 +22,18 @@
     4.4  done
     4.5  echo "$(du -hs ./usr/.moved | cut -f1) have been moved into /usr"
     4.6  echo "$(du -hs ./usr | cut -f1) were used by /usr before compression"
     4.7 +usr=usr
     4.8  if [ -x usr/bin/mkcromfs ]; then
     4.9    usr/bin/mkcromfs -qq -f 262144 -b 16384 usr .usr.cromfs
    4.10  else
    4.11    usr/sbin/mksquashfs usr .usr.sqfs
    4.12  fi
    4.13 +if [ -x bin/funionfs -o -d /var/lib/tazpkg/installed/aufs ]; then
    4.14 +  mkdir .usr.rw .usr.ro
    4.15 +  usr=.usr.ro
    4.16 +fi
    4.17  if [ -x bin/funionfs -o -x usr/bin/mkcromfs ]; then
    4.18 -  mkdir .usr.ro
    4.19 -  ln -s /.usr.ro/lib/$(cd usr/lib ; ls libfuse.so.2.*) lib/libfuse.so.2
    4.20 -  [ -x bin/funionfs ] && mkdir .usr.rw
    4.21 +  ln -s /$usr/lib/$(cd usr/lib ; ls libfuse.so.2.*) lib/libfuse.so.2
    4.22  fi
    4.23  rm -rf usr
    4.24  mkdir usr