diff options
Diffstat (limited to 'config/hooks')
-rwxr-xr-x | config/hooks/kernel-image.sh.binary | 27 | ||||
-rwxr-xr-x | config/hooks/kernel-image.sh.chroot | 26 |
2 files changed, 53 insertions, 0 deletions
diff --git a/config/hooks/kernel-image.sh.binary b/config/hooks/kernel-image.sh.binary new file mode 100755 index 0000000..69a3b77 --- /dev/null +++ b/config/hooks/kernel-image.sh.binary @@ -0,0 +1,27 @@ +#!/bin/sh + +set -e + +echo "Mangling kernel..." +cd ./binary +mkdir initrd-repack +cp live/initrd.img-* initrd-repack +(cd initrd-repack ; \ + zcat initrd.img-* | cpio -i ; \ + rm -f conf/param.conf ; \ + find . | cpio --quiet -o -H newc | \ + gzip -9 > initrd.img ; \ + cd ..) + +cp initrd-repack/initrd.img live/initrd.img +rm -rf initrd-repack + +(cd live; \ + cp ../usr/lib/linux-image-*/kirkwood-dreamplug.dtb dtb ; \ + cat vmlinuz-* dtb >> temp-kernel ; \ + mkimage -A arm -O linux -T kernel -n "Debian kernel (unknown version)" \ + -C none -a 0x8000 -e 0x8000 -d temp-kernel uImage ; \ + rm -f temp-kernel ; \ + mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 \ + -n "Debian ramdisk (unknown version)" \ + -d initrd.img uInitrd ) diff --git a/config/hooks/kernel-image.sh.chroot b/config/hooks/kernel-image.sh.chroot new file mode 100755 index 0000000..28b7f44 --- /dev/null +++ b/config/hooks/kernel-image.sh.chroot @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +# TODO: this seems to be a null-op... flash-kernel is symlinked to `true`? +echo "Trying to flashing kernel..." +/usr/sbin/flash-kernel || echo "Failed to flash kernel! Don't worry, will mangle" + +echo "Mangling kernel..." +mkdir /tmp/initrd-repack +(cd /tmp/initrd-repack ; \ + zcat /boot/initrd.img-* | cpio -i ; \ + rm -f conf/param.conf ; \ + find . | cpio --quiet -o -H newc | \ + gzip -9 > /boot/initrd.img) +rm -rf /tmp/initrd-repack + +(cd /boot ; \ + cp /usr/lib/linux-image-*/kirkwood-dreamplug.dtb dtb ; \ + cat vmlinuz-* dtb >> temp-kernel ; \ + mkimage -A arm -O linux -T kernel -n "Debian kernel (unknown version)" \ + -C none -a 0x8000 -e 0x8000 -d temp-kernel uImage ; \ + rm -f temp-kernel ; \ + mkimage -A arm -O linux -T ramdisk -C gzip -a 0x0 -e 0x0 \ + -n "Debian ramdisk (unknown version)" \ + -d initrd.img uInitrd ) |