Skip to content

Commit 3d3014c

Browse files
committed
fix for KT3
1 parent 33beaae commit 3d3014c

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,22 @@ SWAP_LOCK="/tmp/kUaL_lInUx_sWaP_mOuNtEd"
4141
ROOTFS_LOCK="/tmp/kUaL_lInUx_mOuNtEd"
4242
INNER_TMP="/tmp/kUaL_lInUx"
4343
ROOTFS_TYPE=unknown
44-
if [ -z "$(grep 'nodev.*ext4' /proc/filesystems)" ] && [ -n "$(grep 'ext4' /proc/filesystems)" ]; then
44+
cp rootfs.ext4.base tmp.test.fs.tmp || fail
45+
mkdir -p tmp.test.fs.dir || fail
46+
if [ -f fs.config ];then
47+
ROOTFS_TYPE="$(cat fs.config)"
48+
elif mount -o loop tmp.test.fs.tmp tmp.test.fs.dir 2>/dev/null; then
4549
echo "This kernel support ext4."
4650
ROOTFS_TYPE=ext4
47-
elif [ -z "$(grep 'nodev.*ext3' /proc/filesystems)" ] && [ -n "$(grep 'ext3' /proc/filesystems)" ]; then
48-
echo "This kernel support ext3 and doesn't support ext4."
49-
ROOTFS_TYPE=ext3
51+
echo ext4 > fs.config
5052
else
51-
fail "This kernel doesn't support ext4 and ext3."
53+
echo "This kernel doesn't support ext4."
54+
ROOTFS_TYPE=ext3
55+
echo ext3 > fs.config
5256
fi
57+
umount tmp.test.fs.tmp 2>/dev/null
58+
umount tmp.test.fs.dir 2>/dev/null
59+
rm -fr tmp.test.fs.tmp tmp.test.fs.dir 2>/dev/null
5360

5461
baseus(){
5562
echo "$*" | sed 's|^/mnt/us/|/mnt/base-us/|'

0 commit comments

Comments
 (0)