From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6722331622445678592 X-Received: by 2002:a2e:1459:: with SMTP id 25mr9182606lju.153.1566479309884; Thu, 22 Aug 2019 06:08:29 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:30b:: with SMTP id t11ls552184lfp.15.gmail; Thu, 22 Aug 2019 06:08:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOSykYi3VgStRnU0pqy/tG6dddFtBdklK6trGjRYQJmygP8LgocpqsVw4u0khxaZPFTgFx X-Received: by 2002:a19:6904:: with SMTP id e4mr6955607lfc.156.1566479309463; Thu, 22 Aug 2019 06:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566479309; cv=none; d=google.com; s=arc-20160816; b=qCAfdtwopaNKpFkfXDuFdO2SgaicfFGLUSLfF6/fu5Nk8SPZdhQNj8LvT1+33somKX Wm3bozNMQeJlEgHkgwV2PFYKQOy8Cn0HgmcgBq6KhdZbn53qyvdHsuK5oAwWQqKsyR6U RMcAv1n8i0BI8nNe6X3vbp6FB/cez2WmNGT/B2WtsbOzdBtMePjgqrbd/otfrRoaydUA +xO62g8FZ8LDgkkIuGGhBeB86lECDcOZQlXiKE5XUbTF+KhWCkIOd1Y4/EVkb7BOcvKy 3JKaKmehaqTSFgqH6/wS8jMajsDyd06AKvVXe3JMb/VlFIHfcv83+y68ZjMS72kwaHal 6Yqg== 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:date:subject:cc:to:from; bh=xwR4HsbPZ98uuwDCAdYaFiJo0iV8iLkK24/YnuReulo=; b=ekNZyBxChmH/307ZouE/HuyqzpWtgXmJAn+ftqwiO46v/LKSnoXdGP7RgoEYs1m/5c k13DZMpZGfICHE6a2vSspMk80As6Lb/hjvr3agv3B6LVDm0CHDkw7x/DmvujSRiUQFaU UKGIQExylijjeIq9WJMI7IZc8hmSsOVJkGuh1Njzzl5R4UDEWvMGDYydHCjsS9AtVVOL 6HpwZ/6JTXeJYX38GvaHvab3VIrCjXB3v1dfccfWUNZLc6H4aR2JAFw62znGBpIY+u7V MBjnwMh8Wiox/Mz54hfsLsuXxIArX7wMWzUQM1H4hjIRky0azhSieaXdnA1lXE9YUgep kmZg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id h11si743320lja.2.2019.08.22.06.08.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2019 06:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of quirin.gylstorff@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=Quirin.Gylstorff@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id x7MD8SED026967 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 Aug 2019 15:08:28 +0200 Received: from debian.ad001.siemens.net ([139.25.68.238]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x7MD8SLw031791; Thu, 22 Aug 2019 15:08:28 +0200 From: "Q. Gylstorff" To: isar-users@googlegroups.com Cc: Quirin Gylstorff Subject: [PATCH v2] recipes-support: add fsck to initramfs Date: Thu, 22 Aug 2019 15:07:13 +0200 Message-Id: <20190822130713.3908-1-Quirin.Gylstorff@siemens.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: TTjX2hE0fdUv 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. Signed-off-by: Quirin Gylstorff --- .../files/initramfs.fsck.ext4.hook | 38 +++++++++++++++++++ .../initramfs-fsck-hook/files/postinst | 6 +++ .../initramfs-fsck-hook-ext4_0.1.bb | 18 +++++++++ 3 files changed, 62 insertions(+) create mode 100644 meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook create mode 100644 meta/recipes-support/initramfs-fsck-hook/files/postinst create mode 100644 meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.1.bb diff --git a/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook new file mode 100644 index 0000000..23f7c28 --- /dev/null +++ b/meta/recipes-support/initramfs-fsck-hook/files/initramfs.fsck.ext4.hook @@ -0,0 +1,38 @@ +# 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="ext4" + +copy_exec /sbin/fsck +copy_exec /sbin/logsave + +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 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-ext4_0.1.bb b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.1.bb new file mode 100644 index 0000000..0be52a3 --- /dev/null +++ b/meta/recipes-support/initramfs-fsck-hook/initramfs-fsck-hook-ext4_0.1.bb @@ -0,0 +1,18 @@ +# 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.ext4.hook \ + " + + +do_install() { + install -m 0755 -d ${D}/etc/initramfs-tools/hooks + install -m 0740 ${WORKDIR}/initramfs.fsck.ext4.hook ${D}/etc/initramfs-tools/hooks/fsck.ext4.hook +} -- 2.20.1