wok view slitaz-loram-cdrom/receipt @ rev 251
Add: slitaz-loram-cdrom
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Feb 22 14:36:45 2008 +0100 (2008-02-22) |
parents | |
children | 3a5e92c048e0 |
line source
1 # SliTaz package receipt.
3 PACKAGE="slitaz-loram-cdrom"
4 VERSION="1.0"
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 cat > $fs/etc/tazlito/loram.rootfs << EOF
14 echo "\$(du -hs /usr | cut -f1) were used by /usr"
15 for ii in /sbin /lib /bin; do
16 mkdir -p ./usr/.moved\$ii
17 for j in e2fsprogs pcmciautils cpio syslinux-extra isapnptools ncurses; do
18 for k in \$(grep ^\$ii /var/lib/tazpkg/installed/\$j/files.list) ; do
19 [ -f .\$k ] || continue
20 mv .\$k ./usr/.moved\$k
21 ln -s /usr/.moved\$k .\$k
22 done
23 done
24 done
25 for ii in /var/lib/tazpkg/installed ; do
26 j=\$(dirname /usr/.moved\$ii)
27 mkdir -p .\$j
28 mv .\$ii .\$j
29 ln -s /usr/.moved\$ii .\$ii
30 done
31 echo "\$(du -hs /usr/.moved | cut -f1) have been moved into /usr"
32 if [ -x usr/sbin/mksquashfs ]; then
33 usr/sbin/mksquashfs usr ../rootcd/usr.sqfs
34 rm -rf usr
35 mkdir usr
36 else
37 mv usr ../rootcd
38 ln -s /cdrom/usr usr
39 ln -s /bin ../rootcd/bin
40 fi
41 mkdir cdrom
42 COMPRESSION="gzip"
43 EOF
44 }
46 get_patch()
47 {
48 cat <<EOF
49 --- /etc/init.d/rcS
50 +++ /etc/init.d/rcS
51 @@ -54,4 +54,4 @@
52 #
53 -DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
54 -if [ ! "`readlink /dev/cdrom`" ]; then
55 +DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | busybox cut -f 3`
56 +if [ ! "`busybox readlink /dev/cdrom`" ]; then
57 echo -n "Creating symlink : /dev/cdrom..."
58 @@ -69,2 +69,12 @@
60 +# Mount /usr
61 +if [ -d /cdrom ]; then
62 + echo -n "Mounting /usr read-only from /cdrom... "
63 + /bin/mount -o ro -t iso9660 /dev/cdrom /cdrom
64 + if [ -f /cdrom/usr.sqfs ]; then
65 + /bin/mount -o loop,ro -t squashfs /cdrom/usr.sqfs /usr
66 + fi
67 + status
68 +fi
69 +
70 # Handle kernel cmdline parameter modprobe=<module_list>
71 EOF
72 }
74 # Pre and post install commands for Tazpkg.
75 pre_install()
76 {
77 local $loram
78 loram=$(cd /var/lib/tazpkg/installed ; ls -d slitaz-loram* 2> /dev/null)
79 [ -n "$loram" ] && yes y | tazpkg remove $loram
80 }
82 post_install()
83 {
84 get_patch | patch -p0
85 }
87 # Pre remove commands for Tazpkg.
88 pre_remove()
89 {
90 get_patch | patch -R -p0
91 }