load_sfs.sh + kernel 6+ (Solved: fixed itself)

Moderators: kirk, jamesbond, p310don, JakeSFR, step, Forum moderators

Post Reply
User avatar
stemsee
Posts: 779
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 185 times
Been thanked: 131 times

load_sfs.sh + kernel 6+ (Solved: fixed itself)

Post by stemsee »

I have noticed this problem for a few months, but I only realised today what is happening because I had to learn about aufs and mount -t squashfs -o loop ...etc

since compiling 6+ kernels, I couldn't load an sfs after boot. So today I looked at load_sfs.sh and changed one function then everything worked again.

Code: Select all

find_free_loop() {
	export FREELOOP=$(losetup -f | cut -f2 -d'p')
	#local in_use 
	#in_use=$(losetup -a | sed 's/:.*//; s|^.*/||' | tr '\n' '+')
	
	#FREELOOP=$RESERVED
	#while [ $FREELOOP -le $MAXLOOP ]; do
		#case "$in_use" in
			#*"loop${FREELOOP}+"*) 
				#FREELOOP=$((FREELOOP+1)); 
				#continue ;;
		#esac
		#break
	#done
}

It's not getting the free loop device correctly, my simple code gets it.

jamesbond
Posts: 717
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 124 times
Been thanked: 402 times

Re: load_sfs.sh + kernel 6+

Post by jamesbond »

Errr ... that works, but there is a reason why the complicated code exists.
We don't want to hog the loop devices less than 10.
That's why we test form 10, going upwards.

What is the failure, anyway?
Can you tell me what you see when you run "losetup -a" under kernel 6.x?

User avatar
stemsee
Posts: 779
Joined: Sun Jul 26, 2020 8:11 am
Location: lattitude 8
Has thanked: 185 times
Been thanked: 131 times

Re: load_sfs.sh + kernel 6+

Post by stemsee »

oh! .... i just did a pristine boot with peebee's 6.3 and no problem!

previously System SFS load reported unsuccessful using loop16 (that's when i changed the code and it used loop2) .... so i checked permissions for loop16, and was not the same as loop15, so my /dev/loop16 was corrupted! False alarm.....my apologies for not investigating fully in the first place!

jamesbond
Posts: 717
Joined: Tue Aug 11, 2020 3:02 pm
Location: The Pale Blue Dot
Has thanked: 124 times
Been thanked: 402 times

Re: load_sfs.sh + kernel 6+

Post by jamesbond »

No worries, glad to see it sorts itself out.

Post Reply

Return to “FatDog”