From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7096466320318791680 X-Received: by 2002:a5d:648b:0:b0:20c:593f:5ee3 with SMTP id o11-20020a5d648b000000b0020c593f5ee3mr28627923wri.381.1652357076872; Thu, 12 May 2022 05:04:36 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:500d:b0:394:77fc:d6b8 with SMTP id n13-20020a05600c500d00b0039477fcd6b8ls4410845wmr.1.canary-gmail; Thu, 12 May 2022 05:04:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy21xwPegAkg7tWY+XjHfan/3cG+0xfqFoPZNRaSEv+KMmPPzdu2bp3+lZL991Q9y9nT2yy X-Received: by 2002:a05:600c:2205:b0:394:193a:80ed with SMTP id z5-20020a05600c220500b00394193a80edmr9778903wml.191.1652357075835; Thu, 12 May 2022 05:04:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652357075; cv=none; d=google.com; s=arc-20160816; b=IPzv7Y7gMcyVfRmK3YETnePznHrvjmCLHqQH0qw1hYz4hVa8u+R548RVzzdxd4nkXB CJW+3PzKQpiBySPJlWFS5d4ijc02q59KTdNEiN5sjRjeH1DLBAQ2ZbrGgSXHZiWZwHW+ knY4KvBDtl9xUBvmVPLK3q2XeJMM+7Y+90e+in4hZNIOzpQwJYLVb7gSGhl5v+D90b63 PjlrX/zzROod7p/Cw8FtKPgiuhEsxQFIqSymkO/GY0p0lZWdIsl4FgMBgwnEKwFUGod/ 6MfLgFuL7V5BugUzK73ak819SH3vMIM/sjtjkio5uynj6x3XAKOlO2ZfzS8ysTqW0+GM cWaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:to:from:dkim-signature; bh=/td/+LuWDfwvHjl8D/+KbqBY+3sK2wU9yqwcvPZmdKc=; b=M7W0WDBVPdaBo/TvMcIA3upEyPwEwaBJW7h1kY+87rFp63oLzQ9sLceP8+iWpjzbV6 0LtIQLl0jfJ7wq6Ni7WaFxUXB0ietyiu+pCYVd1YECp6pJKhaSZmwdwHKOzho1RwfRzw Si+u0d+e0um8uIpo3tXW7HPKmNgX8efoIzk4h57DaTl1P/stCdqmNrkCgZpyWtNOMA2q gLVBsZSlw0R+iDae0v2gx587XvIffu402ojSxQ06riHV1Mf165dSvqDqiZt7rtkXoE1Z N7S44+G9zq696QsIHHJKy3/AS60FzKsFVowdkyu52ptJhmMz4Rm4nYRUA/KJLkVtGfu6 crkQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=K8N9apDZ; spf=pass (google.com: domain of fm-51332-20220512120435e4bff55ce5190ceab6-exsk0h@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-51332-20220512120435e4bff55ce5190ceab6-EXSk0h@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id h16-20020adffd50000000b0020c6d76cc7fsi212877wrs.7.2022.05.12.05.04.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 May 2022 05:04:35 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-51332-20220512120435e4bff55ce5190ceab6-exsk0h@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=K8N9apDZ; spf=pass (google.com: domain of fm-51332-20220512120435e4bff55ce5190ceab6-exsk0h@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-51332-20220512120435e4bff55ce5190ceab6-EXSk0h@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 20220512120435e4bff55ce5190ceab6 for ; Thu, 12 May 2022 14:04:35 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=Quirin.Gylstorff@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:References:In-Reply-To; bh=/td/+LuWDfwvHjl8D/+KbqBY+3sK2wU9yqwcvPZmdKc=; b=K8N9apDZftUgE4vZNdH/qGcnwoeazyA9EuSW0TfAwkqZlq6HXmvNburzE5jdwbKNMdwOQQ InrmotR0a40/Y5n5AVf9LypVInjt11qYLzfLNYVYS5vW5dTRbNnsfcFiotTGjNvLzs0HzoTI ZHtYCp4IgQ0A6bctiq52LTCt25QDE=; From: Quirin Gylstorff To: jan.kiszka@siemens.com, isar-users@googlegroups.com, henning.schild@siemens.com Subject: [PATCH v2 1/2] classes/image-account-extension:Move account configuration to post-process Date: Thu, 12 May 2022 14:04:32 +0200 Message-Id: <20220512120433.695303-2-Quirin.Gylstorff@siemens.com> In-Reply-To: <20220512120433.695303-1-Quirin.Gylstorff@siemens.com> References: <20220512120433.695303-1-Quirin.Gylstorff@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-51332:519-21489:flowmailer X-TUID: 6nnKkSAMEQ70 From: Quirin Gylstorff If the root account is deactivate during rootfs configuration , e.g. by setting 'USER_root[expire]="01-01-1970"', the following error occurs if a packages tries to create/modifies a user account. ``` Setting up systemd (247.3-7) ... Created symlink /etc/systemd/system/getty.target.wants/getty@tty1.service -> /lib/systemd/system/getty@.service. Created symlink /etc/systemd/system/multi-user.target.wants/remote-fs.target -> /lib/systemd/system/remote-fs.target. Created symlink /etc/systemd/system/sysinit.target.wants/systemd-pstore.service -> /lib/systemd/system/systemd-pstore.service. Initializing machine ID from random generator. Your account has expired; please contact your system administrator. chfn: PAM: Authentication failure adduser: `/bin/chfn -f systemd Network Management systemd-network' returned error code 1. Exiting. dpkg: error processing package systemd (--configure): installed systemd package post-installation script subprocess returned error exit status 1 Setting up dmsetup (2:1.02.175-2.1) ... Errors were encountered while processing: systemd E: Sub-process /usr/bin/dpkg returned an error code (1) WARNING: exit code 100 from a shell command. ``` This move also allows /etc/skel modification to be applicable to all users. Signed-off-by: Quirin Gylstorff --- RECIPE-API-CHANGELOG.md | 6 ++++++ meta/classes/image-account-extension.bbclass | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md index 5913dd27..8996e1b6 100644 --- a/RECIPE-API-CHANGELOG.md +++ b/RECIPE-API-CHANGELOG.md @@ -349,3 +349,9 @@ For a list of well-known Debian build profiles and common practices, we refer to It was replaced by WIC and no more needed. Machines that use `rpi-sdimg` image type should be modified to use `wic` type with `rpi-sdimg` wks file instead. + +### Handling of variables USERS and GROUPS is moved to image post processing + +The user and groups defined by the variables `USERS` and `GROUPS` +was moved from image configuration to image post processing. The users and +groups are now created after all packages are installed. diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass index c9bebe85..caa962a0 100644 --- a/meta/classes/image-account-extension.bbclass +++ b/meta/classes/image-account-extension.bbclass @@ -58,8 +58,7 @@ IMAGE_ACCOUNTS_GROUPS =+ "${@gen_accounts_array(d, 'GROUPS', 'GROUP', ['gid', 'f do_rootfs_install[vardeps] += "${IMAGE_ACCOUNTS_GROUPS} ${IMAGE_ACCOUNTS_USERS}" -ROOTFS_CONFIGURE_COMMAND += "image_configure_accounts" -image_configure_accounts[weight] = "3" +ROOTFS_POSTPROCESS_COMMAND += "image_configure_accounts" image_configure_accounts() { # Create groups # Add space to the end of the list: -- 2.35.1