diff options
author | Roland Clobus <rclobus@rclobus.nl> | 2021-01-01 16:51:02 +0000 |
---|---|---|
committer | Luca Boccassi <bluca@debian.org> | 2021-01-01 16:51:02 +0000 |
commit | 037e93fe37f8b5d974e3e6219fa6ee94ad5cf504 (patch) | |
tree | e69a07c5d4d2ccc5cfc9bcec3766f445c832deeb | |
parent | 3f7dd00fcb83177e679e9f1449200dee11dc1531 (diff) | |
download | vyos-live-build-037e93fe37f8b5d974e3e6219fa6ee94ad5cf504.tar.gz vyos-live-build-037e93fe37f8b5d974e3e6219fa6ee94ad5cf504.zip |
Preserve timestamps
-rwxr-xr-x | scripts/build/binary_disk | 6 | ||||
-rwxr-xr-x | scripts/build/binary_grub-efi | 14 | ||||
-rwxr-xr-x | scripts/build/binary_loadlin | 6 | ||||
-rwxr-xr-x | scripts/build/binary_manifest | 12 | ||||
-rwxr-xr-x | scripts/build/binary_memtest | 4 | ||||
-rwxr-xr-x | scripts/build/binary_rootfs | 6 | ||||
-rwxr-xr-x | scripts/build/binary_win32-loader | 4 | ||||
-rwxr-xr-x | scripts/build/efi-image | 4 | ||||
-rwxr-xr-x | scripts/build/installer_debian-installer | 10 |
9 files changed, 36 insertions, 30 deletions
diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk index 8086ffead..4be6aef67 100755 --- a/scripts/build/binary_disk +++ b/scripts/build/binary_disk @@ -137,13 +137,13 @@ do then case "${LB_DEBIAN_INSTALLER}" in cdrom) - cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_udeb_include" binary/.disk/udeb_include + cp -a "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_udeb_include" binary/.disk/udeb_include ;; netinst|live) - cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_netinst_udeb_include" binary/.disk/udeb_include + cp -a "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_netinst_udeb_include" binary/.disk/udeb_include ;; businesscard) - cp "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_businesscard_udeb_include" binary/.disk/udeb_include + cp -a "${LOCATION}/${LB_PARENT_DISTRIBUTION_BINARY}/${LB_ARCHITECTURE}_businesscard_udeb_include" binary/.disk/udeb_include ;; none|netboot) ;; diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index b12dd0efe..37f0472cc 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -165,8 +165,8 @@ gen_efi_boot_img(){ local outdir="grub-efi-temp-\${platform}" "\${LIVE_BUILD_PATH}/efi-image" "${_CHROOT_DIR}/\$outdir" "\$platform" "\$efi_name" "\$netboot_prefix" mkdir -p ${_CHROOT_DIR}/grub-efi-temp/EFI/boot - mcopy -n -i ${_CHROOT_DIR}/\$outdir/efi.img '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/EFI/boot - cp -r "${_CHROOT_DIR}"/\$outdir/* "${_CHROOT_DIR}/grub-efi-temp/" + mcopy -m -n -i ${_CHROOT_DIR}/\$outdir/efi.img '::efi/boot/boot*.efi' ${_CHROOT_DIR}/grub-efi-temp/EFI/boot + cp -a "${_CHROOT_DIR}"/\$outdir/* "${_CHROOT_DIR}/grub-efi-temp/" # Secure Boot support: # - create the EFI directory in the ESP with uppercase letters to make @@ -188,9 +188,9 @@ gen_efi_boot_img(){ if [ -r ${_CHROOT_DIR}/usr/lib/grub/\$platform-signed/gcd\$efi_name.efi.signed -a \ -r ${_CHROOT_DIR}/usr/lib/shim/shim\$efi_name.efi.signed -a \ "${LB_UEFI_SECURE_BOOT}" != "disable" ]; then - cp ${_CHROOT_DIR}/usr/lib/grub/\$platform-signed/gcd\$efi_name.efi.signed \ + cp -a ${_CHROOT_DIR}/usr/lib/grub/\$platform-signed/gcd\$efi_name.efi.signed \ ${_CHROOT_DIR}/grub-efi-temp/EFI/boot/grub\$efi_name.efi - cp ${_CHROOT_DIR}/usr/lib/shim/shim\$efi_name.efi.signed \ + cp -a ${_CHROOT_DIR}/usr/lib/shim/shim\$efi_name.efi.signed \ ${_CHROOT_DIR}/grub-efi-temp/EFI/boot/boot\$efi_name.efi fi } @@ -259,12 +259,12 @@ rm -f ${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img mkfs.msdos -C "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" \$blocks >/dev/null mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::EFI mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::EFI/boot -mcopy -o -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ${_CHROOT_DIR}/grub-efi-temp/EFI/boot/*.efi \ +mcopy -m -o -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ${_CHROOT_DIR}/grub-efi-temp/EFI/boot/*.efi \ "::EFI/boot" mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::boot mmd -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ::boot/grub -mcopy -o -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg \ +mcopy -m -o -i "${_CHROOT_DIR}/grub-efi-temp/boot/grub/efi.img" ${_CHROOT_DIR}/grub-efi-temp-cfg/grub.cfg \ "::boot/grub" END @@ -294,7 +294,7 @@ rm -f chroot/grub-efi-temp/bootnetaa64.efi rm -f chroot/grub-efi-temp/bootnetarm.efi mkdir -p binary -cp -r chroot/grub-efi-temp/* binary/ +cp -a chroot/grub-efi-temp/* binary/ rm -rf chroot/grub-efi-temp-x86_64-efi rm -rf chroot/grub-efi-temp-i386-efi rm -rf chroot/grub-efi-temp-arm64-efi diff --git a/scripts/build/binary_loadlin b/scripts/build/binary_loadlin index 25473f11b..8ffc1f260 100755 --- a/scripts/build/binary_loadlin +++ b/scripts/build/binary_loadlin @@ -60,8 +60,10 @@ case "${LB_ARCHITECTURE}" in # Copying loadlin mkdir -p binary/tools - gunzip -c "${_PREFIX}/usr/lib/loadlin/loadlin.exe.gz" > binary/tools/loadlin.exe - gunzip -c "${_PREFIX}/usr/share/doc/loadlin/manual.txt.gz" > binary/tools/loadlin.txt + cp -a "${_PREFIX}/usr/lib/loadlin/loadlin.exe.gz" binary/tools + cp -a "${_PREFIX}/usr/share/doc/loadlin/manual.txt.gz" binary/tools/loadlin.txt.gz + gunzip binary/tools/loadlin.exe.gz + gunzip binary/tools/loadlin.txt.gz # Saving cache Save_package_cache binary diff --git a/scripts/build/binary_manifest b/scripts/build/binary_manifest index e032cd844..382305611 100755 --- a/scripts/build/binary_manifest +++ b/scripts/build/binary_manifest @@ -50,13 +50,17 @@ case "${LB_INITRAMFS}" in esac # Add filesystem.packages -cp chroot.packages.live "binary/${INITFS}/filesystem.${SUFFIX}" -echo "$(diff chroot.packages.live chroot.packages.install | awk '/^< / { print $2 }')" \ +cp -a chroot.packages.live "binary/${INITFS}/filesystem.${SUFFIX}" +diff chroot.packages.live chroot.packages.install | awk '/^< / { print $2 }' \ > "binary/${INITFS}/filesystem.${SUFFIX}-remove" +if [ ! -s "binary/${INITFS}/filesystem.${SUFFIX}-remove" ] +then + rm "binary/${INITFS}/filesystem.${SUFFIX}-remove" +fi -cp chroot.packages.live ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.packages +cp -a chroot.packages.live ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.packages -cp chroot.files ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.files +cp -a chroot.files ${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.files # Creating stage file Create_stagefile diff --git a/scripts/build/binary_memtest b/scripts/build/binary_memtest index de9bedf85..acfdfcbce 100755 --- a/scripts/build/binary_memtest +++ b/scripts/build/binary_memtest @@ -89,11 +89,11 @@ mkdir -p "${DESTDIR}" # Installing memtest case "${LB_BUILD_WITH_CHROOT}" in true) - cp chroot/boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest + cp -a chroot/boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest ;; false) - cp /boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest + cp -a /boot/${LB_MEMTEST}.bin "${DESTDIR}"/memtest ;; esac diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs index 5934ad672..0f72620f5 100755 --- a/scripts/build/binary_rootfs +++ b/scripts/build/binary_rootfs @@ -278,11 +278,11 @@ case "${LB_CHROOT_FILESYSTEM}" in case "${LB_BUILD_WITH_CHROOT}" in true) - cp config/rootfs/squashfs.sort chroot + cp -a config/rootfs/squashfs.sort chroot ;; false) - cp config/rootfs/squashfs.sort . + cp -a config/rootfs/squashfs.sort . ;; esac fi @@ -304,7 +304,7 @@ case "${LB_CHROOT_FILESYSTEM}" in true) if [ -e config/rootfs/excludes ] then - cp config/rootfs/excludes chroot/excludes + cp -a config/rootfs/excludes chroot/excludes MKSQUASHFS_OPTIONS="${MKSQUASHFS_OPTIONS} -wildcards -ef /excludes" fi diff --git a/scripts/build/binary_win32-loader b/scripts/build/binary_win32-loader index 18fccfa64..c4b42e1ad 100755 --- a/scripts/build/binary_win32-loader +++ b/scripts/build/binary_win32-loader @@ -53,9 +53,9 @@ case "${LB_ARCHITECTURE}" in if [ "${LB_BUILD_WITH_CHROOT}" = "true" ] then # Copying win32-loader - cp -r chroot/usr/share/win32/* binary + cp -a chroot/usr/share/win32/* binary else - cp -r usr/share/win32/* binary + cp -a usr/share/win32/* binary fi mv binary/win32-loader.exe binary/setup.exe diff --git a/scripts/build/efi-image b/scripts/build/efi-image index 985922896..a1d3ccfbc 100755 --- a/scripts/build/efi-image +++ b/scripts/build/efi-image @@ -78,10 +78,10 @@ mkfs.msdos -C "$outdir/efi.img" \ / 32 * 32 )) mmd -i "$outdir/efi.img" ::efi mmd -i "$outdir/efi.img" ::efi/boot -mcopy -i "$outdir/efi.img" "$workdir/boot$efi_name.efi" \ +mcopy -m -i "$outdir/efi.img" "$workdir/boot$efi_name.efi" \ "::efi/boot/boot$efi_name.efi" grub-cpmodules "$outdir" "$platform" -cp /usr/share/grub/unicode.pf2 "$outdir/boot/grub/" +cp -a /usr/share/grub/unicode.pf2 "$outdir/boot/grub/" exit 0 diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 6936666b6..b40b15c6e 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -178,7 +178,7 @@ Install_file() { mkdir -p "${TARGET}"/"${LETTER}"/"${SOURCE}" # Move files - cp "${FILE}" "${TARGET}"/"${LETTER}"/"${SOURCE}" + cp -a "${FILE}" "${TARGET}"/"${LETTER}"/"${SOURCE}" } # Set absolute directory for caching; we require it when we call Download_file @@ -215,7 +215,7 @@ Download_file () { CP_OPTIONS="-l" fi - cp -f ${CP_OPTIONS} -- "${_LB_CACHE_FILE}" "${_LB_TARGET}" + cp -a -f ${CP_OPTIONS} -- "${_LB_CACHE_FILE}" "${_LB_TARGET}" } VMLINUZ_DI="vmlinuz" @@ -550,7 +550,7 @@ EOF # Copy from cache if available, otherwise download if [ -f "${UDEB_CACHE_DIR}/${_UDEB_FILENAME}" ]; then Echo_debug "Copying %s from cache" "${UDEB}" - cp "${UDEB_CACHE_DIR}/${_UDEB_FILENAME}" ./ + cp -a "${UDEB_CACHE_DIR}/${_UDEB_FILENAME}" ./ else Echo_debug "Downloading %s" "${UDEB}" wget ${WGET_OPTIONS} "${LB_PARENT_MIRROR_CHROOT}/${UDEB}" @@ -566,7 +566,7 @@ EOF # Copy from cache if available, otherwise download if [ -f "${UDEB_CACHE_DIR}/${_UDEB_FILENAME}" ]; then Echo_debug "Copying %s from cache" "${UDEB}" - cp "${UDEB_CACHE_DIR}/${_UDEB_FILENAME}" ./ + cp -a "${UDEB_CACHE_DIR}/${_UDEB_FILENAME}" ./ else Echo_debug "Downloading %s" "${UDEB}" wget ${WGET_OPTIONS} "${LB_MIRROR_CHROOT}/${UDEB}" @@ -578,7 +578,7 @@ EOF Echo_debug "Refreshing udeb cache" rm -rf "${UDEB_CACHE_DIR}" mkdir -p "${UDEB_CACHE_DIR}" - cp *.udeb "${UDEB_CACHE_DIR}" + cp -a *.udeb "${UDEB_CACHE_DIR}" Echo_debug "Including local udebs" |