* [PATCH] Install /dev/null in rootfs
@ 2018-01-30 9:31 Jan Kiszka
2018-01-30 11:44 ` Henning Schild
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2018-01-30 9:31 UTC (permalink / raw)
To: isar-users
From: Jan Kiszka <jan.kiszka@siemens.com>
...or hell breaks loose, at least in the buildchroot:
x86 kernel builds will generate strange modules.order/builtin files.
That's because drivers/firmware/Makefile does
$(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1)
That tries the above assembly on the x86 gcc which will not understand
it and complain. It's output is directed to /dev/null, but that does not
exist, so it will be printed to the above modules.* files. Argh.
Who knows what may happen in the image rootfs, so update it as well.
Which reminds us that this ugly duplication should be resolved ASAP.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
.../files/{download_dev-random => download_dev-nodes} | 7 +++++++
meta-isar/recipes-core/images/isar-image-base.bb | 4 ++--
meta/recipes-devtools/buildchroot/buildchroot.bb | 4 ++--
.../recipes-devtools/buildchroot/files/download_dev-nodes | 7 +++++++
meta/recipes-devtools/buildchroot/files/download_dev-random | 13 -------------
5 files changed, 18 insertions(+), 17 deletions(-)
copy meta-isar/recipes-core/images/files/{download_dev-random => download_dev-nodes} (73%)
rename meta-isar/recipes-core/images/files/download_dev-random => meta/recipes-devtools/buildchroot/files/download_dev-nodes (73%)
delete mode 100644 meta/recipes-devtools/buildchroot/files/download_dev-random
diff --git a/meta-isar/recipes-core/images/files/download_dev-random b/meta-isar/recipes-core/images/files/download_dev-nodes
similarity index 73%
copy from meta-isar/recipes-core/images/files/download_dev-random
copy to meta-isar/recipes-core/images/files/download_dev-nodes
index f7f5fe5..3149faa 100644
--- a/meta-isar/recipes-core/images/files/download_dev-random
+++ b/meta-isar/recipes-core/images/files/download_dev-nodes
@@ -7,6 +7,13 @@ set -e
readonly ROOTFS="$1"
+if [ ! -c ${ROOTFS}/dev/null ]; then
+ rm -f ${ROOTFS}/dev/null
+ mknod "${ROOTFS}/dev/null" c 1 3
+ chmod 666 "${ROOTFS}/dev/null"
+ chown 0:0 "${ROOTFS}/dev/null"
+fi
+
if [ ! -c ${ROOTFS}/dev/random ]; then
rm -f ${ROOTFS}/dev/random
mknod "${ROOTFS}/dev/random" c 1 8
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 2f03cd1..3954697 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -12,7 +12,7 @@ FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:"
SRC_URI = "file://multistrap.conf.in \
file://${DISTRO_CONFIG_SCRIPT} \
file://setup.sh \
- file://download_dev-random"
+ file://download_dev-nodes"
PV = "1.0"
@@ -38,7 +38,7 @@ do_rootfs() {
chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
chmod +x "${WORKDIR}/setup.sh"
- install -m 755 "${WORKDIR}/download_dev-random" "${WORKDIR}/hooks_multistrap/"
+ install -m 755 "${WORKDIR}/download_dev-nodes" "${WORKDIR}/hooks_multistrap/"
# Multistrap accepts only relative path in configuration files, so get it:
cd ${TOPDIR}
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index 51f9d5d..8743a02 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -12,7 +12,7 @@ FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
SRC_URI = "file://multistrap.conf.in \
file://configscript.sh \
file://setup.sh \
- file://download_dev-random \
+ file://download_dev-nodes \
file://build.sh"
PV = "1.0"
@@ -39,7 +39,7 @@ do_build() {
chmod +x "${WORKDIR}/setup.sh"
chmod +x "${WORKDIR}/configscript.sh"
- install -m 755 "${WORKDIR}/download_dev-random" "${WORKDIR}/hooks_multistrap/"
+ install -m 755 "${WORKDIR}/download_dev-nodes" "${WORKDIR}/hooks_multistrap/"
# Multistrap accepts only relative path in configuration files, so get it:
cd ${TOPDIR}
diff --git a/meta-isar/recipes-core/images/files/download_dev-random b/meta/recipes-devtools/buildchroot/files/download_dev-nodes
similarity index 73%
rename from meta-isar/recipes-core/images/files/download_dev-random
rename to meta/recipes-devtools/buildchroot/files/download_dev-nodes
index f7f5fe5..3149faa 100644
--- a/meta-isar/recipes-core/images/files/download_dev-random
+++ b/meta/recipes-devtools/buildchroot/files/download_dev-nodes
@@ -7,6 +7,13 @@ set -e
readonly ROOTFS="$1"
+if [ ! -c ${ROOTFS}/dev/null ]; then
+ rm -f ${ROOTFS}/dev/null
+ mknod "${ROOTFS}/dev/null" c 1 3
+ chmod 666 "${ROOTFS}/dev/null"
+ chown 0:0 "${ROOTFS}/dev/null"
+fi
+
if [ ! -c ${ROOTFS}/dev/random ]; then
rm -f ${ROOTFS}/dev/random
mknod "${ROOTFS}/dev/random" c 1 8
diff --git a/meta/recipes-devtools/buildchroot/files/download_dev-random b/meta/recipes-devtools/buildchroot/files/download_dev-random
deleted file mode 100644
index 5b5b96b..0000000
--- a/meta/recipes-devtools/buildchroot/files/download_dev-random
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-set -e
-
-readonly ROOTFS="$1"
-
-mknod "${ROOTFS}/dev/random" c 1 8
-chmod 640 "${ROOTFS}/dev/random"
-chown 0:0 "${ROOTFS}/dev/random"
-
-mknod "${ROOTFS}/dev/urandom" c 1 9
-chmod 640 "${ROOTFS}/dev/urandom"
-chown 0:0 "${ROOTFS}/dev/urandom"
--
2.13.6
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Install /dev/null in rootfs
2018-01-30 9:31 [PATCH] Install /dev/null in rootfs Jan Kiszka
@ 2018-01-30 11:44 ` Henning Schild
2018-02-02 10:41 ` Jan Kiszka
2018-02-02 12:19 ` Alexander Smirnov
0 siblings, 2 replies; 5+ messages in thread
From: Henning Schild @ 2018-01-30 11:44 UTC (permalink / raw)
To: [ext] Jan Kiszka, Alexander Smirnov, Baurzhan Ismagulov; +Cc: isar-users
Good catch,
but that and the other mknods makes we wonder why wo do not just
bind-mount /dev. And while we are at it also /sys.
/dev /proc and /sys are known to be usually required for a working
system. Is there a reason to not just mount all three of them?
Otherwise it seems like this patch is just another one in a long series
of mknod patches.
Henning
Am Tue, 30 Jan 2018 10:31:21 +0100
schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> ...or hell breaks loose, at least in the buildchroot:
>
> x86 kernel builds will generate strange modules.order/builtin files.
> That's because drivers/firmware/Makefile does
> $(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1)
> That tries the above assembly on the x86 gcc which will not understand
> it and complain. It's output is directed to /dev/null, but that does
> not exist, so it will be printed to the above modules.* files. Argh.
>
> Who knows what may happen in the image rootfs, so update it as well.
> Which reminds us that this ugly duplication should be resolved ASAP.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> .../files/{download_dev-random => download_dev-nodes} | 7
> +++++++ meta-isar/recipes-core/images/isar-image-base.bb
> | 4 ++-- meta/recipes-devtools/buildchroot/buildchroot.bb
> | 4 ++-- .../recipes-devtools/buildchroot/files/download_dev-nodes
> | 7 +++++++
> meta/recipes-devtools/buildchroot/files/download_dev-random | 13
> ------------- 5 files changed, 18 insertions(+), 17 deletions(-) copy
> meta-isar/recipes-core/images/files/{download_dev-random =>
> download_dev-nodes} (73%) rename
> meta-isar/recipes-core/images/files/download_dev-random =>
> meta/recipes-devtools/buildchroot/files/download_dev-nodes (73%)
> delete mode 100644
> meta/recipes-devtools/buildchroot/files/download_dev-random
>
> diff --git a/meta-isar/recipes-core/images/files/download_dev-random
> b/meta-isar/recipes-core/images/files/download_dev-nodes similarity
> index 73% copy from
> meta-isar/recipes-core/images/files/download_dev-random copy to
> meta-isar/recipes-core/images/files/download_dev-nodes index
> f7f5fe5..3149faa 100644 ---
> a/meta-isar/recipes-core/images/files/download_dev-random +++
> b/meta-isar/recipes-core/images/files/download_dev-nodes @@ -7,6
> +7,13 @@ set -e
> readonly ROOTFS="$1"
>
> +if [ ! -c ${ROOTFS}/dev/null ]; then
> + rm -f ${ROOTFS}/dev/null
> + mknod "${ROOTFS}/dev/null" c 1 3
> + chmod 666 "${ROOTFS}/dev/null"
> + chown 0:0 "${ROOTFS}/dev/null"
> +fi
> +
> if [ ! -c ${ROOTFS}/dev/random ]; then
> rm -f ${ROOTFS}/dev/random
> mknod "${ROOTFS}/dev/random" c 1 8
> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb
> b/meta-isar/recipes-core/images/isar-image-base.bb index
> 2f03cd1..3954697 100644 ---
> a/meta-isar/recipes-core/images/isar-image-base.bb +++
> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -12,7 +12,7 @@
> FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:" SRC_URI =
> "file://multistrap.conf.in \ file://${DISTRO_CONFIG_SCRIPT} \
> file://setup.sh \
> - file://download_dev-random"
> + file://download_dev-nodes"
>
> PV = "1.0"
>
> @@ -38,7 +38,7 @@ do_rootfs() {
>
> chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
> chmod +x "${WORKDIR}/setup.sh"
> - install -m 755 "${WORKDIR}/download_dev-random"
> "${WORKDIR}/hooks_multistrap/"
> + install -m 755 "${WORKDIR}/download_dev-nodes"
> "${WORKDIR}/hooks_multistrap/"
> # Multistrap accepts only relative path in configuration files,
> so get it: cd ${TOPDIR}
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb
> b/meta/recipes-devtools/buildchroot/buildchroot.bb index
> 51f9d5d..8743a02 100644 ---
> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -12,7 +12,7 @@
> FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
> SRC_URI = "file://multistrap.conf.in \ file://configscript.sh \
> file://setup.sh \
> - file://download_dev-random \
> + file://download_dev-nodes \
> file://build.sh"
> PV = "1.0"
>
> @@ -39,7 +39,7 @@ do_build() {
>
> chmod +x "${WORKDIR}/setup.sh"
> chmod +x "${WORKDIR}/configscript.sh"
> - install -m 755 "${WORKDIR}/download_dev-random"
> "${WORKDIR}/hooks_multistrap/"
> + install -m 755 "${WORKDIR}/download_dev-nodes"
> "${WORKDIR}/hooks_multistrap/"
> # Multistrap accepts only relative path in configuration files,
> so get it: cd ${TOPDIR}
> diff --git a/meta-isar/recipes-core/images/files/download_dev-random
> b/meta/recipes-devtools/buildchroot/files/download_dev-nodes
> similarity index 73% rename from
> meta-isar/recipes-core/images/files/download_dev-random rename to
> meta/recipes-devtools/buildchroot/files/download_dev-nodes index
> f7f5fe5..3149faa 100644 ---
> a/meta-isar/recipes-core/images/files/download_dev-random +++
> b/meta/recipes-devtools/buildchroot/files/download_dev-nodes @@ -7,6
> +7,13 @@ set -e
> readonly ROOTFS="$1"
>
> +if [ ! -c ${ROOTFS}/dev/null ]; then
> + rm -f ${ROOTFS}/dev/null
> + mknod "${ROOTFS}/dev/null" c 1 3
> + chmod 666 "${ROOTFS}/dev/null"
> + chown 0:0 "${ROOTFS}/dev/null"
> +fi
> +
> if [ ! -c ${ROOTFS}/dev/random ]; then
> rm -f ${ROOTFS}/dev/random
> mknod "${ROOTFS}/dev/random" c 1 8
> diff --git
> a/meta/recipes-devtools/buildchroot/files/download_dev-random
> b/meta/recipes-devtools/buildchroot/files/download_dev-random deleted
> file mode 100644 index 5b5b96b..0000000 ---
> a/meta/recipes-devtools/buildchroot/files/download_dev-random
> +++ /dev/null @@ -1,13 +0,0 @@
> -#!/bin/sh
> -
> -set -e
> -
> -readonly ROOTFS="$1"
> -
> -mknod "${ROOTFS}/dev/random" c 1 8
> -chmod 640 "${ROOTFS}/dev/random"
> -chown 0:0 "${ROOTFS}/dev/random"
> -
> -mknod "${ROOTFS}/dev/urandom" c 1 9
> -chmod 640 "${ROOTFS}/dev/urandom"
> -chown 0:0 "${ROOTFS}/dev/urandom"
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Install /dev/null in rootfs
2018-01-30 11:44 ` Henning Schild
@ 2018-02-02 10:41 ` Jan Kiszka
2018-02-02 12:19 ` Alexander Smirnov
1 sibling, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2018-02-02 10:41 UTC (permalink / raw)
To: Alexander Smirnov, Baurzhan Ismagulov; +Cc: Henning Schild, isar-users
On 2018-01-30 12:44, Henning Schild wrote:
> Good catch,
>
> but that and the other mknods makes we wonder why wo do not just
> bind-mount /dev. And while we are at it also /sys.
>
> /dev /proc and /sys are known to be usually required for a working
> system. Is there a reason to not just mount all three of them?
> Otherwise it seems like this patch is just another one in a long series
> of mknod patches.
Can you help clarifying this valid question of Henning? Or should we
just merge my fix for now?
Jan
>
> Henning
>
> Am Tue, 30 Jan 2018 10:31:21 +0100
> schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
>
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> ...or hell breaks loose, at least in the buildchroot:
>>
>> x86 kernel builds will generate strange modules.order/builtin files.
>> That's because drivers/firmware/Makefile does
>> $(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1)
>> That tries the above assembly on the x86 gcc which will not understand
>> it and complain. It's output is directed to /dev/null, but that does
>> not exist, so it will be printed to the above modules.* files. Argh.
>>
>> Who knows what may happen in the image rootfs, so update it as well.
>> Which reminds us that this ugly duplication should be resolved ASAP.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> .../files/{download_dev-random => download_dev-nodes} | 7
>> +++++++ meta-isar/recipes-core/images/isar-image-base.bb
>> | 4 ++-- meta/recipes-devtools/buildchroot/buildchroot.bb
>> | 4 ++-- .../recipes-devtools/buildchroot/files/download_dev-nodes
>> | 7 +++++++
>> meta/recipes-devtools/buildchroot/files/download_dev-random | 13
>> ------------- 5 files changed, 18 insertions(+), 17 deletions(-) copy
>> meta-isar/recipes-core/images/files/{download_dev-random =>
>> download_dev-nodes} (73%) rename
>> meta-isar/recipes-core/images/files/download_dev-random =>
>> meta/recipes-devtools/buildchroot/files/download_dev-nodes (73%)
>> delete mode 100644
>> meta/recipes-devtools/buildchroot/files/download_dev-random
>>
>> diff --git a/meta-isar/recipes-core/images/files/download_dev-random
>> b/meta-isar/recipes-core/images/files/download_dev-nodes similarity
>> index 73% copy from
>> meta-isar/recipes-core/images/files/download_dev-random copy to
>> meta-isar/recipes-core/images/files/download_dev-nodes index
>> f7f5fe5..3149faa 100644 ---
>> a/meta-isar/recipes-core/images/files/download_dev-random +++
>> b/meta-isar/recipes-core/images/files/download_dev-nodes @@ -7,6
>> +7,13 @@ set -e
>> readonly ROOTFS="$1"
>>
>> +if [ ! -c ${ROOTFS}/dev/null ]; then
>> + rm -f ${ROOTFS}/dev/null
>> + mknod "${ROOTFS}/dev/null" c 1 3
>> + chmod 666 "${ROOTFS}/dev/null"
>> + chown 0:0 "${ROOTFS}/dev/null"
>> +fi
>> +
>> if [ ! -c ${ROOTFS}/dev/random ]; then
>> rm -f ${ROOTFS}/dev/random
>> mknod "${ROOTFS}/dev/random" c 1 8
>> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb
>> b/meta-isar/recipes-core/images/isar-image-base.bb index
>> 2f03cd1..3954697 100644 ---
>> a/meta-isar/recipes-core/images/isar-image-base.bb +++
>> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -12,7 +12,7 @@
>> FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:" SRC_URI =
>> "file://multistrap.conf.in \ file://${DISTRO_CONFIG_SCRIPT} \
>> file://setup.sh \
>> - file://download_dev-random"
>> + file://download_dev-nodes"
>>
>> PV = "1.0"
>>
>> @@ -38,7 +38,7 @@ do_rootfs() {
>>
>> chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
>> chmod +x "${WORKDIR}/setup.sh"
>> - install -m 755 "${WORKDIR}/download_dev-random"
>> "${WORKDIR}/hooks_multistrap/"
>> + install -m 755 "${WORKDIR}/download_dev-nodes"
>> "${WORKDIR}/hooks_multistrap/"
>> # Multistrap accepts only relative path in configuration files,
>> so get it: cd ${TOPDIR}
>> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb
>> b/meta/recipes-devtools/buildchroot/buildchroot.bb index
>> 51f9d5d..8743a02 100644 ---
>> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
>> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -12,7 +12,7 @@
>> FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
>> SRC_URI = "file://multistrap.conf.in \ file://configscript.sh \
>> file://setup.sh \
>> - file://download_dev-random \
>> + file://download_dev-nodes \
>> file://build.sh"
>> PV = "1.0"
>>
>> @@ -39,7 +39,7 @@ do_build() {
>>
>> chmod +x "${WORKDIR}/setup.sh"
>> chmod +x "${WORKDIR}/configscript.sh"
>> - install -m 755 "${WORKDIR}/download_dev-random"
>> "${WORKDIR}/hooks_multistrap/"
>> + install -m 755 "${WORKDIR}/download_dev-nodes"
>> "${WORKDIR}/hooks_multistrap/"
>> # Multistrap accepts only relative path in configuration files,
>> so get it: cd ${TOPDIR}
>> diff --git a/meta-isar/recipes-core/images/files/download_dev-random
>> b/meta/recipes-devtools/buildchroot/files/download_dev-nodes
>> similarity index 73% rename from
>> meta-isar/recipes-core/images/files/download_dev-random rename to
>> meta/recipes-devtools/buildchroot/files/download_dev-nodes index
>> f7f5fe5..3149faa 100644 ---
>> a/meta-isar/recipes-core/images/files/download_dev-random +++
>> b/meta/recipes-devtools/buildchroot/files/download_dev-nodes @@ -7,6
>> +7,13 @@ set -e
>> readonly ROOTFS="$1"
>>
>> +if [ ! -c ${ROOTFS}/dev/null ]; then
>> + rm -f ${ROOTFS}/dev/null
>> + mknod "${ROOTFS}/dev/null" c 1 3
>> + chmod 666 "${ROOTFS}/dev/null"
>> + chown 0:0 "${ROOTFS}/dev/null"
>> +fi
>> +
>> if [ ! -c ${ROOTFS}/dev/random ]; then
>> rm -f ${ROOTFS}/dev/random
>> mknod "${ROOTFS}/dev/random" c 1 8
>> diff --git
>> a/meta/recipes-devtools/buildchroot/files/download_dev-random
>> b/meta/recipes-devtools/buildchroot/files/download_dev-random deleted
>> file mode 100644 index 5b5b96b..0000000 ---
>> a/meta/recipes-devtools/buildchroot/files/download_dev-random
>> +++ /dev/null @@ -1,13 +0,0 @@
>> -#!/bin/sh
>> -
>> -set -e
>> -
>> -readonly ROOTFS="$1"
>> -
>> -mknod "${ROOTFS}/dev/random" c 1 8
>> -chmod 640 "${ROOTFS}/dev/random"
>> -chown 0:0 "${ROOTFS}/dev/random"
>> -
>> -mknod "${ROOTFS}/dev/urandom" c 1 9
>> -chmod 640 "${ROOTFS}/dev/urandom"
>> -chown 0:0 "${ROOTFS}/dev/urandom"
>
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Install /dev/null in rootfs
2018-01-30 11:44 ` Henning Schild
2018-02-02 10:41 ` Jan Kiszka
@ 2018-02-02 12:19 ` Alexander Smirnov
2018-02-02 12:35 ` Jan Kiszka
1 sibling, 1 reply; 5+ messages in thread
From: Alexander Smirnov @ 2018-02-02 12:19 UTC (permalink / raw)
To: Henning Schild, [ext] Jan Kiszka, Baurzhan Ismagulov; +Cc: isar-users
On 01/30/2018 02:44 PM, Henning Schild wrote:
> Good catch,
>
> but that and the other mknods makes we wonder why wo do not just
> bind-mount /dev. And while we are at it also /sys.
>
> /dev /proc and /sys are known to be usually required for a working
> system. Is there a reason to not just mount all three of them?
> Otherwise it seems like this patch is just another one in a long series
> of mknod patches.
>
I'm also thinking in this way, especially because now we have robust
mechanism how to unmount everything after build finished/stopped via
events. So I propose the following plan:
- Update bitbake
- Merge isar-apt with events
- Rework /proc,/dev mounting to fix this issue
Alex
> Henning
>
> Am Tue, 30 Jan 2018 10:31:21 +0100
> schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
>
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> ...or hell breaks loose, at least in the buildchroot:
>>
>> x86 kernel builds will generate strange modules.order/builtin files.
>> That's because drivers/firmware/Makefile does
>> $(call as-instr,.arch armv7-a\n.arch_extension sec,-DREQUIRES_SEC=1)
>> That tries the above assembly on the x86 gcc which will not understand
>> it and complain. It's output is directed to /dev/null, but that does
>> not exist, so it will be printed to the above modules.* files. Argh.
>>
>> Who knows what may happen in the image rootfs, so update it as well.
>> Which reminds us that this ugly duplication should be resolved ASAP.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>> .../files/{download_dev-random => download_dev-nodes} | 7
>> +++++++ meta-isar/recipes-core/images/isar-image-base.bb
>> | 4 ++-- meta/recipes-devtools/buildchroot/buildchroot.bb
>> | 4 ++-- .../recipes-devtools/buildchroot/files/download_dev-nodes
>> | 7 +++++++
>> meta/recipes-devtools/buildchroot/files/download_dev-random | 13
>> ------------- 5 files changed, 18 insertions(+), 17 deletions(-) copy
>> meta-isar/recipes-core/images/files/{download_dev-random =>
>> download_dev-nodes} (73%) rename
>> meta-isar/recipes-core/images/files/download_dev-random =>
>> meta/recipes-devtools/buildchroot/files/download_dev-nodes (73%)
>> delete mode 100644
>> meta/recipes-devtools/buildchroot/files/download_dev-random
>>
>> diff --git a/meta-isar/recipes-core/images/files/download_dev-random
>> b/meta-isar/recipes-core/images/files/download_dev-nodes similarity
>> index 73% copy from
>> meta-isar/recipes-core/images/files/download_dev-random copy to
>> meta-isar/recipes-core/images/files/download_dev-nodes index
>> f7f5fe5..3149faa 100644 ---
>> a/meta-isar/recipes-core/images/files/download_dev-random +++
>> b/meta-isar/recipes-core/images/files/download_dev-nodes @@ -7,6
>> +7,13 @@ set -e
>> readonly ROOTFS="$1"
>>
>> +if [ ! -c ${ROOTFS}/dev/null ]; then
>> + rm -f ${ROOTFS}/dev/null
>> + mknod "${ROOTFS}/dev/null" c 1 3
>> + chmod 666 "${ROOTFS}/dev/null"
>> + chown 0:0 "${ROOTFS}/dev/null"
>> +fi
>> +
>> if [ ! -c ${ROOTFS}/dev/random ]; then
>> rm -f ${ROOTFS}/dev/random
>> mknod "${ROOTFS}/dev/random" c 1 8
>> diff --git a/meta-isar/recipes-core/images/isar-image-base.bb
>> b/meta-isar/recipes-core/images/isar-image-base.bb index
>> 2f03cd1..3954697 100644 ---
>> a/meta-isar/recipes-core/images/isar-image-base.bb +++
>> b/meta-isar/recipes-core/images/isar-image-base.bb @@ -12,7 +12,7 @@
>> FILESPATH =. "${LAYERDIR_isar}/recipes-core/images/files:" SRC_URI =
>> "file://multistrap.conf.in \ file://${DISTRO_CONFIG_SCRIPT} \
>> file://setup.sh \
>> - file://download_dev-random"
>> + file://download_dev-nodes"
>>
>> PV = "1.0"
>>
>> @@ -38,7 +38,7 @@ do_rootfs() {
>>
>> chmod +x "${WORKDIR}/${DISTRO_CONFIG_SCRIPT}"
>> chmod +x "${WORKDIR}/setup.sh"
>> - install -m 755 "${WORKDIR}/download_dev-random"
>> "${WORKDIR}/hooks_multistrap/"
>> + install -m 755 "${WORKDIR}/download_dev-nodes"
>> "${WORKDIR}/hooks_multistrap/"
>> # Multistrap accepts only relative path in configuration files,
>> so get it: cd ${TOPDIR}
>> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb
>> b/meta/recipes-devtools/buildchroot/buildchroot.bb index
>> 51f9d5d..8743a02 100644 ---
>> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
>> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -12,7 +12,7 @@
>> FILESPATH =. "${LAYERDIR_core}/recipes-devtools/buildchroot/files:"
>> SRC_URI = "file://multistrap.conf.in \ file://configscript.sh \
>> file://setup.sh \
>> - file://download_dev-random \
>> + file://download_dev-nodes \
>> file://build.sh"
>> PV = "1.0"
>>
>> @@ -39,7 +39,7 @@ do_build() {
>>
>> chmod +x "${WORKDIR}/setup.sh"
>> chmod +x "${WORKDIR}/configscript.sh"
>> - install -m 755 "${WORKDIR}/download_dev-random"
>> "${WORKDIR}/hooks_multistrap/"
>> + install -m 755 "${WORKDIR}/download_dev-nodes"
>> "${WORKDIR}/hooks_multistrap/"
>> # Multistrap accepts only relative path in configuration files,
>> so get it: cd ${TOPDIR}
>> diff --git a/meta-isar/recipes-core/images/files/download_dev-random
>> b/meta/recipes-devtools/buildchroot/files/download_dev-nodes
>> similarity index 73% rename from
>> meta-isar/recipes-core/images/files/download_dev-random rename to
>> meta/recipes-devtools/buildchroot/files/download_dev-nodes index
>> f7f5fe5..3149faa 100644 ---
>> a/meta-isar/recipes-core/images/files/download_dev-random +++
>> b/meta/recipes-devtools/buildchroot/files/download_dev-nodes @@ -7,6
>> +7,13 @@ set -e
>> readonly ROOTFS="$1"
>>
>> +if [ ! -c ${ROOTFS}/dev/null ]; then
>> + rm -f ${ROOTFS}/dev/null
>> + mknod "${ROOTFS}/dev/null" c 1 3
>> + chmod 666 "${ROOTFS}/dev/null"
>> + chown 0:0 "${ROOTFS}/dev/null"
>> +fi
>> +
>> if [ ! -c ${ROOTFS}/dev/random ]; then
>> rm -f ${ROOTFS}/dev/random
>> mknod "${ROOTFS}/dev/random" c 1 8
>> diff --git
>> a/meta/recipes-devtools/buildchroot/files/download_dev-random
>> b/meta/recipes-devtools/buildchroot/files/download_dev-random deleted
>> file mode 100644 index 5b5b96b..0000000 ---
>> a/meta/recipes-devtools/buildchroot/files/download_dev-random
>> +++ /dev/null @@ -1,13 +0,0 @@
>> -#!/bin/sh
>> -
>> -set -e
>> -
>> -readonly ROOTFS="$1"
>> -
>> -mknod "${ROOTFS}/dev/random" c 1 8
>> -chmod 640 "${ROOTFS}/dev/random"
>> -chown 0:0 "${ROOTFS}/dev/random"
>> -
>> -mknod "${ROOTFS}/dev/urandom" c 1 9
>> -chmod 640 "${ROOTFS}/dev/urandom"
>> -chown 0:0 "${ROOTFS}/dev/urandom"
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Install /dev/null in rootfs
2018-02-02 12:19 ` Alexander Smirnov
@ 2018-02-02 12:35 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2018-02-02 12:35 UTC (permalink / raw)
To: Alexander Smirnov, Henning Schild, Baurzhan Ismagulov; +Cc: isar-users
On 2018-02-02 13:19, Alexander Smirnov wrote:
> On 01/30/2018 02:44 PM, Henning Schild wrote:
>> Good catch,
>>
>> but that and the other mknods makes we wonder why wo do not just
>> bind-mount /dev. And while we are at it also /sys.
>>
>> /dev /proc and /sys are known to be usually required for a working
>> system. Is there a reason to not just mount all three of them?
>> Otherwise it seems like this patch is just another one in a long series
>> of mknod patches.
>>
>
> I'm also thinking in this way, especially because now we have robust
> mechanism how to unmount everything after build finished/stopped via
> events. So I propose the following plan:
>
> - Update bitbake
> - Merge isar-apt with events
> - Rework /proc,/dev mounting to fix this issue
Sounds like a plan. Let me know where I may help.
Jan
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-02-02 12:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 9:31 [PATCH] Install /dev/null in rootfs Jan Kiszka
2018-01-30 11:44 ` Henning Schild
2018-02-02 10:41 ` Jan Kiszka
2018-02-02 12:19 ` Alexander Smirnov
2018-02-02 12:35 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox