From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6722331622445678592 X-Received: by 2002:adf:dd88:: with SMTP id x8mr39077122wrl.331.1565706977756; Tue, 13 Aug 2019 07:36:17 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:5651:: with SMTP id j17ls1972650wrw.0.gmail; Tue, 13 Aug 2019 07:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwe6sRqu0bKL+rzeDVS+4V5yNasGKkP4RMBd1LRE1/1TxUo/aM0aYlTuVvtZ0U0cJikWgQe X-Received: by 2002:adf:f304:: with SMTP id i4mr18001006wro.61.1565706977352; Tue, 13 Aug 2019 07:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565706977; cv=none; d=google.com; s=arc-20160816; b=LKhoNRAfqD9vhtFIT41nkEsDL49XIanXfYS/3lhcnAypJvPlZwsCAh2Uk/zewE6foj no5xVTWuQV6x4r+Wik2rJcZQSglggSp3Cg9YcM28BF4AVQ3TPf7lTH+XLrRNOl2h1P4m pQCOPhdPLUF5L/wPA2xGWW5tzZspCJO3im8iMmswO3jBat7O6POj9HAvmhqNdTzuOxJ8 QbUGzMjb0RnKzb2+al4DXwJTYjZ+A7k66HToZUn0Wn8KPT0g9l8pCTj1FL6N2cRkGecZ 36QZyq1BPJNDi+MM0k162cjR5ru3nGWqhfK1A3GrWMt3APVT7uXsvjh8f2VbvaOohOAd sBqQ== 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; bh=xNEjUtFCl5t4VeFLP5hAfWSSGkd2eQXCREh47/IKuFc=; b=oTb06CvTBNOWXwGTeNoeRhD9EcLnC/TOGmVAZycnKtd0Bj0dpyEUD13/Guxwx5Y15x 1lAOLGeYuCmfTW72uOfOyVBYt1nU17+T1ZJjUHMy5lDFrCCdTRg9ac2NRjEokpRyHhoT gS6/n6dKr+3VnH/OVPn2UD8cQD8/RU5PNr66mi1AmxXKNL3UQ5QLguvL6fJJdXmiI/Hq YVdZELWvR3TDdhvL0k6oawplNA5gUPNv/VVAIgat5M8YJYePGqSkouZhLBU36w8IBCE6 sp4Twsp5HcTT5zThyO/BsdTnoELcrLUsGkUcxi0QVAYKt4w1BmPEitDypjhgjSs6TSIq tr9Q== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id g7si120288wmk.0.2019.08.13.07.36.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 07:36:17 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id x7DEaGTx012963 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 13 Aug 2019 16:36:17 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.0.65]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id x7DEaGQc016988; Tue, 13 Aug 2019 16:36:16 +0200 Date: Tue, 13 Aug 2019 16:36:15 +0200 From: Henning Schild To: "[ext] Q. Gylstorff" Cc: , "[ext] Claudius Heine" Subject: Re: [PATCH] recipes-support: add fsck to initramfs Message-ID: <20190813163615.0edcfa7c@md1za8fc.ad001.siemens.net> In-Reply-To: <20190807075908.17902-1-Quirin.Gylstorff@siemens.com> References: <20190807075908.17902-1-Quirin.Gylstorff@siemens.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: 7h0UUH6Wgkuj Well it looks like the problem is the missing fstab line. /usr/share/initramfs-tools/hooks/fsck is looking for that to decide which fsck to include. There also seems to be /etc/fstab.d/*.fstab that can be used if we do not like touching the original fstab. I think Claudius once removed / from fstab claiming that it was not required. The package you get from that changes content based on an image variable. That must not be done. The fstypes would have to become part of PN or PV ... I think we should get that fstab line back. Henning Am Wed, 7 Aug 2019 09:59:08 +0200 schrieb "[ext] Q. Gylstorff" : > From: Quirin Gylstorff > > During system start it shall be possible to check all available file > systems. As debootstrap has no knowledge of the existing file system > it will not add all fsck.* application necessary to the initramfs. > This patch adds all file system types given by IMAGE_FILESYSTEM_TYPES > to the initramfs. > > File system types in IMAGE_FILESYSTEM_TYPES are separated with spaces. > > Signed-off-by: Quirin Gylstorff > --- > meta/classes/image.bbclass | 1 + > .../files/initramfs.fsck.hook.tmpl | 45 > +++++++++++++++++++ .../initramfs-fsck-hook/files/postinst | > 6 +++ .../initramfs-fsck-hook_0.1.bb | 20 +++++++++ > 4 files changed, 72 insertions(+) > create mode 100644 > meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.tmpl > create mode 100644 > meta/recipes-support/initramfs-fsck-hook/files/postinst create mode > 100644 > meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook_0.1.bb > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index ec6bd39..4d1feac 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -4,6 +4,7 @@ > PF = "${PN}-${DISTRO}-${MACHINE}" > > IMAGE_INSTALL ?= "" > +IMAGE_FILESYSTEM_TYPES ?= "ext4" > IMAGE_TYPE ?= "ext4-img" > IMAGE_ROOTFS ?= "${WORKDIR}/rootfs" > > diff --git > a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.tmpl > b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.tmpl > new file mode 100644 index 0000000..366160a --- /dev/null > +++ > b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.tmpl > @@ -0,0 +1,45 @@ +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2019 > +# > +# SPDX-License-Identifier: MIT > + > +#!/bin/sh > +PREREQ="" > + > +prereqs() > +{ > + echo "$PREREQ" > +} > + > +case $1 in > +prereqs) > + prereqs > + exit 0 > + ;; > +esac > + > +. /usr/share/initramfs-tools/scripts/functions > +. /usr/share/initramfs-tools/hook-functions > + > +if [ ! -x /sbin/fsck ]; then > + echo "Warning: couldn't find /sbin/fsck!" > + exit 0 > +fi > + > +fsck_types="${IMAGE_FILESYSTEM_TYPES}" > + > +copy_exec /sbin/fsck > +copy_exec /sbin/logsave > + > +for type in $fsck_types; do > + if [ "$type" = "unknown" ] ; then > + echo "Warning: couldn't identify filesystem type for > fsck hook, ignoring." > + continue > + fi > + > + if prog="$(command -v fsck.${type})"; then > + copy_exec "$prog" > + else > + echo "Warning: /sbin/fsck.${type} doesn't exist, > can't install to initramfs, ignoring." > + fi > +done > diff --git a/meta/recipes-support/initramfs-fsck-hook/files/postinst > b/meta/recipes-support/initramfs-fsck-hook/files/postinst new file > mode 100644 index 0000000..07bc3d9 > --- /dev/null > +++ b/meta/recipes-support/initramfs-fsck-hook/files/postinst > @@ -0,0 +1,6 @@ > +#!/bin/sh > +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2019 > +# > +# SPDX-License-Identifier: MIT > +update-initramfs -u > diff --git > a/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook_0.1.bb > b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook_0.1.bb > new file mode 100644 index 0000000..e0da551 --- /dev/null > +++ > b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook_0.1.bb > @@ -0,0 +1,20 @@ +# This software is a part of ISAR. > +# Copyright (C) Siemens AG, 2019 > +# > +# SPDX-License-Identifier: MIT > + > + > +DESCRIPTION = "Recipe to add fsck hook to the initramfs" > + > +inherit dpkg-raw > +SRC_URI = "file://postinst \ > + file://initramfs.fsck.hook.tmpl \ > + " > + > +TEMPLATE_VARS += "IMAGE_FILESYSTEM_TYPES" > +TEMPLATE_FILES += "initramfs.fsck.hook.tmpl" > + > +do_install() { > + install -m 0755 -d ${D}/etc/initramfs-tools/hooks > + install -m 0740 ${WORKDIR}/initramfs.fsck.hook > ${D}/etc/initramfs-tools/hooks/fsck.hook +}