Skip to content

Commit

Permalink
initrd: Start on reproducible build
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-weiss committed Feb 6, 2025
1 parent 9b10beb commit d27d3ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ebcl/tools/initrd/initrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,11 +384,16 @@ def create_initrd(self) -> Optional[str]:
init_script.write_text(init_script_content)
os.chmod(init_script, 0o755)

# reproducible build
self.config.fake.run_sudo(
'find . | xargs touch -h -a -m -d $(date --utc --date=@${SOURCE_DATE_EPOCH:-$(date +%s)} +%Y-%m-%d) {}',
cwd=self.target_dir)

# Create initrd image
os.makedirs(os.path.dirname(image_path), exist_ok=True)
with open(image_path, 'wb') as img:
self.config.fake.run_sudo(
'find . -print0 | cpio --null -ov --format=newc', cwd=self.target_dir, stdout=img)
'find . -print0 | cpio --null -ov --format=newc --reproducible', cwd=self.target_dir, stdout=img)

return image_path

Expand Down

0 comments on commit d27d3ef

Please sign in to comment.