diff options
author | Andrew Cady <d@jerkface.net> | 2016-04-20 14:52:02 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-04-20 14:53:04 -0400 |
commit | 1bddec3db035c4878a91fba7ce585b4ac727a89f (patch) | |
tree | 9f56d5731c9998b46f919ebca4d2b25f54a8f72a /initrd.sh | |
parent | 1961664ec151439d896f90ffdb3b7bd6cbe18fb9 (diff) |
add various missing dependencies
Diffstat (limited to 'initrd.sh')
-rwxr-xr-x | initrd.sh | 30 |
1 files changed, 23 insertions, 7 deletions
@@ -6,14 +6,30 @@ vmlinuz=isolinux/live/vmlinuz | |||
6 | version=$(uname -r) | 6 | version=$(uname -r) |
7 | conf_dir=initramfs-tools | 7 | conf_dir=initramfs-tools |
8 | 8 | ||
9 | if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then | 9 | apt_dependencies=initrd-dependencies.txt |
10 | need_update=1 | 10 | |
11 | elif [ "$(find "$conf_dir" -newer "$initrd" -print -quit)" ]; then | 11 | find_source_dirs() { |
12 | need_update=1 | 12 | set -- find "$conf_dir" ./old-school "$@" |
13 | fi | 13 | "$@" |
14 | } | ||
15 | |||
16 | force_rebuild() | ||
17 | { | ||
18 | touch "$conf_dir" | ||
19 | return 1 | ||
20 | } | ||
21 | |||
22 | rebuild() | ||
23 | { | ||
24 | [ ! -f "$apt_dependencies" ] || sudo apt-get install -q=10 --no-upgrade -y $(cat "$apt_dependencies") | ||
14 | 25 | ||
15 | if [ "$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 | |||
31 | if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then | ||
32 | rebuild | ||
33 | elif [ "$(find_source_dirs -newer "$initrd" -print -quit)" ]; then | ||
34 | rebuild | ||
19 | fi | 35 | fi |