diff --git a/pmb/install/install.py b/pmb/install/install.py index 3c34af7c..56076afb 100644 --- a/pmb/install/install.py +++ b/pmb/install/install.py @@ -82,17 +82,22 @@ def install(args, show_flash_msg=True): pmb.chroot.apk.install(args, pmb.config.install_native_packages, build=False) - # Explicitly call build on the install packages, to re-build it or any - # dependency, in case the version increased + # List all packages to be installed (including the ones specified by --add) + # and upgrade the installed packages/apkindexes logging.info("*** (2/5) CREATE DEVICE ROOTFS (" + args.device + ") ***") - install_packages = pmb.config.install_device_packages + ["device-" + args.device] + install_packages = (pmb.config.install_device_packages + ["device-" + args.device]) + suffix = "rootfs_" + args.device + pmb.chroot.apk.upgrade(args, suffix) + + # Explicitly call build on the install packages, to re-build them or any + # dependency, in case the version increased + if args.add: + install_packages += args.add.split(",") for pkgname in install_packages: pmb.build.package(args, pkgname, args.deviceinfo["arch"]) # Install all packages to device rootfs chroot - suffix = "rootfs_" + args.device pmb.chroot.apk.install(args, install_packages, suffix) - pmb.chroot.apk.upgrade(args, suffix) set_user_password(args) # Partition and fill image/sdcard diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index f6c98ad5..2b754e54 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -108,6 +108,8 @@ def arguments(): " eg. /dev/mmcblk0") install.add_argument("--cipher", help="cryptsetup cipher used to" " encrypt the system partition, eg. aes-xts-plain64") + install.add_argument("--add", help="comma separated list of packages to be" + " added to the rootfs (e.g. 'vim,gcc')") # Action: build / checksum / menuconfig / parse_apkbuild / aportgen menuconfig = sub.add_parser("menuconfig", help="run menuconfig on"