wok view slitaz-loram-cdrom/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-cdrom"
4 VERSION="1.1"
5 CATEGORY="misc"
6 SHORT_DESC="Rules to build low ram system using cdrom."
7 MAINTAINER="pascal.bellard@slitaz.org"
9 # Rules to gen a SliTaz package suitable for Tazpkg.
10 genpkg_rules()
11 {
12 mkdir -p $fs/etc/tazlito
13 cp stuff/loram.* $fs/etc/tazlito
14 }
16 get_patch()
17 {
18 local tag
19 local line
20 local i
21 tag="Handle kernel cmdline parameter config"
22 i=$(grep -n "$tag" /etc/init.d/rcS | cut -d: -f1)
23 i=$(($i-1))
24 tag=$(grep "$tag" /etc/init.d/rcS)
25 if [ "$1" = "-R" ]; then
26 line="-$(($i-24)),26 +$(($i-24)),2"
27 i="-"
28 else
29 line="-$i,2 +$i,26"
30 i="+"
31 fi
32 cat <<EOF
33 --- /etc/init.d/rcS
34 +++ /etc/init.d/rcS
35 @@ $line @@
37 $i# Mount /usr
38 $i if [ -d /cdrom ]; then
39 $i mount -o ro -t iso9660 /dev/cdrom /cdrom
40 $i if [ -d /.usr.rw -a -x /bin/funionfs ]; then
41 $i echo -n "Mounting /usr read-write... "
42 $i usr=.usr.ro
43 $i else
44 $i echo -n "Mounting /usr read-only... "
45 $i usr=usr
46 $i fi
47 $i if [ -f /cdrom/usr.cromfs ]; then
48 $i /bin/cromfs-driver /cdrom/usr.cromfs /\$usr
49 $i elif [ -f /cdrom/usr.sqfs ]; then
50 $i mount -o loop,ro -t squashfs /cdrom/usr.sqfs /\$usr
51 $i elif [ ! -L /\$usr ]; then
52 $i umount /cdrom
53 $i false
54 $i fi
55 $i status
56 $i if [ -d /.usr.rw -a -x /bin/funionfs ]; then
57 $i /bin/funionfs -o dirs=/.usr.ro=RO:/.usr.rw -o allow_other NONE /usr
58 $i fi
59 $i fi
60 $i
61 $tag
62 EOF
63 }
65 # Pre and post install commands for Tazpkg.
66 pre_install()
67 {
68 local $loram
69 loram=$(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null)
70 [ -n "$loram" ] && yes y | tazpkg remove $loram
71 }
73 post_install()
74 {
75 get_patch | patch -p0
76 if [ ! -x /bin/funionfs ]; then
77 cat <<EOF
78 You will build a live CD with /usr mounted read-only.
79 You can install funionfs to have read-write acces du /usr with:
80 # tazpkg get-install funionfs
81 EOF
82 fi
83 }
85 # Pre remove commands for Tazpkg.
86 pre_remove()
87 {
88 get_patch -R | patch -p0
89 }