wok view 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 |
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-loram"
4 VERSION="1.2"
5 CATEGORY="misc"
6 SHORT_DESC="Rules to build low ram rootfs.gz."
7 MAINTAINER="pascal.bellard@slitaz.org"
8 DEPENDS="cromfs"
10 # Rules to gen a SliTaz package suitable for Tazpkg.
11 genpkg_rules()
12 {
13 mkdir -p $fs/etc/tazlito
14 cp stuff/loram.* $fs/etc/tazlito
15 }
17 get_patch()
18 {
19 local tag
20 local line
21 local i
22 tag="Creat /dev/cdrom if needed"
23 i=$(grep -n "$tag" /etc/init.d/rcS | cut -d: -f1)
24 i=$(($i-1))
25 tag=$(grep "$tag" /etc/init.d/rcS)
26 if [ "$1" = "-R" ]; then
27 line="-$(($i-13)),15 +$(($i-13)),2"
28 i="-"
29 else
30 line="-$i,2 +$i,15"
31 i="+"
32 fi
33 cat <<EOF
34 --- /etc/init.d/rcS
35 +++ /etc/init.d/rcS
36 @@ $line @@
38 $i# Mount compressed /usr
39 $i if [ -f /.usr.cromfs ]; then
40 $i if [ -d /.usr.rw ]; then
41 $i echo -n "Mounting compressed /usr read-write... "
42 $i /bin/cromfs-driver /.usr.cromfs /.usr.ro
43 $i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other NONE /usr
44 $i else
45 $i echo -n "Mounting compressed /usr read-only... "
46 $i /bin/cromfs /.usr.cromfs /usr
47 $i fi
48 $i status
49 $i fi
50 $i
51 $tag
52 EOF
53 }
55 # Pre and post install commands for Tazpkg.
56 pre_install()
57 {
58 local $loram
59 loram=$(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null)
60 [ -n "$loram" ] && yes y | tazpkg remove $loram
61 }
63 post_install()
64 {
65 get_patch | patch -p0
66 if [ ! -x /bin/funionfs ]; then
67 cat <<EOF
68 You will build a live CD with /usr mounted read-only.
69 You can install funionfs to have read-write acces du /usr with:
70 # tazpkg get-install funionfs
71 EOF
72 fi
73 }
75 # Pre remove commands for Tazpkg.
76 pre_remove()
77 {
78 get_patch -R | patch -p0
79 }