[PATCH] services: dnsmasq: Add TFTP configuration.

  • Done
  • quality assurance status badge
Details
2 participants
  • Danny Milosavljevic
  • Jonathan Brielmaier
Owner
unassigned
Submitted by
Danny Milosavljevic
Severity
normal

Debbugs page

Danny Milosavljevic wrote 4 years ago
(address . guix-patches@gnu.org)(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
20200927190630.1753-1-dannym@scratchpost.org
* gnu/services/dns.scm (<dnsmasq-configuration>): Add TFTP configuration
fields.
(dnsmasq-shepherd-service): Use them.
---
gnu/services/dns.scm | 70 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 67 insertions(+), 3 deletions(-)

Toggle diff (94 lines)
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index 9caa3611be..572880561c 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -757,7 +757,29 @@ cache.size = 100 * MB
(cache-size dnsmasq-configuration-cache-size
(default 150)) ;integer
(negative-cache? dnsmasq-configuration-negative-cache?
- (default #t))) ;boolean
+ (default #t)) ;boolean
+ (tftp-enable? dnsmasq-configuration-tftp-enable?
+ (default #f)) ;boolean
+ (tftp-no-fail? dnsmasq-configuration-tftp-no-fail?
+ (default #f)) ;boolean
+ (tftp-single-port? dnsmasq-configuration-tftp-single-port?
+ (default #f)) ;boolean
+ (tftp-secure? dnsmasq-tftp-secure?
+ (default #f)) ;boolean
+ (tftp-max dnsmasq-tftp-max
+ (default #f)) ;integer
+ (tftp-mtu dnsmasq-tftp-mtu
+ (default #f)) ;integer
+ (tftp-no-blocksize? dnsmasq-tftp-no-blocksize?
+ (default #f)) ;boolean
+ (tftp-lowercase? dnsmasq-tftp-lowercase?
+ (default #f)) ;boolean
+ (tftp-port-range dnsmasq-tftp-port-range
+ (default #f)) ;string
+ (tftp-root dnsmasq-tftp-root
+ (default "/var/empty,lo")) ;string
+ (tftp-unique-root dnsmasq-tftp-unique-root
+ (default #f))) ;"" or "ip" or "mac"
(define dnsmasq-shepherd-service
(match-lambda
@@ -765,7 +787,12 @@ cache.size = 100 * MB
no-hosts?
port local-service? listen-addresses
resolv-file no-resolv? servers
- addresses cache-size negative-cache?)
+ addresses cache-size negative-cache?
+ tftp-enable? tftp-no-fail?
+ tftp-single-port? tftp-secure?
+ tftp-max tftp-mtu tftp-no-blocksize?
+ tftp-lowercase? tftp-port-range
+ tftp-root tftp-unique-root)
(shepherd-service
(provision '(dnsmasq))
(requirement '(networking))
@@ -794,7 +821,44 @@ cache.size = 100 * MB
#$(format #f "--cache-size=~a" cache-size)
#$@(if negative-cache?
'()
- '("--no-negcache")))
+ '("--no-negcache"))
+ #$@(if tftp-enable?
+ '("--enable-tftp")
+ '())
+ #$@(if tftp-no-fail?
+ '("--tftp-no-fail")
+ '())
+ #$@(if tftp-single-port?
+ '("--tftp-single-port")
+ '())
+ #$@(if tftp-secure?
+ '("--tftp-secure?")
+ '())
+ #$@(if tftp-max
+ (list (format #f "--tftp-max=~a" tftp-max))
+ '())
+ #$@(if tftp-mtu
+ (list (format #f "--tftp-mtu=~a" tftp-mtu))
+ '())
+ #$@(if tftp-no-blocksize?
+ '("--tftp-no-blocksize")
+ '())
+ #$@(if tftp-lowercase?
+ '("--tftp-lowercase")
+ '())
+ #$@(if tftp-port-range
+ (list (format #f "--tftp-port-range=~a"
+ tftp-port-range))
+ '())
+ #$@(if tftp-root
+ (list (format #f "--tftp-root=~a" tftp-root))
+ '())
+ #$@(if tftp-unique-root
+ (list
+ (if (> (length tftp-unique-root) 0)
+ (format #f "--tftp-unique-root=~a" tftp-unique-root)
+ (format #f "--tftp-unique-root")))
+ '()))
#:pid-file "/run/dnsmasq.pid"))
(stop #~(make-kill-destructor))))))
Jonathan Brielmaier wrote 4 years ago
e12c0383-2d4d-efce-41a8-f36b13b89517@web.de
On 27.09.20 21:06, Danny Milosavljevic wrote:
Toggle quote (7 lines)
> * gnu/services/dns.scm (<dnsmasq-configuration>): Add TFTP configuration
> fields.
> (dnsmasq-shepherd-service): Use them.
> ---
> gnu/services/dns.scm | 70 ++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 67 insertions(+), 3 deletions(-)

I think some documentation couldn't hurt, so that user can have a chance
to learn about the TFTP possiblilities of our dnsmasq service :)
Danny Milosavljevic wrote 4 years ago
(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)(address . 43653-done@debbugs.gnu.org)
20201006081526.3de1028d@scratchpost.org
Hi,

On Sun, 27 Sep 2020 21:26:32 +0200
Jonathan Brielmaier <jonathan.brielmaier@web.de> wrote:

Toggle quote (11 lines)
> On 27.09.20 21:06, Danny Milosavljevic wrote:
> > * gnu/services/dns.scm (<dnsmasq-configuration>): Add TFTP configuration
> > fields.
> > (dnsmasq-shepherd-service): Use them.
> > ---
> > gnu/services/dns.scm | 70 ++++++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 67 insertions(+), 3 deletions(-)
>
> I think some documentation couldn't hurt, so that user can have a chance
> to learn about the TFTP possiblilities of our dnsmasq service :)

Added docs and pushed to guix master as commit 34d1c0a03b51fdaef26a3bc630ab096da740e1d6.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl98C34ACgkQ5xo1VCww
uqX5gAf+NwQW9GeqzWY3UU7kW0oGwq2aClQv6BBYDAziQ18q8iZiEKtvy8EUEuM2
tN+Df1lZBjEU/AeAW06PT1VVrcWBJqeY5FaVyCzR4ODRpuKCpPkNKm0Y6yRLDs95
02RldM+G9SzhGTdTBn+EWSn2vwbGVtcdTjuA2pO403tE4aTmgZvvTOBrE0w9Eaqu
zLcq63IIdFq1Fl7b2G8qc52Wur+ztdOtuBCdX7tY90XDrKT9yGuGLpA3+GVX/Oqs
oVBQxePZxl4qMO0e/FVC7tdQEphFhPfYTZNMf5MD52uzf4gr4gZEif0oRb1gfloS
QoHlXSildaIRKRQBJS8gak67Hze5lw==
=XT/W
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 43653@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 43653
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help