]> git.ipfire.org Git - thirdparty/dracut.git/commit
fix(zipl): remove trailing spaces from zipl boot device name
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Mon, 14 Nov 2022 15:45:48 +0000 (16:45 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Wed, 21 Dec 2022 17:16:47 +0000 (17:16 +0000)
commitb4de9ee107742c8b0b8a86dcc22aa4fd366b068e
treed6f43838e23ffaef605b876b825182d6b9c77165
parente877be69b41199ee4384ccb6352754bb9edfbba4
fix(zipl): remove trailing spaces from zipl boot device name

Trailing spaces are misleading blkid input after fixes for shellcheck were
introduced in https://github.com/dracutdevs/dracut/commit/d75b029a

Test showing the wrong output:

```
localhost:~ # _boot_zipl=$(sed -n -e '/^[[:space:]]*#/d' -e 's/\(.*\)\w*\/boot\/zipl.*/\1/p' /etc/fstab)
localhost:~ # echo "[${_boot_zipl}]"
[/dev/disk/by-path/ccw-0.0.0000-part1  ]
localhost:~ # blkid -s TYPE -o udev "${_boot_zipl}"
localhost:~ # blkid -s TYPE -o udev ${_boot_zipl}
ID_FS_TYPE=ext2
```

Also, remove duplicate code by creating a function to get the zipl boot device,
prepend $dracutsysrootdir to /etc/fstab and print cmdline properly: start
with a space and do not print a newline.
dracut-functions.sh
modules.d/91zipl/module-setup.sh