summaryrefslogtreecommitdiff
path: root/initramfs-tools
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-27 20:44:01 -0400
committerAndrew Cady <d@jerkface.net>2016-04-27 20:44:01 -0400
commite8c2c781aea759c47bf81ff2aed5960032a5b50e (patch)
tree27e8e73e8f6ccbc4246e36829389e15b755169c8 /initramfs-tools
parent2a939f345df828b467a28f90052fd6b4ff004a9e (diff)
slight cleanup/factor
Diffstat (limited to 'initramfs-tools')
-rwxr-xr-xinitramfs-tools/hooks/samizdat43
1 files changed, 17 insertions, 26 deletions
diff --git a/initramfs-tools/hooks/samizdat b/initramfs-tools/hooks/samizdat
index 5b1971b..ac71947 100755
--- a/initramfs-tools/hooks/samizdat
+++ b/initramfs-tools/hooks/samizdat
@@ -1,55 +1,46 @@
1#!/bin/sh 1#!/bin/sh
2# TODO: check samizdat source to see what it copies
2[ "$1" = prereqs ] && { echo; exit; } 3[ "$1" = prereqs ] && { echo; exit; }
3 4
4CopyExec() { copy_exec "$@" || exit 1; } 5CopyExec() { copy_exec "$@" || exit 1; }
5 6
6. /usr/share/initramfs-tools/hook-functions 7. /usr/share/initramfs-tools/hook-functions
7 8
8for f in ./old-school/* loop-layer.sh; do CopyExec "$f" /bin; done 9repo_execs=$(echo ./old-school/* loop-layer.sh)
9 10
10# TODO: check samizdat source to see what it copies
11path_execs='mountpoint openvt rsync gpg2 gpg-agent pinentry-curses truncate cryptsetup mkfs.btrfs btrfs fsck.hfsplus' 11path_execs='mountpoint openvt rsync gpg2 gpg-agent pinentry-curses truncate cryptsetup mkfs.btrfs btrfs fsck.hfsplus'
12 12
13for c in $path_execs; do CopyExec "$(which $c)" /bin; done
14
15graft_paths=" 13graft_paths="
16 /bin/OpenVT=/bin/openvt 14 /bin/OpenVT=/bin/openvt
17 /bin/LoSetup=/sbin/losetup 15 /bin/LoSetup=/sbin/losetup
18 /patchroot/patchroot.sh=patchroot.sh 16 /patchroot/patchroot.sh=patchroot.sh
19 /patchroot/sources.list=/etc/apt/sources.list 17 /patchroot/sources.list=/etc/apt/sources.list
20 /patchroot/initrd-dependencies.txt=initrd-dependencies.txt 18 /patchroot/initrd-dependencies.txt=initrd-dependencies.txt
19 /lib/samizdat/vol_id.txt=vol_id.txt
21" 20"
22 21
23for e in $graft_paths; do
24 case "$e" in
25 *=*)
26 dest=${e%%=*}
27 src=${e#*=}
28 CopyExec "$src" "$dest"
29 ;;
30 *) exit 1 ;;
31 esac
32done
33
34absolute_path_copies='/lib/terminfo/l/linux' 22absolute_path_copies='/lib/terminfo/l/linux'
35 23
36for f in $absolute_path_copies; do CopyExec "$f" "$f"; done
37
38samizdat_execs_dir=/home/d/src/samizdat # TODO
39samizdat_execs='wait_for_files samizdat-pinentry dynmenu src/samizdat-password-agent src/samizdat-gpg-agent' 24samizdat_execs='wait_for_files samizdat-pinentry dynmenu src/samizdat-password-agent src/samizdat-gpg-agent'
25modules='loop xts dm-crypt hfs hfsplus'
26modules_dirs='kernel/drivers/net/ethernet kernel/fs/nls'
40 27
41for c in $samizdat_execs; do CopyExec ${samizdat_execs_dir}/$c /bin; done
42 28
43CopyExec vol_id.txt /lib/samizdat/vol_id.txt
44 29
45modules='loop xts dm-crypt hfs hfsplus'
46for m in $modules; do force_load "$m" || exit 1; done
47 30
48sex() { (set -x; "$@"); } 31for f in $repo_execs; do CopyExec "$f" /bin; done
32for c in $path_execs; do CopyExec "$(which $c)" /bin; done
33for f in $absolute_path_copies; do CopyExec "$f" "$f"; done
34samizdat_execs_dir=/home/d/src/samizdat # TODO
35for c in $samizdat_execs; do CopyExec ${samizdat_execs_dir}/$c /bin; done
36for m in $modules; do force_load "$m" || exit 1; done
37for dir in $modules_dirs; do copy_modules_dir "$dir" || exit 1; done
49 38
50modules_dirs='kernel/drivers/net/ethernet kernel/fs/nls' 39for e in $graft_paths; do
51for dir in $modules_dirs; do 40 case "$e" in
52 copy_modules_dir "$dir" || exit 1 41 *=*) CopyExec "${e#*=}" "${e%%=*}" ;;
42 *) exit 1 ;;
43 esac
53done 44done
54 45
55exit 0 46exit 0