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