diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 8b509bb0..9dfee3f9 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -46,6 +46,7 @@ defaults = { "aports": os.path.normpath(pmb_src + "/aports"), "config": os.path.expanduser("~") + "/.config/pmbootstrap.cfg", "device": "samsung-i9100", + "extra_packages": "none", "timestamp_based_rebuild": True, "log": "$WORK/log.txt", "mirror_alpine": "https://nl.alpinelinux.org/alpine/", diff --git a/pmb/config/init.py b/pmb/config/init.py index 318c2780..0b9690b0 100644 --- a/pmb/config/init.py +++ b/pmb/config/init.py @@ -92,6 +92,14 @@ def init(args): default=args.timestamp_based_rebuild) cfg["pmbootstrap"]["timestamp_based_rebuild"] = str(answer) + # Extra packages to be installed to rootfs + logging.info("Additional packages that will be installed to rootfs." + " Specify them in a comma separated list (e.g.: vim,file)" + " or \"none\"") + cfg["pmbootstrap"]["extra_packages"] = pmb.helpers.cli.ask(args, "Extra packages", + None, args.extra_packages, + validation_regex="^(|[-\w\s]+(?:,[-\w\s]*)*)$") + # Do not save aports location to config file del cfg["pmbootstrap"]["aports"] diff --git a/pmb/install/install.py b/pmb/install/install.py index dbb2e9bd..17e7e6ec 100644 --- a/pmb/install/install.py +++ b/pmb/install/install.py @@ -97,6 +97,8 @@ def install(args): # Explicitly call build on the install packages, to re-build them or any # dependency, in case the version increased + if args.extra_packages.lower() != "none": + install_packages += args.extra_packages.split(",") if args.add: install_packages += args.add.split(",") for pkgname in install_packages: