From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6478567610421084160 X-Received: by 10.223.184.197 with SMTP id c5mr140375wrg.23.1508410271500; Thu, 19 Oct 2017 03:51:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.132.142 with SMTP id g136ls1311410wmd.7.gmail; Thu, 19 Oct 2017 03:51:10 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RkQQ/+bal2AElL0cYZsYpV4xXvmSpIe/uvPjRiiOmOC5tflF9fvzKpyDwCf7ihxqx3D+wm X-Received: by 10.28.150.130 with SMTP id y124mr161901wmd.22.1508410270905; Thu, 19 Oct 2017 03:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508410270; cv=none; d=google.com; s=arc-20160816; b=hevf49aoPkjy9TnOM3AHeuaOt/uNAx+8xnvm8Ni/CH07s9IPyZpGZ5ek92OE4iJK/d ZIHljzqqMSeqUmPgMO87k8vaMuLCUtrF5zh0G9AtSUeZbA6uy9RiQ8njw/g+5FJSw6or 4uhC9PRq0R/dka6d2X8ICOU2XshX+srVIkNYT4A1wKAPk4Svr/hqSu0pdh5o/yW5hyqN 1KOeFRUvt0tbn2coeb2jPRCXVHwcLJd8o2x8gY+0Lf9FUJNXDiNZlXWM9UB9ISoXMHY3 WhVO6/JWvo1d/2M4+fmAePVuLZgM2b8zd+hYmMvb3h3zw2p8eIp6QXyTcDNysUiOFqbM waMg== 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:subject:cc:to:from:date:arc-authentication-results; bh=2yKGJDBnxBQqEY4+FfZ4YLVXU32wdpW3n+k7g7GZ8uQ=; b=z+besHIW+yWTlm0xkJZmBaXwE5jFnywq/MUwELxwFZoxMMSFs5V9jOKwGO9Xq1ci1b e18bbhHpiWUxewxkO2TqhuH4Fe4mfrcP5dAGzbn43TrB6yyhZ/zlU9hX31qVDoYH2OFg 4HU2rrRo/vk4Ybq5s1NBCGu9L25flFY7JsEQFmbl32EUQRXmev+/zGYPHZUJRc0044vF zBCHYu3h5GRbGTvOCQFrYghCrv7HUm38KXHei8k8sJPv82z+K1aN9Gx2V6M7jMWSfCo2 6etfL8gZJuSqCWT/nGlRP9ykqIic4yc51QY4JlQ4bxJsOTm5/8EEpVoeseZnmN3RioJm ryoA== 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 j31si373914wre.3.2017.10.19.03.51.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 03:51:10 -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 mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v9JApAMO012231 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Oct 2017 12:51:10 +0200 Received: from md1em3qc ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v9JApArR026011; Thu, 19 Oct 2017 12:51:10 +0200 Date: Thu, 19 Oct 2017 12:51:09 +0200 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [PATCH] meta-isar: Setting root password Message-ID: <20171019125109.71bc0078@md1em3qc> In-Reply-To: <20171019103043.25702-1-asmirnov@ilbers.de> References: <20171019103043.25702-1-asmirnov@ilbers.de> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: xNt6/cre7mRw On Thu, 19 Oct 2017 13:30:43 +0300 Alexander Smirnov wrote: > This patch addresses the following issues: > > 1. At the moment there are two places where root password is set: > - mulristrap scripts > - example-raw application > So there is no need to do this twice for default Isar layout. Productive images are not likely to contain the example, they might have a recipe that sets the password (like the example). Having the second chpasswd makes sure we have a password set even when no additional packages are installed, also not the example. So i think we should stick to two places. > 2. According to the README.md, the default password is 'root', so it > needs to set it back to avoid unnecessary surprise of existing users. That is an issue that could be changed by updating the documentation. > 3. Define default passowrd as variable to have possibility to override > it from local config. The example-raw shows a clear way to set the password for an image, no need to invent another way, we have one that works. So i suggest to drop this patch and i will change the documentation. Either with a new version of the patch i wrote, or with a new patch on top. Henning > Signed-off-by: Alexander Smirnov > --- > meta-isar/recipes-app/example-raw/example-raw_0.2.bb | 4 +++- > meta-isar/recipes-core/images/files/debian-configscript.sh | 3 --- > meta-isar/recipes-core/images/files/raspbian-configscript.sh | 3 --- > 3 files changed, 3 insertions(+), 7 deletions(-) > > diff --git a/meta-isar/recipes-app/example-raw/example-raw_0.2.bb > b/meta-isar/recipes-app/example-raw/example-raw_0.2.bb index > 7dd343a..0f0ee27 100644 --- > a/meta-isar/recipes-app/example-raw/example-raw_0.2.bb +++ > b/meta-isar/recipes-app/example-raw/example-raw_0.2.bb @@ -12,6 +12,8 > @@ SRC_URI = "file://README \ > inherit dpkg-raw > > +ISAR_DEFAULT_PASSWORD ?= "root" > + > do_install() { > bbnote "Creating ${PN} binary" > echo "#!/bin/sh" > ${WORKDIR}/${PN} > @@ -29,7 +31,7 @@ do_install() { > install -v -m 755 ${WORKDIR}/postinst ${D}/DEBIAN/postinst > > bbnote "Also change the root password" > - echo 'echo "root:isar" | chpasswd' >> ${D}/DEBIAN/postinst > + echo 'echo "root:${ISAR_DEFAULT_PASSWORD}" | chpasswd' >> > ${D}/DEBIAN/postinst > bbnote "Now for a fake config file" > echo "# empty config file" > ${WORKDIR}/${PN}.conf > diff --git > a/meta-isar/recipes-core/images/files/debian-configscript.sh > b/meta-isar/recipes-core/images/files/debian-configscript.sh index > 7303598..d028c75 100644 --- > a/meta-isar/recipes-core/images/files/debian-configscript.sh +++ > b/meta-isar/recipes-core/images/files/debian-configscript.sh @@ -46,9 > +46,6 @@ export LC_ALL=C LANGUAGE=C LANG=C # Configuring packages > dpkg --configure -a > -# 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 > /dev/$ROOTFS_DEV / ext4 > defaults 1 1 diff --git > a/meta-isar/recipes-core/images/files/raspbian-configscript.sh > b/meta-isar/recipes-core/images/files/raspbian-configscript.sh index > 4cb004b..2cdd1cb 100644 --- > a/meta-isar/recipes-core/images/files/raspbian-configscript.sh +++ > b/meta-isar/recipes-core/images/files/raspbian-configscript.sh @@ > -50,9 +50,6 @@ > rm /var/lib/dpkg/info/raspberrypi-bootloader-nokernel.postinst # > Configuring packages dpkg --configure -a -# 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 > /dev/$ROOTFS_DEV / ext4 > defaults 1 1