SHA256
1
0
forked from pool/supermin
supermin/002-Fix-if-newer-copy-kernel.patch
Charles Arnold 4a80d0a52d - Update to version 5.3.3
* initrd: Support ztd-compressed modules
  * pacman: Recognise Artix, an Arch derivative
  * Add a separate variable to store link flags, and use that to
    supply
  * Add appropriate globs for arm based kernels. The file names end
    in -arm64 but the architecture is named aarch64.
  * Add support for OCaml 5.0
  * Add LFS support for fts functions
  * Numerous bug fixes
- Upstream bug fixes and features
  001-Improved-debugging-of-the-supermin-if-newer-calculation.patch
  002-Fix-if-newer-copy-kernel.patch
  003-Fix-kernel-filtering-for-aarch64-architecture.patch
  004-Use-output-complete-exe-instead-of-custom.patch
  005-Only-supply-output-complete-exe-to-final-link.patch
  006-Rename-function-file-kernel.patch
  007-Uncompress-kernel-on-RISC-V.patch
  008-Fix-link-to-renamed-kernel-documentation.patch
  009-New-mailing-list-email-address.patch
- Dropped initrd_support_ztd-compressed_modules.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/supermin?expand=0&rev=84
2024-01-04 20:05:17 +00:00

34 lines
1.4 KiB
Diff

Subject: src: Fix --if-newer --copy-kernel
From: Richard W.M. Jones rjones@redhat.com Mon Jun 12 13:02:37 2023 +0100
Date: Mon Jun 12 13:07:51 2023 +0100:
Git: 8c38641042e274a713a18daf7fc85584ca0fc9bb
We previously copied the kernel into the appliance using 'cp -p' which
preserves the datestamps of the installed kernel. This can confuse
the --if-newer calculation, if for example the package database is
newer than the date on the installed kernel (which quite often is the
case). This makes it think that the appliance is always older than
the package database, thus forcing a rebuild.
We can fix this using 'cp' instead of 'cp -p'. We don't need the
permissions and datestamps on the copied kernel to be preserved anyway
(in fact, it could cause problems if the permissions are restrictive).
Fixes: commit 30de2cb603cdde33524a66d5466f6a9b986ce8a6
diff --git a/src/format_ext2_kernel.ml b/src/format_ext2_kernel.ml
index c592703..6d2e699 100644
--- a/src/format_ext2_kernel.ml
+++ b/src/format_ext2_kernel.ml
@@ -311,6 +311,9 @@ and copy_or_symlink_file copy_kernel src dest =
if not copy_kernel then
symlink src dest
else (
- let cmd = sprintf "cp -p %s %s" (quote src) (quote dest) in
+ (* NB: Do not use -p here, we want the kernel to appear newer
+ * so that --if-newer works.
+ *)
+ let cmd = sprintf "cp %s %s" (quote src) (quote dest) in
run_command cmd
)