wok-tiny rev 160

Add geninitramfs & busybox-net (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Feb 29 15:55:26 2020 +0100 (5 months ago)
parents 45eaacc1faf8
children 424fb2c33d92
files base-tiny/stuff/dev/vcs base-tiny/stuff/dev/vcsa base-tiny/stuff/etc/init.d/rcS busybox-net/receipt busybox/receipt geninitramfs/stuff/geninitramfs
line diff
     1.1 --- a/base-tiny/stuff/dev/vcs	Fri Feb 28 18:25:15 2020 +0100
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,1 +0,0 @@
     1.4 -vcs0
     1.5 \ No newline at end of file
     2.1 --- a/base-tiny/stuff/dev/vcsa	Fri Feb 28 18:25:15 2020 +0100
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,1 +0,0 @@
     2.4 -vcsa0
     2.5 \ No newline at end of file
     3.1 --- a/base-tiny/stuff/etc/init.d/rcS	Fri Feb 28 18:25:15 2020 +0100
     3.2 +++ b/base-tiny/stuff/etc/init.d/rcS	Sat Feb 29 15:55:26 2020 +0100
     3.3 @@ -1,23 +1,11 @@
     3.4  #!/bin/sh
     3.5 -# /etc/init.d/rcS - Initial boot script for SliTaz GNU/Linux.
     3.6 -# Config file is : /etc/rcS.conf
     3.7 -#
     3.8 -# rcS is the main initialization script used to check fs, mount, clean,
     3.9 -# run scripts and start daemons.
    3.10 -#
    3.11  . /etc/init.d/rc.functions
    3.12  . /etc/rcS.conf
    3.13 -
    3.14 -# Set TZ and boot time.
    3.15  [ -s /etc/TZ ] && export TZ="$(cat /etc/TZ)"
    3.16 -
    3.17  echo "Processing /etc/init.d/rcS..."
    3.18 -
    3.19 -# Mount /proc.
    3.20  echo -n "Mounting proc filesystem..."
    3.21  mount proc
    3.22  status
    3.23 -
    3.24  if [ "$EARLY_RUN_SCRIPTS" ]; then
    3.25  	echo "Executing early initialization scripts..."
    3.26  	for script in $EARLY_RUN_SCRIPTS
    3.27 @@ -25,8 +13,6 @@
    3.28  		[ -x /etc/init.d/$script ] && /etc/init.d/$script
    3.29  	done
    3.30  fi
    3.31 -
    3.32 -# Load all modules listed in config file.
    3.33  if [ "$LOAD_MODULES" ]; then
    3.34  	echo -n "Loading modules..."
    3.35  	depmod
    3.36 @@ -38,32 +24,15 @@
    3.37  	status
    3.38  	[ "$KEEP_MODULES" ] || rm -rf /lib/modules 2> /dev/null
    3.39  fi
    3.40 -
    3.41 -# Mount /sys.
    3.42  echo -n "Mounting sys filesystem..."
    3.43  mount sysfs
    3.44  status
    3.45 -
    3.46  if [ -e /sbin/mdev ]; then
    3.47  	echo -n "Start hotplug..."
    3.48  	echo /sbin/mdev > /proc/sys/kernel/hotplug
    3.49  	mdev -s
    3.50  	status
    3.51  fi
    3.52 -
    3.53 -echo -n "Updating /dev..."
    3.54 -for i in /sys/block/*/dev /sys/block/*/*/dev ; do
    3.55 -	[ -s "$i" ] || continue
    3.56 -	n=${i%/dev}
    3.57 -	n=/dev/${n##*/}
    3.58 -	[ -e $n ] && continue
    3.59 -	echo -n " ${n##*/}"
    3.60 -	mknod $n b $(sed 's/:/ /' < $i)
    3.61 -done
    3.62 -status
    3.63 -
    3.64 -# Before mounting filesystems we check fs specified in the file
    3.65 -# /etc/rcS.conf and variable $CHECK_FS.
    3.66  if [ "$CHECK_FS" ]; then
    3.67  	mount -o remount,ro /
    3.68  	for i in $CHECK_FS
    3.69 @@ -72,20 +41,11 @@
    3.70  		e2fsck -p $i
    3.71  	done
    3.72  fi
    3.73 -
    3.74 -# Remount rootfs rw.
    3.75  echo "Remounting rootfs read/write..."
    3.76  mount -o remount,rw /
    3.77 -
    3.78 -# Mount filesystems in /etc/fstab.
    3.79  echo "Mounting filesystems in fstab..."
    3.80  mount -a
    3.81 -
    3.82 -# Store boot messages to log files.
    3.83  dmesg > /var/log/dmesg.log &
    3.84 -
    3.85 -# Parse cmdline args for earlier boot options. All other boot options
    3.86 -# are in /etc/init./bootopts.sh.
    3.87  echo -n "Searching for early boot options..."
    3.88  for opt in $(cat /proc/cmdline)
    3.89  do
    3.90 @@ -99,8 +59,6 @@
    3.91  	esac
    3.92  done
    3.93  status
    3.94 -
    3.95 -# Clean up the system.
    3.96  if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then
    3.97  	echo -n "Cleaning up the system..."
    3.98  	find /var/run -name "*.pid" -type f | xargs rm -f
    3.99 @@ -112,9 +70,6 @@
   3.100  	echo -n "Keeping all tmp and pid files..."
   3.101  	status
   3.102  fi
   3.103 -
   3.104 -# Create /dev/cdrom if needed (symlink does not exist on LiveCD).
   3.105 -# Also add /dev/cdrom to fstab if entry does not exist.
   3.106  if [  "$CDROM" ]; then
   3.107  	DRIVE_NAME=${CDROM#/dev/}
   3.108  else
   3.109 @@ -133,9 +88,6 @@
   3.110  		>> /etc/fstab
   3.111  	status
   3.112  fi
   3.113 -
   3.114 -# Handle kernel cmdline parameter config=<device>,<path> to source a
   3.115 -# disk init script
   3.116  if [ "$CONFIG" ]; then
   3.117  	DEVICE=${CONFIG%,*}
   3.118  	SCRIPT=${CONFIG#*,}
   3.119 @@ -158,15 +110,11 @@
   3.120  	fi
   3.121  	status
   3.122  fi
   3.123 -
   3.124 -# Mount /proc/bus/usb.
   3.125  if [ -d /proc/bus/usb ]; then
   3.126  	echo -n "Mounting /proc/bus/usb filesystem..."
   3.127  	mount -t usbfs usbfs /proc/bus/usb
   3.128  	status
   3.129  fi
   3.130 -
   3.131 -# Start syslogd and klogd.
   3.132  if [ "$KERNEL_LOG_DAEMONS" = "yes" ]; then
   3.133  	echo -n "Starting system log deamon: syslogd..."
   3.134  	syslogd -s $SYSLOGD_ROTATED_SIZE && status
   3.135 @@ -175,23 +123,18 @@
   3.136  else
   3.137  	echo "Kernel log daemons are disabled in /etc/rc.conf..."
   3.138  fi
   3.139 -
   3.140  [ -d /usr/share/kmap ] && echo -n "Load keymap..." &&
   3.141  cat /usr/share/kmap/* | { /bin/loadkmap 2>/dev/null || loadkmap; } &&
   3.142  rm -rf /usr/share/kmap && status
   3.143 -
   3.144 -# Start all scripts specified with $RUN_SCRIPTS.
   3.145 +echo -n "Setting hostname..."
   3.146 +hostname -F /etc/hostname
   3.147 +status
   3.148  echo "Executing all initialization scripts..."
   3.149  for script in $RUN_SCRIPTS
   3.150  do
   3.151  	[ -x /etc/init.d/$script ] && /etc/init.d/$script
   3.152  done
   3.153 -
   3.154 -# Re-source main config file. In Live mode, daemons list can be modified
   3.155 -# by boot options (screen=text will remove slim).
   3.156  . /etc/rcS.conf
   3.157 -
   3.158 -# Start all daemons specified with $RUN_DAEMONS.
   3.159  echo "Starting all daemons specified in /etc/rcS.conf..."
   3.160  for daemon in $RUN_DAEMONS
   3.161  do
   3.162 @@ -199,8 +142,6 @@
   3.163  		/etc/init.d/$daemon start
   3.164  	fi
   3.165  done
   3.166 -
   3.167 -# Reset screen and display a bold message.
   3.168  if [  "$MESSAGE" ]; then
   3.169  	reset
   3.170  	echo -e "\033[1m$MESSAGE\033[0m"
     4.1 --- a/busybox-net/receipt	Fri Feb 28 18:25:15 2020 +0100
     4.2 +++ b/busybox-net/receipt	Sat Feb 29 15:55:26 2020 +0100
     4.3 @@ -77,7 +77,7 @@
     4.4  {
     4.5      mkdir $fs/bin $fs/boot
     4.6      cp -a $src/_install/bin/busybox $fs/bin
     4.7 -    for i in /bin/sh /bin/login /bin/false /init ; do
     4.8 +    for i in /bin/sh /bin/login /bin/false /sbin/dev /init ; do
     4.9  	ln -f $fs/bin/busybox $fs$i
    4.10      done
    4.11      mkdir -p $fs/etc/init.d
     5.1 --- a/busybox/receipt	Fri Feb 28 18:25:15 2020 +0100
     5.2 +++ b/busybox/receipt	Sat Feb 29 15:55:26 2020 +0100
     5.3 @@ -76,7 +76,7 @@
     5.4  	cp -a $WOK/base-tiny/stuff/. $fs/
     5.5      cp -a $src/_install/lib $fs/
     5.6      cp -a $src/_install/bin/busybox $fs/bin
     5.7 -    for i in /bin/sh /bin/login /bin/false ; do
     5.8 +    for i in /bin/sh /bin/login /bin/false /sbin/mdev /init ; do
     5.9  	ln $fs/bin/busybox $fs$i
    5.10      done
    5.11      mkdir -p $fs/etc/init.d
    5.12 @@ -90,15 +90,13 @@
    5.13  	ln -s daemon $fs/etc/init.d/$i
    5.14      done
    5.15      sed -i 's|network.sh ||' $fs/etc/rcS.conf
    5.16 -    sed -i 's|.*Executing all initialization scripts|echo -n "Setting hostname..."\
    5.17 +    sed -i 's|.*Executing all initialization scripts.*|echo -n "Setting hostname..."\
    5.18  hostname -F /etc/hostname\
    5.19  status\n&|' $fs/etc/init.d/rcS
    5.20      rm -f $fs/etc/init.d/network.sh $fs/etc/network.conf \
    5.21  	$fs/etc/services $fs/etc/networks $fs/etc/inetd.conf \
    5.22  	$fs/etc/host.conf $fs/etc/hosts
    5.23  	
    5.24 -    ln -f $fs/bin/busybox $fs/init
    5.25 -
    5.26      sed -i '2,$s/^#.*//;/^$/d' $fs/etc/init.d/rc* $fs/etc/init.d/daemon \
    5.27  	$fs/etc/init.d/*.sh
    5.28      sed -i 's/^#.*//;/^$/d' $fs/etc/*.conf $fs/etc/*tab \
     6.1 --- a/geninitramfs/stuff/geninitramfs	Fri Feb 28 18:25:15 2020 +0100
     6.2 +++ b/geninitramfs/stuff/geninitramfs	Sat Feb 29 15:55:26 2020 +0100
     6.3 @@ -1,6 +1,6 @@
     6.4  #!/bin/sh
     6.5  
     6.6 -mkdir -p /boot/fs$$/bin /boot/fs$$/lib /boot/fs$$/proc /boot/fs$$/mnt
     6.7 +mkdir -p /boot/fs$$/bin /boot/fs$$/lib /boot/fs$$/proc /boot/fs$$/sys /boot/fs$$/mnt
     6.8  cp -dpR /lib/modules /boot/fs$$/lib
     6.9  cp -p /bin/busybox /boot/fs$$/bin
    6.10  ln /boot/fs$$/bin/busybox /boot/fs$$/bin/sh
    6.11 @@ -13,15 +13,24 @@
    6.12  #!/bin/sh
    6.13  
    6.14  mount -t proc /proc /proc
    6.15 +mount -t sysfs /sys /sys
    6.16  echo -n "Loading modules..."
    6.17  for mod in $LOAD_MODULES; do
    6.18  	echo -n " \${mod%%|*}"
    6.19  	modprobe \${mod//|/ }
    6.20  done
    6.21  echo
    6.22 -mount \$(blkid | sed "/${1:-\$root}/!d;s|: .*||") /mnt
    6.23 +mdev -s
    6.24 +root=\$(sed '/root=/!d;s|.*root=\\([^ ]*\\).*|\\1|;s|/|\\\\/|g' /proc/cmdline)
    6.25 +case "$1" in
    6.26 +/dev/*) set -- $1 ;;
    6.27 +*) set -- \$(blkid | sed "/${1:-\$root}/!d;s|: .*||;q") ;;
    6.28 +esac
    6.29 +echo "Mounting \$1 ..."
    6.30 +mount \$1 /mnt
    6.31 +umount /sys
    6.32  umount /proc
    6.33 -switch_root /mnt /init
    6.34 +exec switch_root /mnt /init
    6.35  EOT
    6.36  chmod 755 /boot/fs$$/init
    6.37  ( cd /boot/fs$$ ; find * | cpio -o -H newc ) | gzip -9 > /boot/rootfs.gz