pmbootstrap/pmb/parse/arguments.py

553 lines
27 KiB
Python
Raw Normal View History

2017-05-26 20:08:45 +00:00
"""
Copyright 2019 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 copy
2018-08-27 21:35:05 +00:00
try:
import argcomplete
except ImportError:
argcomplete = False
2017-05-26 20:08:45 +00:00
import pmb.config
import pmb.parse.arch
import pmb.helpers.args
2018-11-15 07:36:39 +00:00
import pmb.helpers.pmaports
""" This file is about parsing command line arguments passed to pmbootstrap, as
well as generating the help pages (pmbootstrap -h). All this is done with
Python's argparse. The parsed arguments get extended and finally stored in
the "args" variable, which is prominently passed to most functions all
over the pmbootstrap code base.
See pmb/helpers/args.py for more information about the args variable. """
2017-05-26 20:08:45 +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")
ret.add_argument("--method", help="override flash method",
dest="flash_method", default=None)
sub = ret.add_subparsers(dest="action_flasher")
sub.required = True
2017-05-26 20:08:45 +00:00
# Boot, flash kernel
2017-05-26 20:08:45 +00:00
boot = sub.add_parser("boot", help="boot a kernel once")
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")
for action in [boot, flash_kernel]:
2017-05-26 20:08:45 +00:00
action.add_argument("--flavor", default=None)
flash_kernel.add_argument("--partition", default=None,
help="partition to flash the kernel to (defaults"
" to deviceinfo_flash_*_partition_kernel)")
2017-05-26 20:08:45 +00:00
# Flash rootfs
flash_rootfs = sub.add_parser("flash_rootfs", aliases=["flash_system"],
help="flash the rootfs to a partition on the"
" device (partition layout does not get"
" changed)")
flash_rootfs.add_argument("--partition", default=None,
help="partition to flash the rootfs to (defaults"
" to deviceinfo_flash_*_partition_system,"
" 'userdata' on Android may have more"
" space)")
# Actions without extra arguments
sub.add_parser("sideload", help="sideload recovery zip")
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-05-26 20:08:45 +00:00
return ret
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"
" '" + pmb.config.initfs_hook_prefix + "' prefix, for example: 'debug-shell'")
# ls, build, extract
ls = sub.add_parser("ls", help="list initramfs contents")
build = sub.add_parser("build", help="(re)build the initramfs")
extract = sub.add_parser(
"extract",
help="extract the initramfs to a temporary folder")
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 rootfs size (e.g. 2048M or 2G)")
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
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)")
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="?")
ret.add_argument("--host-qemu", dest="host_qemu", action='store_true',
help="Use the host system's qemu")
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
return ret
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
def arguments_newapkbuild(subparser):
pmbootstrap newapkbuild: Properly parse arguments (#1320) * pmbootstrap newapkbuild: Properly parse arguments The `pmbootstrap newapkbuild` action wraps Alpine's `newapkbuild`. We used to directly pass all arguments to `newapkbuild` without verifying in Python whether they make sense or not. However, as `newpakbuild` doesn't do strict sanity checks on the arguments, it is easy to end up with unexpected behavior when using the command for the first time. For example, `newapkbuild` allows either specifying a PKGNAME or SRCURL as last parameter, and also allows setting a PKGNAME with the `-n` parameter. It only makes sense to use that option when passing a SRCURL. With this commit, we duplicate the optins that should be passed through to `newapkbuild` and use argparse to fully sanitize the options and display a help page (`pmbootstrap newapkbuild -h`) that is consistent with the other help pages. Details: * The `-f` (force) flag does not get passed through anymore. Instead we use it in Python to skip asking if an existing aport should be overwritten (the aports are outside of the chroot, so `newapkbuild` can't handle it in a way that makes sense for pmbootstrap). * Output of `newapkbuild` gets redirected to the log file now, as we don't need it to display a help page. * Don't verify the pkgver while creating the new APKBUILD. When passing a SRCURL, the pkgver gets extracted from the end of the URL and may not have a valid format yet (but we want the APKBUILD anyway). * Stored options passed through in `pmb/config/__init__.py` and use it in both `pmb/parse/arguments.py` and `pmb/helpers/frontend.py`. * Only allow `-n` with SRCURL * The postmarketOS aports folder gets specified with `--folder` now. That way the generated help page is much closer to the original one from `newapkbuild`. The default is `main`. * Made the package type flags (CMake, autotools, ...) exclusive so only one of them can be specified
2018-03-15 21:42:34 +00:00
"""
Wrapper for Alpine's "newapkbuild" command.
Most parameters will get directly passed through, and they are defined in
"pmb/config/__init__.py". That way they can be used here and when passing
them through in "pmb/helpers/frontend.py". The order of the parameters is
kept the same as in "newapkbuild -h".
"""
sub = subparser.add_parser("newapkbuild", help="get a template to package"
" new software")
pmbootstrap newapkbuild: Properly parse arguments (#1320) * pmbootstrap newapkbuild: Properly parse arguments The `pmbootstrap newapkbuild` action wraps Alpine's `newapkbuild`. We used to directly pass all arguments to `newapkbuild` without verifying in Python whether they make sense or not. However, as `newpakbuild` doesn't do strict sanity checks on the arguments, it is easy to end up with unexpected behavior when using the command for the first time. For example, `newapkbuild` allows either specifying a PKGNAME or SRCURL as last parameter, and also allows setting a PKGNAME with the `-n` parameter. It only makes sense to use that option when passing a SRCURL. With this commit, we duplicate the optins that should be passed through to `newapkbuild` and use argparse to fully sanitize the options and display a help page (`pmbootstrap newapkbuild -h`) that is consistent with the other help pages. Details: * The `-f` (force) flag does not get passed through anymore. Instead we use it in Python to skip asking if an existing aport should be overwritten (the aports are outside of the chroot, so `newapkbuild` can't handle it in a way that makes sense for pmbootstrap). * Output of `newapkbuild` gets redirected to the log file now, as we don't need it to display a help page. * Don't verify the pkgver while creating the new APKBUILD. When passing a SRCURL, the pkgver gets extracted from the end of the URL and may not have a valid format yet (but we want the APKBUILD anyway). * Stored options passed through in `pmb/config/__init__.py` and use it in both `pmb/parse/arguments.py` and `pmb/helpers/frontend.py`. * Only allow `-n` with SRCURL * The postmarketOS aports folder gets specified with `--folder` now. That way the generated help page is much closer to the original one from `newapkbuild`. The default is `main`. * Made the package type flags (CMake, autotools, ...) exclusive so only one of them can be specified
2018-03-15 21:42:34 +00:00
sub.add_argument("--folder", help="set postmarketOS aports folder"
" (default: main)", default="main")
# Passthrough: Strings (e.g. -d "my description")
for entry in pmb.config.newapkbuild_arguments_strings:
sub.add_argument(entry[0], dest=entry[1], help=entry[2])
# Passthrough: Package type switches (e.g. -C for CMake)
group = sub.add_mutually_exclusive_group()
for entry in pmb.config.newapkbuild_arguments_switches_pkgtypes:
group.add_argument(entry[0], dest=entry[1], help=entry[2],
action="store_true")
# Passthrough: Other switches (e.g. -c for copying sample files)
for entry in pmb.config.newapkbuild_arguments_switches_other:
sub.add_argument(entry[0], dest=entry[1], help=entry[2],
action="store_true")
# Force switch
sub.add_argument("-f", dest="force", action="store_true",
help="force even if directory already exists")
# Passthrough: PKGNAME[-PKGVER] | SRCURL
sub.add_argument("pkgname_pkgver_srcurl",
metavar="PKGNAME[-PKGVER] | SRCURL",
help="set either the package name (optionally with the"
" PKGVER at the end, e.g. 'hello-world-1.0') or the"
" download link to the source archive")
def arguments_kconfig(subparser):
# Allowed architectures
arch_native = pmb.parse.arch.alpine_native()
arch_choices = set(pmb.config.build_device_architectures + [arch_native])
# Kconfig subparser
ret = subparser.add_parser("kconfig", help="change or edit kernel configs")
sub = ret.add_subparsers(dest="action_kconfig")
sub.required = True
# "pmbootstrap kconfig check"
check = sub.add_parser("check", help="check kernel aport config")
check.add_argument("-f", "--force", action="store_true", help="check all"
" kernels, even the ones that would be ignored by"
" default")
check.add_argument("--arch", choices=arch_choices, dest="arch")
check_package = check.add_argument("package", default="", nargs='?')
if argcomplete:
check_package.completer = kernel_completer
# "pmbootstrap kconfig edit"
edit = sub.add_parser("edit", help="edit kernel aport config")
edit.add_argument("--arch", choices=arch_choices, dest="arch")
edit.add_argument("-x", dest="xconfig", action="store_true",
help="use xconfig rather than ncurses for kernel"
" configuration")
edit.add_argument("-g", dest="gconfig", action="store_true",
help="use gconfig rather than ncurses for kernel"
" configuration")
edit_package = edit.add_argument("package")
if argcomplete:
edit_package.completer = kernel_completer
2018-11-15 07:36:39 +00:00
def arguments_repo_missing(subparser):
ret = subparser.add_parser("repo_missing")
package = ret.add_argument("package", nargs="?", help="only look at a"
" specific package and its dependencies")
if argcomplete:
package.completer = package_completer
2018-11-15 07:36:39 +00:00
ret.add_argument("--arch", choices=pmb.config.build_device_architectures,
default=pmb.parse.arch.alpine_native())
ret.add_argument("--built", action="store_true",
help="include packages which exist in the binary repos")
ret.add_argument("--overview", action="store_true",
help="only print the pkgnames without any details")
return ret
def package_completer(prefix, action, parser, parsed_args):
2018-08-27 21:35:05 +00:00
args = parsed_args
pmb.config.merge_with_args(args)
pmb.helpers.args.replace_placeholders(args)
packages = set(
package for package in pmb.helpers.pmaports.get_list(args)
if package.startswith(prefix))
2018-08-27 21:35:05 +00:00
return packages
def kernel_completer(prefix, action, parser, parsed_args):
packages = package_completer("linux-" + prefix, action, parser, parsed_args)
return [package.replace("linux-", "", 1) for package in packages]
2017-05-26 20:08:45 +00:00
def arguments():
parser = argparse.ArgumentParser(prog="pmbootstrap")
arch_native = pmb.parse.arch.alpine_native()
arch_choices = set(pmb.config.build_device_architectures + [arch_native])
mirrors_pmos_default = pmb.config.defaults["mirrors_postmarketos"]
2017-05-26 20:08:45 +00:00
# Other
parser.add_argument("-V", "--version", action="version",
version=pmb.config.version)
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")
parser.add_argument("-mp", "--mirror-pmOS", dest="mirrors_postmarketos",
help="postmarketOS mirror, disable with: -mp='',"
" specify multiple with: -mp='one' -mp='two',"
" default: " + ", ".join(mirrors_pmos_default),
metavar="URL", action="append", default=[])
parser.add_argument("-m", "--mirror-alpine", dest="mirror_alpine",
help="Alpine Linux mirror, default: " +
pmb.config.defaults["mirror_alpine"],
metavar="URL")
2017-05-26 20:08:45 +00:00
parser.add_argument("-j", "--jobs", help="parallel jobs when compiling")
parser.add_argument("-p", "--aports",
help="postmarketos aports (pmaports) path")
parser.add_argument("-s", "--skip-initfs", dest="skip_initfs",
help="do not re-generate the initramfs",
action="store_true")
parser.add_argument("-t", "--timeout", help="seconds after which processes"
" get killed that stopped writing any output (default:"
" 300)", default=300, type=float)
2017-05-26 20:08:45 +00:00
parser.add_argument("-w", "--work", help="folder where all data"
" gets stored (chroots, caches, built packages)")
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")
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")
parser.add_argument("-o", "--offline", help="Do not attempt to update"
" the package index files", action="store_true")
2017-05-26 20:08:45 +00:00
pmb: adjust to distcc 3.3 and wrap it with sshd Overview: Since Alpine updated to distcc 3.3 last week, pmbootstrap wasn't able to use distcc for cross compilation anymore. It always falled back to running the compiler in QEMU (which works, but is a lot slower). The reason for that is, that distcc requires all compilers that are being used in a whitelist now. This partially fixes CVE-2004-2687 in distccd, which allowed trivial remote code execution by any process connecting to the distccd server. We only run distccd on localhost, but still this can be used for privilege escalation of sandboxed processes running on the host system (not part of pmbootstrap chroots). Because the CVE is only partially fixed (see the comment in `pmb/chroot/distccd.py` for details), we make sure that only the building chroots can talk to the distcc server by running distcc over ssh. Details: * Completely refactored `pmb/chroot/distccd.py` to run distcc over ssh * Store the running distcc server's arguments as JSON now, not as INI * Make debugging distcc issues easy: * Set DISTCC_BACKOFF_PERIOD=0, so the distcc client will not ignore the server after errors happened (this masks the original error!) * New pmbootstrap parameters: * `--distcc-nofallback`: avoids falling back to compiling with QEMU and not throwing an error * `--ccache-disable`: avoid ccache (when the compiler output is cached, distcc does not get used) * `--verbose` prints verbose output of the distcc too * New test case, that uses the new pmbootstrap parameters to force compilation through distcc, and shows the output of distcc and distccd in verbose mode on error (as well as the log of sshd)
2018-07-25 19:09:45 +00:00
# Compiler
parser.add_argument("--ccache-disable", action="store_false",
dest="ccache", help="do not cache the compiled output")
parser.add_argument("--no-crossdirect", action="store_true",
help="Don't use the new, faster 'crossdirect' method,"
" use the old 'distcc-sshd' method instead. Use"
" if crossdirect broke something. This option"
" and the legacy 'distcc-sshd' code will be"
" removed soon if no problems turn up.")
pmb: adjust to distcc 3.3 and wrap it with sshd Overview: Since Alpine updated to distcc 3.3 last week, pmbootstrap wasn't able to use distcc for cross compilation anymore. It always falled back to running the compiler in QEMU (which works, but is a lot slower). The reason for that is, that distcc requires all compilers that are being used in a whitelist now. This partially fixes CVE-2004-2687 in distccd, which allowed trivial remote code execution by any process connecting to the distccd server. We only run distccd on localhost, but still this can be used for privilege escalation of sandboxed processes running on the host system (not part of pmbootstrap chroots). Because the CVE is only partially fixed (see the comment in `pmb/chroot/distccd.py` for details), we make sure that only the building chroots can talk to the distcc server by running distcc over ssh. Details: * Completely refactored `pmb/chroot/distccd.py` to run distcc over ssh * Store the running distcc server's arguments as JSON now, not as INI * Make debugging distcc issues easy: * Set DISTCC_BACKOFF_PERIOD=0, so the distcc client will not ignore the server after errors happened (this masks the original error!) * New pmbootstrap parameters: * `--distcc-nofallback`: avoids falling back to compiling with QEMU and not throwing an error * `--ccache-disable`: avoid ccache (when the compiler output is cached, distcc does not get used) * `--verbose` prints verbose output of the distcc too * New test case, that uses the new pmbootstrap parameters to force compilation through distcc, and shows the output of distcc and distccd in verbose mode on error (as well as the log of sshd)
2018-07-25 19:09:45 +00:00
parser.add_argument("--distcc-nofallback", action="store_false",
help="when using the cross compiler via distcc fails,"
"do not fall back to compiling slowly with QEMU",
dest="distcc_fallback")
parser.add_argument("--no-cross", action="store_false", dest="cross",
help="disable cross compiler, build only with QEMU and"
" gcc (slow!)")
2017-05-26 20:08:45 +00:00
# Logging
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"
" 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)")
sub.add_parser("work_migrate", help="run this before using pmbootstrap"
" non-interactively to migrate the"
" work folder version on demand")
2018-11-15 07:36:39 +00:00
arguments_repo_missing(sub)
arguments_kconfig(sub)
arguments_export(sub)
2017-05-26 20:08:45 +00:00
arguments_flasher(sub)
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)
arguments_pkgrel_bump(sub)
arguments_newapkbuild(sub)
2017-05-26 20:08:45 +00:00
# Action: log
log = sub.add_parser("log", help="follow the pmbootstrap logfile")
log_distccd = sub.add_parser(
"log_distccd",
help="follow the distccd logfile")
for action in [log, log_distccd]:
action.add_argument("-n", "--lines", default="60",
help="count of initial output lines")
action.add_argument("-c", "--clear", help="clear the log",
action="store_true", dest="clear_log")
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")
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("-hc", "--http", action="store_true", help="also delete http"
" cache")
zap.add_argument("-d", "--distfiles", action="store_true", help="also delete"
" downloaded source tarballs")
zap.add_argument("-p", "--pkgs-local", action="store_true",
dest="pkgs_local",
help="also delete *all* locally compiled packages")
zap.add_argument("-m", "--pkgs-local-mismatch", action="store_true",
dest="pkgs_local_mismatch",
help="also delete locally compiled packages without"
" existing aport of same version")
zap.add_argument("-o", "--pkgs-online-mismatch", action="store_true",
dest="pkgs_online_mismatch",
help="also delete outdated packages from online mirrors"
" (that have been downloaded to the apk cache)")
2017-05-26 20:08:45 +00:00
# Action: stats
stats = sub.add_parser("stats", help="show ccache stats")
stats.add_argument("--arch", default=arch_native, choices=arch_choices)
2017-05-26 20:08:45 +00:00
# Action: update
update = sub.add_parser("update", help="update all existing APKINDEX"
" files")
update.add_argument("--arch", default=None, choices=arch_choices,
help="only update a specific architecture")
update.add_argument("--non-existing", action="store_true", help="do not"
" only update the existing APKINDEX files, but all of"
" them", dest="non_existing")
# 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")
chroot.add_argument("--add", help="build/install comma separated list of"
" packages in the chroot before entering it")
aportgen: Gracefully handle old aports_upstream (#1291) In order to get cross-compilers, we generate a few aports (e.g. binutils-armhf, gcc-armhf) automatically from Alpine's aports. pmbootstrap was already able to perform a git checkout of Alpine's aports repository. But it needed to be manually updated. Otherwise the `pmbootstrap aportgen` command could actually downgrade the aport instead of updating it to the current version. After thinking about adding a dedicated pmbootstrap command for updating git repositories, I thought it would be better to not open that can of worms (pmbootstrap as general git wrapper? no thanks). The solution implemented here compares the upstream aport version of the git checkout of a certain package (e.g. gcc for gcc-armhf) with the version in Alpine's binary package APKINDEX. When the aport version is lower than the binary package version, it shows the user how to update the git repository with just one command: pmbootstrap chroot --add=git --user -- \ git -C /mnt/pmbootstrap-git/aports_upstream pull Changes: * `pmb.aportgen.core.get_upstream_aport()`: new function, that returns the absolute path to the upstream aport on disk, after checking the version of the aport against the binary package. * Use that new function in pmb.aportgen.gcc and pmb.aportgen.binutils * New function `pmb.helpers.repo.alpine_apkindex_path()`: updates the APKINDEX if necessary and returns the absolute path to the APKINDEX. This code was basically present already, but not as function, so now we have a bit less overhead there. * `pmbootstrap chroot`: new `--user` argument * `pmb.parse.apkbuild`: make pkgname check optional, as it fails with the official gcc APKBUILD before we modify it (the current APKBUILD parser is not meant to be perfect, as this would require a full shell parsing implementation). * Extended `test_aportgen.py` and enabled it by default in `testcases_fast.sh`. Previously it was disabled due to traffic concerns (cloning the aports repo, but then again we do a full KDE plasma mobile installation in Travis now, so that shouldn't matter too much). * `testcases_fast.sh`: With "test_aport_in_sync_with_git" removed from the disabled-by-default list (left over from timestamp based rebuilds), there were no more test cases disabled by default. I've changed it, so now the qemu_running_processes test case is disabled, and added an `--all` parameter to the script to disable no test cases. Travis runs with the `--all` parameter while it's useful to do a quick local test without `--all` in roughly 2 minutes instead of 10. * `aports/cross/binutils-*`: Fix `_mirror` variable to point to current default Alpine mirror (so the aportgen testcase runs through).
2018-03-11 14:18:21 +00:00
chroot.add_argument("--user", help="run the command as user, not as root",
action="store_true")
chroot.add_argument("--output", choices=["log", "stdout", "interactive",
"tui", "background"], help="how the output of the"
" program should be handled, choose from: 'log',"
" 'stdout', 'interactive', 'tui' (default),"
" 'background'. Details: pmb/helpers/run_core.py",
default="tui")
chroot.add_argument("command", default=["sh", "-i"], help="command"
2017-05-26 20:08:45 +00:00
" to execute inside the chroot. default: sh", nargs='*')
for action in [build_init, chroot]:
suffix = action.add_mutually_exclusive_group()
if action == chroot:
suffix.add_argument("-r", "--rootfs", action="store_true",
help="Chroot for the device root file system")
suffix.add_argument("-b", "--buildroot", nargs="?", const="device",
choices={"device"} | arch_choices,
help="Chroot for building packages, defaults to device "
"architecture")
suffix.add_argument("-s", "--suffix", default=None,
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")
group = install.add_mutually_exclusive_group()
group.add_argument("--sdcard", help="path to the sdcard device,"
" eg. /dev/mmcblk0")
group.add_argument("--split", help="install the boot and root partition"
" in separated image files", action="store_true")
group.add_argument("--android-recovery-zip",
help="generate TWRP flashable zip",
action="store_true", dest="android_recovery_zip")
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 rootfs, eg. aes-xts-plain64")
install.add_argument("--iter-time", help="cryptsetup iteration time (in"
" milliseconds) to use when encrypting the system"
" partition")
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",
action="store_false", dest="full_disk_encryption")
install.add_argument("--flavor",
help="Specify kernel flavor to include in recovery"
" flashable zip", default=None)
install.add_argument("--recovery-install-partition", default="system",
help="partition to flash from recovery,"
" eg. external_sd",
dest="recovery_install_partition")
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
# Action: checksum / aportgen / build
checksum = sub.add_parser("checksum", help="update aport checksums")
checksum.add_argument("--verify", action="store_true", help="download"
" sources and verify that the checksums of the"
" APKBUILD match, instead of updating them")
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")
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: " +
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")
build.add_argument("--strict", action="store_true", help="(slower) zap and install only"
" required depends when building, to detect dependency errors")
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")
build.add_argument("-n", "--no-depends", action="store_true",
help="never build dependencies, abort instead",
dest="no_depends")
build.add_argument("--envkernel", action="store_true",
help="Create an apk package from the build output of"
" a kernel compiled with envkernel.sh.")
for action in [checksum, build, aportgen]:
2018-08-27 21:35:05 +00:00
argument_packages = action.add_argument("packages", nargs="+")
if argcomplete:
argument_packages.completer = package_completer
2017-05-26 20:08:45 +00:00
# Action: apkbuild_parse
apkbuild_parse = sub.add_parser("apkbuild_parse")
apkbuild_parse.add_argument("packages", nargs="*")
# 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
# Action: config
config = sub.add_parser("config",
help="get and set pmbootstrap options")
config.add_argument("name", nargs="?", help="variable name, one of: " +
", ".join(sorted(pmb.config.config_keys)),
choices=pmb.config.config_keys, metavar="name")
config.add_argument("value", nargs="?", help="set variable to value")
# 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")
2018-07-08 21:49:03 +00:00
bootimg_analyze.add_argument("--force", "-f", action="store_true",
help="force even if the file seems to be"
" invalid")
2018-08-27 21:35:05 +00:00
if argcomplete:
argcomplete.autocomplete(parser, always_complete_options="long")
# Parse and extend arguments (also backup unmodified result from argparse)
2017-05-26 20:08:45 +00:00
args = parser.parse_args()
setattr(args, "from_argparse", copy.deepcopy(args))
setattr(args.from_argparse, "from_argparse", args.from_argparse)
pmb.helpers.args.init(args)
2017-05-26 20:08:45 +00:00
return args