Commit Graph

1751 Commits

Author SHA1 Message Date
Oliver Smith ed4072956d
pmbootstrap install --ondev: new option
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-09 15:48:12 +02:00
Oliver Smith 8d0f3a1c55
install_system_image: add sdcard argument
The on-device installer will run install_system_image once with
sdcard=None and the second time with sdcard=args.sdcard.
2020-06-09 15:48:12 +02:00
Oliver Smith 9a0ef38ee3
install_system_image: add split argument 2020-06-09 15:48:11 +02:00
Oliver Smith 21a6c7189b
install_system_image: add step, steps parameters 2020-06-09 15:48:11 +02:00
Oliver Smith 4a5137064d
install_system_image: add root_label parameter
Prepare for on-device installer, so it can use something other than
"pmOS_root" as label.
2020-06-09 15:48:11 +02:00
Oliver Smith 4bebad987d
install_system_image: add suffix argument
Allow files to be copied from a different suffix than rootfs_$DEVICE.
The on-device installer will use this.
2020-06-09 15:48:11 +02:00
Oliver Smith fdc2fe309e
Cosmetics: install_system_image(): remove FDE msg
Full disk encryption (--fde) has not been the default for a long time,
so no need to warn the user about it.
2020-06-09 15:48:11 +02:00
Oliver Smith c940c96078
pmb.install._install.print_flash_info: cosmetics
Fix a typo and wrap lines at 80 characters (especially one extra long
line). Use f-strings in lines that were modified (as we're doing it
nowadays).
2020-06-09 15:48:11 +02:00
Oliver Smith 854c96f63f
pmb.install._install.print_flash_info: new func
Move code that prints flashing information from install_system_image()
to its own function. For the on-device installer, we'll need to call
install_system_image() twice, without printing the flashing information
each time. While at it, add a "step" parameter.
2020-06-09 15:48:11 +02:00
Oliver Smith 67e3c5ad1a
pmbootstrap install: support size_reserve
Create an empty partition between boot and root. This will be used by
the on-device installer, as explained in detail here:
https://wiki.postmarketos.org/wiki/On-device_installer
2020-06-09 15:48:11 +02:00
Oliver Smith d8c84c8912
Cosmetic: pmb.install.partition: fix comment 2020-06-09 15:48:11 +02:00
Oliver Smith 3f1f21add5
pmb/install: have size_boot, size_root in MB
Prepare for a future patch, that adds reserved space in MB, by changing
size_boot and size_root from bytes to MB everywhere. This is what we need
most of the time and allows to drop some /1024**2 statements.
2020-06-09 15:48:11 +02:00
Oliver Smith 9da12415b8
pmbootstrap chroot --install-blockdev: new option
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-09 15:48:11 +02:00
Oliver Smith ac7d66fade
blockdevice.create_and_mount_image: add split arg
Add a "split" argument to the function, instead of using "args.split"
directly. "args.split" is only defined when calling "pmbootstrap install",
but the next patch will add a code path that calls the function from
"pmbootstrap chroot".
2020-06-09 15:48:06 +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
Iskren Chernev 2dd707a7ea
envkernel.sh: Add reactivate, deactivate on re-source (MR 1918)
Some users prefer to re-source the script from time to time. Detect that
and deactivate first.
2020-06-02 11:34:46 +02:00
HenriDellal 4e3a2d6923
Add "flasher flash_vbmeta" support for heimdall devices (MR 1936) 2020-06-02 11:14:59 +02:00
Oliver Smith 40a328388d
pmb.install: simplify root size estimation (MR 1931)
Do not substract the estimated size of the home and boot directories
from the root directory size. While that would be the correct way if we
were able to get exact sizes, it isn't helpful with the very rough
estimates we are getting from pmb.helpers.other.folder_size. Replace
"calculate" wording with "estimate".
2020-06-02 10:48:03 +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
Oliver Smith d623913491
pmbootstrap init: (build => additional) options (MR 1931)
Rename "build options" to "additional options", so we can put non-build
related options there too.
2020-06-02 10:47:58 +02:00
Anjandev Momi 0ff9c5d471
pmbootstrap init: only display UIs for device arch (MR 1937)
Hide user interfaces that are not available for the selected device's
architecture.

Closes #1790
2020-06-02 09:18:39 +02:00
Oliver Smith 2d2ab1df56
testdata: update lg-mako deviceinfo (MR 1937)
Copy from current pmaports master, so pmbootstrap doesn't complain about
missing deviceinfo_codename when parsing it. Right now pmbootstrap
doesn't complain about this, but with the next patch it will attempt to
parse the file.

This replaces the year from 1337 to 2012 too, but let's rather have it
slightly more maintainable than introducing a diff for a funny reference.
2020-06-02 09:18:34 +02:00
Oliver Smith 445410d08c
Prepare 1.20.0 release 2020-05-24 08:51:01 +02:00
Oliver Smith 0aa1dd7145
pmb.parse.deviceinfo.sanity_check: verify chassis (MR 1933) 2020-05-24 08:38:43 +02:00
Luca Weiss 1356707e9a
pmb.install._install: update comments (MR 1933) 2020-05-24 08:38:15 +02:00
Luca Weiss 6bb7f022b1
pmb: introduce deviceinfo_chassis (MR 1933)
"Chassis" defines the what kind of device a device is. Currently the
following standardized types exist:

  "desktop", "laptop", "convertible", "server", "tablet", "handset",
  "watch", "embedded", "vm", "container"

This property is exposed by org.freedesktop.hostname1 (e.g.
openrc-settingsd) and can be used by applications for example to display
appropriate strings instead of "About this phone" for non-phone devices.
2020-05-24 08:38:10 +02:00
Antoine Fontaine c5d0f76005
pmb.parse.kconfig: add tests (MR 1916) 2020-05-24 04:42:13 +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
Antoine Fontaine e36e160167
pmb.parse.kconfig: check for end of line in "CONFIG_…=y" (MR 1916)
it's a nitpick, but now `is_set` won't return true
for (e.g.) CONFIG_XYZ=marmelade.
2020-05-22 23:05:28 +02:00
Antoine Fontaine 075706b26e
pmb/build: remove implicit native cross-compilation (MR 1941)
If a package want native cross compilation, it should explicit that
with "pmb:cross-native" in `options=`.
See https://gitlab.com/postmarketOS/pmbootstrap/-/issues/1910.
2020-05-21 08:03:50 +03:00
Oliver Smith 7f60a6d782
chroot: put built packages into channel subdir (MR 1912)
Migrate to workdir version 5 and move already built packages into the edge
channel subdir, for example:
	$WORK/packages/x86_64/hello-world-1-r5.apk
to:
	$WORK/packages/edge/x86_64/hello-world-1-r5.apk

The build.postmarketos.org code has already been adjusted to find built
packages in either directory structure.
2020-05-17 08:08:45 +02:00
Daniele Debernardi d3dc3b2c98
pmb.chroot.shutdown: losetup with auto_init=False (MR 1912)
Do not go through the pmb.chroot.init() code path when running
pmb.install.losetup.umount() inside pmb.chroot.shutdown(). This is not
necessary, as pmb.install.losetup.umount() only gets called if the
chroot is already initialized and /dev/loop-control is mounted inside
the chroot.

Not going through this code path is important for the upcoming workdir
migration patch. Without this fix, it will fail with the following if
running "pmbootstrap install" before the work migration:

ERROR: Could not figure out on which release channel the 'native' chroot is
2020-05-17 08:08:45 +02:00
Oliver Smith 5a256f66de
pmb.helpers.pkgrel_bump.auto_apkindex_files: remove (MR 1912)
Replace the call to this function with the almost identical
pmb.helpers.repo.apkindex_files(), so release channel related changes
only need to be done in one place.
2020-05-17 08:08:45 +02:00
Oliver Smith 3ff0b18a08
pmb.chroot.init: verify chroot channel (MR 1912)
Refuse to work with a chroot that was created for another release
channel.
2020-05-17 08:08:45 +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 2fb98adf92
pmb.helpers.repo.apkindex_files: deduplicate pmos urls (MR 1912)
Don't generate the postmarketOS mirror URLs here, let the urls()
function do it. A follow-up commit will touch this code, hence it's
important to have it de-duplicated.
2020-05-17 08:08:45 +02:00
Oliver Smith 6d64586b9f
test/test_repo.py: rename to test_helpers_repo.py (MR 1912)
This file is about testing pmb/helpers/repo.py, so make the name of the
test file consistent with other test/test_helpers_*.py files.
2020-05-17 08:08:45 +02:00
Oliver Smith 17f3b3c2f0
pmbootstrap init: ask for release channel (MR 1912)
Ask for release channel and switch pmaports branch to the related branch
defined in channels.cfg.

Store in pmbootstrap.cfg whether the user chose a channel (boolean). If
the user did not choose a channel yet, suggest the recommended channel
from channels.cfg (currently "edge").
2020-05-17 08:08:45 +02:00
Oliver Smith 261e8595ad
pmb.config.keys: sort / one entry per line (MR 1912)
Let's make this long list more git friendly.
2020-05-17 08:08:44 +02:00
Oliver Smith fc5cb2e190
pmb.config.pmaports: don't add to args (MR 1912)
Do not make the parsed pmaports.cfg from pmaports.git available as
args.pmaports anymore. This de-bloats the args variable a bit.

First I thought that we didn't even need to cache it, but it was pointed
out that later patches do access it frequently to read the current channel
from pmaports.cfg. Therefore it is using a cache now.

Related: #1879, #1855
2020-05-17 08:08:44 +02:00
Oliver Smith b015273d86
pmb/config/__init__.py: bump pmaports_min_version (MR 1912)
New pmaports.cfg has the "channel" key described in [1]. This will be
used in "pmbootstrap init" to determine on which release channel a
forked branch is.

[1] https://postmarketos.org/pmaports.cfg
2020-05-17 08:08:44 +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
Oliver Smith 8f2bac8e63
Prepare 1.19.0 release 2020-05-10 18:41:16 +02:00
Dolphin von Chips 62f7a2af30
pmb.aportgen.linux: fix generated apkbuild when using qcdt (MR 1935) 2020-05-10 18:13:04 +02:00
Minecrell 0465f17e92
pmb.aportgen: Stop generating Maintainer: lines for device ports (MR 1932)
Most device ports that are added to pmaports (particularly the testing
category) are not actually "maintained". Many of them are never updated
after the initial contribution. There is little reason to list a
"Maintainer:" if the device package is actually not actively maintained
by that person.

Let's stop generating the Maintainer: line by default.
Instead, contributors should add the lines themselves if they are willing
to (actively) maintain the device package for a longer period of time.
Once they no longer want to maintain the package, the Maintainer:
line should be removed again.
2020-05-10 18:02:07 +02:00
Minecrell c33edea907
pmb.aportgen: Stop generating Contributor: lines for device ports (MR 1932)
The Git history is a much better representation of contributors
to a particular device port.
2020-05-10 18:02:02 +02:00
Oliver Smith f3466dcd3f
pmbootstrap lint: use CUSTOM_VALID_OPTIONS (MR 1934)
Let apkbuild-lint check options again, and pass the pmbootstrap specific
options with the new CUSTOM_VALID_OPTIONS variable. Add a test case and
adjust pmb.helpers.lint.check to return the output of apkbuild-lint, so
we can properly test it.

Related: https://gitlab.alpinelinux.org/Leo/atools/-/merge_requests/28
Fixes: pmaports#553
2020-05-10 16:35:35 +02:00
Martijn Braam df08af7984
arguments: --ccache-disable => --no-ccache (MR 1926)
Rename for consistency.
2020-05-10 16:18:10 +02:00
Anjandev Momi 44ab2f8c40
pmb.helpers.http.download respects --offline flag (MR 1930)
fixes #1837
2020-05-09 12:21:41 +02:00