Commit Graph

2047 Commits

Author SHA1 Message Date
Caleb Connolly 8bc5366e60
parse: deviceinfo: arch is required (MR 2124)
The deviceinfo_arch property is required but not checked, this leads to
weird errors if not caught.
2021-10-17 17:44:18 +02:00
Pablo Correa Gómez 4f793125d1
Allow to set mirror_alpine with pmbootstrap config command (MR 2129)
There is a double reason for this:
 * Better performance when developers/users choose local mirrors
 * Allows to continue developing if a mirror is down
2021-10-17 14:40:37 +02:00
Oliver Smith a676bdef0c
pmb.install.partition: fix mb_reserved calculation (MR 2123)
Calculate the end of the reserved space properly. Instead of:
	from size_boot to size_reserve
it is:
	from size_boot to (size_reserve + size_boot)

The reserved space is used by the on-device installer. Without this
patch, the reserved space could easily end up being too small, resulting
in no space left errors during the installation.
2021-10-17 14:27:44 +02:00
Alexey Min 97f59ffe93
pmb/config: fixup zram check options (MR 2126)
The main option - CONFIG_ZRAM - was not checked.
Add it and its direct requirement - CONFIG_ZSMALLOC.

The other two (ZSMALLOC_STAT, ZRAM_MEMORY_TRACKING) are
for debugging information only.
2021-10-15 21:48:18 +03:00
BO41 58922142ac
pmb.qemu.run.which_qemu: remove args argument (MR 2114)
Drop the argument, as it is not used.
2021-10-10 16:59:21 +02:00
BO41 944f539dd6
args.logfd: remove (MR 2114)
Replace "args.logfd" with "pmb.helpers.logging.logfd" in order to avoid
passing "args" to all functions that only use it to write to logfd. This
is the first step to get rid of this args-passed-to-all-functions
pattern in pmbootstrap.
2021-10-10 16:59:17 +02:00
Oliver Smith 313c9611c8
Prepare 1.38.0 release 2021-10-10 16:31:58 +02:00
Alexey Min ad491bc121
pmb.chroot.initfs: adapt to new mkinitfs (MR 2112)
Follow-up to 09794ef832 -
initfs file does not have flavor now, too.

Without this 'pmbootstrap initfs extract' fails with:

 (rootfs_samsung-klte) % cp /boot/initramfs-postmarketos-qcom-msm8974 /tmp/initfs-extracted/_initfs.gz
 cp: cannot stat '/boot/initramfs-postmarketos-qcom-msm8974': No such file or directory
2021-10-10 16:09:29 +02:00
Alexey Min 48c85cdc1f
kconfig migrate: new option to migrate kernel configs (MR 2111)
With this option you can run

$ pmbootstrap kconfig migrate --arch <arch> linux-postmarketos-xxx-xxx

to perform safe kconfig upgrades between kernel releases.

"make oldconfig" will ask question for every new/renamed kconfig option,
so you have no chance to miss anything.
2021-10-10 15:38:45 +02:00
Bart Ribbers 37c390aeed
pmb/parse/arguments: add aportupgrade to --help (MR 2121)
I keep forgetting this command exists, for one because it doesn't appear
(besides in a big, hard-to-read, one-line list) in the --help output
2021-10-10 13:55:02 +02:00
Newbyte 446a8fc430
pmbootstrap.py: Check which version of Python pmbootstrap is run with (MR 2118)
This prevents people from getting strange syntax errors if they
accidentally run pmbootstrap with e.g. Python 2.
2021-10-01 22:46:23 -07:00
Alexey Min 5761a29f07
pmb.aportgen.binutils: fix for new binutils file conflict (MR 2116)
Newly generated binutils package has file conflicsts with
non-cross binutils.

  ERROR: binutils-2.37-r3: trying to overwrite usr/lib/bfd-plugins/libdep.so
         owned by binutils-aarch64-2.37-r3.

Fix the generator to produce package that does not include these plugins.
2021-09-29 23:41:58 +02:00
Newbyte 2d23849aa3
pmb, test: remove redundant commas (MR 2115) 2021-09-26 17:58:40 +02:00
Bart Ribbers 4675def8e6
pmb/config: add required option for Waydroid support (MR 2109) 2021-09-13 21:10:05 +03:00
Alexey Min 374d7379ab
pmb.parse.bootimg: make boot.img readable for all after copying (MR 2105)
This prevents rare errors when source file didn't have the
correct permissions.
2021-09-13 14:40:15 +03:00
Oliver Smith bf02c72da7
test: add test_bootimg_mtk_mkimage_recovery (MR 2105)
Verify that using a Mediatek recovery boot.img file works with
bootimg_analyze. The mtk_mkimage-boot.img file is the twrp boot.img file
posted in pmbootstrap issue 2066.
2021-09-13 14:40:15 +03:00
Boris Lysov d559db062f
pmb.parse.bootimg: accept Mediatek recovery images too (MR 2105)
Some Mediatek recovery images have headers named
"RECOVERY". Accept those too.

Signed-off-by: Boris Lysov <arzamas-16@mail.ee>
Co-Authored-By: Alexey Min <alexeymin@postmarketos.org>
Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2021-09-13 14:40:02 +03:00
Oliver Smith 881a3a03bc
pmb.parse.bootimg: refactor mtk_bootimg code (MR 2105)
Move all code that verifies the labels of the kernel and ramdisk inside
the boot.img file into a separate function, so it is easier to extend it
to allow recovery images too.
2021-09-12 22:02:52 +02:00
Oliver Smith cd366859de
testdata: replace mtk_mtkimage-boot.img (MR 2105)
Replace the previous mtkimage-boot.img file, which were only the first 4
KiB of a mediatek boot.img file, with a full one. I made this full image
with pmbootstrap install for fairphone-fp1, it contains the kernel
packaged in pmaports.git master.

Reason for the replacement is, that the previous image did not contain
the label for the ramdisk. The current code ignored this, but upcoming
refactoring will test this more strictly and the dummy image will not
pass the test anymore.
2021-09-12 22:02:47 +02:00
Oliver Smith 6fde1f0851
build --strict: use pmb.chroot.init_keys (MR 2110)
Fix the issue of having the postmarketOS binary repository key deleted
from the chroots after "abuild undeps" removes the postmarketos-keys
package. This happens if e.g. building two device packages in a row (as
they depend on postmarketos-base, which depends on postmarketos-keys in
current pmaports.git master).

I've also considered installing the postmarketos-keys next to
alpine-base in new chroots. But this would introduce a bootstrap
problem, since you can't install the postmarketos-keys package unless
it already exists in the repository. We'd run into that when building
the next release.
2021-09-10 21:27:20 -07:00
Oliver Smith 9b7feadca6
pmb.chroot.init_keys: split into own function (MR 2110)
Move code to install Alpine and postmarketOS keys into its own function,
so it can be called outside of pmb.chroot.init too (next patch).

Describe why this is needed in the first place and, while at it, tweak
the function to only copy the key if it does not exist in the target
directory.
2021-09-10 21:27:19 -07:00
BO41 77d39ecdf1
lint: enforce max line length (MR 2097) 2021-09-10 03:18:27 +02:00
Henrik Grimler 51bfdc9784
pmb.aportgen: prefix $_outdir to dtbTool-sprd -p arg (MR 2107)
The -p arg is suppose to point to the folder where the dtc program
resides (if it is not found in PATH). If we use an _outdir, which the
template currently does, then the arg needs to be -p
$_outdir/scripts/dtc/, and not -p scripts/dtc/, as scripts/dtc/ only
contains the dtc source code.
2021-09-05 15:56:52 +02:00
Henrik Grimler c524926295
pmb.aportgen: rm -p scripts/dtc arg from dtbTool cmd (MR 2107)
The python variant of dtbTool, that we currently use, does not use
this arg as it does not run dtc in a shell.  I suppose the argument
was added only for compatibility with other dtbtools.
2021-09-05 15:54:43 +02:00
Clayton Craft 393184672d
pmb/config/flashers/heimdall: support a single kernel flavor (MR 2106)
This was missed in 05c9fb78
2021-09-05 00:50:01 -07:00
Johannes Marbach ac4c967e18
pmbootstrap lint: avoid looping and copying files (MR 2100)
Before this commit, package folders were copied into the chroot one by
one in order to run apkbuild-lint on them. This logic is replaced by
mounting pmaports.git into the chroot and using a single apkbuild-lint
invocation to lint the supplied packages.

Both of these changes result in a performance improvement, especially
when linting multiple packages at once.

Before this change:

    $ time ./pmbootstrap.py -q lint $(cd ../pmaports/cross; echo *) \
        > /dev/null

    real    0m5,261s
    user    0m7,046s
    sys     0m1,842s

Using the pmaports.git mount but calling apkbuild-lint in a loop:

    $ time ./pmbootstrap.py -q lint $(cd ../pmaports/cross; echo *) \
        > /dev/null

    real    0m4,089s
    user    0m6,418s
    sys     0m1,219s

After this change:

    $ time ./pmbootstrap.py -q lint $(cd ../pmaports/cross; echo *) \
        > /dev/null

    real    0m3,518s
    user    0m5,968s
    sys     0m0,959s

Additionally, running apkbuild-lint from the pmaports.git mount point
has the benefit that every printed violation contains a nice source
identifier à la "./cross/grub-x86/APKBUILD". This makes it possible to
differentiate between different packages even though only a single
apkbuild-lint invocation is used.

Relates: postmarketOS/pmaports#564
2021-09-03 10:52:50 -07:00
Oliver Smith 0b95779e30
Prepare 1.37.0 release 2021-09-03 19:28:07 +02:00
Clayton Craft 45ce639aca
pmb/qemu: add support for single kernel 'flavor' (MR 2093) 2021-09-02 18:18:14 -07:00
Clayton Craft 453ce35b8c
pmb/export/symlinks: add support for a single 'flavor' (MR 2093) 2021-09-02 18:18:13 -07:00
Clayton Craft 91bb682755
pmb/install/recovery: add support for single kernel 'flavor' (MR 2093) 2021-09-02 18:18:13 -07:00
Clayton Craft 05c9fb784f
pmb/config/flashers: add support for single kernel 'flavor' (MR 2093) 2021-09-02 18:18:13 -07:00
Clayton Craft 09794ef832
chroot/other/kernel_flavor_installed: support generic kernel name (MR 2093)
kernel is named /boot/vmlinuz now, looking at the filename will no
longer tell us what flavor it is. This now will look at
/usr/share/kernel, which has always contained the kernel 'flavor', and
since we currently only install 1 kernel these days, guarding this with
pmaports.cfg should be unnecessary. In the worst case (if there are
multiple kernel 'flavors' installed), it'll just grab the first one and
return it.
2021-09-02 18:18:13 -07:00
Clayton Craft 184ac91ec5
pmb/install: use kernel pkg for device when printing firewall info (MR 2093)
multiple 'flavor' support will be going away
2021-09-02 18:18:13 -07:00
Clayton Craft 1d5030738c
pmb/helpers/frontend: drop all --flavors args (MR 2093) 2021-09-02 18:18:13 -07:00
Clayton Craft ca7ac4c704
pmb/chroot/initfs: change invocation to support the new mkinitfs (MR 2093)
The new mkinitfs does not have options for kernel flavor or version

A new pmaports.cfg variable, "supported_mkinitfs_without_flavors" is used to
determine how to invoke mkinitfs
2021-09-02 18:18:05 -07:00
Clayton Craft 9ae2eef0f0
pmb/config: add missing option for flash_heimdall_partition_dtbo (MR 2104)
This fixes a regression introduced by pmb!2099
2021-08-31 19:45:25 -07:00
afeuerstein 2d3cfbcbb4
pmbootstrap flasher: add flash_dtbo (MR 2099) 2021-08-29 22:51:56 +02:00
Oliver Smith 468d313790
Prepare 1.36.0 release 2021-08-22 21:45:59 +02:00
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