From patchwork Fri Jul 12 10:38:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "B. Wilson" X-Patchwork-Id: 29220 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 02DA027BBE9; Fri, 12 Jul 2024 11:40:23 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 65F4227BBE2 for ; Fri, 12 Jul 2024 11:40:20 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSDh6-0000ub-3d; Fri, 12 Jul 2024 06:40:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSDh4-0000uE-GB for guix-patches@gnu.org; Fri, 12 Jul 2024 06:40:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSDh4-00060m-6z for guix-patches@gnu.org; Fri, 12 Jul 2024 06:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSDh4-00026Z-5Z for guix-patches@gnu.org; Fri, 12 Jul 2024 06:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72072] gnu: isc-dhcp: Patch dhclient to support resolvconf. References: <2PLKK1GND1Y65.3DPU3DJOTRHJH@wilsonb.com> In-Reply-To: <2PLKK1GND1Y65.3DPU3DJOTRHJH@wilsonb.com> Resent-From: "B. Wilson" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Jul 2024 10:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 72072@debbugs.gnu.org Received: via spool by 72072-submit@debbugs.gnu.org id=B72072.17207807528018 (code B ref 72072); Fri, 12 Jul 2024 10:40:02 +0000 Received: (at 72072) by debbugs.gnu.org; 12 Jul 2024 10:39:12 +0000 Received: from localhost ([127.0.0.1]:53293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSDgF-00025F-Uv for submit@debbugs.gnu.org; Fri, 12 Jul 2024 06:39:12 -0400 Received: from m42-5.mailgun.net ([69.72.42.5]:35899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSDg9-00024g-Vk for 72072@debbugs.gnu.org; Fri, 12 Jul 2024 06:39:10 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.wilsonb.com; q=dns/txt; s=krs; t=1720780740; x=1720787940; h=Content-Type: MIME-Version: From: From: Subject: Subject: To: To: Date: Message-ID: Sender: Sender; bh=5QVawNSk39Aj3B6Z2Shi3AeyW8E4LmJurDzDbPD//ho=; b=CbmlrMMqz6qdUd+0hffWw61sgZQ7TwerPmYMDqxQ/Pjk2N74TYRq/aPJgtlHK9PFwm9DY0g2gdhXDhUGjGYNspIaXQxG2cOm73rsBi/PnLbUA1dLAus1aGOKLhrRrm2/055Wn7SS204tyN1YjSmM9smidr9erThYEwIBc/HqwhXPu/gTSgbX16sCvr6O2LKSMWGs5PxBkVFEQy/3kPTEEK5e39JeTGd/HW7eMtz7kmqEhkK9YBlgdRrjXHv64DG7hlWavs0EmySnJlLamNe0mAHQduQS48oBB+QGpwmMQgnuvu/Eg2BGp1NZWUm+kRrT2r/TB4jkki8b2LauhvRXWw== X-Mailgun-Sending-Ip: 69.72.42.5 X-Mailgun-Sid: WyI1OTNiOCIsIjcyMDcyQGRlYmJ1Z3MuZ251Lm9yZyIsIjA4NTQ3YSJd Received: from wilsonb.com (wilsonb.com [104.199.203.42]) by 45eea559954c with SMTP id 669107c37fe86a720c259a09 (version=TLS1.3, cipher=TLS_AES_128_GCM_SHA256); Fri, 12 Jul 2024 10:38:59 GMT Received: from localhost (p1267142-ipngn3402fukuhanazo.fukushima.ocn.ne.jp [125.174.241.142]) by wilsonb.com (Postfix) with ESMTPSA id 1E953A1BC3 for <72072@debbugs.gnu.org>; Fri, 12 Jul 2024 10:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wilsonb.com; s=201703; t=1720780737; bh=5QVawNSk39Aj3B6Z2Shi3AeyW8E4LmJurDzDbPD//ho=; h=Date:To:Subject:From:From; b=YqRKS+6Aqmr52yUphOnIpi2/zRCxiDT4AN72h+5L+Nx3rlhExSqfrmRFu8/v4gmnl MlSZ9IDFO46DZAJwfC5XzlrWKU5pe5o4vMRm39Xn9fSbVL0NDHBplmLM+TUJou1aUl OStjOVESViZoBxTmRH+zhsGf0MPmoBDc8CVMiZJM0DtjX+HYQBdtSTyzCW1LiAcg70 aEgTLw1XKcpqW2wPTzYnByxutT24n4z6tV19lTOjGG4e9/nBpWIC948cG9ujFfZegM CJRV+ph6ZHEhPTFnp9ObHSw5WsCzhkLXiyc7B5TZDRAPmwJcvsof4EqJaaGBWf6Noa yMg0Uz1ZbJAeMhh3U1+qpelRaQ2E9lzNTkvSUmehieRdEqakH/a8JujV4fM1Oj/U8G 96r2lczVRU6j0y9V5N1Wp3vocKIqf425BrzS0aMNfh8lChWKQC6VvuhvT9EgzAkFob KKbR+itUc3I9BIbVV4v51tWax0f8pKixGJ5aiHdOkxaL0q+rMOd4J6EfGTufmLD+W1 C7etYWEd7atit8UmBPi1wJE1830KyRcenA8CKxVdcBDex7mzjyhC6k1ynLmpj2f3la rzAitmja4IciToEysgHci6d+wIMS2CHom+klWQspMF4gYqdQXGXk8vnHzozDd05ksd iyq0osbLIjR8kCJcsW/AXVcs= Message-ID: <0085c46d51165168bc28ae8c10affab7@wilsonb.com> Date: Fri, 12 Jul 2024 19:38:55 +0900 User-Agent: mblaze/1.2 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: "B. Wilson" X-ACL-Warn: , "B. Wilson via Guix-patches" X-Patchwork-Original-From: "B. Wilson via Guix-patches" via From: "B. Wilson" Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches The attachment in the original message seems to have the incorrect mime type. Trying again. From c96e6489117b2087db86161cc2b3fe0e813ac09f Mon Sep 17 00:00:00 2001 From: "B. Wilson" Date: Fri, 12 Jul 2024 18:03:48 +0900 Subject: [PATCH] gnu: isc-dhcp: Patch dhclient to support resolvconf. * gnu/packages/patches/dhclient-script-resolvconf-support.patch: New patch. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/admin.scm (isc-dhcp): Patch dhclient-script and update wrapper. --- gnu/local.mk | 1 + gnu/packages/admin.scm | 21 ++++--- .../dhclient-script-resolvconf-support.patch | 58 +++++++++++++++++++ 3 files changed, 72 insertions(+), 8 deletions(-) create mode 100644 gnu/packages/patches/dhclient-script-resolvconf-support.patch diff --git a/gnu/local.mk b/gnu/local.mk index ea4cc251ae..e574154ef3 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1116,6 +1116,7 @@ dist_patch_DATA = \ %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \ %D%/packages/patches/dee-vapi.patch \ %D%/packages/patches/dfu-programmer-fix-libusb.patch \ + %D%/packages/patches/dhclient-script-resolvconf-support.patch \ %D%/packages/patches/diffutils-fix-signal-processing.patch \ %D%/packages/patches/directfb-davinci-glibc-228-compat.patch \ %D%/packages/patches/dkimproxy-add-ipv6-support.patch \ diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index f0aa6adc85..509dfaba20 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -1477,7 +1477,9 @@ (define-public isc-dhcp version "/dhcp-" version ".tar.gz")) (sha256 (base32 - "1ivkvhhvqxap6c51cli7pa6xn76ngxri1zbl45ishz4ranxidi0a")))) + "1ivkvhhvqxap6c51cli7pa6xn76ngxri1zbl45ishz4ranxidi0a")) + (patches (search-patches + "dhclient-script-resolvconf-support.patch")))) (build-system gnu-build-system) (arguments `(#:parallel-build? #f @@ -1571,12 +1573,13 @@ (define-public isc-dhcp (lambda* (#:key inputs outputs #:allow-other-keys) ;; Install the dhclient script for GNU/Linux and make sure ;; if finds all the programs it needs. - (let* ((out (assoc-ref outputs "out")) - (libexec (string-append out "/libexec")) - (coreutils (assoc-ref inputs "coreutils*")) - (inetutils (assoc-ref inputs "inetutils")) - (grep (assoc-ref inputs "grep*")) - (sed (assoc-ref inputs "sed*")) + (let* ((out (assoc-ref outputs "out")) + (libexec (string-append out "/libexec")) + (coreutils (assoc-ref inputs "coreutils*")) + (inetutils (assoc-ref inputs "inetutils")) + (grep (assoc-ref inputs "grep*")) + (resolvconf (assoc-ref inputs "resolvconf*")) + (sed (assoc-ref inputs "sed*")) (debianutils (assoc-ref inputs "debianutils"))) (substitute* "client/scripts/linux" (("/sbin/ip") @@ -1592,7 +1595,8 @@ (define-public isc-dhcp ,(map (lambda (dir) (string-append dir "/bin:" dir "/sbin")) - (list inetutils coreutils grep sed debianutils)))))))))) + (list inetutils coreutils grep sed resolvconf + debianutils)))))))))) (native-inputs (list config perl file)) @@ -1621,6 +1625,7 @@ (define-public isc-dhcp ("coreutils*" ,coreutils) ("grep*" ,grep) + ("resolvconf*" ,openresolv) ("sed*" ,sed))) (home-page "https://www.isc.org/dhcp/") diff --git a/gnu/packages/patches/dhclient-script-resolvconf-support.patch b/gnu/packages/patches/dhclient-script-resolvconf-support.patch new file mode 100644 index 0000000000..e4fd8f649e --- /dev/null +++ b/gnu/packages/patches/dhclient-script-resolvconf-support.patch @@ -0,0 +1,58 @@ +Implement resolvconf support + +Due to the potential for multiple sources contenting for /etc/resol.conf +control, this patch replaces direct file munging with resolvconf indirection. + +--- a/client/scripts/linux 1970-01-01 09:00:01.000000000 +0900 ++++ b/client/scripts/linux 1970-01-01 09:00:01.000000000 +0900 +@@ -36,11 +36,11 @@ + # This updated version mostly follows Debian script by Andrew Pollock et al. + make_resolv_conf() { + local new_resolv_conf ++ new_resolv_conf=$(mktemp) + + # DHCPv4 + if [ -n "$new_domain_search" ] || [ -n "$new_domain_name" ] || +- [ -n "$new_domain_name_servers" ]; then +- new_resolv_conf=/etc/resolv.conf.dhclient-new ++ [ -n "$new_domain_name_servers" ]; then + rm -f $new_resolv_conf + + if [ -n "$new_domain_name" ]; then +@@ -70,17 +70,12 @@ + echo nameserver $nameserver >>$new_resolv_conf + done + else # keep 'old' nameservers +- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf ++ resolvconf -l "$interface.dhcp" | sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p >>$new_resolv_conf + fi + +- if [ -f /etc/resolv.conf ]; then +- chown --reference=/etc/resolv.conf $new_resolv_conf +- chmod --reference=/etc/resolv.conf $new_resolv_conf +- fi +- mv -f $new_resolv_conf /etc/resolv.conf ++ resolvconf -a "$interface.dhpc" <"$new_resolv_conf" + # DHCPv6 + elif [ -n "$new_dhcp6_domain_search" ] || [ -n "$new_dhcp6_name_servers" ]; then +- new_resolv_conf=/etc/resolv.conf.dhclient-new + rm -f $new_resolv_conf + + if [ -n "$new_dhcp6_domain_search" ]; then +@@ -97,14 +92,10 @@ + echo nameserver $nameserver >>$new_resolv_conf + done + else # keep 'old' nameservers +- sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p /etc/resolv.conf >>$new_resolv_conf ++ resolvconf -l "$interface.dhcp6" | sed -n /^\w*[Nn][Aa][Mm][Ee][Ss][Ee][Rr][Vv][Ee][Rr]/p >>$new_resolv_conf + fi + +- if [ -f /etc/resolv.conf ]; then +- chown --reference=/etc/resolv.conf $new_resolv_conf +- chmod --reference=/etc/resolv.conf $new_resolv_conf +- fi +- mv -f $new_resolv_conf /etc/resolv.conf ++ resolvconf -a "$interface.dhpc6" <"$new_resolv_conf" + fi + } + -- 2.45.2