Commit Graph

2137 Commits

Author SHA1 Message Date
Oliver Smith 0ea0ced7fd
build: make warning about rebuilt pkgs a -v msg (MR 2047)
Let warnings like the following not get displayed in the regular
pmbootstrap output anymore, only in 'pmbootstrap log' if -v / --verbose
was used. This message informs the user that a package's dependencies
are newer than the package itself. But the WARNING makes it sound like
this is something to be concerned about, whereas in reality this is
fine. In this example, postmarketos-mkinitfs has gotten a new feature /
fix after postmarketos-base and there's no need to rebuild
postmarketos-base.

  [18:02:59] WARNING: postmarketos-base depends on rebuilt package(s)
  postmarketos-mkinitfs (use 'pmbootstrap build postmarketos-base --force'
  if necessary!)

[skip ci] already built in CI, change is trivial
2021-05-09 01:05:33 -07:00
Luca Weiss c42cd93610
pmb.helpers.cli: set empty completer for no completion (MR 2055)
The default completer suggests files from the file system which we
really don't want here.
This can be tested with the 'Manufacturer' field for new devices.

Setting it to a custom lambda instead of None disables the completion
instead of using the default completer.
2021-05-09 00:52:50 -07:00
Oliver Smith 81dbabc1ed
Prepare 1.32.0 release 2021-05-02 20:48:32 +02:00
Oliver Smith 59736b601f
pmb.qemu.run: get rid of -show-cursor (MR 2053)
Qemu has been upgraded to 6.0.0 in Alpine edge. This version doesn't
only warn about -show-cursor, it refuses to start up with the option
set.

Fixes: issue 1995
2021-05-02 19:13:35 +02:00
Alexander Stillich caeb991af6
Fix abuild-keygen aborting because pmbootstrap does not supply a packager email to it (MR 2052)
[ci:skip-build] already built successfully in CI
2021-05-01 15:50:25 -07:00
Caio Fontes 5144195091
fix long lines (E501) in pmb/build (MR 2050) 2021-04-26 23:56:42 -03:00
Alexey Min 2b620a0fdd
pmb.sideload: support non-standard SSH port (!2046)
This can be used for example to sideload packages to
pmbootstrap's QEMU which is running on the port 2222
by default, as follows:

  pmbootstrap sideload --host localhost --port 2222 --user user <pkg>

This adds a `--port` parameter to sideload subcommand.
If not specified, port defaults to 22.
2021-04-25 21:04:49 +03:00
Mark Hargreaves 57c830c410
pmbootstrap qemu: change default frontend to GTK (MR 2044)
Fix issues occurring when using pmbootstrap qemu with proprietary
Nvidia drivers as well as mouse misalignment issues on Phosh UI.

Signed-off-by: Mark Hargreaves <clashclanacc2602@gmail.coM>
2021-04-25 13:28:45 +02:00
Oliver Smith 303e7cd648
Prepare 1.31.0 release
Require latest apk-tools, which fixes CVE-2021-30139.

Related: https://gitlab.alpinelinux.org/alpine/aports/-/issues/12606
2021-04-14 20:50:53 +02:00
Oliver Smith 8df7514b8e
install: verify pmaports branch supporting fs (MR 2011)
Do not attempt to install with a filesystem that is not supported by the
initramfs code in the checked out pmaports branch.

Previously we would have increased the pmaports.cfg version and require
that new version by pmbootstrap, however this will break compatibility
with release branches where we won't roll out this feature (v20.05).
Therefore don't change the version, but add a new
"supported_root_filesystems" key to pmaports.cfg, which defaults to
"ext4".

Related: https://postmarketos.org/pmaports.cfg
2021-04-11 20:10:28 +02:00
Bobby The Builder 807d7019f8
install: add --filesystem to handle ext4 or f2fs (MR 2011)
Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2021-04-11 20:10:28 +02:00
Bobby The Builder 958ecc6c72
install: add install_fsprogs (MR 2011)
Install specific filesystem tools right before they are needed, instead
of installing all filesystem tools that we might need beforehand. This
is in preparation to support f2fs.

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2021-04-11 20:10:24 +02:00
Mark Hargreaves f758812f64
pmbootstrap qemu: fix on systems with more than 8 CPUs (MR 2045)
Fix error when CPU count is more than 8 while emulating a non-native
platform:
  qemu-system-aarch64: Number of SMP CPUs requested (12) exceeds max CPUs supported by machine 'mach-virt' (8)

Signed-off-by: Mark Hargreaves <clashclanacc2602@gmail.coM>
2021-04-04 20:43:40 +02:00
Oliver Smith a440556a0a
pmb.build.menuconfig: fix for native arch case (MR 2041)
Don't try to install and use a cross compiler if none is needed.

Fixes: 2406597f ("menuconfig: use cross-compiler for configuration (MR 2023)")
2021-03-30 16:47:23 +02:00
Anri Dellal 88ec1d1106
pmb.chroot: fix E501, switch to f-strings (MR 2040) 2021-03-30 15:13:26 +02:00
Shubham Naik 87c7859b40
Enforce E501: Limit the line length to 79 for files in pmb/install (MR 2031)
Made changes to limit the line length in following files for #1986,
 - pmb/install/_install.py
 - pmb/install/blockdevice.py
 - pmb/install/losetup.py
 - pmb/install/partition.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-03-30 14:51:53 +02:00
Oliver Smith a9e100ebcc
Prepare 1.30.0 release 2021-03-30 14:26:14 +02:00
Oliver Smith 03e9fb0570
pmb.config.init.boot_size: set to 256 MiB (MR 2037)
Increase the boot partition size from 128 MiB to 256 MiB, as we are
already close to reaching the current limit. By having twice the size,
it should be possible to have atomic replacements of all initramfs
related files.
2021-03-23 22:14:29 +01:00
MightyM17 c3526f3271
envkernel.sh: Add yaml-dev and g++ dependency. (MR 2039) 2021-03-23 12:41:32 +03:00
Luca Weiss 2406597f3c
menuconfig: use cross-compiler for configuration (MR 2023)
Not using the cross compiler for kconfig leads to some differences to
the actual compilation later.
2021-03-19 17:54:28 -07:00
Luca Weiss 29823eec3e
pmb.build._package: split out init_compiler function (MR 2023)
In preparation for using it outside of init_buildenv
2021-03-19 17:54:19 -07:00
Luca Weiss 485b81e96e
menuconfig: remove unused variable assignment (MR 2023)
The variable is set further down anyways.
2021-03-19 17:54:02 -07:00
Oliver Smith 278dfced61
Replace pmaports channels stable, stable-next (MR 2032)
Translate the pmaports channels "stable" to "v20.05" and "stable-next"
to "v21.03", so these have the same channel name as the pmaports.git
branch name.

The original plan was to switch the "stable" channel from the "v20.05"
branch to the "v21.03" branch when the release is done. However, now
that we are close to that, I'm realizing that this would not be useful.
It would lead to conflicts in the dir with locally built packages
(default: ~/.local/var/pmbootstrap/packages/$CHANNEL). And it would make
it awkward to go back to a previous branch (we may name it old-stable
for the time being, but what after that, old-old-stable?).
2021-03-18 18:58:13 +01:00
JuniorJPDJ 5c1c126647
kconfig edit: removed gconfig support (MR 2034)
alpine removed [1] support for libglade, which is needed for gconfig to work
[1] a2d7250043
2021-03-13 19:10:46 +01:00
JuniorJPDJ 2b17e6ab71
kconfig edit: nconfig support (MR 2034) 2021-03-13 15:31:19 +01:00
JuniorJPDJ 8db2ab71b2
kconfig edit: fix xconfig dependencies (MR 2034) 2021-03-13 15:05:15 +01:00
Martijn Braam ed0bbf6069
install: don't try to embed firmware in split images (MR 2033)
Split images have /dev/installp1 and /dev/installp2 but no
/dev/install to place the firmware, so it will actually create that file
in devfs where it might run out of space since it's only 1MB big
2021-03-12 16:52:15 +01:00
Oliver Smith af2b2b5933
install: output empty line before flash/sshd info (MR 2030)
Leave some visual space before the flashing and ssh daemon information
blocks, so they don't get overlooked by the user:

[12:50:31] *** (4/4) FILL INSTALL BLOCKDEVICE ***
[12:50:31] (native) copy rootfs_qemu-amd64 to /mnt/install/
[12:50:36]
[12:50:36] *** FLASHING INFORMATION ***
[12:50:36] Refer to the installation instructions of your device, or the generic install instructions in the wiki.
[12:50:36] https://wiki.postmarketos.org/wiki/Installation_guide#pmbootstrap_flash
[12:50:36]
[12:50:36] *** SSH DAEMON INFORMATION ***
[12:50:36] SSH daemon is disabled (--no-sshd).
[12:50:36]
[12:50:36] NOTE: chroot is still active (use 'pmbootstrap shutdown' as necessary)
[12:50:36] Done
2021-02-17 02:06:36 +01:00
Oliver Smith 2b2ede95e5
install: get rid of redundant suffix line (MR 2030)
It is already filled with the same value at the beginning of the
function.
2021-02-17 02:06:35 +01:00
Oliver Smith 5b01a18cba
install: add --no-sshd argument (MR 2030)
Allow to disable the sshd service in the target OS, and note at the end
of the installation whether sshd is enabled or not.
2021-02-17 02:06:35 +01:00
Michael Kupfer 94544b8435
Prevent RuntimeError if there is no module binfmt_misc (MR 2029)
In case the kernel is compiled with CONFIG_BINFMT_MISC=y,
there is no module but binfmt_misc is still mountable.
2021-02-13 21:58:42 +01:00
Oliver Smith 748d9ce2c7
pmb install: make invalid kernel message clear (MR 2027)
Change "configured" to "valid" in the error message:
  Selected kernel (mainline_modem) is not configured for device bq-paella.
  Please run 'pmbootstrap init' to select a valid kernel.

"configured" makes one think of "pmbootstrap init", but the valid
kernels are defined in the APKBUILD. Therefore I think "not valid" fits
better here.
2021-02-12 11:33:06 +01:00
Oliver Smith 1b67c11396
install --ondev: run setup_login for installer OS (MR 2026)
Run setup_login() while creating the installer OS too, in order to
disable passwordless root login.

Note that this may sound like a security flaw, but it isn't.
* setup_login already ran for the target OS, meaning after the
  installation is done, one is not be able to login as root without
  password
* root login without password was only possible via serial console (or by
  attaching a keyboard), not via SSH
* getting root rights via serial in the installer OS is actually desired
  for debugging, we add a debug user with sudo set up by default:
  https://wiki.postmarketos.org/wiki/On-device_installer#Debug_user

So even though this isn't a problem, disable it to avoid confusion.
2021-02-12 11:15:25 +01:00
Oliver Smith 7320caead0
test_parse_depends: adjust to hello-world bump (MR 2028)
Adjust to pkgrel bump of the hello-world package in pmaports. Of course
it would be best if the tests did not depend on specific versions in
pmaports.git, but as long as they do, we need to keep them in sync.
This fixes the currently failing CI.
2021-02-11 23:36:46 +01:00
nybbled 5f485b8ad3
pmb.aportgen: put dependencies on separate lines (MR 2024)
Generate APKBUILDs with dependencies sorted and placed one per line.
The dependency lists changed are
 - depends in pmb/aportgen/device.py
 - makedepends in pmb/aportgen/linux.py

Sort dependency lists in test/test_aportgen_device_wizard.py
assertions.
2021-02-10 00:08:22 +01:00
Luca Weiss df58d35e27
kconfig check: require TMPFS_POSIX_ACL (MR 2025)
See pmaports!1939 and pmaports#904.
2021-02-09 23:11:31 +01:00
Minecrell 7dc2e197d3
pmb: Introduce support for "unmaintained" devices (MR 2018)
Unmaintained devices are device packages that:
  - Are known to be broken in some way without an active maintainer
    who can investigate how to fix it, or
  - Have not received any updates for a very long time, or
  - Are discouraged from using because they are just intended for testing.
    An example for this are ports using the downstream kernel for devices
    which have a mainline port that is working quite well.

Unmaintained devices are still built by bpo (otherwise it would not make
sense to keep them), but they do not show up in "pmbootstrap init".
However, it is possible to manually select them by entering the name.
pmbootstrap will warn in that case.

Unmaintained packages should have a # Unmaintained: <reason> comment
in the APKBUILD, this comment is displayed in "pmbootstrap init"
so that the user knows why the device should not be used unless they
know what they are doing.
2021-02-05 00:39:16 +01:00
Minecrell 03b3b250a5
pmb.parse._apkbuild: Add function to parse maintainers of APKBUILD (MR 2018)
This can be used for CI checks in pmaports to ensure that:
  - Devices in main have >= 2 maintainers
  - Devices in community have at least one maintainer
2021-02-05 00:39:12 +01:00
Oliver Smith 552246b228
Prepare 1.29.2 release 2021-02-04 23:16:40 +01:00
Shubham Naik 684cb3e1fb
Enforce E501: Limit the line length to 79 for files in pmb/parse - part 2 (MR 2020)
Made changes to limit the line length in following files,
 - pmb/parse/bootimg.py
 - pmb/parse/depends.py
 - pmb/parse/kconfig.py
 - test/test_parse_depends.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-02-04 22:54:00 +01:00
Shubham Naik d1fadba5b4
Enforce E501: Limit the line length to 79 for files in pmb/parse - part 1 (MR 2019)
Made changes to limit the line length in following files,
 - pmb/parse/_apkbuild.py
 - pmb/parse/apkindex.py
 - pmb/parse/binfmt_info.py
 - pmb/parse/deviceinfo.py
 - test/test_parse_apkbuild.py

Added the above files in E501 flake8 command list.
Substitute f-string for string concatenation.
2021-02-04 22:32:35 +01:00
Clayton Craft 4474927141
pmb/config: use uuu package from Alpine (MR 2021) 2021-02-03 09:03:01 -08:00
Alexey Min 69b7543243
pmb.chroot.shutdown: be more user friendly when unmounting SD card (MR 2012)
When unmounting SD card after `pmbootstrap install --sdcard=...`
it takes a lot of time for kernel to sync filesystem cache
before actual umounting happehs. This looks like pmbootstrap is
stuck, so before doing unmount print a message to inform user of
what's happening, in case `--sdcard` was used.
2021-01-30 23:13:26 -08:00
Oliver Smith bc51a1c605
pmb.config.mirror_alpine: use CDN again (MR 2016)
The CDN was disabled, as packages from there often resulted in 'BAD
signature' after Alpine's big musl-1.2 rebuild for 32-bit arches. This
was almost half a year ago, so the CDN should have recovered.

This reverts commit 78f43d254e.
2021-01-27 23:55:33 +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