Browse Source

fix: support mender deb package data archive zstandard compression

Newer upstream mender-client deb packages are using zstd compression
for the data tar archive. Up until now there was only support for xz
compression. Added additional support so that the data archive can be
either xz or zstd compressed.

Changelog: support added for mender-client deb package data archive compressed with zstd
Ticket: MEN-6307

Signed-off-by: Dell Green <dell.green@ideaworks.co.uk>
Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
4.0.x
Dell Green 2 years ago
committed by Kristian Amlie
parent
commit
7e4632dbc4
No known key found for this signature in database GPG Key ID: F464407C996AF03F
  1. 1
      Dockerfile
  2. 7
      modules/deb.sh

1
Dockerfile

@ -17,6 +17,7 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \
# For 'ar' command to unpack .deb # For 'ar' command to unpack .deb
binutils \ binutils \
xz-utils \ xz-utils \
zstd \
# to be able to detect file system types of extracted images # to be able to detect file system types of extracted images
file \ file \
# to copy files between rootfs directories # to copy files between rootfs directories

7
modules/deb.sh

@ -1,4 +1,4 @@
# Copyright 2022 Northern.tech AS # Copyright 2023 Northern.tech AS
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -111,7 +111,10 @@ function deb_extract_package() {
cd ${extract_dir} cd ${extract_dir}
run_and_log_cmd "ar -xv ${deb_package}" run_and_log_cmd "ar -xv ${deb_package}"
mkdir -p files mkdir -p files
run_and_log_cmd "sudo tar xJf data.tar.xz -C files"
local -r data_archive=$(find . -maxdepth 1 -type f -regex '.*/data\.tar\.\(zst\|xz\)' -printf '%P\n' -quit)
run_and_log_cmd "sudo tar xf ${data_archive} -C files"
cd - > /dev/null 2>&1 cd - > /dev/null 2>&1
run_and_log_cmd "sudo rsync --archive --keep-dirlinks --verbose ${extract_dir}/files/ ${dest_dir}" run_and_log_cmd "sudo rsync --archive --keep-dirlinks --verbose ${extract_dir}/files/ ${dest_dir}"

Loading…
Cancel
Save