Commit 5e55485d authored by Natanael Copa's avatar Natanael Copa
Browse files

setup-lbu: use UUID when UUID was used as alpine_dev

parent b468f360
...@@ -23,10 +23,20 @@ __EOF__ ...@@ -23,10 +23,20 @@ __EOF__
get_mnt_line() { get_mnt_line() {
local mntpoint="$1" local mntpoint="$1"
local mnttab="$2" local mnttab="$2"
local media=${mntpoint#/media/}
local uuid=
# replace the device with UUID since the device is in /proc/mounts
# and we want the UUID in fstab
if [ "${media#UUID}" != "$media" ]; then
uuid="$media"
fi
# we need filter out codepage=... in mount option as it makes # we need filter out codepage=... in mount option as it makes
# mount fail if its there. # mount fail if its there.
awk "\$2 == \"$mntpoint\" { awk -v uuid="$uuid" "\$2 == \"$mntpoint\" {
gsub(/,codepage=.*,/, ",", \$4); if (uuid)
\$1 = uuid;
gsub(/,codepage=.*,/, \",\", \$4);
print \$0; print \$0;
}" "$mnttab" }" "$mnttab"
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment