mirror of
https://github.com/TECHNOFAB11/disko.git
synced 2025-12-11 23:50:05 +01:00
use findmnt and mount with X-mount.mkdir
This feels slightly cleaner and makes the code shorter.
This commit is contained in:
parent
f8522774e7
commit
e123b05ff4
2 changed files with 7 additions and 5 deletions
|
|
@ -88,9 +88,8 @@ let {
|
|||
|
||||
mount.filesystem = q: x: {
|
||||
fs.${x.mountpoint} = ''
|
||||
if ! [ "$(mount | sed -n 's:\([^ ]\+\) on /mnt${x.mountpoint} .*:\1:p')" = ${q.device} ]; then
|
||||
mkdir -p /mnt${x.mountpoint}
|
||||
mount ${q.device} /mnt${x.mountpoint}
|
||||
if ! findmnt "${q.device}" "/mnt${x.mountpoint}" > /dev/null 2>&1; then
|
||||
mount "${q.device}" "/mnt${x.mountpoint}" -o X-mount.mkdir
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue