diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/mkinitramfs-samizdat | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mkinitramfs-samizdat b/src/mkinitramfs-samizdat index 4852daa..4b46ce4 100755 --- a/src/mkinitramfs-samizdat +++ b/src/mkinitramfs-samizdat | |||
@@ -11,16 +11,31 @@ loudly() | |||
11 | "$@") | 11 | "$@") |
12 | } | 12 | } |
13 | 13 | ||
14 | up_to_date() | ||
15 | { | ||
16 | local found system_initrd | ||
17 | system_initrd=${1%$OUTPUT_TAG} | ||
18 | [ -e "$1" ] || return | ||
19 | found=$(find "$samizdat_initramfs_conf_dir" \ | ||
20 | "$samizdat_initrd_files_dir" \ | ||
21 | "$system_initrd" \ | ||
22 | -type f -newer "$1" -print -quit) || return | ||
23 | [ -z "$found" ] | ||
24 | } | ||
25 | |||
14 | f() | 26 | f() |
15 | { | 27 | { |
16 | OUTPUT=/boot/initrd.img-$1${OUTPUT_TAG} | 28 | OUTPUT=/boot/initrd.img-$1${OUTPUT_TAG} |
29 | ([ -z "$OUTPUT_TAG" ] || ! up_to_date "$OUTPUT") && | ||
17 | /usr/sbin/mkinitramfs \ | 30 | /usr/sbin/mkinitramfs \ |
18 | -d /usr/local/lib/samizdat-rhizome/initramfs-tools/ \ | 31 | -d "$samizdat_initramfs_conf_dir" \ |
19 | -o "$OUTPUT" \ | 32 | -o "$OUTPUT" \ |
20 | -k "$1" || return | 33 | -k "$1" || return |
21 | loudly ln -sf "${OUTPUT#/}" /initrd.img | 34 | loudly ln -sf "${OUTPUT#/}" /initrd.img |
22 | } | 35 | } |
23 | 36 | ||
37 | . samizdat-paths.sh | ||
38 | |||
24 | OUTPUT_TAG=.samizdat | 39 | OUTPUT_TAG=.samizdat |
25 | while [ $# -gt 0 ] | 40 | while [ $# -gt 0 ] |
26 | do | 41 | do |