summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@cryptonomic.net>2020-10-29 13:36:56 -0400
committerAndrew Cady <d@cryptonomic.net>2020-10-30 10:13:44 -0400
commit36985dbfd7fdefb6511d70afd0c0ebb8896fd511 (patch)
treed024f140d59663dde9c1a3ff744907f3cc084571
parenta3026e0ed993c24ea2585cb58f939497d5af14d9 (diff)
add -s parameter to install to system
-rwxr-xr-xsrc/mkinitramfs-samizdat25
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
3if [ "$(id -u)" != 0 ] 2if [ "$(id -u)" != 0 ]
4then 3then
5 exec sudo -- "$0" "$@" 4 exec sudo -- "$0" "$@"
6 exit 1 5 exit 1
7fi 6fi
8 7
8loudly()
9{
10 (set -x
11 "$@")
12}
13
9f() 14f()
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
24OUTPUT_TAG=.samizdat
25while [ $# -gt 0 ]
26do
27 case "$1" in
28 -s|--system) OUTPUT_TAG=; shift; continue;;
29 --) shift; break;;
30 -?) exit 1;;
31 *) break;;
32 esac
33done
34
18if [ "$1" ] 35if [ "$1" ]
19then 36then
20 k=/boot/vmlinuz-$1 37 k=/boot/vmlinuz-$1