From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6478567610421084160 X-Received: by 10.80.230.12 with SMTP id y12mr369431edm.6.1508409066274; Thu, 19 Oct 2017 03:31:06 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.192.1 with SMTP id r1ls2724030edb.0.gmail; Thu, 19 Oct 2017 03:31:06 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TOpmyd65NncshoBR6lcWuM60A6drCVROD/BPr/T0l37KRVcNiwDpY+rN5ozbqVrWLhwmwy X-Received: by 10.80.173.69 with SMTP id z5mr367914edc.0.1508409066015; Thu, 19 Oct 2017 03:31:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508409065; cv=none; d=google.com; s=arc-20160816; b=MTDaQ/ueoKNiCzr1lc9mTloHv0rRZp2LKcCER2a0R3LkxnBSMRqDSz8oo1MRDbKjgv j5tOV9kCp1J4s/E9Ia++gdXU9OOeLqH2TLCRXcikW/ckxESZmQXFJ5zncY76dmy8xXmR TF1PJ8o5tsOUleLFITRJvHs+6aFGqMyimtMdatEuXdKAbzt+HwsEl7T1F2qbjHqwqCFi LRBVmvIMObQUi2dOO51QjelxoIAoouyHGPwuL1yrGEbQDCcTtlQEWGuP+vx52a6SsDRs Gs1JFYHaWXAsRxYRP5q02kmNfph1jMSwwT5LGinMVFGJQCfinaYPuQiOMygZ/fxJxRWy XtVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:arc-authentication-results; bh=n5dgkcqqFyuvnLEKr5u0edRONapTD7t9RR3T74kF3Fk=; b=C8m5X2UBHn89M/hWgT0RkHDn2xQGZmdgE4UcVNJMz038W4QHTXXTOAK/cfTjtCpdCU y91KZgnzpnCINqJcL0267SXgAAY3yBBcrZd6uUZgbgAzNp3sZP3PFa3jE4lNOw3EsT0o hI7qxXiY6WynWGfV+G1JBQX0VfoGavuRQVAVO8gbLSbr+jg0M500y7wn5yWd2Glxmp+0 CaFmfpUIIyJMp8Dp2H13JYBcdT1phM7xpvqVneG9zrqyE599r5AGnnyKzR0hwvOSC0Cq ibq+PkVySjwhibw0GoB+4IEpzpFQUxOYtz9yxoLUFH74ztwA/CcISHy5YbVjMlXeOamP WMFg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id m13si574994edc.2.2017.10.19.03.31.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Oct 2017 03:31:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from localhost.localdomain ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id v9JAUoZd023213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2017 12:30:56 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH] meta-isar: Setting root password Date: Thu, 19 Oct 2017 13:30:43 +0300 Message-Id: <20171019103043.25702-1-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.4 X-TUID: LyaO8x0Wcnyi 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. 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. 3. Define default passowrd as variable to have possibility to override it from local config. 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 -- 2.1.4