wok rev 780

slitaz-loram-cdrom: loram boot entry to start 12Mb ram machines
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon May 12 20:37:29 2008 +0000 (2008-05-12)
parents a0effbd54b58
children 017c0ef52bdb
files slitaz-loram-cdrom/receipt slitaz-loram-cdrom/stuff/loram.extract slitaz-loram-cdrom/stuff/loram.rootfs
line diff
     1.1 --- a/slitaz-loram-cdrom/receipt	Mon May 12 18:38:56 2008 +0200
     1.2 +++ b/slitaz-loram-cdrom/receipt	Mon May 12 20:37:29 2008 +0000
     1.3 @@ -87,6 +87,31 @@
     1.4  $i
     1.5   $tag
     1.6  EOF
     1.7 +    tag="/var/log/dmesg.log"
     1.8 +    i=$(grep -n "$tag" $1/etc/init.d/rcS | cut -d: -f1)
     1.9 +    i=$(($i-1))
    1.10 +    tag=$(grep "$tag" $1/etc/init.d/rcS)
    1.11 +    if [ "$2" = "-R" ]; then
    1.12 +    	line="-$(($i-7)),9 +$(($i-7)),2"
    1.13 +	i="-"
    1.14 +    else
    1.15 +    	line="-$i,2 +$i,9"
    1.16 +	i="+"
    1.17 +    fi
    1.18 +    patch -p0 <<EOF
    1.19 +--- $1/etc/init.d/rcS
    1.20 ++++ $1/etc/init.d/rcS
    1.21 +@@ $line @@
    1.22 + 
    1.23 +$i# Build ramdisk if root=/dev/cdrom (from slitaz-loram-cdrom package)
    1.24 +$i if [ -L /root ]; then
    1.25 +$i	mount -t tmpfs ramdisk /tmp
    1.26 +$i	mkdir -p /tmp/log/lighttpd /tmp/run /tmp/lock
    1.27 +$i	chown www.www /tmp/log/lighttpd
    1.28 +$i fi
    1.29 +$i
    1.30 + $tag
    1.31 +EOF
    1.32      chmod 0755 $1/etc/init.d/rcS
    1.33  }
    1.34  
     2.1 --- a/slitaz-loram-cdrom/stuff/loram.extract	Mon May 12 18:38:56 2008 +0200
     2.2 +++ b/slitaz-loram-cdrom/stuff/loram.extract	Mon May 12 20:37:29 2008 +0000
     2.3 @@ -30,3 +30,14 @@
     2.4  	done
     2.5  	rm -rf usr/.moved
     2.6  fi
     2.7 +if [ -L root ]; then
     2.8 +	rm -f etc/keymap.conf etc/locale.conf etc/resolv.conf etc/TZ etc/motd
     2.9 +	[ -d var/log.ORG  ] && mv -f var/log.ORG  var/log
    2.10 +	[ -d var/run.ORG  ] && mv -f var/run.ORG  var/run
    2.11 +	[ -d var/lock.ORG ] && mv -f var/lock.ORG var/lock
    2.12 +	[ -d root.ORG     ] && mv -f root.ORG     root
    2.13 +	rm -f media/cdrom
    2.14 +	rmdir mnt/target
    2.15 +	sed -i 's/CLEAN_UP_SYSTEM="no"/CLEAN_UP_SYSTEM="yes"/' etc/rcS.conf
    2.16 +	sed -i 's/RUN_DAEMONS="/RUN_DAEMONS="slim /' etc/rcS.conf
    2.17 +fi
     3.1 --- a/slitaz-loram-cdrom/stuff/loram.rootfs	Mon May 12 18:38:56 2008 +0200
     3.2 +++ b/slitaz-loram-cdrom/stuff/loram.rootfs	Mon May 12 20:37:29 2008 +0000
     3.3 @@ -44,8 +44,31 @@
     3.4    mv usr ../rootcd
     3.5    [ "$usr" = "usr" ] || mv $usr usr
     3.6    ln -s /cdrom/usr $usr
     3.7 -  ln -s /bin ../rootcd/bin
     3.8  fi
     3.9 +for ii in *; do
    3.10 +  case "$ii" in
    3.11 +  usr|boot) continue;;
    3.12 +  mnt|media|sys|proc|cdrom) mkdir ../rootcd/$ii;;
    3.13 +  *) cp -a $ii ../rootcd/$ii;;
    3.14 +  esac
    3.15 +done
    3.16 +for ii in keymap.conf locale.conf resolv.conf TZ motd; do
    3.17 +  ln -s /tmp/$ii ../rootcd/etc
    3.18 +done
    3.19 +for ii in log run lock; do
    3.20 +  mv ../rootcd/var/$ii ../rootcd/var/$ii.ORG
    3.21 +  ln -s /tmp/$ii ../rootcd/var
    3.22 +done
    3.23 +mv ../rootcd/root ../rootcd/root.ORG
    3.24 +ln -s /tmp ../rootcd/root
    3.25 +ln -s / ../rootcd/media/cdrom
    3.26 +mkdir ../rootcd/mnt/target
    3.27 +sed -i 's/CLEAN_UP_SYSTEM="yes"/CLEAN_UP_SYSTEM="no"/' ../rootcd/etc/rcS.conf
    3.28 +sed -i 's/RUN_DAEMONS="slim /RUN_DAEMONS="/' ../rootcd/etc/rcS.conf
    3.29 +for ii in ../rootcd/boot/isolinux/*.cfg; do
    3.30 +  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
    3.31 +  mv -f $ii.tmp $ii
    3.32 +done
    3.33  for ii in bin/vcsa2txt bin/awk bin/script bin/cut bin/readlink ; do
    3.34    ln -s busybox $ii
    3.35  done