# HG changeset patch # User Pascal Bellard # Date 1582988126 -3600 # Node ID 562a49ca00d98b619e04029c547a82be721e6ffc # Parent 45eaacc1faf86288c9b5d164620f464ed3f4f3b0 Add geninitramfs & busybox-net (again) diff -r 45eaacc1faf8 -r 562a49ca00d9 base-tiny/stuff/dev/vcs --- a/base-tiny/stuff/dev/vcs Fri Feb 28 18:25:15 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -vcs0 \ No newline at end of file diff -r 45eaacc1faf8 -r 562a49ca00d9 base-tiny/stuff/dev/vcsa --- a/base-tiny/stuff/dev/vcsa Fri Feb 28 18:25:15 2020 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -vcsa0 \ No newline at end of file diff -r 45eaacc1faf8 -r 562a49ca00d9 base-tiny/stuff/etc/init.d/rcS --- a/base-tiny/stuff/etc/init.d/rcS Fri Feb 28 18:25:15 2020 +0100 +++ b/base-tiny/stuff/etc/init.d/rcS Sat Feb 29 15:55:26 2020 +0100 @@ -1,23 +1,11 @@ #!/bin/sh -# /etc/init.d/rcS - Initial boot script for SliTaz GNU/Linux. -# Config file is : /etc/rcS.conf -# -# rcS is the main initialization script used to check fs, mount, clean, -# run scripts and start daemons. -# . /etc/init.d/rc.functions . /etc/rcS.conf - -# Set TZ and boot time. [ -s /etc/TZ ] && export TZ="$(cat /etc/TZ)" - echo "Processing /etc/init.d/rcS..." - -# Mount /proc. echo -n "Mounting proc filesystem..." mount proc status - if [ "$EARLY_RUN_SCRIPTS" ]; then echo "Executing early initialization scripts..." for script in $EARLY_RUN_SCRIPTS @@ -25,8 +13,6 @@ [ -x /etc/init.d/$script ] && /etc/init.d/$script done fi - -# Load all modules listed in config file. if [ "$LOAD_MODULES" ]; then echo -n "Loading modules..." depmod @@ -38,32 +24,15 @@ status [ "$KEEP_MODULES" ] || rm -rf /lib/modules 2> /dev/null fi - -# Mount /sys. echo -n "Mounting sys filesystem..." mount sysfs status - if [ -e /sbin/mdev ]; then echo -n "Start hotplug..." echo /sbin/mdev > /proc/sys/kernel/hotplug mdev -s status fi - -echo -n "Updating /dev..." -for i in /sys/block/*/dev /sys/block/*/*/dev ; do - [ -s "$i" ] || continue - n=${i%/dev} - n=/dev/${n##*/} - [ -e $n ] && continue - echo -n " ${n##*/}" - mknod $n b $(sed 's/:/ /' < $i) -done -status - -# Before mounting filesystems we check fs specified in the file -# /etc/rcS.conf and variable $CHECK_FS. if [ "$CHECK_FS" ]; then mount -o remount,ro / for i in $CHECK_FS @@ -72,20 +41,11 @@ e2fsck -p $i done fi - -# Remount rootfs rw. echo "Remounting rootfs read/write..." mount -o remount,rw / - -# Mount filesystems in /etc/fstab. echo "Mounting filesystems in fstab..." mount -a - -# Store boot messages to log files. dmesg > /var/log/dmesg.log & - -# Parse cmdline args for earlier boot options. All other boot options -# are in /etc/init./bootopts.sh. echo -n "Searching for early boot options..." for opt in $(cat /proc/cmdline) do @@ -99,8 +59,6 @@ esac done status - -# Clean up the system. if [ "$CLEAN_UP_SYSTEM" = "yes" ]; then echo -n "Cleaning up the system..." find /var/run -name "*.pid" -type f | xargs rm -f @@ -112,9 +70,6 @@ echo -n "Keeping all tmp and pid files..." status fi - -# Create /dev/cdrom if needed (symlink does not exist on LiveCD). -# Also add /dev/cdrom to fstab if entry does not exist. if [ "$CDROM" ]; then DRIVE_NAME=${CDROM#/dev/} else @@ -133,9 +88,6 @@ >> /etc/fstab status fi - -# Handle kernel cmdline parameter config=, to source a -# disk init script if [ "$CONFIG" ]; then DEVICE=${CONFIG%,*} SCRIPT=${CONFIG#*,} @@ -158,15 +110,11 @@ fi status fi - -# Mount /proc/bus/usb. if [ -d /proc/bus/usb ]; then echo -n "Mounting /proc/bus/usb filesystem..." mount -t usbfs usbfs /proc/bus/usb status fi - -# Start syslogd and klogd. if [ "$KERNEL_LOG_DAEMONS" = "yes" ]; then echo -n "Starting system log deamon: syslogd..." syslogd -s $SYSLOGD_ROTATED_SIZE && status @@ -175,23 +123,18 @@ else echo "Kernel log daemons are disabled in /etc/rc.conf..." fi - [ -d /usr/share/kmap ] && echo -n "Load keymap..." && cat /usr/share/kmap/* | { /bin/loadkmap 2>/dev/null || loadkmap; } && rm -rf /usr/share/kmap && status - -# Start all scripts specified with $RUN_SCRIPTS. +echo -n "Setting hostname..." +hostname -F /etc/hostname +status echo "Executing all initialization scripts..." for script in $RUN_SCRIPTS do [ -x /etc/init.d/$script ] && /etc/init.d/$script done - -# Re-source main config file. In Live mode, daemons list can be modified -# by boot options (screen=text will remove slim). . /etc/rcS.conf - -# Start all daemons specified with $RUN_DAEMONS. echo "Starting all daemons specified in /etc/rcS.conf..." for daemon in $RUN_DAEMONS do @@ -199,8 +142,6 @@ /etc/init.d/$daemon start fi done - -# Reset screen and display a bold message. if [ "$MESSAGE" ]; then reset echo -e "\033[1m$MESSAGE\033[0m" diff -r 45eaacc1faf8 -r 562a49ca00d9 busybox-net/receipt --- a/busybox-net/receipt Fri Feb 28 18:25:15 2020 +0100 +++ b/busybox-net/receipt Sat Feb 29 15:55:26 2020 +0100 @@ -77,7 +77,7 @@ { mkdir $fs/bin $fs/boot cp -a $src/_install/bin/busybox $fs/bin - for i in /bin/sh /bin/login /bin/false /init ; do + for i in /bin/sh /bin/login /bin/false /sbin/dev /init ; do ln -f $fs/bin/busybox $fs$i done mkdir -p $fs/etc/init.d diff -r 45eaacc1faf8 -r 562a49ca00d9 busybox/receipt --- a/busybox/receipt Fri Feb 28 18:25:15 2020 +0100 +++ b/busybox/receipt Sat Feb 29 15:55:26 2020 +0100 @@ -76,7 +76,7 @@ cp -a $WOK/base-tiny/stuff/. $fs/ cp -a $src/_install/lib $fs/ cp -a $src/_install/bin/busybox $fs/bin - for i in /bin/sh /bin/login /bin/false ; do + for i in /bin/sh /bin/login /bin/false /sbin/mdev /init ; do ln $fs/bin/busybox $fs$i done mkdir -p $fs/etc/init.d @@ -90,15 +90,13 @@ ln -s daemon $fs/etc/init.d/$i done sed -i 's|network.sh ||' $fs/etc/rcS.conf - sed -i 's|.*Executing all initialization scripts|echo -n "Setting hostname..."\ + sed -i 's|.*Executing all initialization scripts.*|echo -n "Setting hostname..."\ hostname -F /etc/hostname\ status\n&|' $fs/etc/init.d/rcS rm -f $fs/etc/init.d/network.sh $fs/etc/network.conf \ $fs/etc/services $fs/etc/networks $fs/etc/inetd.conf \ $fs/etc/host.conf $fs/etc/hosts - ln -f $fs/bin/busybox $fs/init - sed -i '2,$s/^#.*//;/^$/d' $fs/etc/init.d/rc* $fs/etc/init.d/daemon \ $fs/etc/init.d/*.sh sed -i 's/^#.*//;/^$/d' $fs/etc/*.conf $fs/etc/*tab \ diff -r 45eaacc1faf8 -r 562a49ca00d9 geninitramfs/stuff/geninitramfs --- a/geninitramfs/stuff/geninitramfs Fri Feb 28 18:25:15 2020 +0100 +++ b/geninitramfs/stuff/geninitramfs Sat Feb 29 15:55:26 2020 +0100 @@ -1,6 +1,6 @@ #!/bin/sh -mkdir -p /boot/fs$$/bin /boot/fs$$/lib /boot/fs$$/proc /boot/fs$$/mnt +mkdir -p /boot/fs$$/bin /boot/fs$$/lib /boot/fs$$/proc /boot/fs$$/sys /boot/fs$$/mnt cp -dpR /lib/modules /boot/fs$$/lib cp -p /bin/busybox /boot/fs$$/bin ln /boot/fs$$/bin/busybox /boot/fs$$/bin/sh @@ -13,15 +13,24 @@ #!/bin/sh mount -t proc /proc /proc +mount -t sysfs /sys /sys echo -n "Loading modules..." for mod in $LOAD_MODULES; do echo -n " \${mod%%|*}" modprobe \${mod//|/ } done echo -mount \$(blkid | sed "/${1:-\$root}/!d;s|: .*||") /mnt +mdev -s +root=\$(sed '/root=/!d;s|.*root=\\([^ ]*\\).*|\\1|;s|/|\\\\/|g' /proc/cmdline) +case "$1" in +/dev/*) set -- $1 ;; +*) set -- \$(blkid | sed "/${1:-\$root}/!d;s|: .*||;q") ;; +esac +echo "Mounting \$1 ..." +mount \$1 /mnt +umount /sys umount /proc -switch_root /mnt /init +exec switch_root /mnt /init EOT chmod 755 /boot/fs$$/init ( cd /boot/fs$$ ; find * | cpio -o -H newc ) | gzip -9 > /boot/rootfs.gz