Commit Graph

1983 Commits

Author SHA1 Message Date
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
HenriDellal 6793612a7e
pmb/aportgen/linux.py: add different QCDT implementations (MR 1992)
Adds QCDT templates for Spreadtrum and Exynos SoCs
When "pmbootstrap init" is executed, after the boot image analysis,
if the device is QCDT, then the user is asked about the SoC vendor.
Example:
[HH:MM:SS] SoC vendor (spreadtrum/exynos/other) [other]: exynos
After that, the corresponding template is picked.
2020-11-23 11:48:19 +01:00
Oliver Smith 5ff0bbe4b2
test/static: enforce E501 length check iteratively (MR 1993)
Enforce the E501 length check of max 79 characters for all files where
this test passes already. We can add more to the list as we adjust them
and eventuelly require the check for all files.
2020-11-23 11:31:57 +01:00
Johannes Marbach e2d4678fb7
pmb.aportgen.device Reformat to 79 characters per line (MR 1993) 2020-11-23 11:30:56 +01:00
Johannes Marbach 1e51376b7f
pmb.helpers.aportupgrade Reformat to 79 characters per line (MR 1993) 2020-11-23 11:30:56 +01:00
Johannes Marbach fc7e39d301
pmb.parse.arguments Reformat to 79 characters per line (MR 1993) 2020-11-23 11:30:51 +01:00
Oliver Smith 383bad9e93
Prepare 1.25.0 release 2020-11-23 10:13:36 +01:00
Oliver Smith 20aa4a01a1
install: FDE: use /dev/random, not /dev/urandom (MR 1994)
Change 'cryptsetup luksFormat' arguments to use --use-random instead of
--use-urandom. urandom is not recommended for the generation of long-term
cryptographic keys, as it may generate weak keys in low entropy
situations.
2020-11-23 08:57:09 +01:00
Johannes Marbach 74931b9b93
install: fix CREATE DEVICE ROOTFS message (MR 1991)
This converts the 1st step message to use a format string as well and
fixes two small typos in the 2nd step message.
2020-11-20 11:48:33 +01:00
Johannes Marbach 751524b5b4
install: tweak flash information output (MR 1991)
This adds generic advice when no flashing method is configured and
remove deprecated angle brackets.

Closes: #1948
2020-11-20 11:48:33 +01:00
Johannes Marbach ed2175546c
install: print_flash_info: make non-step (MR 1991)
This doesn't actually do anything else besides printing
advice so it doesn't need to be a processing step.
2020-11-20 11:48:33 +01:00
Johannes Marbach c31bf38409
install: install_recovery_zip: add step args (MR 1991)
This replaces the inline step numbers with arguments passed down
from the install method.
2020-11-20 11:48:33 +01:00