* Check that we're not already running lk2nd as flashing boot partition
inside lk2nd is different to flashing boot partition outside. We could
improve this in the future to use "flash lk2nd lk2nd.img" as
documented in the file.
* Grab the lk2nd package from the device package and install that. The
device package is expected to have a dependency on the correct lk2nd
package.
* Remove some log message in unusual styles for pmbootstrap.
* Group flash_lk2nd action together with the other flash actions and use
string comparison.
See also: https://gitlab.com/postmarketOS/pmaports/-/issues/2074
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230605104026.744005-1-luca@z3ntu.xyz%3E
Use ruff instead of flake8. Aside from being substantially faster, ruff
includes a lot of flake's plug-ins built-in, some of which may be useful
to enable as a follow-up.
Also move the relevant configuration out of the script in .ci/ and into
the project-wide settings. A side effect of this is that IDEs should
detect these settings, and ignore the same rules as CI, avoiding false
positives while developing locally.
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230529203448.18656-1-hugo@whynothugo.nl%3E
In theory, the en_US locale is supposed to be aimed at people, while the
C locale is aimed as computers. In theory, one of the remarkable
differences is in sorting:
$ printf '%s\n' \| a \0 \^ \& B c C | LC_COLLATE=C.UTF-8 sort
&
0
B
C
^
a
c
|
The non-sense there is obvious, with "^" sorting in between the letters,
"|" afterwards and sorting of capitals and non-capitals split. The reason
is the ordering is based on the ascii table. In theory, an en_US locale
should be able to provide a sensitive ordering, but what takes care of it
is the libc, and musl does not have it properly implemented. So LC_COLLATE=en_US
will still give the same results. However, that's hopefully going to change
at some point, and there's no harm in setting a sensible locale by default.
Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Make sure that we disable legacy gadgets like USB_ETH. Our initramfs
uses configfs gadgets instead, currently RNDIS for USB networking.
In the future this can be expanded to more options like mass storage,
MIDI or whatever we're going to integrate into the OS that can be
configured by the user.
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230423163438.746054-1-luca@z3ntu.xyz%3E
When invoking pmbootstrap build most packages default to the host arch,
however depending on your workflow it might be preferrable to default to
the device arch.
Add a new config option "build_default_device_arch" which when set will
make "pmbootstrap build" prioritise the device arch over the native
arch.
Default to False to preserve the old behaviour and don't ask during
pmbootstrap init as this may not be relevant for most folks.
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Co-developed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230418-build-default-arch-v5-2-5223fab65867@postmarketos.org%3E
Put it in /tmp and touch it directly from python instead of running
pmb.chroot.root. This way it's slightly faster and doesn't require root
rights. Order the imports alphabetically while at it, and remove very
obvious comments.
Reviewed-by: Caleb Connolly <kc@postmarketos.org>
Tested-by: Caleb Connolly <kc@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230419192042.3951-2-ollieparanoid@postmarketos.org%3E
abuild.conf got moved to /usr/share/abuild/default.conf and
/etc/abuild.conf is now just for user-changes. Adjust
configure_abuild() to append to /etc/abuild.conf if there is no line
defining JOBS
This should be backward compatible
Signed-off-by: Caleb Connolly <kc@postmarketos.org>
Tested-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
setup.py is on its way out, but it isn't replaced just yet. Adjust the
code that finds the version.
I'm pushing this directly to master as this fix is trivial and unbreaks
packaging current master of pmbootstrap.
Fix for (from pmbootstrap AUR package):
$ pip install build wheel
$ python -m build --wheel --no-isolation
File "/usr/lib/python3.10/ast.py", line 50, in parse
return compile(source, filename, mode, flags,
File "<unknown>", line 1
{"edge": "2.12.11-r0",
^
SyntaxError: '{' was never closed
Fixes: 6352ab9c ("Move version to pmb.__version__")
Fixes: pmbootstrap#2226
When running a pmbootstrap command and the pmaports dir does not exist,
it would print the following error:
WARNING: Can't create log file in '/home/user/.local/var/pmbootstrap', path does not exist!
[02:14:37] ERROR: We have split the aports repository from the pmbootstrap repository (#383). Please run 'pmbootstrap init' again to clone it.
[02:14:37] See also: <https://postmarketos.org/troubleshooting>
Run 'pmbootstrap log' for details. Alternatively you can use '--details-to-stdout' to get more output, e.g. 'pmbootstrap --details-to-stdout init'.
This is long obsolete. By now the reason for the missing pmaports dir is
not that we had moved it from pmbootstrap.git to a separate git
repository, it's most likely that the user did not run
'pmbootstrap init'. Adjust the message, and quit without link to
troubleshooting etc:
[02:15:28] ERROR: pmaports dir not found: /home/user/.local/var/pmbootstrap/cache_git/pmaports
[02:15:28] Did you run 'pmbootstrap init'?
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230408002810.2006-1-ollieparanoid@postmarketos.org%3E
So that githooks can be used in pmaports without the risk that symlinks
pose when checking out random branches from random people. The hooks
are copied, only when doing "pmbootstrap init", selecting the edge
channel and having the master branch checked out (not any other branch
on the edge channel or on any other channel).
Closes: pmaports#2055
Related: pmaports!4008
Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com>
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Co-developed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3CDB9P192MB129107CAA025F4EF59D3FB53C7999@DB9P192MB1291.EURP192.PROD.OUTLOOK.COM%3E
Python passes all arguments by reference. For mutable objects such as
a list used here, changing the object will change the original one. If
components_list is not set, this means the default value gets modified.
This lead to kernels getting checked with the wrong required components.
For example, when checking a kernel from community first with the
default component_list, it would get extended with all options needed
for a kernel in community. When checking another kernel from the
testing category, also with the default component_list, it would now
check for the community options in the testing kernel.
Related: https://stackoverflow.com/a/986145
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230402124338.64886-1-ollieparanoid@postmarketos.org%3E
Rename the file so it runs last, as it's currently failing a lot of
times on sourcehut. When I looked into it last time, it seemed to be
related to CDN caching and then it worked again so I didn't look further
into it at the time. Move it to the end until this is figured out
properly, so at least we see if all other tests are passing.
Replace the old kconfig check tests with new ones, that do not rely on:
* any kernel config in pmaports
* the currently required kconfig options set in pmb/config/__init__.py
This will make it much easier to change the required options, and moves
the testsuite a bit more towards making it completely independent from
current pmaports state.
Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-13-ollieparanoid@postmarketos.org%3E