From 340329599b80d7bab22d8b06bcde14bd0bbea897 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 7 Oct 2020 19:24:22 +0200 Subject: [PATCH] pmbootstrap install: refactor: move set_user() up (MR 1981) Don't have the set_user() call weirdly between multiple commands building the install_packages list. Move it up, together with the log message announcing that the device rootfs is being built. Update the comment above set_user(): there is no 'build' user anymore, and at this point we only call it before actually installing the packages for legacy reasons. --- pmb/install/_install.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index c3276d39..54aebc9f 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -666,10 +666,14 @@ def install(args): pmb.chroot.apk.install(args, pmb.config.install_native_packages, build=False) + logging.info(f'*** (2/{steps} CREATE DEVICE ROOTFS("{args.device}") ***') + + # Create user before installing packages, so post-install scripts of + # pmaports can figure out the username (legacy reasons: pmaports#820) + set_user(args) + # List all packages to be installed (including the ones specified by --add) # and upgrade the installed packages/apkindexes - logging.info('*** (2/{0}) CREATE DEVICE ROOTFS ("{1}") ***'.format(steps, - args.device)) install_packages = (pmb.config.install_device_packages + ["device-" + args.device] + get_kernel_package(args, args.device) + @@ -684,9 +688,6 @@ def install(args): pmb.helpers.repo.update(args, args.deviceinfo["arch"]) - # Create final user and remove 'build' user - set_user(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":