From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6474925990321586176 X-Received: by 10.25.196.9 with SMTP id u9mr452325lff.42.1508320705802; Wed, 18 Oct 2017 02:58:25 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.18.153 with SMTP id 25ls553102ljs.6.gmail; Wed, 18 Oct 2017 02:58:25 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SQySOSs/Vn24NiEzacSX7aMvsYCIflmwCBrYgJc2c0KwuWtB4Cyra+UZ9LVS35h5quHhrQ X-Received: by 10.46.42.66 with SMTP id q63mr180429ljq.39.1508320705261; Wed, 18 Oct 2017 02:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508320705; cv=none; d=google.com; s=arc-20160816; b=ArJLVrpm5NdtP2DVRAGgsOobawmHbDI1udOilrbDcqqrxa5sDlS8CnKGI/E04K7t0H frzLewEZa76WWkD/Kp5228YIZsHtC6ZE8Ew6qn6D4YUq349i9WqSiid1mx3HlYh1YuGp 5+udnJ6zH5agvmjnXDq+fNcgqeyFPuWBQk29vn4NwljbdB4Brk3TByZJMzBsbx+fZzuq zitCcbgWvq+ld4HSWzkNxvn7mWS3wdOpqKRzDi4Cav0L9C42jGD5dQlfm1ymgDehNIGd ckNFoY8ddW2UMH6qp7Bk/nReAXZzg6thI1jjyQ+1xwDLi5/+0UqKTnDV7OzUmssdz7E7 p9Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3X7D5Z0ojYKpi0d4+D2CfcftPdC4IlK3EPRV3HZelsU=; b=v1SiLp+jks4HrGSLGv3dg0xIoCGKcziSkId5BHL5c4T89ueLXFnJbHFDg5qCkVKVeM +lPgzmXb8rUCmBegNoy6x/MgMwg5j1oZ9TzKBk75iqmh4BhPe0/bR8iRh9ymv+EZKCBG QuKRkh48i6vYNez/hrx0it6LenCOI8xhU9eHMobR7iakVMdnDgYUG98sRprI6lV5ownm A1c04aMUxPTBLaNVng1q0Mhf1YipP8OWM24TbAiNPyqRfRho3yGq79R40DH7M/HE4qeP Bu1EXLTSS8pJRFoydxkanRhCFHN9KPI+ZDaBteHFvS0hacnyA5YSIeA2HgW8KOFEzTQ/ HMEg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id 26si516166lfx.0.2017.10.18.02.58.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Oct 2017 02:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v9I9wO4x015069 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Oct 2017 11:58:24 +0200 Received: from md1em3qc.ww002.siemens.net ([139.25.68.40]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v9I9wOux029101; Wed, 18 Oct 2017 11:58:24 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Alexander Smirnov , Henning Schild Subject: [PATCHv2] image: set the root password conditionally Date: Wed, 18 Oct 2017 11:58:22 +0200 Message-Id: <20171018095822.4150-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <6922b5950b19b7d54cf8132106409dc33bb12510.1507561035.git.henning.schild@siemens.com> References: <6922b5950b19b7d54cf8132106409dc33bb12510.1507561035.git.henning.schild@siemens.com> X-TUID: QkSU9yMgyemK If the root password was set by a hook script of a package, do not set it in the configure script. Add chpasswd to example-raw to demonstrate that. Impact: The default root password of images that include example-raw will change. Signed-off-by: Henning Schild --- .../example-raw/{example-raw_0.1.bb => example-raw_0.2.bb} | 5 ++++- meta-isar/recipes-core/images/files/debian-configscript.sh | 3 ++- meta-isar/recipes-core/images/files/raspbian-configscript.sh | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) rename meta-isar/recipes-app/example-raw/{example-raw_0.1.bb => example-raw_0.2.bb} (88%) diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb b/meta-isar/recipes-app/example-raw/example-raw_0.2.bb similarity index 88% rename from meta-isar/recipes-app/example-raw/example-raw_0.1.bb rename to meta-isar/recipes-app/example-raw/example-raw_0.2.bb index 08c7277..7dd343a 100644 --- a/meta-isar/recipes-app/example-raw/example-raw_0.1.bb +++ b/meta-isar/recipes-app/example-raw/example-raw_0.2.bb @@ -5,7 +5,7 @@ DESCRIPTION = "Sample application for ISAR" MAINTAINER = "Your name here " -DEBIAN_DEPENDS = "apt" +DEBIAN_DEPENDS = "apt passwd" SRC_URI = "file://README \ file://postinst" @@ -28,6 +28,9 @@ do_install() { bbnote "Now for a debian hook, see dpkg-deb" install -v -m 755 ${WORKDIR}/postinst ${D}/DEBIAN/postinst + bbnote "Also change the root password" + echo 'echo "root:isar" | chpasswd' >> ${D}/DEBIAN/postinst + bbnote "Now for a fake config file" echo "# empty config file" > ${WORKDIR}/${PN}.conf install -v -d ${D}/usr/local/etc/ diff --git a/meta-isar/recipes-core/images/files/debian-configscript.sh b/meta-isar/recipes-core/images/files/debian-configscript.sh index e2c03b5..698277c 100644 --- a/meta-isar/recipes-core/images/files/debian-configscript.sh +++ b/meta-isar/recipes-core/images/files/debian-configscript.sh @@ -49,7 +49,8 @@ mount proc -t proc /proc dpkg --configure -a umount /proc -echo "root:root" | chpasswd +# set the root password if that has not been done before +grep "root:\*:" /etc/shadow && echo "root:root" | chpasswd cat > /etc/fstab << EOF # Begin /etc/fstab diff --git a/meta-isar/recipes-core/images/files/raspbian-configscript.sh b/meta-isar/recipes-core/images/files/raspbian-configscript.sh index b1f8fd6..61a1aa5 100644 --- a/meta-isar/recipes-core/images/files/raspbian-configscript.sh +++ b/meta-isar/recipes-core/images/files/raspbian-configscript.sh @@ -53,7 +53,8 @@ mount proc -t proc /proc dpkg --configure -a umount /proc -echo "root:root" | chpasswd +# set the root password if that has not been done before +grep "root:\*:" /etc/shadow && echo "root:root" | chpasswd cat > /etc/fstab << EOF # Begin /etc/fstab -- 2.13.6