From patchwork Wed Sep 27 15:04:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Fitzenreiter X-Patchwork-Id: 7261 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) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4Rwfyx2Z28z3wl4 for ; Wed, 27 Sep 2023 15:04:25 +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) server-digest SHA384 client-signature ECDSA (secp384r1) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Rwfyt15vZz2WW; Wed, 27 Sep 2023 15:04:22 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Rwfyt045Jz2y3X; Wed, 27 Sep 2023 15:04:22 +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) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Rwfys19vNz2xGN for ; Wed, 27 Sep 2023 15:04:21 +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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4Rwfyr1p59z2S3; Wed, 27 Sep 2023 15:04:20 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1695827060; 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=IXqa8ASVhEdo/R6dBwgm8CItiqAGYp8pnnn8hdVqr1A=; b=l5AuY6GWoB0XuF6Gua1lVknwOomj3NDZgN61tLRyth6iAiKF/s/BeRflkR2vXAwGi5z9+D YUU6yHFK0KVMayCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1695827060; 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=IXqa8ASVhEdo/R6dBwgm8CItiqAGYp8pnnn8hdVqr1A=; b=SPlfSpRNG8Df056FnlB7Lr+1eRknr3pulDsu9d9zd8H54r34UrVqVJsizLTM4Y0RfjSics zet9WnQxeNaw7lguf76EjvMUfWWTw9Z0xHLyDzwzGViGS8jh+em9v/LJ/BwB2La5wkC9kY Bj6FVGVaQcnUo9Aw0nnxsouiOI5QAFWaU3qeR1GjcsFoobPIMJnDam1qV6Jcok1UN1Q88g g2ZiyJvAyOffu31I59FoZnaJ0tEliC21RjDpc4UKSar0ZY7FtghZvoCjyUX7BDZr1UQber vIS9zJs76qeHxyqneS0hKkkomjmdszRvWWbArqYtvSAxlNmbDeAcMrTgLBB1cA== From: Arne Fitzenreiter To: development@lists.ipfire.org Subject: [PATCH] extrahd: add forgotten udev_event handler to mount partitions via udev Date: Wed, 27 Sep 2023 17:04:08 +0200 Message-Id: <20230927150408.3190-1-arne_f@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: Arne Fitzenreiter Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Signed-off-by: Arne Fitzenreiter --- config/extrahd/extrahd.pl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/config/extrahd/extrahd.pl b/config/extrahd/extrahd.pl index cc85228d5..bcde077d0 100644 --- a/config/extrahd/extrahd.pl +++ b/config/extrahd/extrahd.pl @@ -116,7 +116,21 @@ extrahd_umount() { done < /var/ipfire/extrahd/devices } +handle_udev_event() { + case "${ACTION}" in + add) + if [ -n "${ID_FS_UUID}" ]; then + extrahd_mount "UUID=${ID_FS_UUID}" || return $? + fi + ;; + esac + + return 0 +} + main() { + ( echo "$@"; set ) > /tmp/extrahd.$$ + local command="${1}" shift @@ -129,6 +143,9 @@ main() { umount) extrahd_umount "${@}" || rc="${rc}" ;; + udev-event) + handle_udev_event "${@}" || rc="${rc}" + ;; scanhd) exec /usr/local/bin/scanhd "${@}" ;;