summaryrefslogtreecommitdiff
path: root/src/initrd
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-05-01 05:53:38 -0400
committerAndrew Cady <d@jerkface.net>2016-05-01 05:53:38 -0400
commitc7f98efa895d14a7bf1caa6f567050a6abcb15ce (patch)
treed67147bf60ec66f4f63ab7bd3e58de814de4e862 /src/initrd
parenta8e19d5d8057e82cbda2705d755f3d4e1d3da20a (diff)
copy more executables from initrd to rootfs (if missing)
Diffstat (limited to 'src/initrd')
-rw-r--r--src/initrd/btrfs-create.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/initrd/btrfs-create.sh b/src/initrd/btrfs-create.sh
index edd2d1c..6a6a94e 100644
--- a/src/initrd/btrfs-create.sh
+++ b/src/initrd/btrfs-create.sh
@@ -93,6 +93,19 @@ mountpoint_of()
93 printf '%s\n' "$f" 93 printf '%s\n' "$f"
94} 94}
95 95
96copy_execs()
97{
98 local d b
99 d=$1
100 shift
101
102 for b in "$@"; do
103 [ -x "/root/$d/$b" ] && continue
104 [ "$(which "$b")" ] || continue
105 cp "$(which "$b")" "/root/$d/$b"
106 done
107}
108
96initialize_root_filesystem() 109initialize_root_filesystem()
97{ 110{
98 rm -r /root/root 111 rm -r /root/root
@@ -107,7 +120,9 @@ initialize_root_filesystem()
107 rmdir /root/home 120 rmdir /root/home
108 btrfs subvolume create /root/home || return 121 btrfs subvolume create /root/home || return
109 122
110 [ -x /root/sbin/mdadm ] || cp /sbin/mdadm /root/sbin/ 123 copy_execs sbin mdadm dmsetup cryptsetup
124 copy_execs bin btrfs rsync gpg gpg2 gpg-agent
125
111 # Copy these over unconditionally, because they ought to remain in sync with 126 # Copy these over unconditionally, because they ought to remain in sync with
112 # the initrd. 127 # the initrd.
113 cp /bin/mdadm-dup.sh /root/sbin/ 128 cp /bin/mdadm-dup.sh /root/sbin/