Commit Graph

2372 Commits

Author SHA1 Message Date
Laszlo Molnar 2e39912790
pmb.parse.arguments: add zap --all flag (MR 2117)
Fixes: #1692
2022-02-28 17:09:21 +03:00
Luca Weiss 5252d8de78
config: Move NFT_COUNTER into conditional (MR 2171)
The option has been removed and is now always enabled with nftables
core.

See also https://git.kernel.org/torvalds/c/023223d
2022-02-24 08:54:50 +01:00
Oliver Smith e45e8f932c
Prepare 1.42.0 release 2022-02-20 15:29:40 +01:00
Clayton Craft a367e0d95b
pmb.chroot.mount: create /dev/fd (MR 2170)
Specifically, this fixes issues with process substitution in bash in the
chroot.

For example, the following lines from a NetworkManager build script:

    ... |
        grep -Fx -f <(get_symbols_explicit) -v |
        grep -Fx -f <(get_symbols_nm)

fail with:
     ninja: job failed: /home/pmos/build/src/NetworkManager-1.35.92/tools/create-exports-NetworkManager.sh --called-from-build /home/pmos/build/src/NetworkManager-1.35.92
     grep: /dev/fd/63: No such file or directory
     grep: /dev/fd/63: No such file or directory
2022-02-20 15:03:09 +01:00
jenneron 7b2ffc3e5f
Support ChromeOS partition table and kernel partition (MR 2163)
Stock bootloader on these devices boots kernel (it is intended to boot
kernel, but i place secondary bootloader there) from special ChromeOS
kernel partition on special GPT which is created with cgpt utility.
This MR adds initial support for it introducing new deviceinfo options:

- cgpt_kpart - path to file to be flashed to ChromeOS partition;
- cgpt_kpart_start - offset from the start in sectors;
- cgpt_kpart_size - partition size in sectors.

For example:

deviceinfo_cgpt_kpart="/usr/share/u-boot/google-peach-pit/u-boot-dtb.img.kpart"
deviceinfo_cgpt_kpart_start="8192"
deviceinfo_cgpt_kpart_size="32768"

cgpt requires start and size values of partition, so these values
are calculated for each partition.

Reserved size and on-device installer are not yet supported.

Reference: https://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook
2022-02-20 14:49:56 +01:00
Anton Bambura 2363732645
pmb.install: add get_partition_layout() (MR 2163)
"Keeping track of which partition number is what is hard to understand now.
 I think this should be refactored, so we have it defined only in one
 place, and easy to read. Since this merge request increases the complexity
 of the partitions again, let's do it here before merging." - Oliver

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2022-02-20 14:48:18 +01:00
Caleb Connolly 0d5ff8f520
flake8: increase the line length limit (MR 2168)
80 is quite conservative, to the point where it often impacts code
   readability rather than improving it.
2022-02-13 20:27:47 +01:00
Caleb Connolly 18a16c7899
pmb: flasher: add support for rk partitions (MR 2165) 2022-02-13 19:54:29 +01:00
Martijn Braam 884174ce3c
config: use partition names for rkdeveloptool (MR 2165) 2022-02-13 19:54:23 +01:00
Clayton Craft 100fd332df
pmb.qemu.run: add option to set serial to mon:stdio (MR 1980)
This makes QEMU trap signals like Ctrl-C and send it to the guest
instead of terminating QEMU.

To quit QEMU with this option you can use [Ctrl-A] [x]
  or
[Ctrl-A] [c] and type 'quit' at the prompt.

This behavior is disabled by default, and can be enabled by setting a
new option in the pmbootstrap.cfg (using "pmbootstrap config
qemu_redir_stdio true")

Co-authored-by: Luca Weiss <luca@z3ntu.xyz>
2022-02-13 19:22:49 +01:00
Tony Garnock-Jones dfe8129640
Allow override of SSH key glob: documentation (MR 2167) 2022-02-13 16:26:49 +01:00
Tony Garnock-Jones 3c5effa0e7
Allow override of SSH key glob (MR 2167) 2022-02-08 12:29:27 +01:00
Oliver Smith 5d3cbbdb86
pmb.helpers.pkgrel_bump: !-deps are not missing (MR 2166)
Do not assume that conflicting dependencies are missing.

Fix for:
  Increase 'unl0kr' pkgrel (0 -> 1), missing depend(s): !osk-sdl

Related: https://gitlab.com/postmarketOS/monitoring/-/jobs/2058087076
2022-02-05 11:54:32 +01:00
Caleb Connolly 47410eafb9
config: fix missing comma in flash methods (MR 2164)
o/ hi Martijn
2022-02-02 21:20:11 +00:00
Marian Stramm 80c988236f
pmb.install: add support for creating btrfs root filesystem (MR 2155)
in preparation for reversible upgrades, this change adds the option of
creating a btrfs root filesystem
2022-01-29 11:47:29 +03:00
Bart Ribbers 9e63d5820c
Support generating GPT partition tables (MR 2160)
The PPP will, in combination with tow-boot, boot with GPT on the
internal storage. We need to support that on postmarketOS and as a first
step, let's make it possible to generate GPT images and boot from that
2022-01-28 10:01:46 +01:00
Bart Ribbers 36aabcc4fe
Print return code when subprocess fails (MR 2161)
It can be very useful to figure out why a particular subprocess might be
failing ;)
2022-01-22 15:45:12 +01:00
Mark Hargreaves ff0942b12d
pmbootstrap kconfig check: add netboot check (MR 2064)
Allow checking for the necessary kernel option for netboot.

Co-authored-by: Luca Weiss <luca@z3ntu.xyz>
2022-01-20 22:29:46 +01:00
Mark Hargreaves 47539f1bef
pmb/netboot: new feature (MR 2064)
pmbootstrap netboot command exposes the generated vendor-codename.img
rootfs through nbd interface so that device can mount it and boot
postmarketOS without having any storage medium at all.

Co-authored-by: Luca Weiss <luca@z3ntu.xyz>
2022-01-20 22:29:41 +01:00
Rudraksha Gupta 997e3fb1f5
pmb.install: Remove pass to conform to code style (MR 2159) 2022-01-20 21:01:46 +01:00
Rudraksha Gupta bea18e03f3
pmb.install: password for root is already locked (MR 2159)
When running `pmbootstrap install`, pmbootstrap does not unlock root
when it completes. This patch allows `pmbootstrap install` to run two or
more times (without zap).

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2022-01-20 21:01:41 +01:00
Oliver Smith d698aa15ad
Prepare 1.41.0 release 2022-01-18 21:46:34 +01:00
Johannes Marbach 6d7d113040
pmb.chroot.apk: Delete conflicting dependencies (MR 2157)
When installing dependencies for a package, conflicting (!) dependencies
are now deleted (with `apk del pkg`) whereas before a constraint for
their _absence_ was added (with `apk add !pkg`). Doing it the new way
around prevents creating deadlocks because a `!pkg` constraint will
prevent pkg from ever being installed without an explicit `apk del`
call.

Fixes: #2092
2022-01-18 20:06:23 +01:00
Newbyte 614cb72a2a
pmb.install: update UID 10000 explanation (MR 2158) 2022-01-11 00:17:55 +03:00
Johannes Marbach 2ad5427126
pmb.install: automatically pick unlocker package (MR 2154)
This removes the hard-coded installation of osk-sdl when specifying
--fde (or using the on-device installer) and instead determines the
unlocker package by taking the most suitable provider of
postmarketos-fde-unlocker (factoring provider priority and packages
selected for installation).

With this change applied, one can manually select an unlocker package to
be installed via

    pmbootstrap install --fde --add other-unlocker

Relates to: postmarketOS/pmaports#1309
2022-01-02 22:40:23 +01:00
Oliver Smith 6f6a3b0408
Happy new year 2022! 2022-01-02 22:39:14 +01:00
Andreas Kemnade 8ca71ed3a0
install: do not choke on blockdevices without fs (MR 2153)
when blkid returns 2 while searching for existing pmos installations,
do not abort. That might happen if there is a block device without a
filesystem.

Error given:
(1653851) [21:39:19] (native) % blkid -s LABEL -o value /dev/sdcardp1
(1653851) [21:39:19] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(1653851) [21:39:19] NOTE: The failed command's output is above the ^^^ line in the log file: /home/andi/.local/var/pmbootstrap/log.txt
(1653851) [21:39:19] ERROR: Command failed: (native) % blkid -s LABEL -o value /dev/sdcardp1
(1653851) [21:39:19] See also: <https://postmarketos.org/troubleshooting>
(1653851) [21:39:19] Traceback (most recent call last):
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/__init__.py", line 49, in main
    getattr(frontend, args.action)(args)
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/helpers/frontend.py", line 314, in install
    pmb.install.install(args)
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/install/_install.py", line 944, in install
    install_system_image(args, 0, f"rootfs_{args.device}", step, steps,
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/install/_install.py", line 586, in install_system_image
    pmb.install.blockdevice.create(args, size_boot, size_root,
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/install/blockdevice.py", line 138, in create
    mount_sdcard(args, sdcard)
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/install/blockdevice.py", line 51, in mount_sdcard
    if previous_install(args, path):
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/install/blockdevice.py", line 27, in previous_install
    label = pmb.chroot.root(args, ["blkid", "-s", "LABEL", "-o", "value",
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/chroot/root.py", line 76, in root
    return pmb.helpers.run_core.core(args, msg, cmd_sudo, None, output,
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/home/andi/.local/lib/python3.9/site-packages/pmb/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: (native) % blkid -s LABEL -o value /dev/sdcardp1
2022-01-02 22:14:06 +01:00
Johannes Marbach a9d1049a3c
build: add support for conflicting dependencies (MR 2146)
This adds support for the depends="!conflict ..." syntax for explicitly
marking another package as conflicting with the current one.

Fixes: #2085
2021-12-30 20:25:02 +01:00
Clayton Craft 8a14d366ef
helpers/envkernel.sh: fix shellcheck failure (MR 2151)
A recent update to shellcheck made this line start failing:
In ./helpers/envkernel.sh line 59:
        export pmbootstrap_dir=$(realpath "$script_dir/..")
                               ^--------------------------^ SC2046 (warning): Quote this to prevent word splitting.
2021-12-19 18:16:56 +01:00
Oliver Smith 3e5f27d5e3
pmb.parse.depends.recurse: tweak message (MR 2151)
Fix the lint error. While at it, change the wording so it's clear it's
looking in pmaports instead of aports, use '' around the source package
just as the message does about the pkgname_depend, remove <> from the
link URL.

New message:
  Could not find dependency 'so:libPocoData.so.80' in checked out pmaports dir or any APKINDEX. Required by 'nymphcast'. See: https://postmarketos.org/depends

Fixes: 81dc4c ("pmb.parse: show which package require the missing package")
2021-12-19 18:16:51 +01:00
Martijn Braam 81dc4c17f6
pmb.parse: show which package require the missing package (MR 2150)
When a dependency is not found it now shows all the pacakges that
require that dependency in the error message.
2021-12-17 17:17:25 +01:00
Oliver Smith fd7050835f
Prepare 1.40.0 release 2021-12-12 19:07:21 +01:00
Anjandev Momi c1407f921b
Use doas instead of sudo if installed (MR 2091)
Prefer using doas over sudo if both are installed. Let the user override
the sudo tool with PMB_SUDO.
2021-12-12 18:46:17 +01:00
Tim Zimmermann 2801b5d687
kconfig-check: only check TZDEV/SAMSUNG_TUI on kernels older than 4.14 (MR 2148)
* On newer samsung devices disabling these does the exact opposite of
  what's mentioned in 50cdf04760
* With these enabled the device boots up just fine
2021-12-12 17:23:21 +03:00
Alexey Min 66d11d6d34
pmb.helpers.ui: clarify "none" UI purpose
And suggest users to use "console" UI instead.
2021-12-12 16:51:39 +03:00
Alexey Min 89350b69b6
tests: test single-line comment for unquoted attribute (MR 2149) 2021-12-12 16:16:55 +03:00
Clayton Craft 58e4e86b6b
pmb.parse.parse_attribute: strip off trailing comment on attrib line (MR 2149)
The apkbuild parser could not handle cases where a line ends in a
comment but the value is not quoted.

E.g. this:

    pkgver=1.0 # I'm a comment, look at me

was being parsed to a value like this:

    1.0 # I'm a comment, look at me

... which is obviously wrong. This strips off any trailing comment on
the line, so it's parsed to the correct value.

fixes #2087
2021-12-12 16:16:30 +03:00
Oliver Smith 672ebe797b
Revert "CI: download shellcheck (MR 2142)"
It's back in Alpine edge.

This reverts commit 3987d2f764.
2021-11-27 15:32:15 +01:00
Anjandev Momi 8563efb9da
aportupgrade: if $pkgver=9999, use $_pkgver variable instead (MR 2127)
fixes #2071
2021-11-27 15:05:25 +01:00
Oliver Smith 54fade131c
Fix 'kconfig edit linux-...' (MR 2143)
Properly assemble the required pkgname to fix:

  $ pmbootstrap kconfig linux-postmarketos-allwinner
  ERROR: Could not find aport for package: postmarketos-allwinner

Fixes: 6557e6 ("kconfig argcomplete: support full pkgname")
2021-11-27 14:45:09 +01:00
BO41 3f2bd03d33
remove unused args argument (MR 2136) 2021-11-27 14:13:33 +01:00
BO41 379991aa62
pmb.parse.apkindex.parse: remove unused args argument (MR 2136) 2021-11-27 14:13:33 +01:00
BO41 99bed38272
pmb.parse.apkbuild: remove unused args argument (MR 2136) 2021-11-27 14:13:33 +01:00
BO41 ce0f1c2d4a
args.cache: remove (MR 2136)
Replace "args.cache" with a global variable in order to
avoid passing "args" to all functions. This is a step to get rid of this
args-passed-to-all-functions pattern in pmbootstrap.
2021-11-27 14:13:27 +01:00
Oliver Smith f30b1cc3f2
pmb.config.apk_tools_min_version: add alpine 3.15 (MR 2144)
Prepare for postmarketOS v21.12 release.
2021-11-26 00:51:11 +01:00
Jami Kettunen b3d91f274d
pmb/config: check CROSS_MEMORY_ATTACH config required for Waydroid (MR 2140)
Without this syscall zygote keeps constantly crashing in the container.
2021-11-18 19:43:51 +02:00
Oliver Smith 3987d2f764
CI: download shellcheck (MR 2142)
Similar fix as in pmaports MR 2673.
2021-11-11 22:50:28 +01:00
Caleb Connolly 4c4bd77c87
install: support password as cmdline arg (MR 2125)
So I can finally run `pmbootstrap install --password 147147` and go and
make a cup of tea.

Based on MR 1919.

Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2021-11-06 22:45:00 +01:00
Oliver Smith 498738abcc
Prepare 1.39.0 release 2021-11-06 21:06:53 +01:00
Ultracoolguy 54afa35d70
Add 'flasher flash_lk2nd' command (MR 2089)
Many Qualcomm devices need this second bootloader for booting a mainline
kernel. Add an option to flash one if it exists.
2021-11-06 20:51:58 +01:00