From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6715352290238136320 X-Received: by 2002:a05:600c:2218:: with SMTP id z24mr48001384wml.84.1563539911349; Fri, 19 Jul 2019 05:38:31 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:4989:: with SMTP id w131ls11608940wma.5.gmail; Fri, 19 Jul 2019 05:38:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLIlpNyy/XCjie5spiJ3bj4mqcMVZbA+A4MUpnyunhkvekAi+XA41/VYEyS28kiw+FMGxF X-Received: by 2002:a1c:a686:: with SMTP id p128mr50882784wme.130.1563539910877; Fri, 19 Jul 2019 05:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563539910; cv=none; d=google.com; s=arc-20160816; b=IncY0d8BnDE5wSIxl9p3QuSIQuzdPaYQBc7cvI1BL6PI/Q6F5i3uVJaPf72yPhtQxF 2mseY4pRxim72g4GD3P4CaMkC1P5yNzjZv4kJC0wJbBBh0OnrL7M/hur9I/VgAcAeTA1 eLypIs9eMhp3qPWHNCbegDpNxwOoaqusFFWuFYzwRA6CZItl/yeRQitp2GtWYQ7xTDV8 ++W4j9FKpfEKuejGT1K1A1V63dFzhkb/SsUuJ+V2p/MngBSyuie6nvkzWLSe2lupAyZt uKAevQ3NA1rOvwKV4PTmM9fvESmZ0iTQmHW14W3OsQcnWRzmWhQ2NI4+1deoaXpoBEPF nQZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=r0hP8DgKFFn3RJjyGBlEHRW/zHHJnzOUbvF0XGix4uM=; b=L4QoRRUp0TJzYHq5zPLU+5PevZTEIe8mSC6JRXXEtX7LzntG3iASKb2LWurBV9+V90 4qmMXlCq8VyKdKcuYHAbU8VmzK6zA/PtYAamSp9pGKUfelJzwOtX2oIdJYvhiaFKXiXL yIDoep77TC+lReqeNcq/v+gfjYb5X/ECelNhQzIZSFhWCUQjWw2NwQj2+E/Ojd7QSHLD oRiF68bYbehlOC929I2uOkFzlpwXF/YcQiiQpq4NAdtyAIE2ZojYbZJ9CTQjsF0gTtM4 eDoc+CAGqeSQNjIGCtQieF2DX6EI9IGZXREnnjVgE9wJ8slSztB+ONW1pzFwnC8tVBh0 kukw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=quirin.gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 60si861829wra.2.2019.07.19.05.38.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Jul 2019 05:38:30 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=quirin.gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id x6JCcUNR002843 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 19 Jul 2019 14:38:30 +0200 Received: from debian.ad001.siemens.net ([139.25.68.238]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x6JCcUEY020935; Fri, 19 Jul 2019 14:38:30 +0200 From: Quirin Gylstorff To: isar-users@googlegroups.com Cc: Henning Schild Subject: [PATCH 1/3] image-account-extension: Add skeleton dir option Date: Fri, 19 Jul 2019 14:38:21 +0200 Message-Id: <20190719123823.5599-1-quirin.gylstorff@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719123628.5500-1-quirin.gylstorff@siemens.com> References: <20190719123628.5500-1-quirin.gylstorff@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: yu/2DMQfrTeb Add option to modify a user home directory content with the --skel option from user add. This allows to create a additional folder where special home directory layouts are stored. Signed-off-by: Quirin Gylstorff --- meta/classes/image-account-extension.bbclass | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass index 22754da..b271b8f 100644 --- a/meta/classes/image-account-extension.bbclass +++ b/meta/classes/image-account-extension.bbclass @@ -17,6 +17,7 @@ USERS ??= "" #USER_root[home] = "/home/root" #USER_root[shell] = "/bin/sh" #USER_root[groups] = "audio video" +#USER_root[skel] = "" #USER_root[flags] = "no-create-home create-home system allow-empty-password" GROUPS ??= "" @@ -49,8 +50,8 @@ def gen_accounts_array(d, listname, entryname, flags, verb_flags=None): ) # List of space separated entries, where each entry has the format: -# username:encryptedpassword:expiredate:inactivenumber:userid:groupid:comment:homedir:shell:group1,group2:flag1,flag2 -IMAGE_ACCOUNTS_USERS =+ "${@gen_accounts_array(d, 'USERS', 'USER', ['password', 'expire', 'inactive', 'uid', 'gid', 'comment', 'home', 'shell', 'groups', 'flags'], ['password', 'comment', 'home', 'shell'])}" +# username:encryptedpassword:expiredate:inactivenumber:userid:groupid:comment:homedir:shell:group1,group2:skeldir:flag1,flag2 +IMAGE_ACCOUNTS_USERS =+ "${@gen_accounts_array(d, 'USERS', 'USER', ['password', 'expire', 'inactive', 'uid', 'gid', 'comment', 'home', 'shell', 'groups', 'skel', 'flags'], ['password', 'comment', 'home', 'shell', 'skel'])}" # List of space separated entries, where each entry has the format: # groupname:groupid:flag1,flag2 @@ -127,7 +128,7 @@ image_configure_accounts() { list='${@" ".join(d.getVar('IMAGE_ACCOUNTS_USERS', True).split())} ' while true; do # Pop first user entry: - list_rest="${list#*:*:*:*:*:*:*:*:*:*:* }" + list_rest="${list#*:*:*:*:*:*:*:*:*:*:*:* }" entry="${list%%${list_rest}}" list="${list_rest}" @@ -169,6 +170,9 @@ image_configure_accounts() { groups="${entry%%:*}" entry="${entry#${groups}:}" + skel="${entry%%:*}" + entry="${entry#${skel}:}" + flags="${entry%%:*}" entry="${entry#${flags}:}" @@ -228,6 +232,9 @@ image_configure_accounts() { set -- "$@" --no-create-home else if [ "${flags}" != "${flags%*,create-home,*}" ]; then + if [ -n "$skel" ]; then + set -- "$@" --skel "$skel" + fi set -- "$@" --create-home fi fi -- 2.20.1