Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2091,8 +2091,17 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
fi
done

clamp_mtimes() {
find "$1" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
| xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh"
}

if [[ $do_hardlink == yes ]] && command -v hardlink > /dev/null; then
dinfo "*** Hardlinking files ***"
if [[ $DRACUT_REPRODUCIBLE ]]; then
# hardlink only de-dupes identical mtimes; clamp any dynamically-generated files.
clamp_mtimes "$initdir"
fi
hardlink "$initdir" 2>&1 | ddebug
dinfo "*** Hardlinking files done ***"
fi
Expand Down Expand Up @@ -2299,8 +2308,7 @@ if [[ $uefi == yes ]]; then
fi

if [[ $DRACUT_REPRODUCIBLE ]]; then
find "$initdir" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
| xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh"
clamp_mtimes "$initdir"

if [[ "$(cpio --help)" == *--reproducible* ]]; then
CPIO_REPRODUCIBLE=1
Expand All @@ -2315,8 +2323,7 @@ if [[ $create_early_cpio == yes ]]; then
echo 1 > "$early_cpio_dir/d/early_cpio"

if [[ $DRACUT_REPRODUCIBLE ]]; then
find "$early_cpio_dir/d" -newer "$dracutbasedir/dracut-functions.sh" -print0 \
| xargs -r -0 touch -h -m -c -r "$dracutbasedir/dracut-functions.sh"
clamp_mtimes "$early_cpio_dir/d"
fi

# The microcode blob is _before_ the initramfs blob, not after
Expand Down