wok view slitaz-loram-cdrom/stuff/loram.rootfs @ rev 898
slitaz-loram*: move zlib for module-init-tools
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Jun 12 11:55:27 2008 +0000 (2008-06-12) |
parents | a3a3c2bac53d |
children | 1c1dad96a8f3 |
line source
1 echo "$(du -hs /usr | cut -f1) were used by /usr"
2 mv ./usr/lib/libz.so* ./lib
3 for ii in /sbin /lib /bin; do
4 mkdir -p ./usr/.moved$ii
5 for j in e2fsprogs pcmciautils cpio syslinux-extra isapnptools ncurses \
6 libcap; do
7 for k in $(grep -s ^$ii /var/lib/tazpkg/installed/$j/files.list) ; do
8 [ -f .$k ] || continue
9 mv .$k ./usr/.moved$k
10 ln -s /usr/.moved$k .$k
11 done
12 done
13 done
14 k="$(ls /lib/lib[rp]*.so)"
15 [ -x /bin/funionfs ] && k="$(ls /lib/libresolv*.so)"
16 for ii in /var/lib/tazpkg/installed /lib/modules/*/kernel/drivers/net \
17 /lib/modules/*/kernel/sound /sbin/depmod /sbin/modinfo /bin/lsmod \
18 /lib/libns*.so $k; do
19 [ -L .$ii ] && continue
20 j=$(dirname /usr/.moved$ii)
21 mkdir -p .$j
22 mv .$ii .$j
23 ln -s /usr/.moved$ii .$ii
24 done
25 echo "$(du -hs ./usr/.moved | cut -f1) have been moved into /usr"
26 usr=usr
27 if [ -x bin/funionfs -o -x usr/bin/mkcromfs ]; then
28 usr=.usr.ro
29 mkdir .usr.ro .usr.rw
30 ln -s /.usr.ro/lib/$(cd usr/lib ; ls libfuse.so.2.*) lib/libfuse.so.2
31 fi
32 if [ -x usr/bin/mkcromfs ]; then
33 usr/bin/mkcromfs -qq -f 262144 -b 16384 usr ../rootcd/usr.cromfs
34 rm -rf usr
35 mkdir usr
36 for ii in unmkcromfs cromfs-driver ; do
37 mv bin/$ii ../rootcd
38 ln -s /cdrom/$ii bin/$ii
39 done
40 elif [ -x usr/sbin/mksquashfs ]; then
41 usr/sbin/mksquashfs usr ../rootcd/usr.sqfs
42 rm -rf usr
43 mkdir usr
44 else
45 mv usr ../rootcd
46 [ "$usr" = "usr" ] || mv $usr usr
47 ln -s /cdrom/usr $usr
48 fi
49 if [ -d ../rootcd/usr/lib ]; then
50 for ii in *; do
51 case "$ii" in
52 usr|boot) continue;;
53 mnt|media|sys|proc|cdrom) mkdir ../rootcd/$ii;;
54 *) cp -a $ii ../rootcd/$ii;;
55 esac
56 done
57 for ii in keymap.conf locale.conf resolv.conf TZ motd; do
58 ln -s /tmp/$ii ../rootcd/etc
59 done
60 for ii in log run lock; do
61 mv ../rootcd/var/$ii ../rootcd/var/$ii.ORG
62 ln -s /tmp/$ii ../rootcd/var
63 done
64 mv ../rootcd/root ../rootcd/root.ORG
65 ln -s /tmp ../rootcd/root
66 ln -s / ../rootcd/media/cdrom
67 mkdir ../rootcd/mnt/target
68 sed -i 's/CLEAN_UP_SYSTEM="yes"/CLEAN_UP_SYSTEM="no"/' ../rootcd/etc/rcS.conf
69 sed -i 's/RUN_DAEMONS=.*/RUN_DAEMONS=""/' ../rootcd/etc/rcS.conf
70 for ii in ../rootcd/boot/isolinux/*.cfg; do
71 cat $ii | awk '{ print } /append/ { printf "label loram\n\tkernel /boot/bzImage\n\tappend ro sound=noconf screen=text %s %s %s\n",$5,$6,$7 }' > $ii.tmp
72 mv -f $ii.tmp $ii
73 done
74 cat >> ../rootcd/boot/isolinux/enopts.txt <<EOT
75 With few RAM, you can use loram entry with the cdrom device; example:
76 boot: loram root=/dev/hdc
77 EOT
78 cat >> ../rootcd/boot/isolinux/options.txt <<EOT
79 Avec peu de RAM, utilisez l'entrée loram en précisant le cdrom, exemple:
80 boot: loram root=/dev/hdc
81 EOT
82 fi
83 for ii in bin/vcsa2txt bin/awk bin/script bin/cut bin/readlink bin/du bin/free; do
84 ln -s busybox $ii
85 done
86 mkdir cdrom
87 COMPRESSION="gzip"