2parts_env: Remove 'user' label along with filesystem 12/259212/2 accepted/tizen/unified/20210603.130744 submit/tizen/20210602.084502
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 3 May 2021 08:10:03 +0000 (17:10 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Wed, 2 Jun 2021 09:12:34 +0000 (18:12 +0900)
This updates script for removing user label to check the filesystem
and select the proper tool for changing label.

Change-Id: I3b0d5ca8eee04ef681fbfea243614194d0983725
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
packaging/system-plugin.spec
scripts/2parts_env.sh

index 7ec679aafaaa555550735e05e58ae7fa4252994e..78ba910720932154400f353367081b26e9d1f4bc 100644 (file)
@@ -91,6 +91,7 @@ This package provides configuration files to trigger sdb with udev rule.
 %package config-2parts
 Summary: System configuration files for storage partitions
 Requires: %{name} = %{version}-%{release}
+Requires: f2fs-tools
 BuildArch: noarch
 
 %description config-2parts
index 7ddaa4f7069d51cfb6643546c1b4f5f10822916e..3b1d7c20d2e128759797fc34d47bbfcacc17953d 100644 (file)
@@ -1,5 +1,10 @@
 # Ugly workaround to remove "user" filesystem label for two-partition headless images
 if [ -e /dev/disk/by-label/user ];
 then
-e2label /dev/disk/by-label/user ''
+       F2FS_USERFS=$(/sbin/blkid /dev/disk/by-label/user -t TYPE=f2fs -o device)
+       if [ x$F2FS_USERFS != "x" ]; then
+               f2fslabel /dev/disk/by-label/user ''
+       else
+               e2label /dev/disk/by-label/user ''
+       fi
 fi