Skip to content

Commit 07e8527

Browse files
committed
Adjust decompression command parameters
1 parent 64a2995 commit 07e8527

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

build-armbian/armbian-files/common-files/usr/sbin/armbian-update

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ get_textoffset() {
112112
temp_dir="$(mktemp -d)"
113113
(
114114
cd ${temp_dir}
115-
tar -xzf "${boot_tgz_file}" --touch "${vmlinuz_name}"
115+
tar -mxzf "${boot_tgz_file}" "${vmlinuz_name}"
116116
)
117117
# With TEXT_OFFSET patch is [ 0108 ], without TEXT_OFFSET patch is [ 0000 ] and need to ues [ UBOOT_OVERLOAD ] file.
118118
[[ "$(hexdump -n 15 -x "${temp_dir}/${vmlinuz_name}" 2>/dev/null | head -n 1 | awk '{print $7}')" == "0108" ]] && need_overload="no"
@@ -318,7 +318,7 @@ download_kernel() {
318318
echo -e "${INFO} Download kernel to: [ ${kernel_path} ]"
319319
wget "${kernel_down_from}" -q -P "${kernel_path}"
320320
[[ "${?}" -ne "0" ]] && error_msg "Failed to download kernel."
321-
tar -xzf "${kernel_path}/${inputs_kernel}.tar.gz" --touch -C "${kernel_path}"
321+
tar -mxzf "${kernel_path}/${inputs_kernel}.tar.gz" -C "${kernel_path}"
322322
[[ "${?}" -ne "0" ]] && error_msg "Failed to extract kernel [ ${inputs_kernel} ], stop updating."
323323
kernel_path="${kernel_path}/${inputs_kernel}"
324324
else
@@ -453,7 +453,7 @@ update_kernel() {
453453
rm -rf /boot/uInitrd /boot/Image /boot/zImage /boot/dtb-*
454454

455455
# 01. For /boot five files
456-
tar -xzf boot-${kernel_name}.tar.gz --touch -C /boot
456+
tar -mxzf boot-${kernel_name}.tar.gz -C /boot
457457
[[ "${PLATFORM}" == "amlogic" ]] && (cd /boot && cp -f uInitrd-${kernel_name} uInitrd && cp -f vmlinuz-${kernel_name} zImage)
458458
[[ "${PLATFORM}" == "rockchip" ]] && (cd /boot && ln -sf uInitrd-${kernel_name} uInitrd && ln -sf vmlinuz-${kernel_name} Image)
459459
[[ "${PLATFORM}" == "allwinner" ]] && (cd /boot && cp -f uInitrd-${kernel_name} uInitrd && cp -f vmlinuz-${kernel_name} Image)
@@ -462,21 +462,21 @@ update_kernel() {
462462

463463
# 02. For /boot/dtb/${PLATFORM}/*
464464
[[ -d "/boot/dtb/${PLATFORM}" ]] || mkdir -p /boot/dtb/${PLATFORM}
465-
tar -xzf dtb-${PLATFORM}-${kernel_name}.tar.gz --touch -C /boot/dtb/${PLATFORM}
465+
tar -mxzf dtb-${PLATFORM}-${kernel_name}.tar.gz -C /boot/dtb/${PLATFORM}
466466
[[ "${PLATFORM}" == "rockchip" ]] && ln -sf dtb /boot/dtb-${kernel_name}
467467
[[ "$(ls /boot/dtb/${PLATFORM} -l 2>/dev/null | grep "^-" | wc -l)" -ge "2" ]] || error_msg "/boot/dtb/${PLATFORM} files is missing."
468468
echo -e "${INFO} (2/4) Unpacking [ dtb-${PLATFORM}-${kernel_name}.tar.gz ] succeeded."
469469

470470
# 03. For /usr/src/linux-headers-${kernel_name}
471471
header_path="linux-headers-${kernel_name}"
472472
rm -rf /usr/src/linux-headers-* && mkdir -p "/usr/src/${header_path}"
473-
tar -xzf header-${kernel_name}.tar.gz --touch -C /usr/src/${header_path}
473+
tar -mxzf header-${kernel_name}.tar.gz -C /usr/src/${header_path}
474474
[[ -d "/usr/src/${header_path}/include" ]] || error_msg "/usr/src/${header_path}/include folder is missing."
475475
echo -e "${INFO} (3/4) Unpacking [ header-${kernel_name}.tar.gz ] succeeded."
476476

477477
# 04. For /usr/lib/modules/${kernel_name}
478478
rm -rf /usr/lib/modules/*
479-
tar -xzf modules-${kernel_name}.tar.gz --touch -C /usr/lib/modules
479+
tar -mxzf modules-${kernel_name}.tar.gz -C /usr/lib/modules
480480
(cd /usr/lib/modules/${kernel_name}/ && rm -f build source && ln -sf /usr/src/${header_path} build)
481481
[[ -d "/usr/lib/modules/${kernel_name}" ]] || error_msg "/usr/lib/modules/${kernel_name} kernel folder is missing."
482482
echo -e "${INFO} (4/4) Unpacking [ modules-${kernel_name}.tar.gz ] succeeded."

build-armbian/armbian-files/platform-files/allwinner/rootfs/usr/sbin/armbian-install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ copy_rootfs() {
299299
echo -e "${INFO} Copy the [ ${src} ] directory."
300300
tar -cf - ${src} | (
301301
cd ${DIR_INSTALL}
302-
tar -xf - --touch
302+
tar -mxf -
303303
)
304304
done
305305
# Create relevant symbolic link

build-armbian/armbian-files/platform-files/amlogic/rootfs/usr/sbin/armbian-install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ copy_rootfs() {
523523
echo -e "${INFO} Copying [ ${src} ] ..."
524524
tar -cf - ${src} | (
525525
cd ${DIR_INSTALL}
526-
tar -xf - --touch
526+
tar -mxf -
527527
)
528528
done
529529
# Create relevant symbolic link

rebuild

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ download_kernel() {
491491
wget "${kernel_down_from}" -q -P "${kernel_path}/${kd}"
492492
[[ "${?}" -ne "0" ]] && error_msg "Failed to download the kernel files from the server."
493493

494-
tar -xzf "${kernel_path}/${kd}/${kernel_var}.tar.gz" --touch -C "${kernel_path}/${kd}"
494+
tar -mxzf "${kernel_path}/${kd}/${kernel_var}.tar.gz" -C "${kernel_path}/${kd}"
495495
[[ "${?}" -ne "0" ]] && error_msg "[ ${kernel_var} ] kernel decompression failed."
496496
else
497497
echo -e "${INFO} (${x}.${i}) [ ${k} - ${kernel_var} ] Kernel is in the local directory."
@@ -761,7 +761,7 @@ replace_kernel() {
761761
[[ -s "${kernel_boot}" && -s "${kernel_dtb}" && -s "${kernel_modules}" && -s "${kernel_header}" ]] || error_msg "The 4 kernel missing."
762762

763763
# 01. For /boot five files
764-
tar -xzf ${kernel_boot} --touch -C ${tag_bootfs}
764+
tar -mxzf ${kernel_boot} -C ${tag_bootfs}
765765
[[ "${PLATFORM}" == "amlogic" ]] && (cd ${tag_bootfs} && cp -f uInitrd-${kernel_name} uInitrd && cp -f vmlinuz-${kernel_name} zImage)
766766
[[ "${PLATFORM}" == "rockchip" ]] && (cd ${tag_bootfs} && ln -sf uInitrd-${kernel_name} uInitrd && ln -sf vmlinuz-${kernel_name} Image)
767767
[[ "${PLATFORM}" == "allwinner" ]] && (cd ${tag_bootfs} && cp -f uInitrd-${kernel_name} uInitrd && cp -f vmlinuz-${kernel_name} Image)
@@ -770,18 +770,18 @@ replace_kernel() {
770770

771771
# 02. For /boot/dtb/${PLATFORM}/*
772772
[[ -d "${tag_bootfs}/dtb/${PLATFORM}" ]] || mkdir -p ${tag_bootfs}/dtb/${PLATFORM}
773-
tar -xzf ${kernel_dtb} --touch -C ${tag_bootfs}/dtb/${PLATFORM}
773+
tar -mxzf ${kernel_dtb} -C ${tag_bootfs}/dtb/${PLATFORM}
774774
[[ "${PLATFORM}" == "rockchip" ]] && ln -sf dtb ${tag_bootfs}/dtb-${kernel_name}
775775
[[ "$(ls ${tag_bootfs}/dtb/${PLATFORM} -l 2>/dev/null | grep "^-" | wc -l)" -ge "2" ]] || error_msg "/boot/dtb/${PLATFORM} files is missing."
776776

777777
# 03. For /usr/src/linux-headers-${kernel_name}
778778
header_path="linux-headers-${kernel_name}"
779779
rm -rf ${tag_rootfs}/usr/src/linux-headers-* 2>/dev/null && mkdir -p "${tag_rootfs}/usr/src/${header_path}"
780-
tar -xzf ${kernel_header} --touch -C ${tag_rootfs}/usr/src/${header_path}
780+
tar -mxzf ${kernel_header} -C ${tag_rootfs}/usr/src/${header_path}
781781
[[ -d "${tag_rootfs}/usr/src/${header_path}/include" ]] || error_msg "/usr/src/${header_path}/include folder is missing."
782782

783783
# 04. For /usr/lib/modules/${kernel_name}
784-
tar -xzf ${kernel_modules} --touch -C ${tag_rootfs}/usr/lib/modules
784+
tar -mxzf ${kernel_modules} -C ${tag_rootfs}/usr/lib/modules
785785
(cd ${tag_rootfs}/usr/lib/modules/${kernel_name}/ && rm -f build source 2>/dev/null && ln -sf /usr/src/${header_path} build)
786786
[[ "$(ls ${tag_rootfs}/usr/lib/modules/${kernel_name} -l 2>/dev/null | grep "^d" | wc -l)" -eq "1" ]] || error_msg "/usr/lib/modules kernel folder is missing."
787787
}

0 commit comments

Comments
 (0)