summaryrefslogtreecommitdiff
path: root/initrd.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-19 09:35:26 -0400
committerAndrew Cady <d@jerkface.net>2016-04-19 09:35:26 -0400
commit3b5b679166df95ba2ce2e507e008da04d5efd4da (patch)
tree39c3fd0331a4a032589f1a95d3e7ae03a1590528 /initrd.sh
parent06d9f30f1ba54edeadb953fe870dcc22e71519e0 (diff)
rebuild initrd as necessary before qemu
Diffstat (limited to 'initrd.sh')
-rwxr-xr-xinitrd.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/initrd.sh b/initrd.sh
index 5e7ed90..675dcc8 100755
--- a/initrd.sh
+++ b/initrd.sh
@@ -1,4 +1,18 @@
1#!/bin/sh 1#!/bin/sh
2set -ex 2
3cp -f /boot/vmlinuz-$(uname -r) isolinux/live/vmlinuz 3initrd=isolinux/live/initrd.img
4/usr/sbin/mkinitramfs -d initramfs-tools -o isolinux/live/initrd.img $(uname -r) 4vmlinuz=isolinux/live/vmlinuz
5
6conf_dir=initramfs-tools
7
8if [ ! -e "$initrd" -o ! -e "$vmlinuz" ]; then
9 need_update=1
10elif [ "$(find "$conf_dir" -newer "$initrd" -print -quit)" ]; then
11 need_update=1
12fi
13
14if [ "$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)
18fi