Skip to content

Commit 19b51f5

Browse files
develop
1 parent 5e04193 commit 19b51f5

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

fstab

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# TODO
44
# currently systemd requires use of "root=" kenel argument for /sysroot mount
5-
# https://github.com/systemd/systemd/blob/master/src/fstab-generator/fstab-generator.c
5+
# http://unix.stackexchange.com/questions/289672/kernel-init-without-root-parameter
66

77
# fstab: mappings for direct partitions
88

@@ -11,9 +11,10 @@
1111

1212
# how fstab is used by systemd
1313
# https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html
14+
# https://github.com/systemd/systemd/blob/master/src/fstab-generator/fstab-generator.c
1415

1516
# provide here root partition description (instead of kernel command line)
1617

17-
# <file system> <dir> <type> <option <dump> <pass>
18-
# /dev/mapper/swap none swap defaults 0 0
19-
# /dev/mapper/root /sysroot ext4 defaults,ro 0 1
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

initrd-cryptsetup.path

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file is part of https://github.com/random-archer/mkinitcpio-systemd-tool
2+
3+
[Unit]
4+
Description=Initrd Cryptsetup Path
5+
Documentation=https://github.com/random-archer/mkinitcpio-systemd-tool/blob/master/README.md
6+
ConditionPathExists=/etc/crypttab
7+
ConditionPathExists=/etc/initrd-release
8+
#ConditionPathExists=!/run/plymouth/pid
9+
DefaultDependencies=no
10+
Conflicts=shutdown.target
11+
After=plymouth-start.service
12+
Before=paths.target shutdown.target
13+
14+
[Path]
15+
MakeDirectory=yes
16+
DirectoryNotEmpty=/run/systemd/ask-password
17+
18+
[Install]
19+
WantedBy=sysinit.target
20+
21+
[X-SystemdTool]
22+
23+
# enable service
24+
InitrdService=enable
25+
26+
# disable default password agents
27+
InitrdPath=/usr/lib/systemd/system/systemd-ask-password-console.path replace=yes create=yes
28+
InitrdPath=/usr/lib/systemd/system/systemd-ask-password-wall.path replace=yes create=yes

initrd-cryptsetup.service

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ StandardOutput=inherit
2828
StandardError=inherit
2929
TTYPath=/dev/console
3030

31-
[Install]
32-
WantedBy=sysinit.target
33-
3431
[X-SystemdTool]
3532

36-
# enable service
37-
InitrdService=enable
38-
3933
# provision disk tables in initramfs
4034
InitrdPath=/etc/crypttab source=/etc/mkinitcpio.d/crypttab replace=yes
4135
InitrdPath=/etc/fstab source=/etc/mkinitcpio.d/fstab replace=yes

initrd-shell.service

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ InitrdBinary=/usr/bin/journalctl
3333
InitrdLink=/root/.profile /etc/systemd/system/initrd-shell.sh
3434

3535
# configure user settings
36-
InitrdPath=/etc/group
37-
InitrdPath=/etc/passwd
38-
InitrdPath=/etc/shadow
36+
InitrdPath=/etc/group replace=yes
37+
InitrdPath=/etc/passwd replace=yes
38+
InitrdPath=/etc/shadow replace=yes
3939
InitrdBuild=/etc/systemd/system/initrd-build.sh command=do_root_shell
4040
InitrdBuild=/etc/systemd/system/initrd-build.sh command=do_secret_clean
4141

initrd-shell.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ service_default() {
262262
# cryptsetup service implementation
263263
service_cryptsetup() {
264264
log_info "cryptsetup service"
265+
[[ $watch_folder ]] || log_error "missing $watch_folder"
265266
if has_crypt_jobs ; then
266267
run_crypt_jobs
267268
else
@@ -379,7 +380,6 @@ setup_interrupts() {
379380
# respond depending on script invocation type [script_entry=xxx]
380381
process_invocation() {
381382
log_info "init"
382-
mkdir -p "$watch_folder" || log_error "can not make $watch_folder"
383383
case "$script_entry" in
384384
# development
385385
exit) do_exit ;;

0 commit comments

Comments
 (0)