* [PATCH] meta-isar: Setting root password
@ 2017-10-19 10:30 Alexander Smirnov
2017-10-19 10:51 ` Henning Schild
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Smirnov @ 2017-10-19 10:30 UTC (permalink / raw)
To: isar-users; +Cc: Alexander Smirnov
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 <asmirnov@ilbers.de>
---
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-isar: Setting root password
2017-10-19 10:30 [PATCH] meta-isar: Setting root password Alexander Smirnov
@ 2017-10-19 10:51 ` Henning Schild
2017-10-19 11:18 ` Alexander Smirnov
0 siblings, 1 reply; 4+ messages in thread
From: Henning Schild @ 2017-10-19 10:51 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
On Thu, 19 Oct 2017 13:30:43 +0300
Alexander Smirnov <asmirnov@ilbers.de> 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 <asmirnov@ilbers.de>
> ---
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-isar: Setting root password
2017-10-19 10:51 ` Henning Schild
@ 2017-10-19 11:18 ` Alexander Smirnov
2017-10-19 12:04 ` Henning Schild
0 siblings, 1 reply; 4+ messages in thread
From: Alexander Smirnov @ 2017-10-19 11:18 UTC (permalink / raw)
To: Henning Schild; +Cc: isar-users
On 10/19/2017 01:51 PM, Henning Schild wrote:
> On Thu, 19 Oct 2017 13:30:43 +0300
> Alexander Smirnov <asmirnov@ilbers.de> 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.
The default Isar password should stay the same, i.e. 'root', I see no
reason to change this policy. So if example application is optional and
both password setting approaches should stay in Isar, then they should
set the same password. Otherwise after dropping 'example-raw' user won't
be able to login by following README.md.
So I propose to change 'isar' to 'root' in example-raw application.
Please let me know if you could handle this, or I could prepare the
patch. It's quite urgent because README.md is inconsistent now.
Alex
>
> Henning
>
>> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
>> ---
>> 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
>
--
With best regards,
Alexander Smirnov
ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] meta-isar: Setting root password
2017-10-19 11:18 ` Alexander Smirnov
@ 2017-10-19 12:04 ` Henning Schild
0 siblings, 0 replies; 4+ messages in thread
From: Henning Schild @ 2017-10-19 12:04 UTC (permalink / raw)
To: Alexander Smirnov; +Cc: isar-users
On Thu, 19 Oct 2017 14:18:09 +0300
Alexander Smirnov <asmirnov@ilbers.de> wrote:
> On 10/19/2017 01:51 PM, Henning Schild wrote:
> > On Thu, 19 Oct 2017 13:30:43 +0300
> > Alexander Smirnov <asmirnov@ilbers.de> 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.
>
> The default Isar password should stay the same, i.e. 'root', I see no
> reason to change this policy. So if example application is optional
> and both password setting approaches should stay in Isar, then they
> should set the same password. Otherwise after dropping 'example-raw'
> user won't be able to login by following README.md.
>
> So I propose to change 'isar' to 'root' in example-raw application.
> Please let me know if you could handle this, or I could prepare the
> patch. It's quite urgent because README.md is inconsistent now.
I will send an updated patch. It is not urgent since it is a regression
in next and not in master. And next is not for end-users.
Henning
> Alex
>
> >
> > Henning
> >
> >> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> >> ---
> >> 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
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-10-19 12:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 10:30 [PATCH] meta-isar: Setting root password Alexander Smirnov
2017-10-19 10:51 ` Henning Schild
2017-10-19 11:18 ` Alexander Smirnov
2017-10-19 12:04 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox