Forráskód Böngészése

bug correction when detection swap and share partitions to launch first boot script

Vincent-FK 3 éve
szülő
commit
d9329c5673
1 módosított fájl, 11 hozzáadás és 11 törlés
  1. 11 11
      FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot

+ 11 - 11
FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot

@@ -5,19 +5,19 @@ THIS=$(basename $0)
 case "$1" in
     start)
 
-	# Check is SWAP partition already created
-	sgdisk /dev/mmcblk0 | grep swap
+    # Check is SWAP partition already created
+    sgdisk -p /dev/mmcblk0 | grep swap > /dev/null
     if [ $? -ne 0 ]; then
-		first_boot
-		exit $?
-	fi
+            first_boot
+            exit $?
+    fi
 
-	# Check is share partition already created
-	sgdisk /dev/mmcblk0 | grep share
-	if [ $? -eq 0 ]; then
-	    first_boot
-	    exit $?
-	fi
+    # Check is share partition already created
+    sgdisk -p /dev/mmcblk0 | grep share > /dev/null
+    if [ $? -ne 0 ]; then
+        first_boot
+        exit $?
+    fi
 	;;
     stop)
 	;;