Skip to content

Commit d16de31

Browse files
initrd fstab sysroot support
1 parent d443348 commit d16de31

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

crypttab

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
# provide here mapper partition UUID (instead of kernel command line)
1212

1313
# <name> <device> <password> <options>
14-
swap UUID=${UUID_SWAP} none luks
15-
root UUID=${UUID_ROOT} none luks
14+
# root UUID=${UUID_ROOT} none luks
15+
# swap UUID=${UUID_SWAP} none luks

fstab

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool
22

3-
# TODO
4-
# currently systemd requires use of "root=" kenel argument for /sysroot mount
5-
# http://unix.stackexchange.com/questions/289672/kernel-init-without-root-parameter
6-
73
# fstab: mappings for direct partitions
84

95
# fstab format:
@@ -13,8 +9,10 @@
139
# https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html
1410
# https://github.com/systemd/systemd/blob/master/src/fstab-generator/fstab-generator.c
1511

12+
# note: provide /sysroot/ folder inside initramfs disk image
13+
# note: remove "root=/dev/mapper/root" stanza from kernel command line
14+
1615
# provide here root partition description (instead of kernel command line)
1716

18-
# <file system> <dir> <type> <option> <dump> <pass>
19-
# /dev/mapper/swap none swap defaults 0 0
20-
# /dev/mapper/root /sysroot ext4 defaults,ro 0 1
17+
# <file system> <dir> <type> <option> <dump> <pass>
18+
# /dev/mapper/root /sysroot auto x-systemd.device-timeout=9999h 0 1

initrd-cryptsetup.service

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ TTYPath=/dev/console
3434
InitrdPath=/etc/crypttab source=/etc/mkinitcpio.d/crypttab replace=yes
3535
InitrdPath=/etc/fstab source=/etc/mkinitcpio.d/fstab replace=yes
3636

37+
# provide folder for sysroot.mount
38+
InitrdPath=/sysroot/ create=yes
39+
3740
# include cryptsetup binaries
3841
InitrdBinary=/usr/bin/dmsetup
3942
InitrdCall=add_module dm-crypt

0 commit comments

Comments
 (0)