Commit 153b19dc authored by Michael Shigorin's avatar Michael Shigorin Committed by Anton Midyukov

e2k: add label check to write.sh

...so that it's more applicable to a wider set of images (those lacking e2k-alt-linux' specific labels just won't get broken default boot target label name for no reason).
parent c6889332
......@@ -42,9 +42,12 @@ case "$2" in
rsync -Pavc --inplace --delete --numeric-ids "$src/" "$dst/" ||
cp -avt "$dst" -- "$src"/{.disk,*}
grep -q "^default=.*_flash$" "$dst/boot.conf" || {
echo -n "updating default boot target... "
sed -i 's,default=.*$,&_flash,' "$dst/boot.conf"
echo "done"
cur="$(sed -rn 's/^default=(.*)$/\1/p' "$dst/boot.conf")"
grep -q "^label=${cur}_flash$" "$dst/boot.conf" && {
echo -n "updating default boot target... "
sed -i 's,^default=.*$,&_flash,' "$dst/boot.conf"
echo "done"
} ||:
}
echo -n "unmounting media... "
......
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