Initial Commit
- initial default booting image
This commit is contained in:
48
package/mdnsd/Config.in
Normal file
48
package/mdnsd/Config.in
Normal file
@@ -0,0 +1,48 @@
|
||||
config BR2_PACKAGE_MDNSD
|
||||
bool "mdnsd"
|
||||
depends on BR2_USE_MMU # fork()
|
||||
help
|
||||
Small mDNS-SD daemon for advertising services and device
|
||||
discovery, similar to Avahi and Bonjour, at fraction of
|
||||
the size, ~90 kB.
|
||||
|
||||
By default, mdnsd acts as a responder on all interfaces
|
||||
that support multicast. It works with both IPv4 & IPv6,
|
||||
advertising services from /etc/mdns.d/*.service (common
|
||||
services included below). To override defaults, e.g.,
|
||||
path to services, TTL of multicast frames, hostname, or
|
||||
default interface, set MDNSD_ARGS in /etc/default/mdnsd
|
||||
|
||||
https://github.com/troglobit/mdnsd
|
||||
|
||||
if BR2_PACKAGE_MDNSD
|
||||
|
||||
config BR2_PACKAGE_MDNSD_MQUERY
|
||||
bool "mquery"
|
||||
help
|
||||
Scan a LAN for mDNS capable devices, or query specific
|
||||
records, similar to the mdns-scan and avahi-browse tools.
|
||||
Useful for verifying multicast connectivity or locating
|
||||
neighbors with link-local address.
|
||||
|
||||
comment "Services to advertise"
|
||||
|
||||
config BR2_PACKAGE_MDNSD_FTP_SERVICE
|
||||
bool "FTP service"
|
||||
|
||||
config BR2_PACKAGE_MDNSD_HTTP_SERVICE
|
||||
bool "HTTP service"
|
||||
|
||||
config BR2_PACKAGE_MDNSD_IPP_SERVICE
|
||||
bool "IPP service"
|
||||
|
||||
config BR2_PACKAGE_MDNSD_PRINTER_SERVICE
|
||||
bool "Printer service"
|
||||
|
||||
config BR2_PACKAGE_MDNSD_SSH_SERVICE
|
||||
bool "SSH service"
|
||||
default y if BR2_PACKAGE_DROPBEAR
|
||||
default y if BR2_PACKAGE_OPENSSH
|
||||
default y if BR2_PACKAGE_LIBSSH_SERVER
|
||||
|
||||
endif
|
||||
73
package/mdnsd/S50mdnsd
Normal file
73
package/mdnsd/S50mdnsd
Normal file
@@ -0,0 +1,73 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON=mdnsd
|
||||
MDNSD=/usr/sbin/$DAEMON
|
||||
PIDFILE=/var/run/$DAEMON.pid
|
||||
CFGFILE=/etc/default/$DAEMON
|
||||
|
||||
MDNSD_ARGS=""
|
||||
|
||||
# Read configuration variable file if it is present
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "$CFGFILE" ] && . "$CFGFILE"
|
||||
|
||||
start() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
# shellcheck disable=SC2086 # we need word splitting
|
||||
start-stop-daemon --start --pidfile "$PIDFILE" \
|
||||
--exec "$MDNSD" -- $MDNSD_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping %s: " "$DAEMON"
|
||||
start-stop-daemon --stop --pidfile "$PIDFILE" \
|
||||
--exec "$MDNSD"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
return "$status"
|
||||
fi
|
||||
# mdnsd deletes its PID file on exit, wait for it to be gone
|
||||
while [ -f "$PIDFILE" ]; do
|
||||
sleep 0.1
|
||||
done
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
# SIGHUP reloads /etc/mdns.d/*.service
|
||||
reload() {
|
||||
printf 'Reloading %s: ' "$DAEMON"
|
||||
start-stop-daemon --stop --signal HUP -q --pidfile "$PIDFILE" \
|
||||
--exec "$MDNSD"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
2
package/mdnsd/ftp.service
Normal file
2
package/mdnsd/ftp.service
Normal file
@@ -0,0 +1,2 @@
|
||||
type _ftp._tcp
|
||||
port 21
|
||||
2
package/mdnsd/http.service
Normal file
2
package/mdnsd/http.service
Normal file
@@ -0,0 +1,2 @@
|
||||
type _http._tcp
|
||||
port 80
|
||||
2
package/mdnsd/ipp.service
Normal file
2
package/mdnsd/ipp.service
Normal file
@@ -0,0 +1,2 @@
|
||||
type _ipp._tcp
|
||||
port 631
|
||||
5
package/mdnsd/mdnsd.hash
Normal file
5
package/mdnsd/mdnsd.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# Upstream sha256 from GitHub
|
||||
sha256 b3f242415b2f29c510e709c862126ecab09d77e8dc1eecf1aefef879bce29003 mdnsd-1.1.tar.gz
|
||||
|
||||
# Locally computed
|
||||
sha256 89a722240ac1fdc0366696eaa5469968397ae274a0003e09a88d0686eeb3cd3e LICENSE
|
||||
51
package/mdnsd/mdnsd.mk
Normal file
51
package/mdnsd/mdnsd.mk
Normal file
@@ -0,0 +1,51 @@
|
||||
################################################################################
|
||||
#
|
||||
# mdnsd
|
||||
#
|
||||
################################################################################
|
||||
|
||||
MDNSD_VERSION = 1.1
|
||||
MDNSD_SITE = https://github.com/troglobit/mdnsd/releases/download/v$(MDNSD_VERSION)
|
||||
MDNSD_LICENSE = BSD-3-Clause
|
||||
MDNSD_LICENSE_FILES = LICENSE
|
||||
MDNSD_INSTALL_STAGING = YES
|
||||
MDNSD_DEPENDENCIES = host-pkgconf
|
||||
|
||||
ifeq ($(BR2_PACKAGE_MDNSD_MQUERY),y)
|
||||
MDNSD_CONF_OPTS += --with-mquery
|
||||
else
|
||||
MDNSD_CONF_OPTS += --without-mquery
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_SYSTEMD),y)
|
||||
MDNSD_DEPENDENCIES += systemd
|
||||
MDNSD_CONF_OPTS += --with-systemd
|
||||
else
|
||||
MDNSD_CONF_OPTS += --without-systemd
|
||||
endif
|
||||
|
||||
MDNSD_SERVICES_$(BR2_PACKAGE_MDNSD_FTP_SERVICE) += ftp
|
||||
MDNSD_SERVICES_$(BR2_PACKAGE_MDNSD_HTTP_SERVICE) += http
|
||||
MDNSD_SERVICES_$(BR2_PACKAGE_MDNSD_IPP_SERVICE) += ipp
|
||||
MDNSD_SERVICES_$(BR2_PACKAGE_MDNSD_PRINTER_SERVICE) += printer
|
||||
MDNSD_SERVICES_$(BR2_PACKAGE_MDNSD_SSH_SERVICE) += ssh
|
||||
|
||||
define MDNSD_INSTALL_SERVICES
|
||||
$(foreach service,$(MDNSD_SERVICES_y),\
|
||||
$(INSTALL) -D -m 0644 package/mdnsd/$(service).service \
|
||||
$(TARGET_DIR)/etc/mdns.d/$(service).service
|
||||
)
|
||||
endef
|
||||
MDNSD_POST_INSTALL_TARGET_HOOKS += MDNSD_INSTALL_SERVICES
|
||||
|
||||
define MDNSD_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D package/mdnsd/S50mdnsd \
|
||||
$(TARGET_DIR)/etc/init.d/S50mdnsd
|
||||
endef
|
||||
|
||||
define MDNSD_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 $(@D)/mdnsd.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/mdnsd.service
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
2
package/mdnsd/printer.service
Normal file
2
package/mdnsd/printer.service
Normal file
@@ -0,0 +1,2 @@
|
||||
type _printer._tcp
|
||||
port 515
|
||||
2
package/mdnsd/ssh.service
Normal file
2
package/mdnsd/ssh.service
Normal file
@@ -0,0 +1,2 @@
|
||||
type _ssh._tcp
|
||||
port 22
|
||||
Reference in New Issue
Block a user