diff options
author | Andrew Cady <d@jerkface.net> | 2016-04-19 09:35:26 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2016-04-19 09:35:26 -0400 |
commit | 3b5b679166df95ba2ce2e507e008da04d5efd4da (patch) | |
tree | 39c3fd0331a4a032589f1a95d3e7ae03a1590528 /initrd.sh | |
parent | 06d9f30f1ba54edeadb953fe870dcc22e71519e0 (diff) |
rebuild initrd as necessary before qemu
Diffstat (limited to 'initrd.sh')
-rwxr-xr-x | initrd.sh | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -1,4 +1,18 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | set -ex | 2 | |
3 | cp -f /boot/vmlinuz-$(uname -r) isolinux/live/vmlinuz | 3 | initrd=isolinux/live/initrd.img |
4 | /usr/sbin/mkinitramfs -d initramfs-tools -o isolinux/live/initrd.img $(uname -r) | 4 | vmlinuz=isolinux/live/vmlinuz |
5 | |||
6 | conf_dir=initramfs-tools | ||
7 | |||
8 | if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then | ||
9 | need_update=1 | ||
10 | elif [ "$(find "$conf_dir" -newer "$initrd" -print -quit)" ]; then | ||
11 | need_update=1 | ||
12 | fi | ||
13 | |||
14 | if [ "$need_update" ]; then | ||
15 | set -ex | ||
16 | cp -f /boot/vmlinuz-$(uname -r) "$vmlinuz" | ||
17 | /usr/sbin/mkinitramfs -d "$conf_dir" -o "$initrd" $(uname -r) | ||
18 | fi | ||