1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 03:19:47 +03:00
Commit graph

78 commits

Author SHA1 Message Date
Caleb Connolly
65419c2bbe
treewide: lint markdown files (MR 2485)
lint all the markdown files so they pass markdownlint.

Signed-off-by: Caleb Connolly <caleb@postmarketos.org>
2025-02-17 00:20:03 +01:00
Robert Eckelmann
b87ae17414
docs: fix typos (MR 2510)
this fixes the typos found in #2524

Signed-off-by: Robert Eckelmann <longnoserob@postmarketos.org>
2024-12-19 16:36:21 +01:00
Oliver Smith
1dcb68bdca
docs: add env vars page with PMB_SUDO (MR 2506)
Move the description of PMB_SUDO from the README to docs.
2024-12-03 10:08:43 +01:00
Oliver Smith
79c6e4c36d
Prepare 3.0.0 release 2024-11-10 19:13:39 +01:00
Luca Weiss
49fd496c94
pmb.config: Set default ssh_key_glob to *.pub (MR 2251)
When generating an ssh key it's simple to change the name of the key to
something that's not e.g. id_rsa.pub or id_ed25519.pub, so let's try to
capture ssh keys for more users.
2024-11-07 01:14:06 +01:00
Oliver Smith
ef9d618199
README.md: remove deviceinfo_parse (MR 2469)
The command has been removed, so remove it from README.md too.
2024-11-05 00:18:33 +01:00
Newbyte
e0a2fbf28c
pmb.config: Check for kpartx and losetup with --json support (MR 2450)
Running these inside the chroot is tricky, and we ended up reverting
previous commits that attempted to make them run there (see
1ec55fc11a). As such, just accept defeat
and ensure that the host has these.

Also see https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2465
2024-10-27 13:14:10 +01:00
Luca Weiss
3df0be358f
Replace gitlab.com with gitlab.postmarketos.org (MR 2443)
Try to finish the migration by changing various links and texts to point
to the new GitLab instance.
2024-10-21 18:12:21 +02:00
Stefan Hansson
7aa7f63160
README.md: Add section about pmbootstrap's relation to pmaports (MR 2421)
This is section is not meant to represent my opinions, rather I seek to
document the status quo. I base the support range on what's been
reasoned in prior merge requests such as [1] and [2], as well as [3]
which only fixed CI in the one active stable release and left old stable
releases unfixed.

While I don't necessary think this is a great situation given that old
releases may sometimes be useful, extending the time pmbootstrap has to
support old releases would incur significant additional maintenance
effort and consequently require more discussion than just documenting
what's already happening. As such, I think this is the most reasonable
thing to do for now.

 [1]: https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2360#note_1999012908
 [2]: https://gitlab.com/postmarketOS/pmbootstrap/-/merge_requests/2417#note_2135527528
 [3]: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5676
2024-10-03 12:22:42 +02:00
Oliver Smith
9fd45fb334
Bump minimum python3 version to 3.10 (MR 2357) 2024-07-16 00:26:35 +02:00
Oliver Smith
9dfa89c58c
Use pmbootstrap_v3.cfg as config file (MR 2350)
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.
2024-07-10 20:06:25 +02:00
Oliver Smith
1dfaafe577
kconfig check: move rules to kconfigcheck.toml (MR 2333)
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.
2024-06-30 18:04:31 +02:00
Hugo Osvaldo Barrera
5a8e2c6cad
Converge supported Python onto 3.9 (MR 2326)
Python 3.9 was required in pmb/__init__.py already, but some references
still said 3.8 and 3.7.

Co-Developed-By: Oliver Smith <ollieparanoid@postmarketos.org>
2024-06-23 15:37:19 +02:00
Oliver Smith
6ebd4cccb9
README: mention 3.0.0_alpha 2024-06-23 12:49:25 +02:00
Newbyte
d0277bd315
README: Replace osk-sdl with tinydm in newapkbuild example (MR 2289)
See https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2333
2024-04-04 10:59:58 +02:00
Ferass El Hafidi
385fc2cfc1
README.md: mention parted bug in kernels between 5.8 and 6.0 (MR 2264)
Many have been unable to use pmbootstrap install on kernel versions
between 5.8 and 6.0 as parted was giving the following error:

	Error: Partition(s) 1, <...>, 64 on /dev/install have been
	       written, but we have been unable to inform the kernel
	       of the change, probably because it/they are in use.
	       As a result, the old partition(s) will remain in use.
	       You should reboot now before making further changes.

And pmb couldn't find /dev/loop0p1:

	ERROR: Unable to find the first partition of /dev/loop0,
	       expected it to be at /dev/loop0p1!

Related: pmbootstrap#2309

[ci:skip-build]: no code changes

Signed-off-by: Ferass El Hafidi <funderscore@postmarketos.org>
2024-02-22 14:59:23 +01:00
Oliver Smith
6ffb174870
README.md: update source code location
Related: https://postmarketos.org/blog/2024/01/17/moving-pmbootstrap/
2024-01-16 22:26:55 +00:00
Oliver Smith
d7f9769ee0
aportgen: remove binutils
Remove the code for generating binutils-aarch64 etc. packages, as these
live upstream in Alpine now. Having the generator scripts for binutils
cross pkgs is therefore not useful anymore and would just bitrot if we
kept it.

Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231126121617.3855-1-ollieparanoid@postmarketos.org%3E
2023-12-03 20:11:31 +01:00
Oliver Smith
ef047137d0
install: rename --sdcard arg to --disk
Rename the argument, because any block device can be passed to the
argument. Use "disk", because the other short word "device" usually
means the target device/phone to install.

Keep --sdcard as alias for compatibility with existing scripts and
muscle memory.

Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20231119182302.2415-1-ollieparanoid@postmarketos.org%3E
2023-11-19 20:27:37 +01:00
Raymond Hackley
9045bfb2b9
README.md: add armv7 to supported architecture
Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230812155519.52730-1-raymondhackley@protonmail.com%3E
2023-08-14 09:52:23 +02:00
Oliver Smith
185973fd97
Remove distcc support
With this code path, pmbootstrap would start a distccd + sshd in the
native chroot, and configure it so it runs the cross compiler. The
foreign arch chroots would then call this cross compiler from localhost
by calling the distcc client instead of gcc.

This code has been obsoleted by the much simpler crossdirect in 2019.
Let's finally remove it.

Fixes: issue 2179
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Reviewed-by: Clayton Craft <clayton@craftyguy.net>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230613161437.570196-4-ollieparanoid@postmarketos.org%3E
2023-06-15 08:31:03 +02:00
Caleb Connolly
204419fe49
build: make preferred target arch configurable
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
2023-05-01 13:19:14 +02:00
Oliver Smith
3113f354b8
Bump min. required Python version to 3.7
Increase it as 3.6 is EOL.

Related: https://en.wikipedia.org/wiki/History_of_Python#Table_of_versions
Reviewed-by: Luca Weiss <luca@z3ntu.xyz>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230326164931.2390-2-ollieparanoid@postmarketos.org%3E
2023-04-04 09:13:09 +02:00
Oliver Smith
04f8f59208
pmb.config.required_programs: add tar
Add tar as it is required for 'pmbootstrap ci' to get the source into
the pmbootstrap chroot.

Reviewed-by: Caleb Connolly <kc@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20221031111614.1377-2-ollieparanoid@postmarketos.org%3E
2022-11-09 09:19:32 +01:00
Martijn Braam
5042a947e5
README: Document git commands for setting the git-send-email defaults
It's possible to set the default To: address and subject prefix in the
git config of the local checkout. This makes the workflow a bit easier
and makes sure the subject starts with [PATCH pmbootstrap] instead of
the regular [PATCH].
2022-10-29 15:36:20 +01:00
Oliver Smith
1ef933e3be
README: add ML subscribe link 2022-10-26 00:36:34 +02:00
Oliver Smith
3bee7222d8
README: add link to issues 2022-10-25 22:49:23 +02:00
Oliver Smith
d61afe99eb
README: add new line
Just a detail, but given that the rest of this section is organized like
title: (new line) information, it looks more consistent.
2022-10-25 22:45:35 +02:00
Oliver Smith
1df2160129
README: update development section
* Mention that upstream is on SourceHut now
* Move it to the top, so people see this immediatelly
* Modernize instructions for running CI
2022-10-25 22:30:29 +02:00
Oliver Smith
39d75445b5
README: add line breaks
Get rid of very long lines, break them at 80 characters except if there
is a link or command-line output that is longer.
2022-10-25 22:30:29 +02:00
Oliver Smith
7914c11d1c
README: remove outdated information
* Links in the top row point to some very old blog posts and to the
  devices wiki page. Remove them, the first line has a link to
  postmarketos.org where the user should be able to get all relevant
  information about postmarketOS if they don't know this project.

* "Package build scripts live in the pmaports repository now.", this
  was useful shortly after we made the change, but it has been like this
  for years now. Again, the postmarketOS homepage lists where other
  related source code is, in case the user doesn't know.

* 2 GB of RAM recommened for compiling: this was a rule of thumb for
  when all postmarketOS packages had to be compiled from source. This is
  not the case anymore, we have a binary repository. Depending on which
  package you want to compile, you don't need as much RAM. And some
  users who just want to run 'pmbootstrap install' don't need to build
  anything at all. I think this is more confusing than helpful, so
  remove it.

* Kernels based on grsec patchset are not supported. I don't think
  anyone will try this, this was more relevant when the patchset was
  still distributed freely and you could actually use it in Alpine
  Linux (by default even?) and Arch Linux. An artefact of the past.
2022-10-25 22:30:28 +02:00
Tony Garnock-Jones
dfe8129640
Allow override of SSH key glob: documentation (MR 2167) 2022-02-13 16:26:49 +01:00
Anjandev Momi
c1407f921b
Use doas instead of sudo if installed (MR 2091)
Prefer using doas over sudo if both are installed. Let the user override
the sudo tool with PMB_SUDO.
2021-12-12 18:46:17 +01:00
Oliver Smith
d38bd6be2b
CI: drop support for cached venv + ci runner (MR 2080)
CI started failing with:
/builds/ollieparanoid/pmbootstrap/venv/bin/python3: No module named pytest

I've briefly tried to fix this with the existing scripts. However,
instead of investing more time into that, do the long overdue
refactoring of the scripts that involve dropping the venv logic and
support for a custon gitlab-ci-runner using some python docker image as
base. This configuration hasn't been used for a long time and is
probably broken anyway.

Refactor the logic to skip the qemu test case in gitlab CI by using
pytest markers. The new script is now similar to bpo's .ci/pytest.py.
2021-07-04 22:51:53 +02:00
Maxim Karasev
3d651af763
README: update requirements (MR 2077)
Alpine no longer provides linux-hardened, and also no additional
packages are required to run pmbootstrap on Alpine.
2021-07-02 04:06:49 +03:00
Antoine Fontaine
c30540d13c
README: add some documentation on how to run tests (MR 1973) 2021-06-13 17:43:51 +02:00
timbz
d0b32b3b05
pmbootstrap deviceinfo_parse: new action (MR 1986)
Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2020-11-10 09:15:52 +03:00
Oliver Smith
2933b57f5d
README.md: mention "pmbootstrap status" (!1882) 2020-03-14 19:15:32 +03:00
Minecrell
527f5a9512
Update required Python version to 3.6+ (!1879)
We need Python 3.5+ for recursive (**) globs.
While we are at it, we might as well require Python 3.6
so we can use f-strings in the future.
2020-03-14 08:39:13 +01:00
Oliver Smith
02e514f4d3
pmb.helpers.git.clone: use git from host system (!1845)
Do not install git in the native chroot and use it from there. Remove the
chown_to_user argument from pmb.helpers.git.clone(), the resulting dir
is now always owned by the user. While at it, refactor the function and
display the clone URL.

Previously we had cloned aports_upstream (from Alpine) with
chown_to_user=False (legacy) and pmaports with chown_to_user=True.
pmb.helpers.git.rev_parse() would only work after chown_to_user=True.

Check if git is installed in "pmbootstrap init", and remove the same
check from rev_parse(). Add a new work dir version, that checks for git
and changes ownership of already checked out aports_upstream to the
host system's user.

When creating a new work dir, create cache_git instead of cache_http.
cache_http is created on demand already, with proper permissions. But
cache_git must be created, otherwise pmb.helpers.mount.bind will create it
as root.

This is in preparation for the "pmbootstrap pull" feature, as it allows
using the host system's git in all new code paths. We will be able to
handle repositories even if they were cloned outside of the work dir
(which we do in a few CI scripts for example).

Related: #1858
2020-01-12 00:39:47 +01:00
Luca Weiss
2ad8b66ccc
Fix case sensitivity: Qemu => QEMU (!1800) 2019-07-05 20:27:12 +02:00
Idan Horo
fd79a60383
pmbootstrap install: make --no-fde default (!1798)
Implement --fde, add deprecation warning to --no-fde, update related
help files and tests.
2019-07-05 20:04:10 +02:00
Oliver Smith
933c4d0f0d new action: 'pmbootstrap repo_missing'
Add a new action that lists all aports, for which no binary packages
exist. Only list packages that can be built for the relevant arch
(specified with --arch). This works recursively: when a package can be
built for a certain arch, but one of its dependencies
(or their depends) can not be built for that arch, then don't list it.

This action will be used for the new sr.ht based build infrastructure,
to figure out which packages need to be built ahead of time (so we can
trigger each of them as single build job). Determining the order of the
packages to be built is not determined with pmbootstrap, the serverside
code of build.postmarketos.org takes care of that.

For testing purposes, a single package can also be specified and the
action will list if it can be built for that arch with its
dependencies, and what needs to be built exactly.

Add pmb/helpers/package.py to hold functions that work on both pmaports
and (binary package) repos - in contrary to the existing
pmb/helpers/pmaports.py (see previous commit) and pmb/helpers/repo.py,
which only work with one of those.

Refactoring:
* pmb/helpers/pmaports.py: add a get_list() function, which lists all
  aports and use it instead of writing the same glob loop over and over
* add pmb.helpers.pmaports.get(), which finds an APKBUILD and parses it
  in one step.
* rename pmb.build._package.check_arch to ...check_arch_abort to
  distinguish it from the other check_arch function
2018-12-01 21:30:59 +00:00
Robert Yang
277854e80f Kill the child processes spawned by a run command
When the timeout occurs it is important to ensure clean up of child
processes. Killing only the direct process created by a command can
leave child processes running.

For example a pmbootstrap.py install will run apk add. This run command
creates multiple processes as follows:
(cmd line arguments snipped for readability)

  $ ps -e -o pid,ppid,pgid,cmd
  PID  PPID  PGID CMD
  31738 23247 31738 python3 ./pmbootstrap.py -t 15 install --no-fde
  31746 31738 31738 sudo env -i /bin/sh -c ... ;apk --no-progress add
  31747 31746 31738 /bin/sh -c ... ;apk --no-progress add
  31748 31747 31738 apk --no-progress add

The root process of the run command is PID 31746. We want to kill
the child processes too. Otherwise only running kill -9 31746 will leave
the processes 31747 and 31748 running.
2018-10-02 07:06:46 +00:00
Oliver Smith
f68a7a6baa Link to wiki page if first git clone fails 2018-09-26 05:58:11 +00:00
Oliver Smith
3ce00de710 Move aports into own repository (pmaports) 2018-09-05 05:57:38 +00:00
Grant Miller
7eaf9de000 Implement bash tab completion 2018-08-27 21:35:05 +00:00
Oliver Smith
0d7802d7ef
s/system partition/rootfs: fix remaining mentions
Follow-up to !1373, where `pmbootstrap flasher flash_system` was
replaced with `pmbootstrap flasher flash_rootfs`. We still had used
terms like "system partition" in a lot of places.

This commit replaces it everywhere, so it's clear that we're talking
about the pmOS rootfs (which may or may not be installed to Android's
system partition).
2018-07-15 23:41:31 +02:00
Oliver Smith
4c8d4815af README.md: slightly adjust URLs [skip ci]
* add .git at the end of the clone URL
* add `osk-sdl` in file name
2018-07-08 23:20:13 +00:00
Simon Schmeisser
cd90f35527 Update Package section of README.md as well 2018-07-08 22:32:38 +00:00