From d9329c567342ddbae2bd856f294a5081418b81ac Mon Sep 17 00:00:00 2001 From: Vincent-FK Date: Mon, 16 Nov 2020 11:12:20 +0100 Subject: [PATCH] bug correction when detection swap and share partitions to launch first boot script --- .../rootfs-overlay/etc/init.d/S01first_boot | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot b/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot index 7ac8c2a..51f1eb2 100755 --- a/FunKey/board/funkey/rootfs-overlay/etc/init.d/S01first_boot +++ b/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) ;;