wok-current rev 17049

busyboot-boot: use devtmpfs
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Aug 20 16:27:39 2014 +0200 (2014-08-20)
parents 95ae6a87842c
children d303e26dcea3
files busybox-boot/receipt busybox/stuff/busybox-1.22.config-static
line diff
     1.1 --- a/busybox-boot/receipt	Wed Aug 20 12:40:53 2014 +0200
     1.2 +++ b/busybox-boot/receipt	Wed Aug 20 16:27:39 2014 +0200
     1.3 @@ -38,7 +38,7 @@
     1.4  		mknod -m 660 $fs/usr/share/boot/dev/ttyS0 c 4 64
     1.5  	fi
     1.6  	cat > $fs/usr/share/boot/init <<EOT
     1.7 -#!/bin/sh
     1.8 +#!/bin/busybox sh
     1.9  
    1.10  export PATH=/bin
    1.11  export HOME=/
    1.12 @@ -58,21 +58,7 @@
    1.13  
    1.14  mkdir /tmp /mnt /proc /etc
    1.15  mount -t proc none /proc
    1.16 -while read name major minor ; do
    1.17 -	for i in '' 1 2 3 4 5 6 7 8 9 ; do
    1.18 -		mknod -m 644 /dev/\$name\$i b \$major \$((\$i + \$minor))
    1.19 -	done
    1.20 -done <<EOM
    1.21 -loop	7	0
    1.22 -hda	3	0
    1.23 -hdb	3	64
    1.24 -hdc	22	0
    1.25 -hdd	22	64
    1.26 -sda	8	0
    1.27 -sdb	8	16
    1.28 -sdc	8	32
    1.29 -sdd	8	48
    1.30 -EOM
    1.31 +mount -t devtmpfs none /dev
    1.32  
    1.33  arg()
    1.34  {
    1.35 @@ -85,22 +71,20 @@
    1.36  [ -n "\$(sed 's/\$/ /;s/^/ /;/ ro /!d' /proc/cmdline)" ] && ro="-o ro"
    1.37  [ -n "\$(sed 's/\$/ /;s/^/ /;/ rw /!d' /proc/cmdline)" ] && ro="-o rw"
    1.38  arg root && root="\$(echo \$root | sed 's|/|\\\\/|g')" &&
    1.39 -	mount \$ro \$(busybox blkid | sed "s/\"//g;/\$root/!d;s/:.*//;q") /mnt
    1.40 -arg loopfs && busybox losetup /dev/loop /mnt/\$root && mount /dev/loop /mnt
    1.41 +	root="\$(busybox blkid | sed "s/\"//g;/\$root/!d;s/:.*//;q")" &&
    1.42 +	[ -n "\$root" ] && mount \$ro \$root /mnt
    1.43 +arg loopfs && busybox losetup /dev/loop0 /mnt/\$root && mount /dev/loop0 /mnt
    1.44  arg subroot && cp /bin/busybox /mnt/\$root/dev/shm &&
    1.45  	chroot="\$root/dev/shm/busybox chroot \$root"
    1.46 -busybox [ -x /mnt/\$root/\$init ] && exec busybox switch_root mnt \$chroot \$init
    1.47 -
    1.48 -for i in \$(busybox --list) ; do ln /bin/busybox /bin/\$i 2> /dev/null ; done
    1.49 +busybox [ -x /mnt/\$root/\$init ] && umount /dev && umount /proc && exec busybox switch_root mnt \$chroot \$init
    1.50  
    1.51  [ -d /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb
    1.52  while read type dir ; do
    1.53  	grep -qs \$type /proc/filesystems || continue
    1.54 -	mkdir \$dir
    1.55 +	[ -d "\$dir" ] || mkdir \$dir
    1.56  	mount -t \$type none \$dir
    1.57  done <<EOM
    1.58  sysfs		/sys
    1.59 -devtmpfs	/dev
    1.60  devpts		/dev/pts
    1.61  EOM
    1.62  
    1.63 @@ -110,14 +94,10 @@
    1.64  	$jslinux && echo 'stty -F $TTY rows 30 2>/dev/null' >> $fs/usr/share/boot/init
    1.65  	cat >> $fs/usr/share/boot/init <<EOT
    1.66  
    1.67 -[ -x /bin/udhcpc ] && udhcpc -b -s /init
    1.68 +udhcpc -b -s /init
    1.69  while true; do
    1.70  	busybox | sed '/Current/,\$!d'
    1.71 -	if [ -x /bin/setsid ]; then
    1.72 -		setsid sh -c "exec sh <\$TTY >\$TTY 2>&1"
    1.73 -	else
    1.74 -		sh <\$TTY >\$TTY 2>&1
    1.75 -	fi
    1.76 +	setsid sh -c "exec sh <\$TTY >\$TTY 2>&1"
    1.77  done
    1.78  EOT
    1.79  	chmod +x $fs/usr/share/boot/init
     2.1 --- a/busybox/stuff/busybox-1.22.config-static	Wed Aug 20 12:40:53 2014 +0200
     2.2 +++ b/busybox/stuff/busybox-1.22.config-static	Wed Aug 20 16:27:39 2014 +0200
     2.3 @@ -1,7 +1,7 @@
     2.4  #
     2.5  # Automatically generated make config: don't edit
     2.6  # Busybox version: 1.22.0
     2.7 -# Wed Jan  1 19:33:26 2014
     2.8 +# Wed Aug 20 14:19:25 2014
     2.9  #
    2.10  CONFIG_HAVE_DOT_CONFIG=y
    2.11  
    2.12 @@ -47,8 +47,8 @@
    2.13  # CONFIG_FEATURE_SUID_CONFIG is not set
    2.14  # CONFIG_FEATURE_SUID_CONFIG_QUIET is not set
    2.15  # CONFIG_SELINUX is not set
    2.16 -# CONFIG_FEATURE_PREFER_APPLETS is not set
    2.17 -CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
    2.18 +CONFIG_FEATURE_PREFER_APPLETS=y
    2.19 +CONFIG_BUSYBOX_EXEC_PATH="/bin/busybox"
    2.20  # CONFIG_FEATURE_SYSLOG is not set
    2.21  # CONFIG_FEATURE_HAVE_RPC is not set
    2.22  
    2.23 @@ -486,10 +486,10 @@
    2.24  #
    2.25  # Linux Ext2 FS Progs
    2.26  #
    2.27 -# CONFIG_CHATTR is not set
    2.28 +CONFIG_CHATTR=y
    2.29  # CONFIG_FSCK is not set
    2.30 -# CONFIG_LSATTR is not set
    2.31 -# CONFIG_FATATTR is not set
    2.32 +CONFIG_LSATTR=y
    2.33 +CONFIG_FATATTR=y
    2.34  # CONFIG_TUNE2FS is not set
    2.35  
    2.36  #
    2.37 @@ -616,7 +616,7 @@
    2.38  #
    2.39  CONFIG_FEATURE_VOLUMEID_BTRFS=y
    2.40  # CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
    2.41 -# CONFIG_FEATURE_VOLUMEID_EXFAT is not set
    2.42 +CONFIG_FEATURE_VOLUMEID_EXFAT=y
    2.43  CONFIG_FEATURE_VOLUMEID_EXT=y
    2.44  # CONFIG_FEATURE_VOLUMEID_F2FS is not set
    2.45  CONFIG_FEATURE_VOLUMEID_FAT=y
    2.46 @@ -631,7 +631,7 @@
    2.47  # CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
    2.48  # CONFIG_FEATURE_VOLUMEID_REISERFS is not set
    2.49  # CONFIG_FEATURE_VOLUMEID_ROMFS is not set
    2.50 -# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
    2.51 +CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
    2.52  # CONFIG_FEATURE_VOLUMEID_SYSV is not set
    2.53  # CONFIG_FEATURE_VOLUMEID_UDF is not set
    2.54  # CONFIG_FEATURE_VOLUMEID_XFS is not set
    2.55 @@ -1005,8 +1005,8 @@
    2.56  CONFIG_SH_MATH_SUPPORT=y
    2.57  # CONFIG_SH_MATH_SUPPORT_64 is not set
    2.58  CONFIG_FEATURE_SH_EXTRA_QUIET=y
    2.59 -# CONFIG_FEATURE_SH_STANDALONE is not set
    2.60 -# CONFIG_FEATURE_SH_NOFORK is not set
    2.61 +CONFIG_FEATURE_SH_STANDALONE=y
    2.62 +CONFIG_FEATURE_SH_NOFORK=y
    2.63  # CONFIG_FEATURE_SH_HISTFILESIZE is not set
    2.64  
    2.65  #