Commit Graph

2009 Commits

Author SHA1 Message Date
Alexander Krotov f853ec18e5
helpers/envkernel.sh: support `aports` configuration variable (MR 2096) 2021-08-22 20:36:24 +02:00
BO41 87dd1d0961
pmbootstrap: add color support (MR 2090)
Can be disabled by setting the $NO_COLOR environment variable
2021-08-19 11:00:04 +02:00
BO41 e1aef47271
pmbootstrap: make use of consistent casing (MR 2090) 2021-08-12 17:06:11 +02:00
Alexey Min a6c63f9580
pmb.aportgen.gcc: use more f-strings (MR 2092) 2021-08-10 01:18:22 +03:00
afeuerstein 83c4f142e2
pmb.aportgen.gcc: sync makedepends of gcc aportgen to upstream (MR 2092)
Remove paxmark dep. Follow up to
1c6ba9f907,
which happened 5 months ago.

Fixup testdata too.
2021-08-10 01:16:54 +03:00
Oliver Smith d01027fe2c
pmb.config.apk_tools_min_version: update
Require an apk-tools version that has the recent CVE fixed.

Related: https://security.alpinelinux.org/vuln/CVE-2021-36159
2021-08-07 17:12:03 +02:00
Petr Vorel ba07c4cf14
pmbootstrap init: Fix regexp for int (MR 2086)
This improves handling input in pmbootstrap init.

Various config options in "Additional options" are int, thus whole input
must be checked:

This fixes obvious error:
Jobs [9]: 5e

and less obvious errors:
Extra space size: 600.5
Extra space size: 600m
...
$ pmbootstrap install
[17:28:23] *** (3/4) PREPARE INSTALL BLOCKDEVICE ***
[17:28:23] ERROR: invalid literal for int() with base 10: '600.5'

NOTE: I suppose moving ^ $ to ReadlineTabCompleter.ask() would break
some of already defined regexes.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2021-08-01 16:12:04 +02:00
Clayton Craft db12e987d0
pmb/chroot/binfmt: always install qemu- binary (MR 2088)
gitlab runners seem to be registering binfmt now (?), so this fixes an
issue where register() might return immediately because the OS (or ??)
took care of registration, but the qemu-<arch> binary wasn't added to
the chroot.
2021-07-28 15:27:59 -07:00
Clayton Craft 8447629f3c
pmb/chroot/binfmt: don't register arch if OS does it automatically (MR 2088)
It seems like the gitlab runners will now automatically register archs
when binfmt is mounted (I'm not completely sure, it's really
hard/annoying to confirm using gitlab CI jobs and no direct access to
the runner)

In any case, checking if it's already registered fixes a problem where
CI fails with "File exists" when it tries to register the arch.
2021-07-28 14:39:07 -07:00
Petr Vorel f3b6534b69
pmbootstrap init: Fix project in issue reference (MR 2087)
It's in https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1904,
not in https://gitlab.com/postmarketOS/pmaports/-/issues/1904.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
2021-07-28 10:51:21 -07:00
Newbyte 3c98cae230
kconfig check: require CONFIG_SWAP for zram (MR 2085)
While zram has uses outside of swap-on-zram, I would believe that the
main use of zram in postmarketOS is swap-on-zram. In addition to that,
I imagine many probably expect swap-on-zram to work if the zram kconfig
succeeds.
2021-07-17 18:11:50 -07:00
Oliver Smith 68fe7df046
pmbootstrap install: support new ondev boot label (MR 2083)
In order to support FAT32 as boot partition, the label is shortened from
pmOS_inst_boot to pmOS_i_boot. Read the value from pmaports.cfg and fall
back to the old value, so both are supported (-> building v21.06 and
v21.03 will use the old label).

Remove the old codepath that would set "pmOS_boot" as label for the
install partition, if the postmarketos-ondev package was older than
0.4.0. This is only the case on the long unsupported v20.05 branch.
2021-07-13 19:57:08 +02:00
Minecrell f62242aeb1
helpers/envkernel.sh: Try harder to not generate Git version suffix (MR 2084)
The Git version suffixes usually generated automatically by the Linux
build system break packaging in Alpine because the flavor (e.g.
"-postmarketos-qcom-msm8916") will no longer match the module and
zImage path. So far setting LOCALVERSION= and disabling
CONFIG_LOCALVERSION_AUTO was sufficient to avoid the Git version
suffixes but this is no longer enough in Linux 5.14.

Instead, add a better fix by creating an empty .scmversion file
that will be used by the kernel instead of checking the Git status.
The advantage is that this works on Linux 5.14 and it should even
work when CONFIG_LOCALVERSION_AUTO is set.

The .scmversion code can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/setlocalversion?h=v5.14-rc1#n38
2021-07-12 10:56:36 -07:00
Oliver Smith a34db4c8fd
Prepare 1.35.0 release 2021-07-11 22:47:27 +02:00
Oliver Smith a0ca7d9a14
install --ondev: no postmarketos-base-nofde (MR 2082)
Install osk-sdl in the installer OS's boot partition for now. I forgot
about a code path earlier, which could render an encrypted target OS
without osk-sdl in the initramfs (and being unable to boot).

The target OS gets embeded in the installer OS as image file. This can
happen in two formats:

a) a full image with partition header and the boot and root partition
This is what bpo is doing when building the official, pre-built images,
as this method allows having the exact same image available separately
without the installer. Basically:
	pmbootstrap install \
		--ondev \
		--no-rootfs \
		--cp path/to/rootfs:/var/lib/rootfs.img

b) an image with just the root partition, no partition header and no
boot partition. This is what you get when running regular
"pmbootstrap install --ondev". It's slightly smaller, as there is no
duplicate boot partition.

If b) was done, the installer will copy the contents of the installer's
boot partition to the target OS. And that means: if osk-sdl is missing
from the installer's boot partition (the initramfs generated there), it
will also be missing in the boot partition of the target OS!

I think we should get rid of the b) code path to avoid confusion in the
future/make maintenance. But until that is done, always install osk-sdl
into the installer OS.
2021-07-11 20:18:41 +02:00
Oliver Smith 9bef0a815a
pmbootstrap init: fix question for locale (MR 2082)
Remove the "(y/n) " in the question:
  Choose default locale for installation (y/n) [C.UTF-8]:
So it becomes:
  Choose default locale for installation [C.UTF-8]:
2021-07-11 17:12:31 +02:00
Oliver Smith 9e03034b28
Fix pmbootstrap -h for --mirror-pmOS (MR 2082)
Fix this weird help output:
  -mp URL, --mirror-pmOS URL
                        postmarketOS mirror, disable with: -mp='', specify
                        multiple with: -mp='one' -mp='two', default: h, t, t,
                        p, :, /, /, m, i, r, r, o, r, ., p, o, s, t, m, a, r,
                        k, e, t, o, s, ., o, r, g, /, p, o, s, t, m, a, r, k,
                        e, t, o, s, /
2021-07-11 17:12:31 +02:00
Oliver Smith 7616803207
pmb.chroot.shutdown: clean up chroot marker here (MR 2082)
Remove /in-pmbootstrap inside chroots in "pmbootstrap shutdown" instead
of having it at a specific part of "pmbootstrap install".

Reasoning:
* With current approach, it didn't get removed in the on-device
  installer chroot.
* This is less error prone than calling it multiple times in
  "pmbootstrap install"
2021-07-11 17:12:26 +02:00
Anri Dellal c347b27f69
pmb/config/init.py: use f-strings, fix E501 (MR 2043) 2021-07-06 18:55:41 -07:00
Anri Dellal 08617722a4
init: Hide unsupported UIs (MR 2043)
Hides user interfaces which require GPU acceleration
for unsupported devices. Device support is identified
by deviceinfo property `deviceinfo_gpu_accelerated`.
UI which has GPU acceleration as requirement,
must have `pmb:gpu-accel` in APKBUILD's options.
2021-07-06 18:55:34 -07:00
Anri Dellal d764b0de58
bootimg_analyze: Add support for boot header version 3 (MR 2073) 2021-07-07 04:43:24 +03:00
Clayton Craft 9d22989a88
kconfig: add missing options for nftables support to kconfig check (MR 2076)
I missed these when collecting the required kconfig options for
nftables, and it was a happy coincidence that the kernels I enabled the
nftables stuff on already had these enabled so that the initial kconfig
check passsed

test/kconfig: add missing nftables options
2021-07-07 04:24:07 +03:00
Newbyte 73d242485a
pmbootstrap.py: Don't print stacktrace when KeyboardInterrupt is caught (MR 2078)
This looks obnoxious and I cannot think of a single time I found it
useful, so let's make it prettier.
2021-07-05 12:19:35 +02:00
Oliver Smith 8a371cd18f
CI: remove stages (MR 2080)
It's more annoying than useful to have to wait for the first stage
before the second stage (pytest) starts. I'd rather have the whole
pipeline run through quicker and see if there are python errors too even
if linting errors are not resolved yet.

In pmaports.git this makes more sense: there we have "lint" and "build"
and in the worst case "build" may take up to three hours. So it makes
sense to only start it if there are no cosmetic errors. But that's not
the case here.
2021-07-04 22:51:54 +02:00
Oliver Smith 6c2b72ca13
CI: .gitlab/vermin.sh -> .ci/vermin.sh (MR 2080) 2021-07-04 22:51:53 +02:00
Oliver Smith d7e22e4993
CI: check_mr_settings: use version from ci-common (MR 2080) 2021-07-04 22:51:53 +02: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
Maxim Karasev 90529a0518
CI: don't install procps (MR 2077)
After MR 2074 it's not a hard-dependency anymore.
2021-07-02 04:06:13 +03:00
Maxim Karasev 479b51cfb6
CI: use Alpine for testing (MR 2074) 2021-06-28 02:07:55 +03:00
Maxim Karasev 1bb15765ed
pmb.helpers.run_core.kill_commands: use minimal subset of ps parameters (MR 2074)
again, busybox ps supports only -o option (-e is ignored, because
busybox always shows all processes).
2021-06-28 02:07:55 +03:00
Maxim Karasev 31e7a0006d
pmb.helpers.other.folder_size: use kilobytes (MR 2074)
busybox du doesn't support bytes or custom block sizes.
2021-06-28 02:07:55 +03:00
Anri Dellal 5c1da79634
pmbootstrap init: Add mirror choice (MR 2035)
Allows user to choose one of the mirrors from
https://mirrors.postmarketos.org.

Example:
[1] Mirror 1 (Location 1)
[2] Mirror 2 (Location 2)
[3] Mirror 3 (Location 3)
Select a mirror [1]: 2

Co-Authored-By: Alexey Min <alexey.min@gmail.com>
2021-06-27 18:38:01 +02:00
Alexey Min c5bd07e3ae
pmb.helpers.http: add missing parameter doc (MR 2035) 2021-06-27 18:37:57 +02:00
Dylan Van Assche 834cc7f877
install: allow to use last block for embedding (MR 2069)
Devices such as ODROIDs have binaries use which every single block for
embedding. Do not raise an error when binaries are touching, but not
overlapping, each other when embedding these binaries during installation.

Add a test for this scenario, which fails when reverting the change.

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2021-06-26 20:11:42 +02:00
Dylan Van Assche e900ee169a
install: refactor embed_firmware and add test (MR 2069) 2021-06-26 20:11:36 +02:00
Clayton Craft 31e36e195c
install: explicitly install osk-sdl when needed (MR 2066)
This adds osk-sdl to the rootfs when --fde is set, or when building a
rootfs for the ondev installer. Ideally the ondev installer would
selectively install osk-sdl if the user opted for fde at runtime, but
I haven't found a straight forward way to enable that yet, and this
behavior here is no different than the current behavior (where osk-sdl
is always installed in the rootfs by way of depends= in pmos-mkinitfs).

For images that are built without --fde, osk-sdl won't be installed at
all in the rootfs, once the dependency is dropped from pmos-mkinitfs.
Instead, a dummy package postmarketos-base-nofde will be installed
instead to satisfy the dependency that postmarketos-mkinitfs has on the
virtual package "postmarketos-fde-unlocker"
2021-06-25 12:28:36 -07:00
Clayton Craft 6afd35eb11
kconfig check: add support for checking zram options (MR 2075)
Device kernels that enable zram support can use `pmb:kconfigcheck-zram`
to protect against kconfig regressions that disable support for zram.
2021-06-23 21:17:41 -07:00
Alexey Min 687807fa73
Add kconfig check for containers (MR 2060)
Usage: pmbootstrap kconfig check --containers linux-postmarketos-qcom-msm8974
2021-06-23 01:12:47 +02:00
Oliver Smith 716336e30b
kconfig check: allow range of kernel versions (MR 2060)
Make it possible to specify rules as range, e.g. ">=4.0 <5.0".
2021-06-23 01:12:43 +02:00
Martijn Braam 475377fbfc
Prepare 1.34.0 release
* Update so v21.06 can be built
2021-06-20 11:02:04 +02:00
Clayton Craft 76489653df
helpers/envkernel.sh: fix shellcheck disabled tests (MR 2072)
Shellcheck 0.7.2 has a change that gives many error conditions their own
SC30** codes, instead of including them in SC2039. This updates the
scripts in this package that "disable SC2039" to disable the new code.

New codes added in shellcheck: cfd68ee0c2ebfd0ab08a1d4bf628162b454dc207

[ci:skip-build] already built successfully in CI
2021-06-18 20:22:31 -07:00
Oliver Smith 5afc2e626f
pmb.config.apk_tools_min_version: add alpine v3.14 2021-06-16 22:15:49 +02:00
Oliver Smith 53dfe85956
Prepare 1.33.0 release 2021-06-15 00:09:42 +02:00
Alexey Min fbffee3645
test: fix crossdirect rust test (MR 2071)
Currently running test_crossdirect locally may fail if selected device
does not exist on stable branch. Fix it by switching to qemu-amd64 before
running this test.

While at it, switch to more recent stable branch, v20.05 is now
unmaintained.
2021-06-14 23:07:03 +02:00
Clayton Craft f8fa80e20e
install: add --no-firewall / print firewall status (MR 2042)
The option, --no-firewall, will disable nftables on boot in the image,
and print a warning message if it's being disabled in a device image
where the device's kernel should support running the firewall.

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2021-06-14 21:51:36 +02:00
Anri Dellal 21c9e38162
kconfig: Refactor check_config (MR 2042)
Support force-checking multiple components. Fixes #2034.

Co-Authored-By: Clayton Craft <clayton@craftyguy.net>
2021-06-14 21:50:56 +02:00
Clayton Craft 599d74ec25
kconfig check: add support for nftables (MR 2042) 2021-06-14 21:50:45 +02:00
Alexey Min df9c61a868
pmb.config.aportgen_mirror_alpine: use working mirror (MR 2067)
The dl-2 mirror is missing required .apk files now.
Use dl-4 instead.
2021-06-13 23:49:55 +02:00
Antoine Fontaine c30540d13c
README: add some documentation on how to run tests (MR 1973) 2021-06-13 17:43:51 +02:00