wok diff slitaz-loram-http/receipt @ rev 14966

Up: firefox-langpack-es_ES (17.0.8esr)
author Dominique Corbex <domcox@slitaz.org>
date Thu Aug 08 22:19:56 2013 +0200 (2013-08-08)
parents 3cdfaefe3387
children f4c22f009037
line diff
     1.1 --- a/slitaz-loram-http/receipt	Wed May 12 14:10:24 2010 +0200
     1.2 +++ b/slitaz-loram-http/receipt	Thu Aug 08 22:19:56 2013 +0200
     1.3 @@ -1,12 +1,12 @@
     1.4  # SliTaz package receipt.
     1.5  
     1.6  PACKAGE="slitaz-loram-http"
     1.7 -VERSION="1.6"
     1.8 +VERSION="2.0"
     1.9  CATEGORY="misc"
    1.10  SHORT_DESC="Rules to build low ram system using http."
    1.11  MAINTAINER="pascal.bellard@slitaz.org"
    1.12  WEB_SITE="http://www.slitaz.org/"
    1.13 -DEPENDS="slitaz-boot-scripts tazlito httpfs-fuse funionfs"
    1.14 +DEPENDS=""
    1.15  
    1.16  # Rules to gen a SliTaz package suitable for Tazpkg.
    1.17  genpkg_rules()
    1.18 @@ -14,165 +14,3 @@
    1.19      mkdir -p $fs/etc/tazlito
    1.20      cp stuff/loram.* $fs/etc/tazlito
    1.21  }
    1.22 -
    1.23 -set_patch()
    1.24 -{
    1.25 -    local tag
    1.26 -    local line
    1.27 -    local len
    1.28 -    local i
    1.29 -    tag="Handle kernel cmdline parameter config"
    1.30 -    i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1)
    1.31 -    i=$(($i-1))
    1.32 -    len=89
    1.33 -    tag=$(grep "$tag" $1/etc/init.d/rcS)
    1.34 -    if [ "$2" = "-R" ]; then
    1.35 -    	line="-$(($i-$len+2)),$len +$(($i-$len+2)),2"
    1.36 -	i="-"
    1.37 -    else
    1.38 -        grep -q 'from slitaz-loram-http package' $1/etc/init.d/rcS && return
    1.39 -    	line="-$i,2 +$i,$len"
    1.40 -	i="+"
    1.41 -    fi
    1.42 -    busybox patch -p0 <<EOF
    1.43 ---- $1/etc/init.d/rcS
    1.44 -+++ $1/etc/init.d/rcS
    1.45 -@@ $line @@
    1.46 - 
    1.47 -$i# Try to release http link (from slitaz-loram-http package)
    1.48 -$i release_http()
    1.49 -$i {
    1.50 -$i	FREEMEM=\$(free | awk '{ n = \$NF } END { print n }')	
    1.51 -$i	if [ \$FREEMEM -gt \$(du -s \$FS | awk '{ print \$1+40000 }') ]; then
    1.52 -$i		status
    1.53 -$i		if ! grep -q " keep-loram" /proc/cmdline &&
    1.54 -$i		    [ -d \$FS -o \$FREEMEM -gt \$(du -s \$FS | \\
    1.55 -$i			awk '{ print (\$1*4)+40000 }') ]; then
    1.56 -$i			echo -n "Extracting loram..."
    1.57 -$i			. /etc/tazlito/loram.extract /cdrom
    1.58 -$i			if status; then
    1.59 -$i				umount /cdrom && umount /cdrom
    1.60 -$i				rmdir /cdrom
    1.61 -$i				yes y | tazpkg remove slitaz-loram-http > /dev/null
    1.62 -$i				return 0
    1.63 -$i			fi
    1.64 -$i		fi
    1.65 -$i		echo -n "Loading /usr in memory..."
    1.66 -$i		cp -a \$FS /.usr.fs
    1.67 -$i		status
    1.68 -$i		echo -n "Releasing HTTP link..."
    1.69 -$i		umount /cdrom && umount /cdrom
    1.70 -$i		FS=/.usr.fs
    1.71 -$i		if [ -d \$FS ]; then
    1.72 -$i			rm -f /\$usr
    1.73 -$i			mv \$FS /usr
    1.74 -$i		fi
    1.75 -$i	fi
    1.76 -$i	return 1
    1.77 -$i }
    1.78 -$i
    1.79 -$i# Mount /usr (from slitaz-loram-http package)
    1.80 -$i while [ -d /cdrom ]; do
    1.81 -$i	/etc/init.d/network.sh
    1.82 -$i	RUN_SCRIPTS="\$(echo \$RUN_SCRIPTS | sed 's/network.sh//')"
    1.83 -$i	release=\$(cat /etc/slitaz-release)
    1.84 -$i	iso1=iso/\$release/flavors/slitaz-\$release-loram-cdrom.iso
    1.85 -$i	iso2=iso/\$release/flavors/slitaz-loram-cdrom.iso
    1.86 -$i	URLISO=http://mirror.slitaz.org/\$iso1,http://mirror.slitaz.org/\$iso2,http://download.tuxfamily.org/slitaz/\$iso1,http://download.tuxfamily.org/slitaz/\$iso2,http://slitaz.c3sl.ufpr.br/\$iso1,http://slitaz.c3sl.ufpr.br/\$iso2
    1.87 -$i	grep -q " urliso=" /proc/cmdline && URLISO=\$(cat /proc/cmdline | sed 's/.* urliso=\([^ ]*\).*/\1/'),\$URLISO
    1.88 -$i	for i in \$(echo \$URLISO | sed 's/,/ /g'); do
    1.89 -$i		/bin/httpfs \$i /cdrom && break
    1.90 -$i	done
    1.91 -$i	mount -o loop,ro /cdrom/*.iso /cdrom
    1.92 -$i	if [ -d /.usr.rw -a -x /bin/funionfs ]; then
    1.93 -$i		echo -n "Mounting /usr read-write... "
    1.94 -$i		usr=.usr.ro
    1.95 -$i	else
    1.96 -$i		echo -n "Mounting /usr read-only... "
    1.97 -$i		usr=usr
    1.98 -$i	fi
    1.99 -$i	FS=/cdrom/usr.cromfs
   1.100 -$i	if [ -f \$FS ]; then
   1.101 -$i		mkdir /\$usr
   1.102 -$i		ln -s /usr/.moved /.moved
   1.103 -$i		release_http && break
   1.104 -$i		/bin/cromfs-driver \$FS /\$usr -o ro,dev,suid,allow_other
   1.105 -$i	elif grep -q squashfs /etc/filesystems && [ -f /cdrom/usr.sqfs ]; then
   1.106 -$i		FS=/cdrom/usr.sqfs
   1.107 -$i		ln -s /usr/.moved /.moved
   1.108 -$i		mkdir /\$usr
   1.109 -$i		release_http && break
   1.110 -$i		mount -o loop,ro -t squashfs \$FS /\$usr
   1.111 -$i	elif grep -q squashfs /etc/filesystems && [ -f /cdrom/rootfs.gz ]; then
   1.112 -$i		FS=/cdrom/rootfs.gz
   1.113 -$i		ln -s /.rootfs /.moved
   1.114 -$i		mkdir /.rootfs
   1.115 -$i		release_http && break
   1.116 -$i		mount -o loop,ro -t squashfs \$FS /.rootfs
   1.117 -$i		ln -s /.rootfs/usr /\$usr
   1.118 -$i	elif [ -d /cdrom/usr ]; then
   1.119 -$i		FS=/cdrom/usr
   1.120 -$i		ln -s /usr/.moved /.moved
   1.121 -$i		rm -rf /\$usr && ln -s \$FS /\$usr
   1.122 -$i	else
   1.123 -$i		FS=/cdrom/fs/usr
   1.124 -$i		ln -s /cdrom/fs /.moved
   1.125 -$i		rm -rf /\$usr && ln -s \$FS /\$usr
   1.126 -$i	fi
   1.127 -$i	status 
   1.128 -$i	if [ -d /.usr.rw -a -x /bin/funionfs ]; then
   1.129 -$i		/bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other,nonempty -o suid,dev NONE /usr
   1.130 -$i	fi
   1.131 -$i	break
   1.132 -$i done
   1.133 -$i
   1.134 - $tag
   1.135 -EOF
   1.136 -    chmod 0755 $1/etc/init.d/rcS
   1.137 -}
   1.138 -
   1.139 -# Pre and post install commands for Tazpkg.
   1.140 -pre_install()
   1.141 -{
   1.142 -    local i
   1.143 -    for i in $(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null); do
   1.144 -        [ "$i" = "$PACKAGE" ] && continue
   1.145 -        yes y | tazpkg remove $i
   1.146 -        . /etc/tazlito/tazlito.conf
   1.147 -	rm -f $PACKAGES_REPOSITORY/slitaz-boot-scripts-*.tazpkg 2> /dev/null
   1.148 -    done
   1.149 -}
   1.150 -
   1.151 -post_install()
   1.152 -{
   1.153 -    set_patch "$1"
   1.154 -    
   1.155 -    # Don't support FAST_BOOT_X yet
   1.156 -    sed -i 's/FAST_BOOT_X=.*/FAST_BOOT_X="no"/' $1/etc/rcS.conf
   1.157 -    
   1.158 -    cat <<EOF
   1.159 -----
   1.160 -'tazlito gen-distro' will create a loram-http flavor 
   1.161 -while this package is installed.
   1.162 -EOF
   1.163 -    if [ ! -x $1/bin/funionfs ]; then
   1.164 -        cat <<EOF
   1.165 -----
   1.166 -You will build a live CD with /usr mounted read-only.
   1.167 -You can install funionfs to have read-write access into /usr with:
   1.168 -
   1.169 -# tazpkg get-install funionfs
   1.170 -
   1.171 -EOF
   1.172 -    fi
   1.173 -}
   1.174 -
   1.175 -# Pre remove commands for Tazpkg.
   1.176 -pre_remove()
   1.177 -{
   1.178 -    set_patch '' -R 
   1.179 -    cat <<EOF
   1.180 -----
   1.181 -'tazlito gen-distro' will work as expected now.
   1.182 -EOF
   1.183 -}