wok-4.x annotate slitaz-loram/receipt @ rev 371
slitaz-loram*: add post-install message
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Sat Mar 08 11:57:03 2008 +0000 (2008-03-08) |
parents | fc9f573e8ac8 |
children | 526c779c9331 |
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@371 | 66 if [ ! -x /bin/funionfs ]; then |
pascal@371 | 67 cat <<EOF |
pascal@371 | 68 You will build a live CD with /usr mounted read-only. |
pascal@371 | 69 You can install funionfs to have read-write acces du /usr with: |
pascal@371 | 70 # tazpkg get-install funionfs |
pascal@371 | 71 EOF |
pascal@371 | 72 fi |
pascal@229 | 73 } |
pascal@229 | 74 |
pascal@229 | 75 # Pre remove commands for Tazpkg. |
pascal@229 | 76 pre_remove() |
pascal@229 | 77 { |
pascal@370 | 78 get_patch -R | patch -p0 |
pascal@229 | 79 } |