wok-next annotate slitaz-loram/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 | c570ed86d31a |
children | 1408dfa76481 |
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" |
pascal@229 | 9 |
pascal@229 | 10 # Rules to gen a SliTaz package suitable for Tazpkg. |
pascal@229 | 11 genpkg_rules() |
pascal@229 | 12 { |
pascal@229 | 13 mkdir -p $fs/etc/tazlito |
pascal@370 | 14 cp stuff/loram.* $fs/etc/tazlito |
pascal@229 | 15 } |
pascal@229 | 16 |
pascal@229 | 17 get_patch() |
pascal@229 | 18 { |
pascal@370 | 19 local tag |
pascal@370 | 20 local line |
pascal@370 | 21 local i |
pascal@370 | 22 tag="Creat /dev/cdrom if needed" |
pascal@370 | 23 i=$(grep -n "$tag" /etc/init.d/rcS | cut -d: -f1) |
pascal@370 | 24 i=$(($i-1)) |
pascal@370 | 25 tag=$(grep "$tag" /etc/init.d/rcS) |
pascal@370 | 26 if [ "$1" = "-R" ]; then |
pascal@370 | 27 line="-$(($i-13)),15 +$(($i-13)),2" |
pascal@370 | 28 i="-" |
pascal@370 | 29 else |
pascal@370 | 30 line="-$i,2 +$i,15" |
pascal@370 | 31 i="+" |
pascal@370 | 32 fi |
pascal@229 | 33 cat <<EOF |
pascal@229 | 34 --- /etc/init.d/rcS |
pascal@229 | 35 +++ /etc/init.d/rcS |
pascal@370 | 36 @@ $line @@ |
pascal@229 | 37 |
pascal@370 | 38 $i# Mount compressed /usr |
pascal@370 | 39 $i if [ -f /.usr.cromfs ]; then |
pascal@370 | 40 $i if [ -d /.usr.rw ]; then |
pascal@370 | 41 $i echo -n "Mounting compressed /usr read-write... " |
pascal@370 | 42 $i /bin/cromfs-driver /.usr.cromfs /.usr.ro |
pascal@370 | 43 $i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other NONE /usr |
pascal@370 | 44 $i else |
pascal@370 | 45 $i echo -n "Mounting compressed /usr read-only... " |
pascal@370 | 46 $i /bin/cromfs /.usr.cromfs /usr |
pascal@370 | 47 $i fi |
pascal@370 | 48 $i status |
pascal@370 | 49 $i fi |
pascal@370 | 50 $i |
pascal@370 | 51 $tag |
pascal@229 | 52 EOF |
pascal@229 | 53 } |
pascal@229 | 54 |
pascal@229 | 55 # Pre and post install commands for Tazpkg. |
pascal@251 | 56 pre_install() |
pascal@251 | 57 { |
pascal@251 | 58 local $loram |
pascal@251 | 59 loram=$(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null) |
pascal@251 | 60 [ -n "$loram" ] && yes y | tazpkg remove $loram |
pascal@251 | 61 } |
pascal@251 | 62 |
pascal@229 | 63 post_install() |
pascal@229 | 64 { |
pascal@229 | 65 get_patch | patch -p0 |
pascal@229 | 66 } |
pascal@229 | 67 |
pascal@229 | 68 # Pre remove commands for Tazpkg. |
pascal@229 | 69 pre_remove() |
pascal@229 | 70 { |
pascal@370 | 71 get_patch -R | patch -p0 |
pascal@229 | 72 } |