genfstab: correctly trim root prefix on swapfiles

We remove the root prefix for all other devices by design, but omitted
doing so for swapfiles.

Fixes FS#63069
This commit is contained in:
Eli Schwartz 2019-07-02 11:20:33 -04:00
parent c7fb67064a
commit 4eb54af72a
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6

View File

@ -220,7 +220,7 @@ done
[[ $device = *'\040(deleted)' ]] && continue
if [[ $type = file ]]; then
printf '%-20s' "$device"
printf '%-20s' "${device#${root%/}}"
elif [[ $device = /dev/dm-+([0-9]) ]]; then
# device mapper doesn't allow characters we need to worry
# about being mangled, and it does the escaping of dashes