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