summaryrefslogtreecommitdiff
path: root/initrd.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-20 14:52:02 -0400
committerAndrew Cady <d@jerkface.net>2016-04-20 14:53:04 -0400
commit1bddec3db035c4878a91fba7ce585b4ac727a89f (patch)
tree9f56d5731c9998b46f919ebca4d2b25f54a8f72a /initrd.sh
parent1961664ec151439d896f90ffdb3b7bd6cbe18fb9 (diff)
add various missing dependencies
Diffstat (limited to 'initrd.sh')
-rwxr-xr-xinitrd.sh30
1 files changed, 23 insertions, 7 deletions
diff --git a/initrd.sh b/initrd.sh
index 5adb405..1eca9bb 100755
--- a/initrd.sh
+++ b/initrd.sh
@@ -6,14 +6,30 @@ vmlinuz=isolinux/live/vmlinuz
6version=$(uname -r) 6version=$(uname -r)
7conf_dir=initramfs-tools 7conf_dir=initramfs-tools
8 8
9if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then 9apt_dependencies=initrd-dependencies.txt
10 need_update=1 10
11elif [ "$(find "$conf_dir" -newer "$initrd" -print -quit)" ]; then 11find_source_dirs() {
12 need_update=1 12 set -- find "$conf_dir" ./old-school "$@"
13fi 13 "$@"
14}
15
16force_rebuild()
17{
18 touch "$conf_dir"
19 return 1
20}
21
22rebuild()
23{
24 [ ! -f "$apt_dependencies" ] || sudo apt-get install -q=10 --no-upgrade -y $(cat "$apt_dependencies")
14 25
15if [ "$need_update" ]; then
16 set -ex 26 set -ex
17 cp -f /boot/vmlinuz-${version} "$vmlinuz" 27 cp -f /boot/vmlinuz-${version} "$vmlinuz"
18 /usr/sbin/mkinitramfs -d "$conf_dir" -o "$initrd" ${version} 28 /usr/sbin/mkinitramfs -d "$conf_dir" -o "$initrd" ${version} || force_rebuild
29}
30
31if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then
32 rebuild
33elif [ "$(find_source_dirs -newer "$initrd" -print -quit)" ]; then
34 rebuild
19fi 35fi