3
# move the kernel out into a new device tarfile with system/boot
7
echo "I: Moving kernel into device tarball"
11
mkdir -p $TMPDIR/system/
12
mkdir -p $TMPDIR/assets/
14
# cp files, we can't simply use tar --transform as it changes the symlink target
16
cd binary/boot/filesystem.dir
18
cp -ar --parent lib/modules/ $TMPDIR/system/
19
cp -ar --parent lib/firmware/ $TMPDIR/system/
22
if [ -f boot/vmlinu?-*.signed ]; then
23
kernel=boot/vmlinu?-*.signed
28
initrd=boot/initrd.img-*
30
cp -ar $initrd $TMPDIR/assets/
31
cp -ar $kernel $TMPDIR/assets/
32
cp -ar boot/abi-* boot/System.map-* $TMPDIR/assets/
34
dtbs=$(find lib/firmware -type d -name 'device-tree' -print0)
35
if [ -n "$dtbs" ]; then
36
mv "$dtbs" $TMPDIR/assets/dtbs
39
# create hardware.yaml
40
# this assumes armh == u-boot
43
cat > $TMPDIR/hardware.yaml << EOF
44
kernel: assets/$(basename $kernel)
45
initrd: assets/$(basename $initrd)
46
partition-layout: system-AB
50
if [ "$ARCH" = "armhf" ]; then
51
cat >> $TMPDIR/hardware.yaml << EOF
56
cat >> $TMPDIR/hardware.yaml << EOF
65
tar -c -z -f $HERE/device.tar.gz system assets hardware.yaml
70
# remove files from the root filesystem
71
(cd binary/boot/filesystem.dir
73
rm -f boot/initrd.img-*
75
rm -f boot/System.map-*