added own service for creating overlays
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
/usr/lib/systemd/system/nimux-zfs-mount.service
|
||||||
23
rootfs-overlay/usr/lib/nimux/nimux-early-mount.xsh
Executable file
23
rootfs-overlay/usr/lib/nimux/nimux-early-mount.xsh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/xonsh --no-rc
|
||||||
|
# Nimux Early Mount (xonsh)
|
||||||
|
|
||||||
|
#mount /mnt
|
||||||
|
print("mount /mnt")
|
||||||
|
/bin/mount /mnt
|
||||||
|
|
||||||
|
# mount root on future accesable place
|
||||||
|
print("re-mount rootfs")
|
||||||
|
/bin/mkdir -p /mnt/rootfs
|
||||||
|
/bin/mount --bind / /mnt/rootfs
|
||||||
|
/bin/mount --make-rprivate /mnt/rootfs/
|
||||||
|
|
||||||
|
# import zpool
|
||||||
|
print("import zpool")
|
||||||
|
/sbin/zpool import nimux-zfs
|
||||||
|
|
||||||
|
# overlay etc and home with a persistant zfs dataset
|
||||||
|
print("overlay mount etc")
|
||||||
|
/bin/unionfs -o cow,nonempty /mnt/rootfs.overlay/etc=RW:/mnt/rootfs/etc=RO /etc
|
||||||
|
print("overlay mount home")
|
||||||
|
/bin/unionfs -o cow,nonempty /mnt/rootfs.overlay/home=RW:/mnt/rootfs/home=RO /home
|
||||||
|
|
||||||
0
rootfs-overlay/usr/lib/nimux/nimux-firstlogin
Normal file
0
rootfs-overlay/usr/lib/nimux/nimux-firstlogin
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Nimux early mount: ZFS import + overlay for /etc and /home
|
||||||
|
DefaultDependencies=no
|
||||||
|
After=systemd-udev-settle.service
|
||||||
|
Wants=systemd-udev-settle.service
|
||||||
|
Before=local-fs-pre.target local-fs.target
|
||||||
|
Wants=local-fs-pre.target
|
||||||
|
Conflicts=shutdown.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
Environment=XONSH_HISTORY_BACKEND=none
|
||||||
|
Environment=XONSH_CACHE_DIR=/dev/null
|
||||||
|
Environment=XONSH_DATA_DIR=/dev/null
|
||||||
|
Environment=HOME=/tmp/xonsh-home
|
||||||
|
ExecStart=/usr/lib/nimux/nimux-early-mount.xsh
|
||||||
|
TimeoutStartSec=30s
|
||||||
|
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=local-fs-pre.target
|
||||||
|
|
||||||
Reference in New Issue
Block a user