wok-next annotate slitaz-loram/receipt @ rev 465
Fix grsync-batch (use sh not bash)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Mar 20 14:59:14 2008 +0100 (2008-03-20) |
parents | be1ec018b4bd |
children | 1c1dad96a8f3 |
rev | line source |
---|---|
pascal@229 | 1 # SliTaz package receipt. |
pascal@229 | 2 |
pascal@229 | 3 PACKAGE="slitaz-loram" |
pascal@369 | 4 VERSION="1.2" |
pascal@229 | 5 CATEGORY="misc" |
pascal@229 | 6 SHORT_DESC="Rules to build low ram rootfs.gz." |
pascal@229 | 7 MAINTAINER="pascal.bellard@slitaz.org" |
pascal@369 | 8 DEPENDS="cromfs" |
pankso@422 | 9 WEB_SITE="http://www.slitaz.org/" |
pascal@229 | 10 |
pascal@229 | 11 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@229 | 12 genpkg_rules() |
pascal@229 | 13 { |
pascal@229 | 14 mkdir -p $fs/etc/tazlito |
pascal@370 | 15 cp stuff/loram.* $fs/etc/tazlito |
pascal@229 | 16 } |
pascal@229 | 17 |
pascal@377 | 18 set_patch() |
pascal@229 | 19 { |
pascal@370 | 20 local tag |
pascal@370 | 21 local line |
pascal@370 | 22 local i |
pascal@370 | 23 tag="Creat /dev/cdrom if needed" |
pascal@375 | 24 i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1) |
pascal@370 | 25 i=$(($i-1)) |
pascal@375 | 26 tag=$(grep "$tag" $1/etc/init.d/rcS) |
pascal@375 | 27 if [ "$2" = "-R" ]; then |
pascal@389 | 28 line="-$(($i-21)),23 +$(($i-21)),2" |
pascal@370 | 29 i="-" |
pascal@370 | 30 else |
pascal@389 | 31 grep -q 'from slitaz-loram package' $1/etc/init.d/rcS && return |
pascal@389 | 32 line="-$i,2 +$i,23" |
pascal@370 | 33 i="+" |
pascal@370 | 34 fi |
pascal@377 | 35 patch -p0 <<EOF |
pascal@375 | 36 --- $1/etc/init.d/rcS |
pascal@375 | 37 +++ $1/etc/init.d/rcS |
pascal@370 | 38 @@ $line @@ |
pascal@229 | 39 |
pascal@389 | 40 $i# Mount compressed /usr (from slitaz-loram package) |
pascal@389 | 41 $i if [ -f /.usr.cromfs -o -f /.usr.sqfs ]; then |
pascal@389 | 42 $i usr=usr |
pascal@389 | 43 $i echo -n "Mounting /usr read-" |
pascal@370 | 44 $i if [ -d /.usr.rw ]; then |
pascal@389 | 45 $i usr=.usr.ro |
pascal@389 | 46 $i echo -n "write... " |
pascal@389 | 47 $i else |
pascal@389 | 48 $i echo -n "only... " |
pascal@389 | 49 $i fi |
pascal@389 | 50 $i if [ -f /.usr.cromfs ]; then |
pascal@389 | 51 $i /bin/cromfs-driver /.usr.cromfs /\$usr |
pascal@389 | 52 $i else |
pascal@389 | 53 $i /bin/mount -o loop,ro -t squashfs /.usr.sqfs /\$usr |
pascal@389 | 54 $i fi |
pascal@389 | 55 $i if [ -d /.usr.rw ]; then |
pascal@370 | 56 $i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other NONE /usr |
pascal@370 | 57 $i fi |
pascal@370 | 58 $i status |
pascal@370 | 59 $i fi |
pascal@370 | 60 $i |
pascal@370 | 61 $tag |
pascal@229 | 62 EOF |
pascal@375 | 63 chmod 0755 $1/etc/init.d/rcS |
pascal@229 | 64 } |
pascal@229 | 65 |
pascal@229 | 66 # Pre and post install commands for Tazpkg. |
pascal@251 | 67 pre_install() |
pascal@251 | 68 { |
pascal@380 | 69 local i |
pascal@389 | 70 . /etc/tazlito/tazlito.conf |
pascal@380 | 71 for i in $(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null); do |
pascal@380 | 72 [ "$i" = "$PACKAGE" ] && continue |
pascal@380 | 73 yes y | tazpkg remove $i |
pascal@389 | 74 rm -f $PACKAGES_REPOSITORY/slitaz-boot-scripts-*.tazpkg 2> /dev/null |
pascal@380 | 75 done |
pascal@251 | 76 } |
pascal@251 | 77 |
pascal@229 | 78 post_install() |
pascal@229 | 79 { |
pascal@395 | 80 set_patch "$1" |
pascal@371 | 81 if [ ! -x /bin/funionfs ]; then |
pascal@371 | 82 cat <<EOF |
pascal@389 | 83 ---- |
pascal@371 | 84 You will build a live CD with /usr mounted read-only. |
pascal@389 | 85 You can install funionfs to have read-write access into /usr with: |
pascal@389 | 86 |
pascal@371 | 87 # tazpkg get-install funionfs |
pascal@389 | 88 |
pascal@371 | 89 EOF |
pascal@371 | 90 fi |
pascal@229 | 91 } |
pascal@229 | 92 |
pascal@229 | 93 # Pre remove commands for Tazpkg. |
pascal@229 | 94 pre_remove() |
pascal@229 | 95 { |
pascal@377 | 96 set_patch '' -R |
pascal@229 | 97 } |