From 39c0c2c98d9cc6cf21923e3f408f8eeaea92f7a8 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 15 Jul 2018 16:19:44 +0200 Subject: [PATCH] Handle boot files via regular rootfs package machanisms Just install the kernel package to the rootfs /boot directory and add a step to the rootfs package to move /boot data out of the squasfs image. Add linux package as regular dependency to the rootfs. Signed-off-by: David Oberhollenzer --- board/alix/ROOTFS | 1 + board/rpi3/ROOTFS | 1 + pkg/linux-rpi3/build | 7 +++++-- pkg/linux/build | 7 +++++-- pkg/release-alix/build | 2 +- pkg/release-rpi3/build | 2 +- pkg/rootfs/build | 7 +++++++ 7 files changed, 21 insertions(+), 6 deletions(-) diff --git a/board/alix/ROOTFS b/board/alix/ROOTFS index 09a75ec..7020041 100644 --- a/board/alix/ROOTFS +++ b/board/alix/ROOTFS @@ -8,3 +8,4 @@ btrfs-progs dosfstools nftables dhcpcd +linux diff --git a/board/rpi3/ROOTFS b/board/rpi3/ROOTFS index 762f73e..902b63d 100644 --- a/board/rpi3/ROOTFS +++ b/board/rpi3/ROOTFS @@ -11,3 +11,4 @@ kbd firmware-rpi3 dhcpcd linux-firmware-rpi3 +linux-rpi3 diff --git a/pkg/linux-rpi3/build b/pkg/linux-rpi3/build index 31cfe85..e218c90 100755 --- a/pkg/linux-rpi3/build +++ b/pkg/linux-rpi3/build @@ -30,7 +30,10 @@ deploy() { local SOURCE="$1" local DEPLOY="$2" - install -m 755 "arch/arm/boot/zImage" "$DEPLOY/vmlinuz" + mkdir -p "$DEPLOY/boot" + cp "arch/arm/boot/zImage" "$DEPLOY/boot/vmlinuz" + + echo "boot/vmlinuz m 555 0 0" > "$DEPLOY/rootfs_files.txt" } check_update() { @@ -40,4 +43,4 @@ check_update() { grep -o "raspberrypi-kernel_[0-9.]*-[0-9]" | \ sed 's/raspberrypi-kernel_//g' | sed 's/-/./g' | \ verson_find_greatest "$version" -} \ No newline at end of file +} diff --git a/pkg/linux/build b/pkg/linux/build index 03ed2df..b9df17b 100755 --- a/pkg/linux/build +++ b/pkg/linux/build @@ -32,11 +32,14 @@ deploy() { local SOURCE="$1" local DEPLOY="$2" - install -m 755 "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/vmlinuz" + mkdir -p "$DEPLOY/boot" + cp "arch/$LINUX_CPU/boot/$LINUX_TGT" "$DEPLOY/boot/vmlinuz" + + echo "boot/vmlinuz m 555 0 0" > "$DEPLOY/rootfs_files.txt" } check_update() { curl --silent -L https://www.kernel.org/feeds/kdist.xml | \ grep -o "[0-9.]*: longterm" | grep -o "[0-9.]*" | \ verson_find_greatest "$VERSION" -} \ No newline at end of file +} diff --git a/pkg/release-alix/build b/pkg/release-alix/build index 73ed91c..237fcd0 100755 --- a/pkg/release-alix/build +++ b/pkg/release-alix/build @@ -1,4 +1,4 @@ -DEPENDS="rootfs linux" +DEPENDS="rootfs" build() { local SOURCE="$1" diff --git a/pkg/release-rpi3/build b/pkg/release-rpi3/build index 19fdeae..2d13263 100755 --- a/pkg/release-rpi3/build +++ b/pkg/release-rpi3/build @@ -1,4 +1,4 @@ -DEPENDS="rootfs linux-rpi3 boot-rpi3" +DEPENDS="rootfs boot-rpi3" build() { local SOURCE="$1" diff --git a/pkg/rootfs/build b/pkg/rootfs/build index a0dc408..f31e71a 100755 --- a/pkg/rootfs/build +++ b/pkg/rootfs/build @@ -82,6 +82,13 @@ build() { sed -i 's#etc/#cfg/preserve/etc/#g' "$DEPLOY/pseudo" sed -i 's#var/lib/#cfg/preserve/var_lib/#g' "$DEPLOY/pseudo" sed -i 's#usr/#cfg/preserve/usr/#g' "$DEPLOY/pseudo" + + # don't add stuff for the boot partition to the squashfs image + mv ${PKGBUILDDIR}/boot/* "$DEPLOY" + + grep -v "^boot/" "$DEPLOY/pseudo" > "$DEPLOY/pseudo.temp" + mv "$DEPLOY/pseudo.temp" "$DEPLOY/pseudo" + echo "boot m 750 0 0" >> "$DEPLOY/pseudo" } deploy() {