introduce DEB_COMPRESS for dpkg-deb+kernel's KDEB_COMPRESS (#3222)

* introduce DEB_COMPRESS for dpkg-deb+kernel's KDEB_COMPRESS

- Avoids zstd which is now default in Ubuntu Impish, but can't be read by Debian dpkg
- Allows for xz, gzip, or none; defaults to xz; use gzip for faster, and none for much faster.

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>

* use KDEB_COMPRESS in packages/armbian/builddep for 5.12+ kernels too

Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
This commit is contained in:
Ricardo Pardini
2021-10-27 18:55:12 +02:00
committed by GitHub
parent a22e929853
commit be5f2b8c75
8 changed files with 16 additions and 13 deletions

View File

@@ -64,7 +64,7 @@ unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSO
PACKAGE_LIST_DESKTOP_BOARD_REMOVE PACKAGE_LIST_DESKTOP_FAMILY_REMOVE BOOTCONFIG_EDGE DESKTOP_ENVIRONMENT DESKTOP_ENVIRONMENT_CONFIG_NAME \
DESKTOP_APPGROUPS_SELECTED DESKTOP_APT_FLAGS_SELECTED DESKTOP_ENVIRONMENT_DIRPATH DESKTOP_ENVIRONMENT_PACKAGE_LIST_DIRPATH UBOOT_TARGET_MAP \
DESKTOP_ENVIRONMENT_DIRPATH DESKTOP_ENVIRONMENT_PACKAGE_LIST_DIRPATH DESKTOP_CONFIG_PREFIX DESKTOP_CONFIGS_DIR DESKTOP_APPGROUPS_DIR \
DEBIAN_RECOMMENDS USE_OVERLAYFS aggregated_content DEBOOTSTRAP_COMPONENTS DEBOOTSTRAP_OPTION MAINTAINER MAINTAINERMAIL EXTRAWIFI BOOTSCRIPT
DEBIAN_RECOMMENDS USE_OVERLAYFS aggregated_content DEBOOTSTRAP_COMPONENTS DEBOOTSTRAP_OPTION DEB_COMPRESS MAINTAINER MAINTAINERMAIL EXTRAWIFI BOOTSCRIPT
}
pack_upload ()

View File

@@ -315,7 +315,7 @@ compile_uboot()
[[ -n $atftempdir && -f $atftempdir/license.md ]] && cp "${atftempdir}/license.md" "$uboottempdir/${uboot_name}/usr/lib/u-boot/LICENSE.atf"
display_alert "Building deb" "${uboot_name}.deb" "info"
fakeroot dpkg-deb -b "$uboottempdir/${uboot_name}" "$uboottempdir/${uboot_name}.deb" >> "${DEST}"/${LOG_SUBPATH}/output.log 2>&1
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "$uboottempdir/${uboot_name}" "$uboottempdir/${uboot_name}.deb" >> "${DEST}"/${LOG_SUBPATH}/output.log 2>&1
rm -rf "$uboottempdir/${uboot_name}"
[[ -n $atftempdir ]] && rm -rf "${atftempdir}"
@@ -358,7 +358,7 @@ create_linux-source_package ()
Description: This package provides the source code for the Linux kernel $version
EOF
fakeroot dpkg-deb -z0 -b "${sources_pkg_dir}" "${sources_pkg_dir}.deb"
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} -z0 "${sources_pkg_dir}" "${sources_pkg_dir}.deb"
rsync --remove-source-files -rq "${sources_pkg_dir}.deb" "${DEB_STORAGE}/"
te=$(date +%s)
@@ -503,6 +503,7 @@ compile_kernel()
eval CCACHE_BASEDIR="$(pwd)" env PATH="${toolchain}:${PATH}" \
'make $CTHREADS $kernel_packing \
KDEB_PKGVERSION=$REVISION \
KDEB_COMPRESS=${DEB_COMPRESS} \
BRANCH=$BRANCH \
LOCALVERSION="-${LINUXFAMILY}" \
KBUILD_DEBARCH=$ARCH \
@@ -575,7 +576,8 @@ compile_firmware()
cd "${firmwaretempdir}" || exit
# pack
mv "armbian-firmware${FULL}" "armbian-firmware${FULL}_${REVISION}_all"
fakeroot dpkg -b "armbian-firmware${FULL}_${REVISION}_all" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
display_alert "Building firmware package" "armbian-firmware${FULL}_${REVISION}_all" "info"
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "armbian-firmware${FULL}_${REVISION}_all" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
mv "armbian-firmware${FULL}_${REVISION}_all" "armbian-firmware${FULL}"
rsync -rq "armbian-firmware${FULL}_${REVISION}_all.deb" "${DEB_STORAGE}/"
@@ -656,7 +658,7 @@ compile_armbian-zsh()
chmod 755 "${tmp_dir}/${armbian_zsh_dir}"/DEBIAN/postinst
fakeroot dpkg -b "${tmp_dir}/${armbian_zsh_dir}" >/dev/null
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "${tmp_dir}/${armbian_zsh_dir}" >> "${DEST}"/${LOG_SUBPATH}/output.log 2>&1
rsync --remove-source-files -rq "${tmp_dir}/${armbian_zsh_dir}.deb" "${DEB_STORAGE}/"
rm -rf "${tmp_dir}"
@@ -713,7 +715,7 @@ compile_armbian-config()
ln -sf /usr/sbin/armbian-config "${tmp_dir}/${armbian_config_dir}"/usr/bin/armbian-config
ln -sf /usr/sbin/softy "${tmp_dir}/${armbian_config_dir}"/usr/bin/softy
fakeroot dpkg -b "${tmp_dir}/${armbian_config_dir}" >/dev/null
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "${tmp_dir}/${armbian_config_dir}" >/dev/null
rsync --remove-source-files -rq "${tmp_dir}/${armbian_config_dir}.deb" "${DEB_STORAGE}/"
rm -rf "${tmp_dir}"
}

View File

@@ -21,6 +21,7 @@ fi
[[ -z $ROOTPWD ]] && ROOTPWD="1234" # Must be changed @first login
[[ -z $MAINTAINER ]] && MAINTAINER="Igor Pecovnik" # deb signature
[[ -z $MAINTAINERMAIL ]] && MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature
[[ -z $DEB_COMPRESS ]] && DEB_COMPRESS="xz" # compress .debs with XZ by default. Use 'none' for faster/larger builds
TZDATA=$(cat /etc/timezone) # Timezone for target is taken from host or defined here.
USEALLCORES=yes # Use all CPU cores for compiling
HOSTRELEASE=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d"=" -f2)

View File

@@ -95,7 +95,7 @@ create_desktop_package ()
mkdir -p "${DEB_STORAGE}/${RELEASE}"
cd "${destination}"; cd ..
fakeroot dpkg-deb -b "${destination}" "${DEB_STORAGE}/${RELEASE}/${CHOSEN_DESKTOP}_${REVISION}_all.deb" >/dev/null
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "${destination}" "${DEB_STORAGE}/${RELEASE}/${CHOSEN_DESKTOP}_${REVISION}_all.deb" >/dev/null
# cleanup
rm -rf "${tmp_dir}"
@@ -160,7 +160,7 @@ create_bsp_desktop_package ()
mkdir -p "${DEB_STORAGE}/${RELEASE}"
cd "${destination}"; cd ..
fakeroot dpkg-deb -b "${destination}" "${DEB_STORAGE}/${RELEASE}/${package_name}.deb" >/dev/null
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "${destination}" "${DEB_STORAGE}/${RELEASE}/${package_name}.deb" >/dev/null
# cleanup
rm -rf "${tmp_dir}"
@@ -264,7 +264,7 @@ desktop_postinstall ()
# install per board packages
if [[ -n ${PACKAGE_LIST_DESKTOP_BOARD} ]]; then
run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get -yqq --no-install-recommends install $PACKAGE_LIST_DESKTOP_BOARD"
run_on_sdcard "DEBIAN_FRONTEND=noninteractive apt-get -yqq --no-install-recommends install $PACKAGE_LIST_DESKTOP_BOARD"
fi
# install per family packages

View File

@@ -309,7 +309,7 @@ fi
find "${destination}" ! -type l -print0 2>/dev/null | xargs -0r chmod 'go=rX,u+rw,a-s'
# create board DEB file
fakeroot dpkg-deb -b "${destination}" "${destination}.deb" >> "${DEST}"/${LOG_SUBPATH}/install.log 2>&1
fakeroot dpkg-deb -b -Z${DEB_COMPRESS} "${destination}" "${destination}.deb" >> "${DEST}"/${LOG_SUBPATH}/output.log 2>&1
mkdir -p "${DEB_STORAGE}/${RELEASE}/"
rsync --remove-source-files -rq "${destination}.deb" "${DEB_STORAGE}/${RELEASE}/"

View File

@@ -99,7 +99,7 @@ EOT
# Create the package
dpkg-gencontrol -p$pname -P"$pdir"
dpkg-deb --build "$pdir" ..
dpkg-deb ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
}
deploy_kernel_headers () {

View File

@@ -84,7 +84,7 @@ index 1b11f8993..c21d931ea 100755
# Create the package
dpkg-gencontrol -p$pname -P"$pdir"
- dpkg-deb $dpkg_deb_opts ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
+ dpkg-deb --build "$pdir" ..
+ dpkg-deb ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
}
deploy_kernel_headers () {

View File

@@ -61,7 +61,7 @@ index 6df3c9f..d33e1f3 100755
- dpkg-gencontrol -p$pname -P"$pdir"
- dpkg-deb ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
+ dpkg-gencontrol -p$pname -P"$pdir"
+ dpkg-deb --build "$pdir" ..
+ dpkg-deb ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
}
deploy_kernel_headers () {