slitaz-boot-scripts rev 464

init: remove nr_inodes=0
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jul 25 08:40:08 2020 +0000 (2020-07-25)
parents 14a300e1bc9b
children f92ced20dc0d
files init
line diff
     1.1 --- a/init	Tue Jul 07 06:33:59 2020 +0000
     1.2 +++ b/init	Sat Jul 25 08:40:08 2020 +0000
     1.3 @@ -13,7 +13,7 @@
     1.4  # rootfssize= [RAMDISK]
     1.5  #         size of / regarding the RAM size, default 90%
     1.6  # rootfsinodes= [RAMDISK]
     1.7 -#         files count of / regarding the RAM size, default 0 (unlimited)
     1.8 +#         files count of / regarding the RAM size
     1.9  #
    1.10  ### Indirect mode ; an initramfs is used to mount root from the hard disk.
    1.11  ### Any rootfs should fit, minimum required is slitaz-base.
    1.12 @@ -120,7 +120,7 @@
    1.13  	for i in $@; do
    1.14  		echo "Loading module: $i"
    1.15  		modprobe $i 2>/dev/null ||
    1.16 -		for j in $(find /lib/modules|sed "/\/$i.ko/!d"); do
    1.17 +		for j in $(find /lib/modules /mnt/.fs*/lib/modules|sed "/\/$i.ko/!d" 2> /dev/null); do
    1.18  			busybox insmod $j && break
    1.19  		done
    1.20  	done
    1.21 @@ -269,12 +269,11 @@
    1.22  root=100
    1.23  got tmpram
    1.24  r=$root
    1.25 -inodes=0
    1.26 -got rootfsinodes && inodes=$root
    1.27 +got rootfsinodes && inodes=",nr_inodes=$root"
    1.28  root=90%
    1.29  got rootfssize
    1.30  [ $(busybox free|busybox awk '/Mem:/{print int(($4*100)/$3)}') -ge $r ] &&
    1.31 -	busybox mount -t tmpfs -o size=$root,nr_inodes=$inodes tmpfs /mnt &&
    1.32 +	busybox mount -t tmpfs -o size=$root$inodes tmpfs /mnt &&
    1.33  	export PATH=/mnt/bin:$PATH &&
    1.34  	for i in $(ls -a /); do
    1.35  		case "$i" in
    1.36 @@ -287,7 +286,7 @@
    1.37  		esac
    1.38  	done || fail 3mSkipped
    1.39  quit
    1.40 -mod squashfs 2>/dev/null || exit
    1.41 +grep -q squashfs /proc/filesystems || mod squashfs 2>/dev/null || exit
    1.42  msg aufs
    1.43  br=/mnt/.rw
    1.44  mkdir $br /mnt/.wd
    1.45 @@ -314,7 +313,8 @@
    1.46  	busybox mount -o ro -t squashfs /dev/loop$((l++)) /mnt/.$fs
    1.47  done
    1.48  while read type opt; do
    1.49 -	mod $type && busybox mount -t $type -o $opt none /mnt && break
    1.50 +	grep -q $type /proc/filesystems || mod $type || continue
    1.51 +	busybox mount -t $type -o $opt none /mnt && break
    1.52  done <<EOT
    1.53  aufs		br=$br$r
    1.54  overlayfs	workdir=/mnt/.wd${r/:/,lowerdir=},upperdir=$br