diff options
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 | ||