From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6474925990321586176 X-Received: by 10.28.145.11 with SMTP id t11mr1310546wmd.0.1507561185194; Mon, 09 Oct 2017 07:59:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.145.14 with SMTP id t14ls222528wmd.4.canary-gmail; Mon, 09 Oct 2017 07:59:44 -0700 (PDT) X-Google-Smtp-Source: AOwi7QAFrIxsYBF7wD5V0dVWa8rrmbXZsXHZK3H64YV0zx8Wsa6PNxuc2FCtjtVt9tAWgw6+ASNH X-Received: by 10.223.163.215 with SMTP id m23mr762264wrb.25.1507561184938; Mon, 09 Oct 2017 07:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507561184; cv=none; d=google.com; s=arc-20160816; b=mvsCJzT2y7FrjunAn4Y5UMJU8JlmfgAFfvAFAT+t9Ct+cuk+4XxDGrohz+BVCbUI21 HJ/bzUjOZKgy/9WzpPb8y/pKLwETVuu2aDh4SHyS6pCeWpYv+K19S/wBNLNifRPPo96M F5zBRjmpW9YgGTg2hjr24zVcJ5bMCfFiMO55FULVtQegEEmzlS2vA75IxF94BXrAWILm ajlDoBCAxpp3rJg5IZb1FLAnPm8IK/gjP12tXsvvcTem6sbjBLI4ZBIwuWlkrbRlCZv+ /GaMqw6Sp6ShtLj3Wh91k8mY7U/BmDNuj5gQQsLljRAoA46n7oFIx3JROKAH9JN3i44S JAhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=1IYSjhUwgVO/aSlQ7IlLSbpZs+ut54tPS999gd0uPMA=; b=sbbaVACTxEKJCErVLGjlz14tCYcyc4mch9M5mXDTMrglQXTWrd1u8H6CxGm7KAAlZM 6sHgn6vM3VS3w7mtfVCktRWWdr4w2ITrsRLPd2zmOREUzlEWlRTKd0j76EQyAQEOf1YI f1sIkNehbdXVhCnl2NcmTzVUXpYiodFfpnN9dxUYwQxImwX8Fp7OqKEu7f4hwgqbrIiG zAKiCEwsTlEnRBAcCkT1yfh7C75h74L0S1QK6y3M/P6I4VsrN7iG0/FFn++AS3VBEig+ rY+2cemzCdF6ymCOczo4sO7mQ1/AmwQV0LYkdjxGj94tBjoY6ZX5955RA/MDbCt5ehaJ 7NpA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id p70si989139wma.1.2017.10.09.07.59.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Oct 2017 07:59:44 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by domain of henning.schild@siemens.com) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v99ExixH008064 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 9 Oct 2017 16:59:44 +0200 Received: from md1em3qc.ww002.siemens.net ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v99ExibU001881; Mon, 9 Oct 2017 16:59:44 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Henning Schild Subject: [PATCH 1/3] image: set the root password conditionally Date: Mon, 9 Oct 2017 16:59:40 +0200 Message-Id: <6922b5950b19b7d54cf8132106409dc33bb12510.1507561035.git.henning.schild@siemens.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-TUID: v4DcddqltKTM 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. Signed-off-by: Henning Schild --- .../recipes-app/example-raw/{example-raw_0.1.bb => example-raw_0.2.bb} | 3 +++ meta-isar/recipes-core/images/files/debian-configscript.sh | 3 ++- meta-isar/recipes-core/images/files/raspbian-configscript.sh | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) rename meta-isar/recipes-app/example-raw/{example-raw_0.1.bb => example-raw_0.2.bb} (91%) 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 91% 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..f504490 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 @@ -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