From patchwork Tue Aug 15 10:19:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tremer X-Patchwork-Id: 7091 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4RQ6hG3K9wz3wtH for ; Tue, 15 Aug 2023 10:19:42 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) client-signature ECDSA (secp384r1)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RQ6hD0qQmz2WM; Tue, 15 Aug 2023 10:19:40 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4RQ6hD0Jtxz2ypP; Tue, 15 Aug 2023 10:19:40 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4RQ6hB5RKyz2yTq for ; Tue, 15 Aug 2023 10:19:38 +0000 (UTC) Received: from michael.haj.ipfire.org (michael.haj.ipfire.org [172.28.1.242]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "michael.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4RQ6hB1pg1z1t9; Tue, 15 Aug 2023 10:19:38 +0000 (UTC) Received: by michael.haj.ipfire.org (Postfix, from userid 0) id 4RQ6h95CjNzTgn6; Tue, 15 Aug 2023 10:19:37 +0000 (UTC) From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 3/3] core179: Migrate old ExtraHD entries in /etc/fstab Date: Tue, 15 Aug 2023 10:19:36 +0000 Message-Id: <20230815101936.261078-3-michael.tremer@ipfire.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230815101936.261078-1-michael.tremer@ipfire.org> References: <20230815101936.261078-1-michael.tremer@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Tremer Errors-To: development-bounces@lists.ipfire.org Sender: "Development" The rewritten version of ExtraHD no longer stores entries in /etc/fstab which is why they have to be removed during the update. Signed-off-by: Michael Tremer --- config/rootfiles/core/179/update.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/config/rootfiles/core/179/update.sh b/config/rootfiles/core/179/update.sh index bc8fa28cd..110335d13 100644 --- a/config/rootfiles/core/179/update.sh +++ b/config/rootfiles/core/179/update.sh @@ -24,6 +24,24 @@ . /opt/pakfire/lib/functions.sh /usr/local/bin/backupctrl exclude >/dev/null 2>&1 +migrate_extrahd() { + local dev + local fs + local mp + local rest + + while IFS=';' read -r dev fs mp rest; do + # Make sure mountpoint it set (so that we won't delete + # everything in /etc/fstab if there was an empty line). + if [ -z "${mp}" ]; then + continue + fi + + # Remove the mountpoint from /etc/fstab + sed "/[[:blank:]]${mp//\//\\\/}[[:blank:]]/d" -i /etc/fstab + done < /var/ipfire/extrahd/devices +} + core=179 # Remove old core updates from pakfire cache to save space... @@ -61,6 +79,9 @@ ldconfig # Filesytem cleanup /usr/local/bin/filesystem-cleanup +# Migrate ExtraHD +migrate_extrahd + # Start services /etc/init.d/udev restart /etc/init.d/squid restart