SFR wrote:Hmm, but if I additionally load more SFSes via sfs_load, I'm getting "Updating... layered filesystem next boot will be faster" every time I reboot
Phew, I think I have sorted it out eventually!
It was kinda conflict between
init and
sfs_load.
The "next boot will be faster" was triggered due to inconsistencies between PREVUNIONRECORD & LASTUNIONRECORD (see screenie).
It turned out to be a matter of changing the placement of
$ZFACTOR.
However some changes to
sfs_load were also necessary, to take into account the "shift" in numbering in
init.
Without these changes, new SFSes got mounted on restricted loops.
@Shino: please review the changes, if you could.
Both modified scipts (init & sfs_load) attached.
Btw, in initrd.gz additional
pup_ro10 dir should be created.
It's only for testing purposes, though, since there's no final decision in which way the problem with too low amount of loops will be solved (the final word belongs to Mick, I guess
).
Also, I did my best, but don't know the both scripts well enough to be 100% sure that my changes won't break something else.
And here are the individual diffs:
Code: Select all
--- old/init 2014-06-23 01:54:16.000000000 +0200
+++ new/init 2014-06-23 11:56:30.000000000 +0200
@@ -1679,11 +1679,12 @@
do
ONEBASE="`basename $ONEEXTRA`"
EXTRASFSLIST="${EXTRASFSLIST}${ONEBASE} " #construct list of actually used.
+ mknod -m664 /dev/loop${CNTLOOP} b 7 ${CNTLOOP}
losetup /dev/loop${CNTLOOP} $ONEEXTRA
mount -r -t squashfs -o noatime /dev/loop${CNTLOOP} /pup_ro${CNTLOOP}
[ $? -eq 0 ] && UMNTRO="${UMNTRO}:/pup_ro${CNTLOOP}=ro"
CNTLOOP=`expr $CNTLOOP + 1`
- [ $CNTLOOP -eq 10 ] && break
+ [ $CNTLOOP -eq 11 ] && break
#...only support adding 3 extra .sfs files, as performance degrades as each layer added.
#...v410 bugfix, change 6 to 7 so can have 3 sfs files.
#...w015 change 7 to 10 so can have 6 sfs files.
@@ -1694,7 +1695,7 @@
SAVEFILENAMEONLY="`basename $SAVEFILE`"
SFSFILE="`echo -n "$PUPSFS" | cut -f 3 -d ','`"
SFSFILENAMEONLY="`basename $SFSFILE`"
- RECORDLIST="$SAVEFILENAMEONLY $AFACTOR $YFACTOR $SFSFILENAMEONLY $EXTRASFSLIST $ZFACTOR" #v426
+ RECORDLIST="$SAVEFILENAMEONLY $AFACTOR $YFACTOR $ZFACTOR $SFSFILENAMEONLY $EXTRASFSLIST" #v426
NEWUNIONRECORD="`echo "$RECORDLIST" | tr -s ' ' | sed -e 's/ $//'`"
#120130 bring back Underdog Linux...
@@ -1739,6 +1740,7 @@
#sync
echo "LASTUNIONRECORD='$NEWUNIONRECORD'" >> /pup_rw/etc/rc.d/BOOTCONFIG
[ "$LASTUNIONRECORD" = "$NEWUNIONRECORD" ] && NEWUNIONRECORD="" #used below.
+
#...if layers changed since last boot, code further down will do whiteout files purge.
#.../etc/rc.d/rc.update reads BOOTCONFIG, updates menu (etc) if layers changed.
@@ -1941,6 +1943,7 @@
mkdir -p /pup_new/initrd/pup_ro7
mkdir -p /pup_new/initrd/pup_ro8
mkdir -p /pup_new/initrd/pup_ro9
+mkdir -p /pup_new/initrd/pup_ro10
mkdir -p /pup_new/initrd/pup_rw
mkdir -p /pup_new/initrd/pup_z
mkdir -p /pup_new/initrd/pup_a
Code: Select all
--- old/sfs_load 2014-06-09 16:37:50.000000000 +0200
+++ new/sfs_load 2014-06-23 17:59:32.000000000 +0200
@@ -1264,12 +1264,12 @@
# where to mount
NUMS=$(LANG=C df | grep '/initrd/pup_ro'| cut -d'%' -f2 | tr -dc '0-9\n'| sort -n)
N=$(echo "$NUMS" | tail -n 1)
- [ $N ] || N=3 # precaution
- [ $N -ge 3 ] || N=3 # pup_ro1 to 3 is reserved
+ [ $N ] || N=4 # precaution
+ [ $N -ge 4 ] || N=4 # pup_ro1 to 4 is reserved
NEW=$(($N + 1))
#v1.9.1: search lower
- if [ $NEW -gt 4 ]; then
- for I in $(seq 4 $N); do
+ if [ $NEW -gt 5 ]; then
+ for I in $(seq 5 $N); do
! (echo "$NUMS" | grep -qw "$I") && NEW=$I && break
done
fi
@@ -1278,8 +1278,8 @@
if [ ! -d "$MNTPNT" ]; then
# exceeds the number the Puppy supports
# search free number from the smaller
- S=$(seq 4 $N) # skip 1-3
- [ "$SNAPMERGEBUG" ] && [ $N -gt 9 ] && S="$(seq 4 9) $(seq 20 $N)" # skip 10-19
+ S=$(seq 5 $N) # skip 1-4
+ [ "$SNAPMERGEBUG" ] && [ $N -gt 10 ] && S="$(seq 5 9) $(seq 20 $N)" # skip 10-19
if [ $N -lt 100 ]; then
for I in $S; do
[ "$(echo "$NUMS" | grep -w "$I")" = "" ] && NEW=$I && break
@@ -1938,7 +1938,7 @@
elif [ -s "$MAXEXTRANUMSAVE" ]; then
MAXEXTRANUM=$(cat "$MAXEXTRANUMSAVE")
else
- MAXEXTRANUM=$(ls -1 -d /initrd/pup_ro*| grep -vw 'pup_ro[123]'|wc -l) # not exact. new directories may be createded after.
+ MAXEXTRANUM=$(ls -1 -d /initrd/pup_ro*| grep -vw 'pup_ro[1234]'|wc -l) # not exact. new directories may be createded after.
echo -n $MAXEXTRANUM > "$MAXEXTRANUMSAVE"
fi
[ $MAXEXTRANUM ] || MAXEXTRANUM=0 # precaution
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]