slitaz-boot-scripts rev 465

init: do not load module twice
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Aug 15 10:56:01 2020 +0000 (2020-08-15)
parents fc5989c03379
children a53219934611
files init
line diff
     1.1 --- a/init	Sat Jul 25 08:40:08 2020 +0000
     1.2 +++ b/init	Sat Aug 15 10:56:01 2020 +0000
     1.3 @@ -118,6 +118,8 @@
     1.4  
     1.5  mod() {
     1.6  	for i in $@; do
     1.7 +		grep -q "^$i\\W" /proc/modules && continue
     1.8 +		grep -q "\\W$i\$" /proc/filesystems && continue
     1.9  		echo "Loading module: $i"
    1.10  		modprobe $i 2>/dev/null ||
    1.11  		for j in $(find /lib/modules /mnt/.fs*/lib/modules|sed "/\/$i.ko/!d" 2> /dev/null); do
    1.12 @@ -286,7 +288,7 @@
    1.13  		esac
    1.14  	done || fail 3mSkipped
    1.15  quit
    1.16 -grep -q squashfs /proc/filesystems || mod squashfs 2>/dev/null || exit
    1.17 +mod squashfs 2>/dev/null || exit
    1.18  msg aufs
    1.19  br=/mnt/.rw
    1.20  mkdir $br /mnt/.wd
    1.21 @@ -313,7 +315,7 @@
    1.22  	busybox mount -o ro -t squashfs /dev/loop$((l++)) /mnt/.$fs
    1.23  done
    1.24  while read type opt; do
    1.25 -	grep -q $type /proc/filesystems || mod $type || continue
    1.26 +	mod $type || continue
    1.27  	busybox mount -t $type -o $opt none /mnt && break
    1.28  done <<EOT
    1.29  aufs		br=$br$r