From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4ZWTfk6rrvz3368 for ; Mon, 7 Apr 2025 12:53:50 +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 (secp384r1) client-signature RSA-PSS (4096 bits)) (Client CN "mail01.haj.ipfire.org", Issuer "R10" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4ZWTfg2rCkz32KR for ; Mon, 7 Apr 2025 12:53:47 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4ZWTfd6pbBzHP; Mon, 7 Apr 2025 12:53:45 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1744030426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s2oRRZIs3obExSgMi5BQ2SKs7i5w+XNqcQb0UkXLPFI=; b=SjkSE4HFbLMUlKAojtCmK5M7Tqz37o4d7Ks8HHSH23S6+vvRWVv0f9tMEpVKmwQPXC6SdG 9oUDzf8L2ltywmDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1744030426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=s2oRRZIs3obExSgMi5BQ2SKs7i5w+XNqcQb0UkXLPFI=; b=VhRs9ZqWF7IxKGI2NG0IxewUUUrsNKFU3o0wcdWq23kqCKZ0evdkPeMdVbTqzX7c9yNRFm FmjkE083aUTLBnVUTuyntEA6i+CSz7Lv2d9BzHESGlYBLBV4ILPdX5istZ3ktNOqMkxpHp PLEH5HGlAnEPCk++LxI2yJf2Khks4yIg6aHjP+/cLyu/KVD0K3thERh5f0659+kKNZHYoQ wO8N3vvZdgLhCPkSZvGGbVSXJH3JzQxnz2jD9TF1/WCKuAfEADSE/mRtdjMxXZdZoTxII4 emIMXgFnYDsV5VNZVycZX+Zl6mI9bm0havcFVz/VjKsoij5esNPiXuq3lH5ZUg== From: Adolf Belka To: development@lists.ipfire.org Cc: Adolf Belka Subject: [PATCH 1/2] smartmontools: Add update of drive database Date: Mon, 7 Apr 2025 14:53:40 +0200 Message-ID: <20250407125341.3240782-1-adolf.belka@ipfire.org> Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit - Existing install uses database provide with source tarball. The database is also updated on a periodic basis which can vary between a few weeks up to 6 months or so. - The last release was back in Aug 2023 so the database all users will have is quite old. - This patch adds a script into the monthly fcron directory that will run the update-smart-drivedb script from the smartmontools installation. This script downloads the database file via https and also checks the signature of the file to ensure that it has not been changed in any way. The script is run with the -q (quiet) option. The script checks if the downloaded database is corrupted ands will not install it if it is corrupted. It checks if the database has changed since the last version installed on the system. If not changed it does not replace the file. - Tested this out with my production IPFire system and I ended up with the latest database from 3 weeks ago. Signed-off-by: Adolf Belka --- config/rootfiles/common/smartmontools | 1 + config/smartmontools/fcron.monthly | 5 +++++ lfs/smartmontools | 7 ++++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 config/smartmontools/fcron.monthly diff --git a/config/rootfiles/common/smartmontools b/config/rootfiles/common/smartmontools index 6b3f923b1..0f72814f4 100644 --- a/config/rootfiles/common/smartmontools +++ b/config/rootfiles/common/smartmontools @@ -30,3 +30,4 @@ usr/sbin/update-smart-drivedb #usr/share/man/man8/update-smart-drivedb.8 #usr/share/smartmontools usr/share/smartmontools/drivedb.h +etc/fcron.monthly/smart-drivedb diff --git a/config/smartmontools/fcron.monthly b/config/smartmontools/fcron.monthly new file mode 100644 index 000000000..6561cd081 --- /dev/null +++ b/config/smartmontools/fcron.monthly @@ -0,0 +1,5 @@ +#!/bin/bash + +/usr/sbin/update-smart-drivedb -q + +exit 0 diff --git a/lfs/smartmontools b/lfs/smartmontools index 3e81181fc..61a5ea881 100644 --- a/lfs/smartmontools +++ b/lfs/smartmontools @@ -1,7 +1,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2023 IPFire Team # +# Copyright (C) 2007-2025 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -74,5 +74,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && ./configure --prefix=/usr cd $(DIR_APP) && make BUILD_INFO='"($(NAME) $(VERSION))"' $(MAKETUNING) cd $(DIR_APP) && make install + + # Install cron job. + install -m 754 -v $(DIR_CONF)/smartmontools/fcron.monthly \ + /etc/fcron.monthly/smart-drivedb + @rm -rf $(DIR_APP) @$(POSTBUILD) -- 2.49.0