aboutsummaryrefslogtreecommitdiffstats
path: root/config/hooks/kernel-image.sh.binary
blob: 65ed75ae1153851aea9b2d3af6b6a02e3123949d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

set -e

# This script is necessary for squashfs (or any not-plainroot) builds, where
# the usual /live images end up inside the filesystem.

# In these cases the kernel ships in three places, which is inefficient: 
#   enclosing binary /live (mangled)
#   rootfs /live (mangled)
#   rootfs /boot (original)

echo "(re)Copying in kernel images..."
cp -a chroot/live/uInitrd chroot/live/uImage chroot/live/dtb binary/live/

# This reduces final image size significantly; original raw kernel files are
# still duplicated in /boot.
# Don't stop on errors, because this script may have already been run.
echo "Removing redundant kernel images..."
rm binary/live/vmlinuz-* || true
rm binary/live/initrd.img-* || true