Commit Graph

1894 Commits

Author SHA1 Message Date
Oliver Smith 5b2efb59e9
pmb.build._package: detect recursion 2021-01-28 02:49:00 +01:00
Oliver Smith 34d6b3edb3
Prepare 1.29.1 release 2021-01-27 23:02:24 +01:00
Oliver Smith 69cd7895e2
pmb.config.apk_tools_min_version: support branches (MR 2015)
Support branches, so pmbootstrap won't fail if v20.05 is selected:
  ERROR: You have an outdated version of the 'apk' package manager installed
  (your version: 2.10.5-r1, expected at least: 2.12.1-r0).

Move the logic for this check to pmb.helpers.apk.check_outdated and
adjust the test.

This fixes the CI failure in test_crossdirect_rust, which uses the
stable channel. (My bad for not creating this patch earlier, while at
the same time explaining in the creating pmbootstrap release instructions,
that this minimum apk version should be adjusted.)
2021-01-27 22:05:25 +01:00
Oliver Smith e9947f42de
pmb.config.apk_tools_static_min_version: rename (MR 2015)
Remove "_static" from the variable name, as this version isn't just
used to compare apk-tools-static's version (used to set up chroot), but
also for regular apk-tools before entering chroots.
2021-01-27 22:05:20 +01:00
Martijn Braam 9d6e0ec4d8
Prepare 1.29.0 release 2021-01-27 15:14:51 +01:00
Oliver Smith 51c01f384f
pmb/install/format.py: fix too long line (MR 2008) 2021-01-27 15:01:57 +01:00
Oliver Smith 39ad7246f7
install: add comments: logic in postmarketos-ondev (MR 2008)
Add comments to two functions, that if they are changed, the logic also
needs to be updated in ondev-preapre-internal-storage.sh of
postmarketos-ondev.git.
2021-01-27 15:01:56 +01:00
Oliver Smith d9682be771
install --ondev: set boot label: pmOS_inst_boot (MR 2008)
With postmarketos-ondev >= 0.4.0, have a different label for the boot
partition in the installer OS, so the postmarketOS initramfs can find
the proper partition to boot. Even if the boot partition is available
twice (once installed on eMMC, once as part of installer OS on SD card).

pmOS_inst_boot instead of pmOS_install_boot because of character limit.
2021-01-27 15:01:55 +01:00
Oliver Smith 34f5a12c21
pmb.install: split get_ondev_pkgver to own func (MR 2008) 2021-01-27 15:01:54 +01:00
Oliver Smith b07ff9444c
pmb.install: add boot label arg to several funcs (MR 2008)
Allow to set a different label for the boot partition than "pmOS_boot".
2021-01-27 15:01:54 +01:00
Oliver Smith 7d1c8d29df
pmbootstrap qemu: add --second-storage (MR 2008)
Create a second storage to test installing from SD card to eMMC with the
on-device installer.
2021-01-27 15:01:53 +01:00
Oliver Smith 61f5c20ebb
pmbootstrap qemu: tweak resize_image messages (MR 2008)
Replace "rootfs" with generic image, because the function will be used
for a second storage too. Refer to IMAGE_SIZE, as it is shown in the
help output.
2021-01-27 15:01:52 +01:00
Dylan Van Assche dd61d57b0e
pmbootstrap install: support _pmb_groups (MR 2010) 2021-01-27 08:38:53 +03:00
Dylan Van Assche e357ee885e
install: create groups regardless of existing user (MR 2010) 2021-01-24 16:18:38 +01:00
Dylan Van Assche 8455c82eee
install.ui: move get_recommends to new file (MR 2010) 2021-01-24 16:18:33 +01:00
Oliver Smith 10abb10dcf
Prepare 1.28.0 release 2021-01-07 23:30:51 +01:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01:00
Martijn Braam 3d00888f2e
pmb.install.file: remove in favor of packaged os-release (MR 1970)
Don't install /etc/os-release with pmbootstrap, this is handled by
postmarketos-base instead.
2021-01-07 15:28:50 +01:00
Henrik Grimler e14a823fda
envkernel.py: don't search for kbuild_out if _outdir is set (MR 2012)
Patch by Oliver, fixes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2000
2021-01-07 16:21:45 +03:00
Oliver Smith 6a4f012bf9
pmb.run.qemu.install_depends: fix with v20.05 (MR 2009)
Don't try to install the recently split up packages if the pmaports
branch is based on Alpine 3.12.

Fixes: 61845c93 ("pmb.run.qemu.install_depends: add new depends (MR 2007)")
2021-01-02 11:23:51 +01:00
Oliver Smith 8e3196a42a
CI: enforce python 3.6+ with vermin (MR 2002)
Make sure that features requiring a higher python version don't sneak in
by accident.

It would be nice to add this to test/static_code_analysis.sh, so it is
easy to run it locally. But vermin is not packaged in Alpine right now,
and given that this should be a rather rarer error, it doesn't seem
worth the effort right now.

Run silently by default and only in verbose mode if there are errors,
because if vermin isn't silent, it will not just point out errors, but
describe required python versions for everything it sees. (Copied that
part from the bpo CI script, where I had used it as pre-commit hook as
it was stuck on 3.5 for some time.)
2020-12-22 00:33:08 -08:00
HenriDellal 196186df24
pmbootstrap init: add locale selection (MR 2004)
Adds a list of locales user can choose from on init step.
If locale isn't default, then "lang" package is installed
and LANG is changed to the chosen locale.
2020-12-21 08:30:08 +03:00
Oliver Smith 2247fc5aad
pmbootstrap install: add --ondev --no-rootfs (MR 1995)
Skip building the postmarketOS rootfs, and allow either installing a
pre-built pmOS rootfs, or even another operating system.
2020-12-19 13:41:23 +01:00
Oliver Smith 74d71c1b6c
pmbootstrap install: add --ondev --cp (MR 1995)
Allow to copy one or more files to the install chroot. It will be
possible to use this to put a non-pmOS image into the generated
installer OS.
2020-12-19 13:41:23 +01:00
Oliver Smith 2660360293
Prepare 1.27.0 release 2020-12-16 23:40:16 +01:00
Oliver Smith 61845c934b
pmb.run.qemu.install_depends: add new depends (MR 2007)
Alpine's qemu packaging has been split up into more subpackages, so
install them too.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/15554
2020-12-16 23:20:51 +01:00
Oliver Smith c140912eed
pmb.run.qemu.install_depends: put each on new line (MR 2007) 2020-12-16 23:20:50 +01:00
Oliver Smith a9d4ba32a2
cli: --details-to-stdout: no progress bars (MR 2007)
Hide progress bars if --details-to-stdout is used, which redirects all
output that would land in the pmbootstrap log to stdout. This caused the
progress bar output to get mixed with the apk output. A new progress bar
would get drawn whenever a new package was installed, without removing
the previous progress bar.
2020-12-16 23:20:46 +01:00
Johannes Marbach 1eac61bcf7
Add option to run sudo -v in a loop to prevent repeated password entries (MR 1997)
Many of pmbootstrap's actions require root rights. When after requesting
sudo access pmbootstrap takes longer than the sudo timeout interval to finish
execution, the password will have to be entered again on the next sudo
action.

This change adds an opt-in feature to run sudo -v in a background loop
in order to prevent having to enter the password more than once for a single
pmbootstrap run. The loop runs as a daemon timer which automatically gets
canceled when pmbootstrap exits.

Closes: #1677
2020-12-14 19:14:14 +01:00
Johannes Marbach 8842a7d5c0
pmb.helpers.run_core: change kill_as_root to sudo (MR 1997)
Replace the "kill_as_root" argument with a much simpler "sudo" argument
and remove the now obsolete check for the output mode of "kill_as_root".

"kill_as_root" would only get set to True if both conditions are met:
a) command is running with sudo
b) command is running with an output mode ("log" or "stdout") where
   pmb.helpers.run_core would kill it if it does not output anything
   before a timeout is reached

The new "sudo" argument just indicates if the command is running with
sudo (a), regardless of the output mode (b).
2020-12-14 19:08:07 +01:00
Martijn Braam 27127f1cae
pmb.build._package: Clean up and expand documentation (MR 2003)
Fix typo introduced in earlier commit and expand on force=True behavior
2020-12-09 16:24:54 +01:00
Martijn Braam 1921fc5f27
Add sideload command
The sideload command runs the supplied names through the pmbootstrap
buildsystem to make sure they're up-to-date, then uses scp from the host
to copy the built apks to /tmp on the phone and installs them through
ssh.

If the --install-key option is set then it will also copy over the apk
key that's used for signing the packages built by pmbootstrap in case
the postmarketOS install on the device isn't build by the same machine
as you're sideloading from.
2020-12-08 17:42:30 +01:00
Oliver Smith 5cbde81842
pmbootstrap install: properly count install steps (MR 1978)
Get rid of hardcoded step numbers, even for the currently common steps.
With the upcoming --ondev --no-rootfs, we will need to skip the
hardcoded step 2 (create device rootfs).
2020-12-07 22:42:24 -08:00
Oliver Smith b6dce2486c
pmbootstrap install: new func create_device_rootfs (MR 1978)
Move related code from pmb/install/_install.py:install() to a new
create_device_rootfs() function in the same file, so it can be skipped
with the upcoming --no-rootfs parameter.
2020-12-07 22:42:24 -08:00
Johannes Marbach e058841709
pmb.helpers.repo: Show progress bar when downloading APKINDEX files (MR 1996)
Run pmbootstrap update to test
2020-12-07 12:41:28 +01:00
Johannes Marbach bbf0a70e5b
Add progress bar when running apk commands (MR 1996)
This adds a progress bar when running apk commands both inside and
outside of the chroot.

Closes: #1700
2020-12-07 12:41:28 +01:00
Johannes Marbach 705b71d89e
pmb.helpers.run_core: move error to extra func (MR 1996)
Extract the error check to a separate function so that it can be
reused.
2020-12-07 12:41:28 +01:00
Johannes Marbach 45dbeca587
pmb.helpers.run_core: add output=pipe (MR 1996)
This adds a new output mode "pipe" that is identical to the existing
"background" mode except for that its stdout is redirected into a
pipe so that it can be retrieved.
2020-12-07 12:41:28 +01:00
Johannes Marbach 82d149c85d
Make pmb.helpers.run.root support non-timeout output modes (MR 1996)
Before this commit, pmb.helpers.run_core.sanity_checks would raise
a runtime error when pmb.helpers.run.root was called with an output
mode that did not support timeouts (like background).
2020-12-07 12:41:28 +01:00
Johannes Marbach de175bfb1f
pmb.helpers.run_core.background: tweak log msg (MR 1996)
This makes the output mode apparent
2020-12-07 12:41:28 +01:00
Johannes Marbach 97a9633af4
pmb.chroot.root: set LANG=UTF-8 (MR 1996)
This makes apk use the pretty character for printing progress
2020-12-07 12:41:23 +01:00
Oliver Smith c7e7d24458
Prepare 1.26.0 release 2020-12-07 11:24:17 +01:00
HenriDellal 50cdf04760
kconfig check: add Samsung-specific options (MR 2000)
Adds checks for following kernel config options:
SAMSUNG_TUI:
    TUI HW Handler - related to Samsung's security measures
    Creates "secure frame buffer", results in bootloop
SEC_RESTRICT_ROOTING:
    blocks gaining root permissions
TZDEV:
    Samsung TZ Based Secure OS interface driver
    (results in bootloops)
2020-12-07 09:26:19 +01:00
Oliver Smith 2401423e2b
install: fix crash if /etc/skel is missing (MR 2001)
Create an empty home dir if /etc/skel does not exist in the target
rootfs. Due to changes in packaging, this can happen now, previously
/etc/skel would always have existed.
2020-12-07 09:06:59 +01:00
Alexey Min 799f4b925b
pmbootstrap status: fix typo
Closes #1991
2020-12-04 17:12:36 +03:00
Bart Ribbers 5b831d899d
Automatically mount binfmt_misc if not mounted already (MR 1923)
This is needed at least on Alpine Linux, and probably on distros like NixOS as well.

Fixes: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1135
2020-12-03 21:03:13 +01:00
HenriDellal e8e560e18e
kconfig edit: make package name a positional argument (MR 1998)
Makes argument "package" positional instead of required.
Uses codename from deviceinfo as default value.
2020-12-03 12:36:48 +03:00
HenriDellal 2d496d983e
pmb/aportgen/linux.py: Fix bad substitution error (MR 1999) 2020-12-02 21:32:43 +03:00
Oliver Smith 7683b80541
pmb/parse/arguments.py: refactor 'install' args (MR 1977)
Move the numerous "install" arguments into an own function (as it was
done with actions added later). Categorize the options and update the
help output, so the options are easier to understand.
2020-11-23 20:35:40 +01:00
Oliver Smith a1d9f66d96
install: embed_firmware: use correct suffix (MR 1979)
Embed the firmware from the right chroot suffix. Previously it would
always use the rootfs_{args.device} chroot, which does not work anymore
with upcoming 'pmbootstrap install --ondev --no-rootfs' as there will
only be the installer_{args.device} chroot.
2020-11-23 20:20:40 +01:00