Add module that provides utilities and information related to localization.
Initial implementation includes code to generate keyboard configs
for locale set by user.
Don't just run one "mv" command to move everything from source to
target. This fails if the same directory already exists in target.
Instead, go into each directory in source, and move all files inside
that directory into the target directory structure.
Fix the following error:
mv: cannot overwrite '/home/user/.local/var/pmbootstrap/chroot_native/usr/lib/sysctl.d': Directory not empty
Using pmbootstrap v3 with the old config can cause problems, for example
when having $WORK in the pmaports dir instead of the actual work path.
This is not supported anymore by v3 to reduce complexity. The format of
how mirrors are stored in the config also has changed.
Use a separate config file, so users can go back from v3 to 2.3.x if
they need to (for figuring out a regression) and so users won't run into
bugs when moving from 2.3.x to v3.
Move all kconfig rules from pmb.config to a separate toml file
pmb/data/kconfigcheck.toml. This is a fallback, pmbootstrap now prefers
loading kconfigcheck.toml from the currently checked out pmaports branch
if it exists.
This finally allows having separate kconfig check rules per pmaports
branch and makes the workflow of adjusting these rules much more
pleasant as the rules and kernel configs can just be adjusted at the
same time in pmaports!
This patch also moves the definition of what rules should be checked for
community and main devices, those that have pmb:kconfigcheck-community
in their linux APKBUILD, to the new kconfigcheck.toml. This should make
it much more intuitive, previously one needed to find the place in the
pmbootstrap source and edit it there.
Furthermore the "enforce_check" logic is removed. Previously pmbootstrap
would print warnings for failed config checks in some cases, but not
exit with error which was very confusing. Now exit 0 means all checks
passed and exit 1 means, that there is at least one error.
Use toml for the file, as discussed in pmbootstrap issue 2165. Python
3.11 has a native toml reader, use tomli for previous Python versions
for compatibility.
This is a potential security risk. Tighten things up so we only allow
local checksums to mismatch but remote ones must be correct.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
We can fairly easily patch abuild by appending anything we want to the
APKBUILD file after copying it to the chroot.
Leverage this to override the verify() function so that it doesn't die
when checksums don't match.
Instead let's build the package anyway, but set a flag and print a
warning with instructions on how to generate the checksums.
We should continue to require APKBUILDs in pmaports to have valid
checksums.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
Add some exhaustive unit testing to validate that these types behave as
expected.
And fix a few bugs uncovered by the tests.
Signed-off-by: Caleb Connolly <caleb@postmarketos.org>