From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6722331622445678592 X-Received: by 2002:adf:e8c2:: with SMTP id k2mr46237879wrn.198.1565710317877; Tue, 13 Aug 2019 08:31:57 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:c645:: with SMTP id u5ls3787423wrg.11.gmail; Tue, 13 Aug 2019 08:31:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSYcmwQfN1E1rrxMt9sCHJ2xazOG3eUWqo5KIETWLwxUK12ymed7AAVGz2miDA6tUNxdKM X-Received: by 2002:adf:ea08:: with SMTP id q8mr32161525wrm.188.1565710317402; Tue, 13 Aug 2019 08:31:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565710317; cv=none; d=google.com; s=arc-20160816; b=oUAPvgtG2rBo3OI9PVF4d7V4V9nCTttw1OtFIPnuZd+mayJteQ0VbuLJqZyL2MWTz6 0pzDdbEnxMdeBwBqeQFPeS5U8dEZl2kA2ilcuudoar5v4Nac1u34WUbdRJwqO1wjGA6Z n3lp5PV5NoizN0/sywS+8nIzruiuD5uOZuMCA5tuz1ozlJqruKNK2I1ow8erfvVOOAbi zIjSx/Hl6RmVBwsx5uDmcplPn7ULfYq5LSFdn44k5QWUEXEAHFYBf0ZxB1og0C0lNdFU Vdx3iVLpycshXooTeXtSJoY1wSYZ+TkD31wtSE0tetDt47Hm3/QlyOHGlG95HlRcZnte TsHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:mime-version:user-agent:date:message-id:organization :openpgp:from:references:cc:to:subject; bh=vP6CSr0Q+PTx1nSq4qFxHeuuwMSqxIKXaBAS8CELWjU=; b=w6W8xQz2IQ6sqbbbouaFacJ0uATlNIPU3o3MEZ0+jU+yen0sItz1FMFKUi9SeHCLON pPsNundCwpKRh1mKtKdcn9/aFdMCJVQ+kOf3oKa/tg81EGoLYX7n76/WZGopKITIEZrX iXrDQLuWNHo1P0paYF43Ha73cSzVPeFsO5ZuuuvxaRtBeQfDPk5TsJwZx6rOjFgMnrZ8 JQZ7phL515HVrHEnSxO3XXyxDIHveNEoo3d9VN3TfGnL3XZiLXRr1//RfSnpd/j89cEV MEi1A/5zUsTcgEhRcgS4VBhDlC9gX8fEwIg9vOYY0v+evYrttGNn7tXZ7SdufHFckUkz BRxg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of ch@denx.de) smtp.mailfrom=ch@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id g7si129340wmk.0.2019.08.13.08.31.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Aug 2019 08:31:57 -0700 (PDT) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of ch@denx.de) client-ip=212.18.0.9; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of ch@denx.de) smtp.mailfrom=ch@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 467Gsn1XwBz1rMqd; Tue, 13 Aug 2019 17:31:57 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 467Gsn1FLDz1qqkG; Tue, 13 Aug 2019 17:31:57 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id RNHIcVZ46QJt; Tue, 13 Aug 2019 17:31:55 +0200 (CEST) X-Auth-Info: r2oPSPSQhpuvIoF1bZQ7ZPvq9uIowojLL7bGU8dv3JA= Received: from [10.70.148.157] (unknown [165.225.72.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Tue, 13 Aug 2019 17:31:55 +0200 (CEST) Subject: Re: [PATCH] recipes-support: add fsck to initramfs To: Henning Schild , "[ext] Q. Gylstorff" Cc: isar-users@googlegroups.com, "[ext] Claudius Heine" References: <20190807075908.17902-1-Quirin.Gylstorff@siemens.com> <20190813163615.0edcfa7c@md1za8fc.ad001.siemens.net> From: Claudius Heine Openpgp: preference=signencrypt Organization: Denx Software Engineering Message-ID: Date: Tue, 13 Aug 2019 17:31:42 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190813163615.0edcfa7c@md1za8fc.ad001.siemens.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="xacRZB52wMcd7dYHh4ar6Hg9XdOYdJVM5" X-TUID: jE8uwhxpoPdE This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xacRZB52wMcd7dYHh4ar6Hg9XdOYdJVM5 Content-Type: multipart/mixed; boundary="Q22N28q2btyFnFcCgxvdHWRK8Mqk7u7u9"; protected-headers="v1" From: Claudius Heine To: Henning Schild , "[ext] Q. Gylstorff" Cc: isar-users@googlegroups.com, "[ext] Claudius Heine" Message-ID: Subject: Re: [PATCH] recipes-support: add fsck to initramfs References: <20190807075908.17902-1-Quirin.Gylstorff@siemens.com> <20190813163615.0edcfa7c@md1za8fc.ad001.siemens.net> In-Reply-To: <20190813163615.0edcfa7c@md1za8fc.ad001.siemens.net> --Q22N28q2btyFnFcCgxvdHWRK8Mqk7u7u9 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Henning On 13/08/2019 16.36, Henning Schild wrote: > 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. >=20 > 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. No, i have not touched the /etc/fstab generation code. That code goes all the way back, when multistrap was used and the fstab was generated in the config scripts. I thought about refactoring that and put the idea out, but I never did. regards, Claudius >=20 > 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 ... >=20 > I think we should get that fstab line back. >=20 > Henning >=20 > Am Wed, 7 Aug 2019 09:59:08 +0200 > schrieb "[ext] Q. Gylstorff" : >=20 >> 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.tmp= l >> 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 =3D "${PN}-${DISTRO}-${MACHINE}" >> =20 >> IMAGE_INSTALL ?=3D "" >> +IMAGE_FILESYSTEM_TYPES ?=3D "ext4" >> IMAGE_TYPE ?=3D "ext4-img" >> IMAGE_ROOTFS ?=3D "${WORKDIR}/rootfs" >> =20 >> diff --git >> a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.t= mpl >> b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.t= mpl >> new file mode 100644 index 0000000..366160a --- /dev/null >> +++ >> b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.hook.t= mpl >> @@ -0,0 +1,45 @@ +# This software is a part of ISAR. >> +# Copyright (C) Siemens AG, 2019 >> +# >> +# SPDX-License-Identifier: MIT >> + >> +#!/bin/sh >> +PREREQ=3D"" >> + >> +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=3D"${IMAGE_FILESYSTEM_TYPES}" >> + >> +copy_exec /sbin/fsck >> +copy_exec /sbin/logsave >> + >> +for type in $fsck_types; do >> + if [ "$type" =3D "unknown" ] ; then >> + echo "Warning: couldn't identify filesystem type for >> fsck hook, ignoring." >> + continue >> + fi >> + >> + if prog=3D"$(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 =3D "Recipe to add fsck hook to the initramfs" >> + >> +inherit dpkg-raw >> +SRC_URI =3D "file://postinst \ >> + file://initramfs.fsck.hook.tmpl \ >> + " >> + >> +TEMPLATE_VARS +=3D "IMAGE_FILESYSTEM_TYPES" >> +TEMPLATE_FILES +=3D "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 +} >=20 --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de PGP key: 6FF2 E59F 00C6 BC28 31D8 64C1 1173 CB19 9808 B153 Keyserver: hkp://pool.sks-keyservers.net --Q22N28q2btyFnFcCgxvdHWRK8Mqk7u7u9-- --xacRZB52wMcd7dYHh4ar6Hg9XdOYdJVM5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQI/BAEBCgApFiEEb/LlnwDGvCgx2GTBEXPLGZgIsVMFAl1S198LHGNoQGRlbngu ZGUACgkQEXPLGZgIsVN9CA//YW3tfCLWjaKlqYjFsD5w/zNlz6H3+uI6q5n8WhPT 4fqQvaIIoGRxeUvB+t4MLeczkvuRRp7hmPIZyjYwDQTFq83EiLAcFFutMO1GhqT1 uLOz1iNuSNWdckJFkH/rS933KqchKnXv6h518IXdAafiKuubrH5jun2vkb6EgTvG X7Zw3pWO49UajT98z4ah/oN1Yg4NC8+kd2LtBGMmSciMfnOuRVTaTb5iq+I4lMBc JxZ1I/Z9PtB6juKGWCkqe7U+iI6kfR1lGXyyOwA93/PoNaOUF9apwG+Rf+TJc9BU qTivos4EpIzaCQdFgI18eM2UDamOk80oDXpBZsJRl9QAk3vGepyZP7z5gBXKTi35 I3S8BzTPwjPJN2eIGD/Omn4j5GAHCzHZesCJUs3JdV/o4e0/PcHYSL9kJzY3ARWT dnlc7cD0l1p+a1YO7JDWW4l9mtzYFwqxzlH2QpPw2UADZWo1+KgL+cvMzWCU8vX4 RZDBlg2VTIENYcteKGp0BlWLIzh/w1uhgXiyTDOHQXkM1uFCBfss2v0yCj4wrlCj 0w/httA0xEWnf7CGbJEUk5HQ/ENjQ3cTGrJEDXCuOnHzoYzEVZILFaCQc8jP5NDo kryYxHNsifhxH/8P0j/+be6Sph4MdRhknkWKV5QsnwVmEQCuXYvFQlYn01x7D4pK AVM= =EAsy -----END PGP SIGNATURE----- --xacRZB52wMcd7dYHh4ar6Hg9XdOYdJVM5--