Skip to content

Commit

Permalink
Merge pull request #356 from aafeijoo-suse/SL-Micro-6.0_Update-bsc122…
Browse files Browse the repository at this point in the history
…8847

fix(convertfs): error in conditional expressions (bsc#1228847) (SL-Micro-6.0:Update)
  • Loading branch information
aafeijoo-suse authored Aug 7, 2024
2 parents add3169 + 042fcb2 commit a89da38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules.d/30convertfs/convertfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ done
[ -w $ROOT ] || mount -o remount,rw $ROOT

#mount /sysroot/var if it is a separate mount
VARDEV=$(sed -n -e 's/^\#.*//' -e '/ \/var /s/\([[:graph:]]* \).*/\1/p' /sysroot/etc/fstab)
VARFS=$(sed -n -e 's/^\#.*//' -e '/ \/var /s/[[:graph:]]* * [[:graph:]]* *\([[:graph:]]* \).*/\1/p' /sysroot/etc/fstab)
VARDEV=$(sed -n -e 's/^\#.*//' -e '/ \/var /s/\([[:graph:]]* \).*/\1/p' "$ROOT"/etc/fstab)
VARFS=$(sed -n -e 's/^\#.*//' -e '/ \/var /s/[[:graph:]]* * [[:graph:]]* *\([[:graph:]]* \).*/\1/p' "$ROOT"/etc/fstab)

if [ -n $VARDEV ] && [ -n $VARFS ]; then
if [[ -n $VARDEV ]] && [[ -n $VARFS ]]; then
#mount btrfs subvolume var
if [ $VARFS == btrfs ]; then
SUBVOLIDVAR=$(btrfs subvolume list $ROOT | sed -n '/var$/s/ID \([[:digit:]]*\) .*/\1/p')
Expand All @@ -50,7 +50,7 @@ if [ ! -L "$ROOT"/var/lock -a -e "$ROOT"/var/lock ]; then
ln -sfn ../run/lock "$ROOT"/var/lock
fi

[ -n $SUBVOLIDVAR ] && umount $ROOT/var
[[ -n $SUBVOLIDVAR ]] && umount $ROOT/var
[ -w $ROOT ] && mount -o remount,ro $ROOT

echo "Done."
Expand Down

0 comments on commit a89da38

Please sign in to comment.