wok diff slitaz-loram-cdrom/receipt @ rev 370

Slitaz-loram*: more flexible
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Mar 08 11:30:12 2008 +0000 (2008-03-08)
parents 3a5e92c048e0
children 1408dfa76481
line diff
     1.1 --- a/slitaz-loram-cdrom/receipt	Sat Mar 01 12:55:33 2008 +0000
     1.2 +++ b/slitaz-loram-cdrom/receipt	Sat Mar 08 11:30:12 2008 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="slitaz-loram-cdrom"
     1.7 -VERSION="1.0"
     1.8 +VERSION="1.1"
     1.9  CATEGORY="misc"
    1.10  SHORT_DESC="Rules to build low ram system using cdrom."
    1.11  MAINTAINER="pascal.bellard@slitaz.org"
    1.12 @@ -10,44 +10,55 @@
    1.13  genpkg_rules()
    1.14  {
    1.15      mkdir -p $fs/etc/tazlito
    1.16 -    cp stuff/loram.rootfs $fs/etc/tazlito
    1.17 +    cp stuff/loram.* $fs/etc/tazlito
    1.18  }
    1.19  
    1.20  get_patch()
    1.21  {
    1.22 +    local tag
    1.23 +    local line
    1.24 +    local i
    1.25 +    tag="Handle kernel cmdline parameter config"
    1.26 +    i=$(grep -n "$tag" /etc/init.d/rcS | cut -d: -f1)
    1.27 +    i=$(($i-1))
    1.28 +    tag=$(grep "$tag" /etc/init.d/rcS)
    1.29 +    if [ "$1" = "-R" ]; then
    1.30 +    	line="-$(($i-24)),26 +$(($i-24)),2"
    1.31 +	i="-"
    1.32 +    else
    1.33 +    	line="-$i,2 +$i,26"
    1.34 +	i="+"
    1.35 +    fi
    1.36      cat <<EOF
    1.37  --- /etc/init.d/rcS
    1.38  +++ /etc/init.d/rcS
    1.39 -@@ -53,4 +53,4 @@
    1.40 - /bin/dmesg > /var/log/dmesg.log
    1.41 --/usr/bin/vcsa2txt < /dev/vcsa1 > /var/log/boot.log
    1.42 --/usr/bin/script -a -q -c '/etc/init.d/rcS logged' /var/log/boot.log
    1.43 -+busybox vcsa2txt < /dev/vcsa1 > /var/log/boot.log
    1.44 -+busybox script -a -q -c '/etc/init.d/rcS logged' /var/log/boot.log
    1.45 +@@ $line @@
    1.46   
    1.47 -@@ -62,4 +62,4 @@
    1.48 - #
    1.49 --DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
    1.50 --if [ ! "`readlink /dev/cdrom`" ]; then
    1.51 -+DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | busybox cut -f 3`
    1.52 -+if [ ! "`busybox readlink /dev/cdrom`" ]; then
    1.53 - 	echo -n "Creating symlink : /dev/cdrom..."
    1.54 -@@ -87,2 +87,15 @@
    1.55 - 
    1.56 -+# Mount /usr
    1.57 -+if [ -d /cdrom ]; then
    1.58 -+	echo -n "Mounting /usr read-only from /cdrom... "
    1.59 -+	mount -o ro -t iso9660 /dev/cdrom /cdrom
    1.60 -+	if [ -f /cdrom/usr.sqfs ]; then
    1.61 -+		mount -o loop,ro -t squashfs /cdrom/usr.sqfs /usr
    1.62 -+	elif [ ! -L /usr ]; then
    1.63 -+		umount /cdrom
    1.64 -+		false
    1.65 -+	fi
    1.66 -+	status 
    1.67 -+fi
    1.68 -+
    1.69 - # Handle kernel cmdline parameter config=<device>,<path> to source a 
    1.70 +$i# Mount /usr
    1.71 +$i if [ -d /cdrom ]; then
    1.72 +$i	mount -o ro -t iso9660 /dev/cdrom /cdrom
    1.73 +$i	if [ -d /.usr.rw -a -x /bin/funionfs ]; then
    1.74 +$i		echo -n "Mounting /usr read-write... "
    1.75 +$i		usr=.usr.ro
    1.76 +$i	else
    1.77 +$i		echo -n "Mounting /usr read-only... "
    1.78 +$i		usr=usr
    1.79 +$i	fi
    1.80 +$i	if [ -f /cdrom/usr.cromfs ]; then
    1.81 +$i		/bin/cromfs-driver /cdrom/usr.cromfs /\$usr
    1.82 +$i	elif [ -f /cdrom/usr.sqfs ]; then
    1.83 +$i		mount -o loop,ro -t squashfs /cdrom/usr.sqfs /\$usr
    1.84 +$i	elif [ ! -L /\$usr ]; then
    1.85 +$i		umount /cdrom
    1.86 +$i		false
    1.87 +$i	fi
    1.88 +$i	status 
    1.89 +$i	if [ -d /.usr.rw -a -x /bin/funionfs ]; then
    1.90 +$i		/bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other NONE /usr
    1.91 +$i	fi
    1.92 +$i fi
    1.93 +$i
    1.94 + $tag
    1.95  EOF
    1.96  }
    1.97  
    1.98 @@ -67,5 +78,5 @@
    1.99  # Pre remove commands for Tazpkg.
   1.100  pre_remove()
   1.101  {
   1.102 -    [ -L /usr/bin/patch ] || get_patch | patch -R -p0
   1.103 +    get_patch -R | patch -p0
   1.104  }