]> git.draconx.ca Git - scripts.git/blob - genlibs.sh
Add script to convert "JWK"-format RSA keys to normal.
[scripts.git] / genlibs.sh
1 #!/bin/zsh
2 #
3 # Copyright (C) 2009 Nick Bowler
4 # Copying and distribution of this file, with or without modification,
5 # are permitted in any medium without royalty provided the copyright
6 # notice and this notice are preserved.  This file is offered as-is,
7 # without any warranty.
8 #
9 # Generate library dependencies for an initramfs.  Finds all dynamically linked
10 # binaries listed in an initramfs description (as needed by gen_init_cpio from
11 # the Linux source) and passes them to libs.sh in order to actually generate
12 # the dependencies.
13
14 if [ -z "$1" ]; then
15         echo "usage: genlibs.sh initramfs-desc"
16         exit 1
17 fi
18
19 files=(`sed -n 's/^ *file \+[^ ]\+ \+\([^ ]\+\).*/\1/p' "$1"`)
20
21 dyns=()
22
23 for i in $files; do
24         if ! file "$i" | grep dynamic >/dev/null; then continue; fi
25         dyns+="$i"
26 done
27
28 ./libs.sh $dyns