slitaz-modular rev 173

initramfs: Update initramfs.list. Add changes need for init script to work.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Jul 19 11:49:58 2012 +0000 (2012-07-19)
parents b227f5995c89
children 0b68eab7409c
files initramfs/etc/init.d/local.sh initramfs/etc/lighttpd/vhosts-local-tank.conf initramfs/init initramfs/initramfs.list
line diff
     1.1 --- a/initramfs/etc/init.d/local.sh	Thu Jul 19 11:48:23 2012 +0000
     1.2 +++ b/initramfs/etc/init.d/local.sh	Thu Jul 19 11:49:58 2012 +0000
     1.3 @@ -10,13 +10,26 @@
     1.4  [ -d /etc/pango ] || mkdir -p /etc/pango
     1.5  [ -d /etc/gtk-2.0 ] || mkdir -p /etc/gtk-2.0
     1.6  [ -x /usr/bin/pango-querymodules ] && /usr/bin/pango-querymodules > /etc/pango/pango.modules
     1.7 -[ -x /usr/bin/gdk-pixbuf-query-loaders ] && /usr/bin/gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders
     1.8 +[ -x /usr/bin/gdk-pixbuf-query-loaders ] && /usr/bin/gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders 
     1.9  [ -x /usr/bin/update-mime-database ] && update-mime-database /usr/share/mime
    1.10  
    1.11 +if [ -x /usr/bin/glib-compile-schemas ] && [ -d /usr/share/glib-2.0/schemas ]; then
    1.12 +	glib-compile-schemas /usr/share/glib-2.0/schemas
    1.13 +fi
    1.14  if [ -f /etc/local-mirror.conf ]; then
    1.15  	. /etc/local-mirror.conf
    1.16  	if [ ! $(grep -l "$PKGDIR" $LOCALSTATE/mirror) ]; then
    1.17  		[ -d $PKGDIR ] && echo "$PKGDIR" > $LOCALSTATE/mirror
    1.18  	fi
    1.19  fi
    1.20 +
    1.21 +if [ ! -d /home/slitaz/cooking ]; then
    1.22 +	mkdir -p /home/slitaz/cooking
    1.23 +	if [ -d /repos/flavors ]; then
    1.24 +		ln -sf /repos/flavors /home/slitaz/cooking/flavors
    1.25 +	fi
    1.26 +	if [ -d /packages ]; then
    1.27 +		ln -sf /packages /home/slitaz/cooking/packages
    1.28 +	fi
    1.29 +fi
    1.30  #[ -x /usr/bin/setup-live ] && /usr/bin/setup-live
     2.1 --- a/initramfs/etc/lighttpd/vhosts-local-tank.conf	Thu Jul 19 11:48:23 2012 +0000
     2.2 +++ b/initramfs/etc/lighttpd/vhosts-local-tank.conf	Thu Jul 19 11:49:58 2012 +0000
     2.3 @@ -243,6 +243,14 @@
     2.4    accesslog.filename = "/var/log/lighttpd/pizza.slitaz.org-access.log"
     2.5  }
     2.6  
     2.7 +# usbkey.slitaz.org
     2.8 +#
     2.9 +$HTTP["host"] =~ "usbkey\.slitaz\.org" {
    2.10 +  server.document-root = "/home/slitaz/www/usbkey"
    2.11 +  server.errorlog = "/var/log/lighttpd/usbkey.slitaz.org-error.log"
    2.12 +  accesslog.filename = "/var/log/lighttpd/usbkey.slitaz.org-access.log"
    2.13 +}
    2.14 +
    2.15  # piratebox.lan
    2.16  #
    2.17  $HTTP["host"] =~ "piratebox\.lan" {
     3.1 --- a/initramfs/init	Thu Jul 19 11:48:23 2012 +0000
     3.2 +++ b/initramfs/init	Thu Jul 19 11:49:58 2012 +0000
     3.3 @@ -2,7 +2,7 @@
     3.4  
     3.5  success()
     3.6  {
     3.7 -	cat > /tmp/init
     3.8 +	cat > /run/init
     3.9  	[ -d /proc/sys ] && umount /proc
    3.10  	echo -e "\\033[70G[ \\033[1;32mOK\\033[0;39m ]"
    3.11  	exit
    3.12 @@ -10,8 +10,7 @@
    3.13  
    3.14  launch_init()
    3.15  {
    3.16 -	mount --move /dev/pts /mnt/dev/pts
    3.17 -	mount --move /dev/shm /mnt/dev/shm
    3.18 +	mount --move /run /mnt/run
    3.19  	success <<EOT
    3.20  exec /sbin/switch_root mnt /sbin/init
    3.21  EOT
    3.22 @@ -68,6 +67,8 @@
    3.23  		fi
    3.24  		mount /dev/mapper/$dmlabel /mnt
    3.25  	fi
    3.26 +	grep -q subroot= /proc/cmdline && return
    3.27 +	grep -q loopfs= /proc/cmdline && return
    3.28  	if [ -d /mnt/etc ]; then
    3.29  		umount /sys
    3.30  		[ -n "$1" ] && for i in $@ ; do
    3.31 @@ -103,6 +104,7 @@
    3.32  	*raid0*)	modprobe raid0 ;;
    3.33  	*raid1*)	modprobe raid1 ;;
    3.34  	*raid[456]*)	modprobe raid456 ;;
    3.35 +	*mirror*)	modprobe dm-mirror ;;
    3.36  	esac
    3.37  done
    3.38  }
    3.39 @@ -110,14 +112,12 @@
    3.40  if [ "$1" != "logged" ]; then
    3.41  	mount -t devpts devpts /dev/pts
    3.42  	mount -t tmpfs tmpfs /dev/shm
    3.43 -	script -qc '/init logged' /dev/shm/boot.log
    3.44 -	. /tmp/init
    3.45 +	mount -t tmpfs tmpfs /run
    3.46 +	script -qc '/init logged' /run/boot.log
    3.47 +	. /run/init
    3.48  else
    3.49 -mountpoint -q /proc || mount -t proc proc /proc -o nosuid,noexec,nodev
    3.50 -mountpoint -q /sys  || mount -t sysfs sys /sys -o nosuid,noexec,nodev
    3.51 -mountpoint -q /run  || mount -t tmpfs run /run -o mode=0755,nosuid,nodev
    3.52 -mountpoint -q /dev  || mount -t devtmpfs dev /dev -o mode=0755,nosuid
    3.53 -
    3.54 +mount -t proc proc /proc
    3.55 +mount -t sysfs sysfs /sys
    3.56  if grep -q dmraid= /proc/cmdline; then
    3.57  	root="$(sed 's/.*dmraid=\([^ ]*\).*/\1/' < /proc/cmdline)"
    3.58  	echo -n "Switching / to dmraid $root..."
    3.59 @@ -181,17 +181,14 @@
    3.60  	subroot="/$(sed 's/.*subroot=\([^ ]*\).*/\1/' < /proc/cmdline)" &&
    3.61  	echo -n "Chrooting to $subroot..."
    3.62  	mount --move /dev/pts /mnt$subroot/dev/pts
    3.63 -	shm=$subroot/dev/shm
    3.64 -	mount --move /dev/shm /mnt$shm &&
    3.65 -	if mv /usr/share/boot/busybox-static /mnt$shm 2> /dev/null; then
    3.66 -		success <<EOT
    3.67 -exec /sbin/switch_root mnt $shm/busybox-static chroot $subroot /sbin/init
    3.68 +	run=$subroot/run
    3.69 +	mount --move /run /mnt$run
    3.70 +	cp $(LD_TRACE_LOADED_OBJECTS=1 /lib/ld*.so /usr/sbin/chroot | sed \
    3.71 +	     's|.*=> \(/lib/l[^ ]*\).*|\1|;/^\//!d') /usr/sbin/chroot /mnt$run
    3.72 +	success <<EOT
    3.73 +export LD_LIBRARY_PATH=$run:/lib
    3.74 +exec /sbin/switch_root mnt $run/$(cd /mnt$run ; ls ld-*) $run/chroot $subroot /sbin/init
    3.75  EOT
    3.76 -	else
    3.77 -		success <<EOT
    3.78 -exec chroot /mnt$subroot /sbin/init
    3.79 -EOT
    3.80 -	fi
    3.81  fi
    3.82  echo -n "Switching / to tmpfs"
    3.83  size="$(grep rootfssize= < /proc/cmdline | \
    3.84 @@ -199,8 +196,8 @@
    3.85  free=$(busybox free | busybox awk '/Mem:/ { print int(($4*100)/$3) }')
    3.86  umount /proc
    3.87  [ -n "$size" ] || size="-o size=90%"
    3.88 -echo "exec /sbin/init" > /tmp/init
    3.89 -if [ $free -lt 50 ] || ! mount -t tmpfs $size tmpfs /mnt; then
    3.90 +echo "exec /sbin/init" > /run/init
    3.91 +if [ $free -lt 100 ] || ! mount -t tmpfs $size tmpfs /mnt; then
    3.92  	echo -e "\\033[70G[ \\033[1;33mSkipped\\033[0;39m]"
    3.93  	exit
    3.94  fi
     4.1 --- a/initramfs/initramfs.list	Thu Jul 19 11:48:23 2012 +0000
     4.2 +++ b/initramfs/initramfs.list	Thu Jul 19 11:49:58 2012 +0000
     4.3 @@ -28,8 +28,8 @@
     4.4  linux-squashfs
     4.5  aufs
     4.6  aufs-utils
     4.7 -util-linux-ng-uuid
     4.8 -util-linux-ng-blkid
     4.9 +util-linux-uuid
    4.10 +util-linux-blkid
    4.11  pciids
    4.12  pciutils
    4.13  libusb