frank-w / BPI-Router-Linux

Linux kernel 4.14+ for BPI-R2, 5.4+ for R64, 6.1+ for R2Pro and R3
Other
136 stars 47 forks source link

6.1-main deb package is not compatible with Debian Bullseye #101

Closed martinl closed 1 year ago

martinl commented 1 year ago
dpkg --contents linux-image-6.1.12-bpi-r2-main_6.1.12-bpi-r2-main-2_armhf.deb
dpkg-deb: error: archive 'linux-image-6.1.12-bpi-r2-main_6.1.12-bpi-r2-main-2_armhf.deb' uses unknown compression for member 'control.tar.zst', giving up

Looks like zst support was added in Debian 12: https://unix.stackexchange.com/questions/669004/zst-compression-not-supported-by-apt-dpkg

frank-w commented 1 year ago

Thanks for reporting,any idea how to fix it? As the debs are created by kernel build-chain i don't know how to change the compression

martinl commented 1 year ago

Looks like the issue is that github workflow is using ubuntu to build the deb packages and ubuntu deb/dpkg is using zst by default. Here are some recommendations how to change that, either by using command line or debian rules file:

https://stackoverflow.com/questions/71196872/how-do-i-build-a-deb-without-zstd-compression-in-ubuntu-21-10

Are the kernel deb packages built using build.sh pack_debs or before that?

martinl commented 1 year ago

I'm currently looking into getting bpi-r2 support in armbian back to shape (without internal bt/wifi) and I have 5.10 running with u-boot 2022.07 from sd (https://github.com/armbian/build/pull/4873)

Armbian build system can build mainline 6.1.x debs for bpi-r2 but it currently hangs at boot so I ended up here to find out how to fix it

frank-w commented 1 year ago

if you use the deb package from github-releases this is done by pack-deps

https://github.com/frank-w/BPI-Router-Linux/blob/6.1-main/.github/workflows/build.yml#L76

i do not create the debian-rules file...all is done by kernel build chain...so we need to find a way to pass this to dpkg

override_dh_builddeb:
    dh_builddeb -- -Zgzip

i found this, maybe we can change it by some env variable:

scripts/package/builddeb:53: dpkg-deb $dpkg_deb_opts ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..

could you try this and running build.sh pack_debs?

--- a/build.sh
+++ b/build.sh
@@ -327,7 +327,7 @@ function pack_debs {
        get_version
        echo "pack linux-headers, linux-image, linux-libc-dev debs..."
     echo "LOCALVERSION=${gitbranch} board=$board ARCH=$ARCH CROSS_COMPILE=$CROSS_COMPILE"
-       LOCALVERSION="${gitbranch}" board="$board" make bindeb-pkg
+       LOCALVERSION="${gitbranch}" board="$board" KDEB_COMPRESS=gzip make bindeb-pkg
        ls ../*.deb
 }
ejka commented 1 year ago

builddeb is only called in intdeb-pkg target and you use bindeb-pkg. To make bindeb-pkg work you need to patch scripts/package/mkdebian to add those two override lines to generated debian/rules. Something like this:

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index a3ac5a716e9f..9a70cb712313 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -240,6 +240,9 @@ clean:
        \$(MAKE) clean

 binary: binary-arch
+
+override_dh_builddeb:
+       dh_builddeb -- -Zgzip
 EOF
 chmod +x debian/rules
frank-w commented 1 year ago

thx, but could you try my way? i try to avoid patching kernel-source here

seems good from my point of view...i see a control.tar.gz and data.tar.gz in the deb-file i have generated now

frank-w commented 1 year ago

Verified older 6.1.12 main built by github actions has zst and last build has tar.gz files inside. So my way works too :)