Commit Graph

185 Commits

Author SHA1 Message Date
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
Clayton Craft 1d5030738c
pmb/helpers/frontend: drop all --flavors args (MR 2093) 2021-09-02 18:18:13 -07:00
afeuerstein 2d3cfbcbb4
pmbootstrap flasher: add flash_dtbo (MR 2099) 2021-08-29 22:51:56 +02:00
BO41 e1aef47271
pmbootstrap: make use of consistent casing (MR 2090) 2021-08-12 17:06:11 +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
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
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
Clayton Craft 599d74ec25
kconfig check: add support for nftables (MR 2042) 2021-06-14 21:50:45 +02: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
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
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
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
Oliver Smith 7d1c8d29df
pmbootstrap qemu: add --second-storage (MR 2008)
Create a second storage to test installing from SD card to eMMC with the
on-device installer.
2021-01-27 15:01:53 +01:00
Oliver Smith 1c791da482
treewide: bump copyright to 2021 2021-01-07 23:30:47 +01: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
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
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
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
Johannes Marbach fc7e39d301
pmb.parse.arguments Reformat to 79 characters per line (MR 1993) 2020-11-23 11:30:51 +01:00
Johannes Marbach 5dea31058d
Add option to specify extra free space in pmbootstrap init (MR 1989)
This adds a new commandline flag -E / --extra-space for
specifying the amount of additional space to be added to
the image size to work around cases where the automatically
determined size turns out to not actually be enough.

The value is also asked for in the "Additional options"
section of the interactive mode.

Fixes: #1904
2020-11-17 20:07:01 +01:00
timbz d0b32b3b05
pmbootstrap deviceinfo_parse: new action (MR 1986)
Co-Authored-By: Oliver Smith <ollieparanoid@postmarketos.org>
2020-11-10 09:15:52 +03:00
Luca Weiss 93f13277b9
aportupgrade: add support for specifying git ref (MR 1964)
This adds support for specifying an arbitrary git ref (e.g. commits,
tags, branches) to upgrade to. This can be useful if a specific commit
needs to be packaged instead of the latest available. Alternatively you
can also specify a branch to be used if the default branch is 'stable'
but 'develop' should be packaged.

This also removes old code to use the 'bionic' branch for UBports Lomiri
(formerly Unity 8) packages.
2020-09-16 20:31:04 +03:00
Oliver Smith d8615a9cae
pmbootstrap install: support _pmb_recommends (MR 1962)
Let UI meta-packages specify apps in "pmb_recommends" to be explicitly
installed by default, and not implicitly as dependency of the UI
meta-package ("depends"). Therefore make these apps uninstallable,
without removing the meta-package.

Add pmbootstrap install --no-recommends to disable this feature.
2020-07-20 14:29:06 +02:00
Oliver Smith c8d581e749
pmbootstrap install --no-local-pkgs: new option (MR 1951)
Don't install locally compiled packages and package signing keys. This
will be used for the official images generated with pmbootstrap.
2020-07-15 16:47:51 +03:00
Oliver Smith ddb5d9ae2c
pmbootstrap install --ondev: new option (MR 1946)
Add initial support for the on-device installer in pmbootstrap. Let
pmbootstrap create a regular split image, then prepare a new installer
rootfs and copy the previously generated rootfs image into the installer
rootfs. Put the installer rootfs into a new image, with reserved space.

There is more to do from here, such as disabling the generation of the
user account when using --ondev. But this requires support in
postmarketos-ondev first, so let's build that iteratively.

Related: https://wiki.postmarketos.org/wiki/On-device_installer
Related: https://gitlab.com/postmarketOS/postmarketos-ondev/-/issues
2020-06-19 09:36:51 +02:00
Oliver Smith 63fc2b621a
pmbootstrap chroot --install-blockdev: new option (MR 1946)
Create /dev/install inside the chroot from a block device, just like
done during the installation. This is useful for testing the Calamares
installer.
2020-06-19 09:36:50 +02:00
Oliver Smith 6d013b4472
pmbootstrap chroot --xauth: new option (MR 1944)
Make it easy to start any X11 application from the native chroot.
2020-06-09 04:10:51 +02:00
Anjandev Momi 37b4af19fc
make boot partition size user-overridable (MR 1931)
Ask for the boot partition size during "pmbootstrap init" in the
additional options with a default of 128 MB, and allow to override it
with -B.
2020-06-02 10:48:03 +02:00
Antoine Fontaine 28da033267
pmb.parse.kconfig: implement anbox kconfig check (MR 1916)
fixes https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1891.
2020-05-24 04:42:01 +02:00
Oliver Smith ce433ae012
pmb.helpers.repo.urls: use channels.cfg mirrordirs (MR 1912)
Use mirrordir_pmos and mirrordir_alpine from channels.cfg to generate
the mirror URLs for postmarketOS and Alpine, which get written to
/etc/apk/repositories and which postmarketOS uses to download the
APKINDEX files.

Remove hardcoded "master" at the end of the postmarketOS mirror and use
mirrordir_pmos instead (which is "master" for the edge channel). Let the
postmarketOS mirror end in a '/' for consistency with the Alpine mirror
in pmb/config/__init__.py.

Remove obsolete --alpine-version. To experiment with a different Alpine
version, one should pass a custom --config-channels from now on.
2020-05-17 08:08:45 +02:00
Oliver Smith c616874443
pmb.helpers.git: parse channels.cfg (MR 1912)
Prepare to base postmarketOS on Alpine stable by parsing the new
channels.cfg file in pmaports.git, that describes which channel
needs which branches and mirror dirs from postmarketOS and Alpine.

Use the information in pmb.helpers.git.get_branches_official() first,
more is coming in follow-up commits.

Read the file from origin/master, so we get the latest fetched version
even if the last checked out master branch is not up-to-date (think of
currently checked out release branch instead of master, master will
never be updated to point to latest origin/master). Allow to override
the file with a new --config-channels parameter.

Related: https://postmarketos.org/channels.cfg
2020-05-17 08:08:44 +02:00
Oliver Smith ed16a9d080
pmb/parse/arguments.py: --config: add help text (MR 1912) 2020-05-17 08:08:39 +02:00
Martijn Braam df08af7984
arguments: --ccache-disable => --no-ccache (MR 1926)
Rename for consistency.
2020-05-10 16:18:10 +02:00
Daniele Debernardi 34c6f88691
pmb.install._install: add option to not generate the image (MR 1914) 2020-04-14 00:29:35 +03:00
Niklas Cathor 29a3cb2b8c
pmb.helpers.frontend.config: add option to reset config to default (!1907) 2020-04-07 01:02:19 +03:00
Oliver Smith 73401f8606
pmb.parse.arguments: fix pkgname autocompletion (!1905)
Use pmb.helpers.args.add_cache() with the args used during
autocompletion, so pmb.helpers.pmaports._find_apkbuilds() does not fail
when trying to access args.cache.
2020-04-05 13:04:53 +02:00
Alexey Min e6da56d9b0
add "flasher flash_vbmeta" command (!1885)
Flashes device vbmeta partition (can be overriden with
"flash_fastboot_partition_vbmeta" setting in deviceinfo)
with custom vbmeta.img which has verity flag disabled,
so device can boot postmarketOS with no problems.
2020-03-21 20:58:08 +01:00
Daniele Debernardi 9718320829
pmb.qemu: drop --flavor option (!1886)
Since we ask for the kernel flavor during init, only the chosen kernel is
installed, hence there's no need to specify a different one.
2020-03-14 08:05:57 +01:00
Daniele Debernardi a76897b4a1
pmb.qemu: set default image size of 4G (!1886) 2020-03-14 08:05:32 +01:00
Minecrell 7bbc507416
pmb.qemu: use -cpu host for KVM, make configurable with --cpu (!1886)
For KVM the code is run pretty much natively on the host CPU, so all
CPU extensions available on the host CPU can be also used inside the VM.
To expose that information to the VM we should pass "-cpu host", so the
VM is aware of which CPU is in use.

For CPU emulation, QEMU uses a rather minimal CPU on x86_64 by default.
It does not have support for SSE3/4 etc, which may be required for some
applications to work properly (e.g. Android in Anbox). Add a --cpu flag
to make the emulated CPU configurable. Useful values are for example
--cpu max to emulate all implemented CPU features.
2020-03-14 08:05:32 +01:00
Minecrell 76dcf8aa0b
pmb.qemu: add --no-kvm to disable KVM even when available (!1886)
To test QEMU's CPU emulation it is useful to have a switch to disable
KVM, even when it is available (and potentially working fine).

Add --no-kvm for that purpose.
2020-03-14 08:05:32 +01:00
Minecrell b4678f0882
pmb.qemu: make video resolution configurable + consistent (!1886)
For some reason, the SDL display backend changes the video resolution
to 1024x768, while the GTK display keeps it at 640x480.
This is annoying, because at the moment we can only set one display
resolution for a device in postmarketOS (e.g. for the splash screen).

At the moment, the resolution for the splash screen is set to 640x480,
which therefore shows up too small with the default SDL display.

It seems like the display resolution can be only changed in the guest
directly. Linux has a video= kernel parameter that can be used to
implement this. (See: https://www.kernel.org/doc/html/latest/fb/modedb.html)

Let's set 1024x768 by default, but make it configurable through --video.
2020-03-14 08:05:32 +01:00
Minecrell f602df0140
pmb.qemu: add --tablet option for QEMU tablet input device (!1886)
The QEMU 'tablet' input device reports absolute positions instead
of relative mouse pointer movements. This can be used to automatically
grab/release the mouse pointer when entering/leaving the QEMU window,
instead of having to release it with CTRL + ALT + G manually.

This is quite convenient and should be the default option normally,
but at least on my PC the mouse pointer is reported with some vertical
offset for some reason (you can't reach the top and it extends below
the QEMU window...). Let's add it as an optional --tablet option for now.
2020-03-14 08:05:32 +01:00
Minecrell f536fd9cb9
pmb.qemu: use current device instead of requiring --arch (!1886)
When using pmbootstrap, you usually select the device you want to work
on using 'pmbootstrap init', generate the rootfs and can then run more
commands in the context of the device.

The same needs to be done before using QEMU (to generate the rootfs).
But for some reason 'pmbootstrap qemu' requires setting the --arch
parameter when running QEMU for a foreign architecture, even when the
device is still selected in pmbootstrap.

Even more confusing is that setting "--arch arm" always selects
device-qemu-vexpress, but this is not immediately clear from the name.

Let's make this a lot more intuitive by making sure there is a QEMU
device selected when running 'pmbootstrap qemu'. We can then use the
device information to infer the architecture automatically.
2020-03-14 08:05:32 +01:00
Minecrell 32dca18eb6
pmb.qemu: simplify --display by introducing --no-gl (!1886)
At the moment, the --display argument is a bit complicated to use.
A common use would be to switch between the UIs (sdl, gtk, none)
or to enable the software rasterizer. Split the two use cases
to separate arguments to make it more intuitive.
2020-03-14 08:05:32 +01:00