-
-
Notifications
You must be signed in to change notification settings - Fork 206
Makefile: initrd refactoring and data.cpio simplification #1974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…or tools.cpio dir (initrd_tmp_dir/tools/bin+lib) and data (initrd_tmp_dir/data) so that wiping tools don't wipe data
There was an issue where initrd_tmp_dir was used to create tools.cpio and wipe that dir, while data.cpio was subdirectory of initrd_tmp_dir.
This seperates tools.cpio temp dir from data.cpio temp dir:
- tools.cpio: initrd_tmp_dir/tools/{bin,lib}
- data.cpio: initrd_tmp_dir/data
So that when wiping happens of a subdir, this doesn't affect others:
- initrd_tmp_dir = mktemp -d
- initrd_tools_dir = initrd_tmp_dir/tools
- initrd_bin_dir = initrd_tools_dir/bin
- initrd_lib_dir = initrd_tools_dir/lib
- initrd_data_dir = initrd_tmp_dir/data
This commit:
- Use proper variable names everywhere, no more initrd_tmp_dir.
- initrd_tools_dir, initrd_lib_dir, initrd_bin_dir, initrd_data_dir
- change to busybox (initrd_tmp_dir/bin -> initrd_bin_dir) as well and review all other modules
Signed-off-by: Thierry Laurion <[email protected]>
|
TLDR:
Unfortunately, its not the case all the time: i'm out of ideas here @JonathonHall-Purism So the broken changes are somewhere in those lines (introducing data.cpio to master): Where changes of this PR don't seem to fix it. The two data.cpio compared, one with good hash and whole slovene.map, the other with 0 byte slovene.map. No clue why 0 byte slovene.map. |
|
This board build: https://app.circleci.com/pipelines/github/tlaurion/heads/3343/workflows/ef3f1c47-ebeb-41d3-91be-9b06dc3d224a/jobs/68321/steps CircleCI just finished t480-hotp-maximized invalid data.cpio with 0 byte keymap: As can be seen in hashes.txt So to repro:
|
|
Some additional notes @JonathonHall-Purism : Note that an empty file hash is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 (as can be seen for cryptsetup placeholder file under hashes.txt and sizes.txt for ./run/cryptsetup/.placeholder
So at the time of populating hashes.txt and sizes.txt, I'm really puzzled right now. |
|
And x230-hotp-maximized has the good hash
So full repro to compare data.cpio of t480-hotp-maximized (bad) with x230-hotp-maximized (good)
|
…d from src|dst in modules; simplify logic (no cp -a --remove-destination; cp -R) Signed-off-by: Thierry Laurion <[email protected]>
|
@JonathonHall-Purism after off channel discussion, @JonathonHall-Purism pointed me that some Makefile code was interpreted at build time and not Makefile processing time; directory checks were always failing prior of kbd being compiled (so archive decompressed to check directories and files under it). It was also noted that the two problematic files under kbd keymaps were hardlinks of each other Note that having multiple copies of same files content, increasing space consumption instead of hardlinking doesn't make sense for cpio, since any duplicated space will be saved back with compression. And we don't care much about ram consumption for bootloader. So data.cpio was simplified to deal wirh src|dst registration under modules, copy into a differenciates data temp dir, and have that temp dir used to create data.cpio through /bin/clean-cpio to finally remove technical debt introduced by whiptail coloring with terminfo a while ago,useful for (not used much...) server BMC/ssh server console. f9afeb7 should be reproducible. Tested:
|
|
This is bugfix still, merging. |
|
Yes looks like that should do it, thanks. |
Fixes #1969 in f9afeb7
data.cpio should have hash of 879be3583e8a7ad429e969cba378d000f36cfd7d11acbebda78c0f0bb94eab1f for most boards.
Verified over Circleci t480, x230. And local builds.
TLDR: kbd archive contained hardlinked files which cp -a --remove-destination was not able to reproducibly put in data temp dir.
Details :
There was an issue where initrd_tmp_dir was used to create tools.cpio and wipe that dir, while data.cpio was subdirectory of initrd_tmp_dir. This PR seperates tools.cpio temp dir from data.cpio temp dir:
So that when wiping happens of a subdir, this doesn't affect others:
This commit: