2017-05-26 20:08:45 +00:00
|
|
|
"""
|
2018-01-04 03:53:35 +00:00
|
|
|
Copyright 2018 Oliver Smith
|
2017-05-26 20:08:45 +00:00
|
|
|
|
|
|
|
This file is part of pmbootstrap.
|
|
|
|
|
|
|
|
pmbootstrap is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
pmbootstrap is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with pmbootstrap. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
"""
|
|
|
|
import argparse
|
|
|
|
import pmb.config
|
|
|
|
import pmb.parse.arch
|
|
|
|
|
|
|
|
|
2017-09-06 20:14:03 +00:00
|
|
|
def arguments_export(subparser):
|
|
|
|
ret = subparser.add_parser("export", help="create convenience symlinks"
|
|
|
|
" to generated image files (system, kernel,"
|
|
|
|
" initramfs, boot.img, ...)")
|
|
|
|
|
|
|
|
ret.add_argument("export_folder", help="export folder, defaults to"
|
|
|
|
" /tmp/postmarketOS-export",
|
|
|
|
default="/tmp/postmarketOS-export", nargs="?")
|
|
|
|
ret.add_argument("--odin", help="odin flashable tar"
|
|
|
|
" (boot.img/kernel+initramfs only)",
|
|
|
|
action="store_true", dest="odin_flashable_tar")
|
|
|
|
ret.add_argument("--flavor", default=None)
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
2017-05-26 20:08:45 +00:00
|
|
|
def arguments_flasher(subparser):
|
|
|
|
ret = subparser.add_parser("flasher", help="flash something to the"
|
|
|
|
" target device")
|
|
|
|
sub = ret.add_subparsers(dest="action_flasher")
|
2017-08-24 21:07:36 +00:00
|
|
|
ret.add_argument("--method", help="override flash method",
|
|
|
|
dest="flash_method", default=None)
|
2017-05-26 20:08:45 +00:00
|
|
|
|
2017-09-06 20:14:03 +00:00
|
|
|
# Boot, flash kernel
|
2017-05-26 20:08:45 +00:00
|
|
|
boot = sub.add_parser("boot", help="boot a kernel once")
|
2017-07-22 21:16:51 +00:00
|
|
|
boot.add_argument("--cmdline", help="override kernel commandline")
|
2017-05-26 20:08:45 +00:00
|
|
|
flash_kernel = sub.add_parser("flash_kernel", help="flash a kernel")
|
2017-09-06 20:14:03 +00:00
|
|
|
for action in [boot, flash_kernel]:
|
2017-05-26 20:08:45 +00:00
|
|
|
action.add_argument("--flavor", default=None)
|
|
|
|
|
2017-09-13 17:50:06 +00:00
|
|
|
# Flash system
|
Close #453: Support mesa-dri-virtio in Qemu (#861)
The mesa driver, which ends up in the installation image, needs to be known
before the installation is done (in other words: when running the qemu action,
it is to late as the image has already been generated). That's why one can
choose the Qemu mesa driver in `pmbootstrap init` now:
```
Device [qemu-amd64]:
Which mesa driver do you prefer for your Qemu device? Only select something other
than the default if you are having graphical problems (such as glitches).
Mesa driver (dri-swrast/dri-virtio) [dri-virtio]:
```
It is still possible to select `dri-swrast`, because `dri-virtio` may not work
in all cases, and that way we could easily debug it or experiment with other
mesa drivers (e.g. the "vmware" one, which is supported by mesa and Qemu).
Other changes:
* `pmbootstrap qemu` accepts a `--display` variable now, which passes the value
directly to `qemu`'s `display` option. It defaults to `sdl,gl=on` (@PureTryOut
reported that to work best with plasma mobile on his PC). `--display` and
`--spice` (which is still working) are mutually exclusive.
* Removed obsolete telnet port pass-through: We only use the debug telnet port
since osk-sdl has been merged.
* Add show-cursor to the Qemu command line, so it shows a cursor in X11
* Refactored the spice code (`command_spice` only returns the spice command,
because it has all necessary information already) and the spice port can be
specified on the commandline now (previously it was hardcoded in one place and
then always looked up from there).
* Start comments with capital letters.
* Keep the log on the screen a bit shorter (e.g. Qemu command is written to the
"pmbootstrap log" anyway, so there's no need to display it again).
* linux-postmarketos-stable: Adjust kernel configs
x86_64, armhf: enable as modules:
CONFIG_DRM_VIRTIO_GPU, CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_BALLOON
aarch64: all 3 options were already enabled as built-in (no change)
* Set '-vga virtio' for mesa-dri-virtio
2017-11-05 13:48:49 +00:00
|
|
|
flash_system = sub.add_parser(
|
|
|
|
"flash_system", help="flash the system partition")
|
2017-09-13 17:50:06 +00:00
|
|
|
flash_system.add_argument("--partition", default=None, help="partition to flash"
|
|
|
|
" the system image")
|
|
|
|
|
2017-09-06 20:14:03 +00:00
|
|
|
# Actions without extra arguments
|
|
|
|
sub.add_parser("sideload", help="sideload recovery zip")
|
2017-08-24 21:07:36 +00:00
|
|
|
sub.add_parser("list_flavors", help="list installed kernel flavors" +
|
|
|
|
" inside the device rootfs chroot on this computer")
|
|
|
|
sub.add_parser("list_devices", help="show connected devices")
|
|
|
|
|
2017-09-06 20:14:03 +00:00
|
|
|
# Deprecated "pmbootstrap flasher export"
|
|
|
|
arguments_export(sub)
|
2017-05-26 20:08:45 +00:00
|
|
|
return ret
|
|
|
|
|
|
|
|
|
2017-06-09 17:22:25 +00:00
|
|
|
def arguments_initfs(subparser):
|
|
|
|
ret = subparser.add_parser(
|
|
|
|
"initfs", help="do something with the initramfs")
|
|
|
|
sub = ret.add_subparsers(dest="action_initfs")
|
|
|
|
|
|
|
|
# hook ls
|
|
|
|
sub.add_parser(
|
|
|
|
"hook_ls",
|
|
|
|
help="list available and installed hook packages")
|
|
|
|
|
|
|
|
# hook add/del
|
|
|
|
hook_add = sub.add_parser("hook_add", help="add a hook package")
|
|
|
|
hook_del = sub.add_parser("hook_del", help="uninstall a hook package")
|
|
|
|
for action in [hook_add, hook_del]:
|
|
|
|
action.add_argument("hook", help="name of the hook aport, without the"
|
2017-12-23 19:22:28 +00:00
|
|
|
" '" + pmb.config.initfs_hook_prefix + "' prefix, for example: 'debug-shell'")
|
2017-06-09 17:22:25 +00:00
|
|
|
|
|
|
|
# ls, build, extract
|
2017-06-09 17:49:01 +00:00
|
|
|
ls = sub.add_parser("ls", help="list initramfs contents")
|
2017-06-09 17:22:25 +00:00
|
|
|
build = sub.add_parser("build", help="(re)build the initramfs")
|
2017-06-11 12:19:57 +00:00
|
|
|
extract = sub.add_parser(
|
|
|
|
"extract",
|
|
|
|
help="extract the initramfs to a temporary folder")
|
2017-06-09 17:22:25 +00:00
|
|
|
for action in [ls, build, extract]:
|
|
|
|
action.add_argument(
|
|
|
|
"--flavor",
|
|
|
|
default=None,
|
|
|
|
help="name of the kernel flavor (run 'pmbootstrap flasher list_flavors'"
|
|
|
|
" to get a list of all installed flavors")
|
|
|
|
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
Close #453: Support mesa-dri-virtio in Qemu (#861)
The mesa driver, which ends up in the installation image, needs to be known
before the installation is done (in other words: when running the qemu action,
it is to late as the image has already been generated). That's why one can
choose the Qemu mesa driver in `pmbootstrap init` now:
```
Device [qemu-amd64]:
Which mesa driver do you prefer for your Qemu device? Only select something other
than the default if you are having graphical problems (such as glitches).
Mesa driver (dri-swrast/dri-virtio) [dri-virtio]:
```
It is still possible to select `dri-swrast`, because `dri-virtio` may not work
in all cases, and that way we could easily debug it or experiment with other
mesa drivers (e.g. the "vmware" one, which is supported by mesa and Qemu).
Other changes:
* `pmbootstrap qemu` accepts a `--display` variable now, which passes the value
directly to `qemu`'s `display` option. It defaults to `sdl,gl=on` (@PureTryOut
reported that to work best with plasma mobile on his PC). `--display` and
`--spice` (which is still working) are mutually exclusive.
* Removed obsolete telnet port pass-through: We only use the debug telnet port
since osk-sdl has been merged.
* Add show-cursor to the Qemu command line, so it shows a cursor in X11
* Refactored the spice code (`command_spice` only returns the spice command,
because it has all necessary information already) and the spice port can be
specified on the commandline now (previously it was hardcoded in one place and
then always looked up from there).
* Start comments with capital letters.
* Keep the log on the screen a bit shorter (e.g. Qemu command is written to the
"pmbootstrap log" anyway, so there's no need to display it again).
* linux-postmarketos-stable: Adjust kernel configs
x86_64, armhf: enable as modules:
CONFIG_DRM_VIRTIO_GPU, CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_BALLOON
aarch64: all 3 options were already enabled as built-in (no change)
* Set '-vga virtio' for mesa-dri-virtio
2017-11-05 13:48:49 +00:00
|
|
|
def arguments_qemu(subparser):
|
|
|
|
ret = subparser.add_parser("qemu")
|
|
|
|
ret.add_argument("--arch", choices=["aarch64", "arm", "x86_64"],
|
|
|
|
help="emulate a different architecture")
|
|
|
|
ret.add_argument("--cmdline", help="override kernel commandline")
|
|
|
|
ret.add_argument(
|
|
|
|
"--image-size", help="set system image size (e.g. 2048M or 2G)")
|
|
|
|
ret.add_argument("-m", "--memory", type=int, default=1024,
|
|
|
|
help="guest RAM (default: 1024)")
|
|
|
|
ret.add_argument("-p", "--port", type=int, default=2222,
|
|
|
|
help="SSH port (default: 2222)")
|
2018-02-25 19:20:22 +00:00
|
|
|
ret.add_argument("--flavor", help="name of the kernel flavor (run 'pmbootstrap flasher list_flavors'"
|
|
|
|
" to get a list of all installed flavors")
|
Close #453: Support mesa-dri-virtio in Qemu (#861)
The mesa driver, which ends up in the installation image, needs to be known
before the installation is done (in other words: when running the qemu action,
it is to late as the image has already been generated). That's why one can
choose the Qemu mesa driver in `pmbootstrap init` now:
```
Device [qemu-amd64]:
Which mesa driver do you prefer for your Qemu device? Only select something other
than the default if you are having graphical problems (such as glitches).
Mesa driver (dri-swrast/dri-virtio) [dri-virtio]:
```
It is still possible to select `dri-swrast`, because `dri-virtio` may not work
in all cases, and that way we could easily debug it or experiment with other
mesa drivers (e.g. the "vmware" one, which is supported by mesa and Qemu).
Other changes:
* `pmbootstrap qemu` accepts a `--display` variable now, which passes the value
directly to `qemu`'s `display` option. It defaults to `sdl,gl=on` (@PureTryOut
reported that to work best with plasma mobile on his PC). `--display` and
`--spice` (which is still working) are mutually exclusive.
* Removed obsolete telnet port pass-through: We only use the debug telnet port
since osk-sdl has been merged.
* Add show-cursor to the Qemu command line, so it shows a cursor in X11
* Refactored the spice code (`command_spice` only returns the spice command,
because it has all necessary information already) and the spice port can be
specified on the commandline now (previously it was hardcoded in one place and
then always looked up from there).
* Start comments with capital letters.
* Keep the log on the screen a bit shorter (e.g. Qemu command is written to the
"pmbootstrap log" anyway, so there's no need to display it again).
* linux-postmarketos-stable: Adjust kernel configs
x86_64, armhf: enable as modules:
CONFIG_DRM_VIRTIO_GPU, CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_BALLOON
aarch64: all 3 options were already enabled as built-in (no change)
* Set '-vga virtio' for mesa-dri-virtio
2017-11-05 13:48:49 +00:00
|
|
|
|
|
|
|
display = ret.add_mutually_exclusive_group()
|
|
|
|
display.add_argument("--spice", dest="spice_port", const="8077",
|
|
|
|
action="store", nargs="?", default=None,
|
|
|
|
help="use SPICE for 2D acceleration (default port:"
|
|
|
|
" 8077)")
|
|
|
|
display.add_argument("--display", dest="qemu_display", const="sdl,gl=on",
|
|
|
|
help="Qemu's display parameter (default: sdl,gl=on)",
|
|
|
|
default="sdl,gl=on", nargs="?")
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
2018-01-14 01:26:42 +00:00
|
|
|
def arguments_pkgrel_bump(subparser):
|
|
|
|
ret = subparser.add_parser("pkgrel_bump", help="increase the pkgrel to"
|
|
|
|
" indicate that a package must be rebuilt"
|
|
|
|
" because of a dependency change")
|
|
|
|
ret.add_argument("--dry", action="store_true", help="instead of modifying"
|
|
|
|
" APKBUILDs, exit with >0 when a package would have been"
|
|
|
|
" bumped")
|
|
|
|
|
|
|
|
# Mutually exclusive: "--auto" or package names
|
|
|
|
mode = ret.add_mutually_exclusive_group(required=True)
|
|
|
|
mode.add_argument("--auto", action="store_true", help="all packages which"
|
|
|
|
" depend on a library which had an incompatible update"
|
|
|
|
" (libraries with a soname bump)")
|
|
|
|
mode.add_argument("packages", nargs="*", default=[])
|
|
|
|
return ret
|
|
|
|
|
|
|
|
|
2018-01-15 22:00:11 +00:00
|
|
|
def arguments_newapkbuild(subparser):
|
|
|
|
ret = subparser.add_parser("newapkbuild", help="get a template to package"
|
|
|
|
" new software")
|
|
|
|
ret.add_argument("folder", help="aports subfolder, where the new aport will"
|
|
|
|
" be located (main, cross, device, ...)")
|
|
|
|
ret.add_argument("args_passed", nargs=argparse.REMAINDER,
|
|
|
|
help="arguments directly passed to Alpine's newapkbuild,"
|
|
|
|
" more information: 'pmbootstrap newapkbuild main -h'")
|
|
|
|
|
|
|
|
|
2017-05-26 20:08:45 +00:00
|
|
|
def arguments():
|
|
|
|
parser = argparse.ArgumentParser(prog="pmbootstrap")
|
2017-10-24 16:18:42 +00:00
|
|
|
arch_native = pmb.parse.arch.alpine_native()
|
|
|
|
arch_choices = set(pmb.config.build_device_architectures + [arch_native])
|
2017-05-26 20:08:45 +00:00
|
|
|
|
|
|
|
# Other
|
|
|
|
parser.add_argument("-V", "--version", action="version",
|
|
|
|
version=pmb.config.version)
|
|
|
|
parser.add_argument("--no-cross", action="store_false", dest="cross",
|
|
|
|
help="disable crosscompiler, build only with qemu + gcc (slower!)")
|
|
|
|
|
|
|
|
parser.add_argument("-a", "--alpine-version", dest="alpine_version",
|
|
|
|
help="examples: edge, latest-stable, v3.5")
|
|
|
|
parser.add_argument("-c", "--config", dest="config",
|
|
|
|
default=pmb.config.defaults["config"])
|
|
|
|
parser.add_argument("-d", "--port-distccd", dest="port_distccd")
|
2017-06-20 18:13:05 +00:00
|
|
|
parser.add_argument("-mp", "--mirror-pmOS", dest="mirror_postmarketos")
|
2017-05-26 20:08:45 +00:00
|
|
|
parser.add_argument("-m", "--mirror-alpine", dest="mirror_alpine")
|
|
|
|
parser.add_argument("-j", "--jobs", help="parallel jobs when compiling")
|
|
|
|
parser.add_argument("-p", "--aports",
|
|
|
|
help="postmarketos aports paths")
|
2017-08-18 19:19:48 +00:00
|
|
|
parser.add_argument("-s", "--skip-initfs", dest="skip_initfs",
|
|
|
|
help="do not re-generate the initramfs",
|
|
|
|
action="store_true")
|
2017-05-26 20:08:45 +00:00
|
|
|
parser.add_argument("-w", "--work", help="folder where all data"
|
|
|
|
" gets stored (chroots, caches, built packages)")
|
2017-08-26 15:50:04 +00:00
|
|
|
parser.add_argument("-y", "--assume-yes", help="Assume 'yes' to all"
|
|
|
|
" question prompts. WARNING: this option will"
|
|
|
|
" cause normal 'are you sure?' prompts to be"
|
|
|
|
" disabled!",
|
|
|
|
action="store_true")
|
2018-01-14 08:13:35 +00:00
|
|
|
parser.add_argument("--as-root", help="Allow running as root (not"
|
|
|
|
" recommended, may screw up your work folders"
|
|
|
|
" directory permissions!)", dest="as_root",
|
|
|
|
action="store_true")
|
2017-05-26 20:08:45 +00:00
|
|
|
|
|
|
|
# Logging
|
2017-08-02 19:38:42 +00:00
|
|
|
parser.add_argument("-l", "--log", dest="log", default=None,
|
|
|
|
help="path to log file")
|
|
|
|
parser.add_argument("--details-to-stdout", dest="details_to_stdout",
|
|
|
|
help="print details (e.g. build output) to stdout,"
|
|
|
|
" instead of writing to the log",
|
|
|
|
action="store_true")
|
2017-05-26 20:08:45 +00:00
|
|
|
parser.add_argument("-v", "--verbose", dest="verbose",
|
Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.
I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.
To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.
In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.
In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".
This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.
Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).
The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
|
|
|
action="store_true", help="write even more to the"
|
2017-07-21 16:25:52 +00:00
|
|
|
" logfiles (this may reduce performance)")
|
2017-05-26 20:08:45 +00:00
|
|
|
parser.add_argument("-q", "--quiet", dest="quiet",
|
|
|
|
action="store_true", help="do not output any log messages")
|
|
|
|
|
|
|
|
# Actions
|
|
|
|
sub = parser.add_subparsers(title="action", dest="action")
|
|
|
|
sub.add_parser("init", help="initialize config file")
|
|
|
|
sub.add_parser("shutdown", help="umount, unregister binfmt")
|
|
|
|
sub.add_parser("index", help="re-index all repositories with custom built"
|
|
|
|
" packages (do this after manually removing package files)")
|
2017-11-19 15:04:08 +00:00
|
|
|
sub.add_parser("update", help="update all APKINDEX files")
|
2017-09-06 20:14:03 +00:00
|
|
|
arguments_export(sub)
|
2017-05-26 20:08:45 +00:00
|
|
|
arguments_flasher(sub)
|
2017-06-09 17:22:25 +00:00
|
|
|
arguments_initfs(sub)
|
Close #453: Support mesa-dri-virtio in Qemu (#861)
The mesa driver, which ends up in the installation image, needs to be known
before the installation is done (in other words: when running the qemu action,
it is to late as the image has already been generated). That's why one can
choose the Qemu mesa driver in `pmbootstrap init` now:
```
Device [qemu-amd64]:
Which mesa driver do you prefer for your Qemu device? Only select something other
than the default if you are having graphical problems (such as glitches).
Mesa driver (dri-swrast/dri-virtio) [dri-virtio]:
```
It is still possible to select `dri-swrast`, because `dri-virtio` may not work
in all cases, and that way we could easily debug it or experiment with other
mesa drivers (e.g. the "vmware" one, which is supported by mesa and Qemu).
Other changes:
* `pmbootstrap qemu` accepts a `--display` variable now, which passes the value
directly to `qemu`'s `display` option. It defaults to `sdl,gl=on` (@PureTryOut
reported that to work best with plasma mobile on his PC). `--display` and
`--spice` (which is still working) are mutually exclusive.
* Removed obsolete telnet port pass-through: We only use the debug telnet port
since osk-sdl has been merged.
* Add show-cursor to the Qemu command line, so it shows a cursor in X11
* Refactored the spice code (`command_spice` only returns the spice command,
because it has all necessary information already) and the spice port can be
specified on the commandline now (previously it was hardcoded in one place and
then always looked up from there).
* Start comments with capital letters.
* Keep the log on the screen a bit shorter (e.g. Qemu command is written to the
"pmbootstrap log" anyway, so there's no need to display it again).
* linux-postmarketos-stable: Adjust kernel configs
x86_64, armhf: enable as modules:
CONFIG_DRM_VIRTIO_GPU, CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_BALLOON
aarch64: all 3 options were already enabled as built-in (no change)
* Set '-vga virtio' for mesa-dri-virtio
2017-11-05 13:48:49 +00:00
|
|
|
arguments_qemu(sub)
|
2018-01-14 01:26:42 +00:00
|
|
|
arguments_pkgrel_bump(sub)
|
2018-01-15 22:00:11 +00:00
|
|
|
arguments_newapkbuild(sub)
|
2017-05-26 20:08:45 +00:00
|
|
|
|
2017-06-08 16:15:38 +00:00
|
|
|
# Action: log
|
|
|
|
log = sub.add_parser("log", help="follow the pmbootstrap logfile")
|
2017-06-09 16:01:39 +00:00
|
|
|
log_distccd = sub.add_parser(
|
|
|
|
"log_distccd",
|
|
|
|
help="follow the distccd logfile")
|
2017-06-08 16:15:38 +00:00
|
|
|
for action in [log, log_distccd]:
|
2017-08-17 23:27:06 +00:00
|
|
|
action.add_argument("-n", "--lines", default="60",
|
2017-08-07 18:56:35 +00:00
|
|
|
help="count of initial output lines")
|
|
|
|
action.add_argument("-c", "--clear", help="clear the log",
|
|
|
|
action="store_true", dest="clear_log")
|
2017-06-08 16:15:38 +00:00
|
|
|
|
2017-05-26 20:08:45 +00:00
|
|
|
# Action: zap
|
2017-06-20 17:12:41 +00:00
|
|
|
zap = sub.add_parser("zap", help="safely delete chroot folders")
|
2018-01-31 19:34:02 +00:00
|
|
|
zap.add_argument("--dry", action="store_true", help="instead of actually"
|
|
|
|
" deleting anything, print out what would have been"
|
|
|
|
" deleted")
|
2017-05-26 20:08:45 +00:00
|
|
|
zap.add_argument("-p", "--packages", action="store_true", help="also delete"
|
|
|
|
" the precious, self-compiled packages")
|
|
|
|
zap.add_argument("-hc", "--http", action="store_true", help="also delete http"
|
|
|
|
"cache")
|
2017-08-28 20:34:03 +00:00
|
|
|
zap.add_argument("-m", "--mismatch-bins", action="store_true", help="also delete"
|
|
|
|
" binary packages that are newer than the corresponding"
|
|
|
|
" package in aports")
|
2017-11-02 17:33:14 +00:00
|
|
|
zap.add_argument("-o", "--old-bins", action="store_true", help="also delete outdated"
|
|
|
|
" binary packages downloaded from mirrors (e.g. from Alpine)")
|
2017-09-14 18:28:10 +00:00
|
|
|
zap.add_argument("-d", "--distfiles", action="store_true", help="also delete"
|
|
|
|
" downloaded files cache")
|
2017-05-26 20:08:45 +00:00
|
|
|
|
|
|
|
# Action: stats
|
|
|
|
stats = sub.add_parser("stats", help="show ccache stats")
|
2017-12-21 16:42:29 +00:00
|
|
|
stats.add_argument("--arch", default=arch_native, choices=arch_choices)
|
2017-05-26 20:08:45 +00:00
|
|
|
|
2017-07-26 18:59:11 +00:00
|
|
|
# Action: build_init / chroot
|
2017-05-26 20:08:45 +00:00
|
|
|
build_init = sub.add_parser("build_init", help="initialize build"
|
|
|
|
" environment (usually you do not need to call this)")
|
|
|
|
chroot = sub.add_parser("chroot", help="start shell in chroot")
|
2018-02-20 19:52:28 +00:00
|
|
|
chroot.add_argument("--add", help="build/install comma separated list of"
|
|
|
|
" packages in the chroot before entering it")
|
2017-05-26 20:08:45 +00:00
|
|
|
chroot.add_argument("command", default=["sh"], help="command"
|
|
|
|
" to execute inside the chroot. default: sh", nargs='*')
|
|
|
|
for action in [build_init, chroot]:
|
2017-07-26 18:59:11 +00:00
|
|
|
suffix = action.add_mutually_exclusive_group()
|
2017-10-25 22:54:17 +00:00
|
|
|
if action == chroot:
|
|
|
|
suffix.add_argument("-r", "--rootfs", action="store_true",
|
|
|
|
help="Chroot for the device root file system")
|
2017-10-28 00:45:15 +00:00
|
|
|
suffix.add_argument("-b", "--buildroot", nargs="?", const="device",
|
|
|
|
choices={"device"} | arch_choices,
|
|
|
|
help="Chroot for building packages, defaults to device "
|
2017-07-26 18:59:11 +00:00
|
|
|
"architecture")
|
2017-07-29 15:16:43 +00:00
|
|
|
suffix.add_argument("-s", "--suffix", default=None,
|
2017-07-26 18:59:11 +00:00
|
|
|
help="Specify any chroot suffix, defaults to"
|
|
|
|
" 'native'")
|
2017-05-26 20:08:45 +00:00
|
|
|
|
|
|
|
# Action: install
|
|
|
|
install = sub.add_parser("install", help="set up device specific" +
|
|
|
|
" chroot and install to sdcard or image file")
|
|
|
|
install.add_argument("--sdcard", help="path to the sdcard device,"
|
|
|
|
" eg. /dev/mmcblk0")
|
2018-01-28 23:25:21 +00:00
|
|
|
install.add_argument("--rsync", help="update the sdcard using rsync,"
|
|
|
|
" only works with --no-fde", action="store_true")
|
2017-05-26 20:08:45 +00:00
|
|
|
install.add_argument("--cipher", help="cryptsetup cipher used to"
|
|
|
|
" encrypt the system partition, eg. aes-xts-plain64")
|
2017-09-19 19:46:18 +00:00
|
|
|
install.add_argument("--iter-time", help="cryptsetup iteration time (in"
|
|
|
|
" miliseconds) to use when encrypting the system"
|
|
|
|
" partiton")
|
2017-06-08 16:10:00 +00:00
|
|
|
install.add_argument("--add", help="comma separated list of packages to be"
|
|
|
|
" added to the rootfs (e.g. 'vim,gcc')")
|
2017-06-22 10:19:32 +00:00
|
|
|
install.add_argument("--no-fde", help="do not use full disk encryption",
|
2017-06-28 15:22:48 +00:00
|
|
|
action="store_false", dest="full_disk_encryption")
|
2017-09-02 03:53:58 +00:00
|
|
|
install.add_argument("--flavor",
|
|
|
|
help="Specify kernel flavor to include in recovery"
|
|
|
|
" flashable zip", default=None)
|
2017-08-24 21:07:36 +00:00
|
|
|
install.add_argument("--android-recovery-zip",
|
|
|
|
help="generate TWRP flashable zip",
|
|
|
|
action="store_true", dest="android_recovery_zip")
|
|
|
|
install.add_argument("--recovery-install-partition", default="system",
|
|
|
|
help="partition to flash from recovery,"
|
2017-09-19 19:46:18 +00:00
|
|
|
" eg. external_sd",
|
2017-08-24 21:07:36 +00:00
|
|
|
dest="recovery_install_partition")
|
2017-09-28 22:05:00 +00:00
|
|
|
install.add_argument("--recovery-no-kernel",
|
|
|
|
help="do not overwrite the existing kernel",
|
|
|
|
action="store_false", dest="recovery_flash_kernel")
|
2017-05-26 20:08:45 +00:00
|
|
|
|
2018-01-18 22:05:27 +00:00
|
|
|
# Action: menuconfig
|
2017-05-26 20:08:45 +00:00
|
|
|
menuconfig = sub.add_parser("menuconfig", help="run menuconfig on"
|
|
|
|
" a kernel aport")
|
2017-10-24 16:18:42 +00:00
|
|
|
menuconfig.add_argument("--arch", choices=arch_choices)
|
2018-01-18 22:05:27 +00:00
|
|
|
menuconfig.add_argument("package")
|
2017-07-26 18:59:11 +00:00
|
|
|
|
2018-01-18 22:05:27 +00:00
|
|
|
# Action: checksum / aportgen / build
|
2017-07-26 18:59:11 +00:00
|
|
|
checksum = sub.add_parser("checksum", help="update aport checksums")
|
2018-01-15 22:00:11 +00:00
|
|
|
aportgen = sub.add_parser("aportgen", help="generate a postmarketOS"
|
|
|
|
" specific package build recipe (aport/APKBUILD)")
|
2017-05-26 20:08:45 +00:00
|
|
|
build = sub.add_parser("build", help="create a package for a"
|
|
|
|
" specific architecture")
|
2017-11-28 19:12:16 +00:00
|
|
|
build.add_argument("--arch", choices=arch_choices, default=None,
|
Fix #824: Refactor pmb/build/package.py (make depends work like in abuild) (#935)
* Rename pmb/build/package.py to pmb/build/_package.py, so we can
access the functions it contains in testcases, and still use
pmb.build.package()
* Refactor the entire file. Instead of one big function that does
too many things, we have many small ones now, that are tested
in the testsuite and easier to modify
* Whenever building a package, pmbootstrap does not only build and
install the "makedepends" (like we did before), now it does the
same for the "depends". That's required to be compatible with
abuild. The old behavior can still be used with 'pmbootstrap
build --ignore-depends'.
* Because of that change, noarch packages can no longer be built in
the native chroot if we need them for a foreign chroot. A device-
package depending on a kernel would pull in the same kernel for
the native architecture otherwise.
* Running 'pmbootstrap build device-...' without '--ignore-depends'
and without a matching '--arch' displays a note that explains
this change to the user and tells how to use it instead.
* Noarch packages no longer get symlinked. That was only
implemented for packages built in the native chroot, and now that
is not always the case anymore. Symlinking these packages creates
packages with broken dependencies anyway (e.g.
device-samsung-i9100 can't be installed in x86_64, because
linux-samsung-i9100 is armhf only).
* Rename "carch" to "arch" wherever used. Naming it "carch"
sometimes is confusing with no benefit.
* Add a testcase for the aarch64 qemu workaround (because it failed
first and I needed to know for sure if it is working again).
* Improved some verbose logging, which helped with development of
this feature.
* Removed the old "build" test case (which was disabled in
testcases_fast.sh) as the new "build_package" test case covers its
functionallity.
* Only build indexes if the packages folder exists for that arch (Travis
couldn't run a test case otherwise)
2017-11-26 14:32:02 +00:00
|
|
|
help="CPU architecture to build for (default: " +
|
2017-11-28 19:12:16 +00:00
|
|
|
arch_native + " or first available architecture in"
|
|
|
|
" APKBUILD)")
|
Fix #824: Refactor pmb/build/package.py (make depends work like in abuild) (#935)
* Rename pmb/build/package.py to pmb/build/_package.py, so we can
access the functions it contains in testcases, and still use
pmb.build.package()
* Refactor the entire file. Instead of one big function that does
too many things, we have many small ones now, that are tested
in the testsuite and easier to modify
* Whenever building a package, pmbootstrap does not only build and
install the "makedepends" (like we did before), now it does the
same for the "depends". That's required to be compatible with
abuild. The old behavior can still be used with 'pmbootstrap
build --ignore-depends'.
* Because of that change, noarch packages can no longer be built in
the native chroot if we need them for a foreign chroot. A device-
package depending on a kernel would pull in the same kernel for
the native architecture otherwise.
* Running 'pmbootstrap build device-...' without '--ignore-depends'
and without a matching '--arch' displays a note that explains
this change to the user and tells how to use it instead.
* Noarch packages no longer get symlinked. That was only
implemented for packages built in the native chroot, and now that
is not always the case anymore. Symlinking these packages creates
packages with broken dependencies anyway (e.g.
device-samsung-i9100 can't be installed in x86_64, because
linux-samsung-i9100 is armhf only).
* Rename "carch" to "arch" wherever used. Naming it "carch"
sometimes is confusing with no benefit.
* Add a testcase for the aarch64 qemu workaround (because it failed
first and I needed to know for sure if it is working again).
* Improved some verbose logging, which helped with development of
this feature.
* Removed the old "build" test case (which was disabled in
testcases_fast.sh) as the new "build_package" test case covers its
functionallity.
* Only build indexes if the packages folder exists for that arch (Travis
couldn't run a test case otherwise)
2017-11-26 14:32:02 +00:00
|
|
|
build.add_argument("--force", action="store_true", help="even build if not"
|
|
|
|
" necessary")
|
2017-09-08 23:50:59 +00:00
|
|
|
build.add_argument("--strict", action="store_true", help="(slower) zap and install only"
|
|
|
|
" required depends when building, to detect dependency errors")
|
2018-02-19 22:04:01 +00:00
|
|
|
build.add_argument("--src", help="override source used to build the"
|
|
|
|
" package with a local folder (the APKBUILD must"
|
|
|
|
" expect the source to be in $builddir, so you might"
|
|
|
|
" need to adjust it)",
|
|
|
|
nargs=1)
|
Fix #824: Refactor pmb/build/package.py (make depends work like in abuild) (#935)
* Rename pmb/build/package.py to pmb/build/_package.py, so we can
access the functions it contains in testcases, and still use
pmb.build.package()
* Refactor the entire file. Instead of one big function that does
too many things, we have many small ones now, that are tested
in the testsuite and easier to modify
* Whenever building a package, pmbootstrap does not only build and
install the "makedepends" (like we did before), now it does the
same for the "depends". That's required to be compatible with
abuild. The old behavior can still be used with 'pmbootstrap
build --ignore-depends'.
* Because of that change, noarch packages can no longer be built in
the native chroot if we need them for a foreign chroot. A device-
package depending on a kernel would pull in the same kernel for
the native architecture otherwise.
* Running 'pmbootstrap build device-...' without '--ignore-depends'
and without a matching '--arch' displays a note that explains
this change to the user and tells how to use it instead.
* Noarch packages no longer get symlinked. That was only
implemented for packages built in the native chroot, and now that
is not always the case anymore. Symlinking these packages creates
packages with broken dependencies anyway (e.g.
device-samsung-i9100 can't be installed in x86_64, because
linux-samsung-i9100 is armhf only).
* Rename "carch" to "arch" wherever used. Naming it "carch"
sometimes is confusing with no benefit.
* Add a testcase for the aarch64 qemu workaround (because it failed
first and I needed to know for sure if it is working again).
* Improved some verbose logging, which helped with development of
this feature.
* Removed the old "build" test case (which was disabled in
testcases_fast.sh) as the new "build_package" test case covers its
functionallity.
* Only build indexes if the packages folder exists for that arch (Travis
couldn't run a test case otherwise)
2017-11-26 14:32:02 +00:00
|
|
|
build.add_argument("-i", "--ignore-depends", action="store_true",
|
|
|
|
help="only build and install makedepends from an"
|
|
|
|
" APKBUILD, ignore the depends (old behavior). This is"
|
|
|
|
" faster for device packages for example, because then"
|
|
|
|
" you don't need to build and install the kernel. But it"
|
|
|
|
" is incompatible with how Alpine's abuild handles it.",
|
|
|
|
dest="ignore_depends")
|
2017-07-26 18:59:11 +00:00
|
|
|
for action in [checksum, build, aportgen]:
|
|
|
|
action.add_argument("packages", nargs="+")
|
2017-05-26 20:08:45 +00:00
|
|
|
|
2018-01-18 22:05:27 +00:00
|
|
|
# Action: kconfig_check / apkbuild_parse
|
2017-09-18 21:36:54 +00:00
|
|
|
kconfig_check = sub.add_parser("kconfig_check", help="check, whether all"
|
|
|
|
" the necessary options are"
|
|
|
|
" enabled/disabled in the kernel config")
|
2018-01-18 22:05:27 +00:00
|
|
|
apkbuild_parse = sub.add_parser("apkbuild_parse")
|
|
|
|
for action in [kconfig_check, apkbuild_parse]:
|
|
|
|
action.add_argument("packages", nargs="*")
|
2017-09-18 21:36:54 +00:00
|
|
|
|
2018-01-18 22:05:27 +00:00
|
|
|
# Action: apkindex_parse
|
|
|
|
apkindex_parse = sub.add_parser("apkindex_parse")
|
|
|
|
apkindex_parse.add_argument("apkindex_path")
|
|
|
|
apkindex_parse.add_argument("package", default=None, nargs="?")
|
Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.
I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.
To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.
In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.
In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".
This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.
Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).
The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
|
|
|
|
2017-08-14 14:25:28 +00:00
|
|
|
# Action: config
|
|
|
|
config = sub.add_parser("config",
|
|
|
|
help="get and set pmbootstrap options")
|
|
|
|
config.add_argument("name", nargs="?", help="variable name")
|
|
|
|
config.add_argument("value", nargs="?", help="set variable to value")
|
|
|
|
|
2017-11-19 14:35:23 +00:00
|
|
|
# Action: bootimg_analyze
|
|
|
|
bootimg_analyze = sub.add_parser("bootimg_analyze", help="Extract all the"
|
|
|
|
" information from an existing boot.img")
|
|
|
|
bootimg_analyze.add_argument("path", help="path to the boot.img")
|
|
|
|
|
2017-05-26 20:08:45 +00:00
|
|
|
# Use defaults from the user's config file
|
|
|
|
args = parser.parse_args()
|
2017-11-19 15:04:08 +00:00
|
|
|
pmb.config.merge_with_args(args)
|
|
|
|
|
|
|
|
# Replace $WORK in variables from any config
|
|
|
|
for key, value in pmb.config.defaults.items():
|
|
|
|
if key not in args:
|
|
|
|
continue
|
|
|
|
old = getattr(args, key)
|
Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.
I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.
To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.
In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.
In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".
This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.
Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).
The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
|
|
|
if isinstance(old, str):
|
2017-11-19 15:04:08 +00:00
|
|
|
setattr(args, key, old.replace("$WORK", args.work))
|
2017-05-26 20:08:45 +00:00
|
|
|
|
2017-07-04 21:03:51 +00:00
|
|
|
# Add convenience shortcuts
|
2017-10-24 16:18:42 +00:00
|
|
|
setattr(args, "arch_native", arch_native)
|
2017-05-26 20:08:45 +00:00
|
|
|
|
Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.
I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.
To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.
In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.
In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".
This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.
Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).
The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
|
|
|
# Add a caching dict (caches parsing of files etc. for the current session)
|
|
|
|
setattr(args, "cache", {"apkindex": {},
|
|
|
|
"apkbuild": {},
|
|
|
|
"apk_min_version_checked": [],
|
2017-07-11 17:19:39 +00:00
|
|
|
"apk_repository_list_updated": [],
|
2017-12-05 23:17:39 +00:00
|
|
|
"built": {},
|
Properly rebuild/install packages when something changed (Fix #120, #108, #131) (#129)
TLDR: Always rebuild/install packages when something changed when executing "pmbootstrap install/initfs/flash", more speed in dependency resolution.
---
pmbootstrap has already gotten some support for "timestamp based rebuilds", which modifies the logic for when packages should be rebuilt. It doesn't only consider packages outdated with old pkgver/pkgrel combinations, but also packages, where a source file has a newer timestamp, than the built package has.
I've found out, that this can lead to more rebuilds than expected. For example, when you check out the pmbootstrap git repository again into another folder, although you have already built packages. Then all files have the timestamp of the checkout, and the packages will appear to be outdated. While this is not largely a concern now, this will become a problem once we have a binary package repository, because then the packages from the binary repo will always seem to be outdated, if you just freshly checked out the repository.
To combat this, git gets asked if the files from the aport we're looking at are in sync with upstream, or not. Only when the files are not in sync with upstream and the timestamps of the sources are newer, a rebuild gets triggered from now on.
In case this logic should fail, I've added an option during "pmbootstrap init" where you can enable or disable the "timestamp based rebuilds" option.
In addition to that, this commit also works on fixing #120: packages do not get updated in "pmbootstrap install" after they have been rebuilt. For this to work, we specify all packages explicitly for abuild, instead of letting abuild do the resolving. This feature will also work with the "timestamp based rebuilds".
This commit also fixes the working_dir argument in pmb.helpers.run.user, which was simply ignored before.
Finally, the performance of the dependency resolution is faster again (when compared to the current version in master), because the parsed apkbuilds and finding the aport by pkgname gets cached during one pmbootstrap call (in args.cache, which also makes it easy to put fake data there in testcases).
The new dependency resolution code can output lots of verbose messages for debugging by specifying the `-v` parameter. The meaning of that changed, it used to output the file names where log messages come from, but no one seemed to use that anyway.
2017-07-10 15:23:43 +00:00
|
|
|
"find_aport": {}})
|
2017-06-17 23:09:21 +00:00
|
|
|
|
2017-06-15 00:26:32 +00:00
|
|
|
# Add and verify the deviceinfo (only after initialization)
|
2017-11-19 14:35:23 +00:00
|
|
|
if args.action not in ("init", "config", "bootimg_analyze"):
|
2017-05-26 20:08:45 +00:00
|
|
|
setattr(args, "deviceinfo", pmb.parse.deviceinfo(args))
|
2017-06-15 00:26:32 +00:00
|
|
|
arch = args.deviceinfo["arch"]
|
|
|
|
if (arch != args.arch_native and
|
|
|
|
arch not in pmb.config.build_device_architectures):
|
|
|
|
raise ValueError("Arch '" + arch + "' is not officially enabled"
|
|
|
|
" in postmarketOS yet. However, this should be straight"
|
|
|
|
" forward. Simply enable it in pmb/config/__init__.py"
|
|
|
|
" in build_device_architectures, zap your package cache"
|
|
|
|
" (otherwise you will have issues with noarch packages)"
|
2017-08-07 22:53:54 +00:00
|
|
|
" and try again.")
|
2017-05-26 20:08:45 +00:00
|
|
|
|
|
|
|
return args
|