diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/mkinitramfs-samizdat | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/mkinitramfs-samizdat b/src/mkinitramfs-samizdat index 7f2b1a7..4852daa 100755 --- a/src/mkinitramfs-samizdat +++ b/src/mkinitramfs-samizdat | |||
@@ -1,20 +1,37 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | |||
3 | if [ "$(id -u)" != 0 ] | 2 | if [ "$(id -u)" != 0 ] |
4 | then | 3 | then |
5 | exec sudo -- "$0" "$@" | 4 | exec sudo -- "$0" "$@" |
6 | exit 1 | 5 | exit 1 |
7 | fi | 6 | fi |
8 | 7 | ||
8 | loudly() | ||
9 | { | ||
10 | (set -x | ||
11 | "$@") | ||
12 | } | ||
13 | |||
9 | f() | 14 | f() |
10 | { | 15 | { |
16 | OUTPUT=/boot/initrd.img-$1${OUTPUT_TAG} | ||
11 | /usr/sbin/mkinitramfs \ | 17 | /usr/sbin/mkinitramfs \ |
12 | -d /usr/local/lib/samizdat-rhizome/initramfs-tools/ \ | 18 | -d /usr/local/lib/samizdat-rhizome/initramfs-tools/ \ |
13 | -o "/boot/initrd.img-$1.samizdat" \ | 19 | -o "$OUTPUT" \ |
14 | -k "$1" || return | 20 | -k "$1" || return |
15 | ln -sf "initrd.img-$1.samizdat" /initrd.img | 21 | loudly ln -sf "${OUTPUT#/}" /initrd.img |
16 | } | 22 | } |
17 | 23 | ||
24 | OUTPUT_TAG=.samizdat | ||
25 | while [ $# -gt 0 ] | ||
26 | do | ||
27 | case "$1" in | ||
28 | -s|--system) OUTPUT_TAG=; shift; continue;; | ||
29 | --) shift; break;; | ||
30 | -?) exit 1;; | ||
31 | *) break;; | ||
32 | esac | ||
33 | done | ||
34 | |||
18 | if [ "$1" ] | 35 | if [ "$1" ] |
19 | then | 36 | then |
20 | k=/boot/vmlinuz-$1 | 37 | k=/boot/vmlinuz-$1 |