From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6516773995002462208 X-Received: by 10.28.91.147 with SMTP id p141mr1284956wmb.31.1517568105167; Fri, 02 Feb 2018 02:41:45 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.144.41 with SMTP id h38ls509752wrh.11.gmail; Fri, 02 Feb 2018 02:41:44 -0800 (PST) X-Google-Smtp-Source: AH8x224DvDSUiyjnHwgP4pLVLzS2WWpKV/5Zgq2cv3Sow1Wf9OZJ8KtgnxD0DPim6tkTLMYHOKu2 X-Received: by 10.223.176.235 with SMTP id j40mr3177271wra.27.1517568104564; Fri, 02 Feb 2018 02:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517568104; cv=none; d=google.com; s=arc-20160816; b=XaILLdEfa+Yyk4qA+FTFCUw/vuWWMVtC0oqB1Ql8nQQJicmssEC6KfTUKQKAW6/MZ1 1AlbD6QaIJ4ZsMf2Vye32SUFEQgdlPaS+8uefYPIYaTw/cejA/qtISEuNTKAwkAg2Hbd BCSoYpllonFDLudbOxbxb803YOncQu/pk+rgsUtqeRdhN5l+BiQ51/68pNXcVVBI8ChW pbT9qzCO938Czc2OOSaHKw/2eymUlaZaMLzpagau7BQDyp8oMsjPO37HvPJd/cz9XCg3 T1fkjpJ2h+XUImyAbbsuC2VB94LShFUn0X/OnobuybMpiazhwNLH73S+ZWMQDoWF+MZt YbHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :arc-authentication-results; bh=ORvMhFO+OkUH9Wn6BMtsE3FBbcSwj0GN+KLA8ineRnM=; b=ptq46UAA1VC9HGneMgIpuQFINMLKe4K+xZIWYthRifHn++h2Cm/XUwvdU5I1cVMQmB rISni5iLpXJ0SiH6B+8/zEu5uQnWpHCV3HkPjuYunMtbN/VgCD/QufsUzSAQjwgqxAD4 u7Z6TcW7XkPhMwRyyEbnw21fHS9f/pS6JWLOGaE1nApSKIPIyylYqSqEgdDYNG3J+LB7 SQ7PtW7yPxTUsai/q9CGFnGc8FQmefNgKm8DQTuAnPTuiPS3P74FLIELd0GZfvE5rxYQ R9bjRiol+AG3O4Vm/dENvfCq6TFjJR+OzcNNbfJ/wmmaWK+5ALx4qO0M0H8q1Y3lLF5i GjcQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id v8si112447wrg.2.2018.02.02.02.41.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Feb 2018 02:41:44 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@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 w12AfixL006441 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Feb 2018 11:41:44 +0100 Received: from [167.87.37.228] ([167.87.37.228]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w12Afge1030227; Fri, 2 Feb 2018 11:41:42 +0100 Subject: Re: [PATCH] Install /dev/null in rootfs To: Alexander Smirnov , Baurzhan Ismagulov Cc: Henning Schild , isar-users References: <14fbc8f0-b5dd-afd0-bd73-1592f6ee05ca@siemens.com> <20180130124417.130d5b4c@mmd1pvb1c.ad001.siemens.net> From: Jan Kiszka Message-ID: Date: Fri, 2 Feb 2018 11:41:42 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20180130124417.130d5b4c@mmd1pvb1c.ad001.siemens.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: kVUXVng5B6+I 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" : > >> From: Jan Kiszka >> >> ...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 >> --- >> .../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