Skip to content

Commit

Permalink
added a buildroot patch for NUT package to use "--with-user" and "--w…
Browse files Browse the repository at this point in the history
…ith-group" configure option to use nobody:nogroup rather than nobody:nobody which results in varies problems leading to nun working NUT server support. This closes #93.
  • Loading branch information
jens-maus committed Apr 15, 2017
1 parent c07b6b7 commit 0998cb6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -18,7 +18,7 @@ buildroot-$(BUILDROOT_VERSION).tar.bz2:
BUILDROOT_PATCHES=$(wildcard buildroot-patches/*.patch)

buildroot-$(BUILDROOT_VERSION): | buildroot-$(BUILDROOT_VERSION).tar.bz2
if [ ! -d $@ ]; then tar xf buildroot-$(BUILDROOT_VERSION).tar.bz2; for p in `ls buildroot-patches`; do patch -d buildroot-$(BUILDROOT_VERSION) -p1 < buildroot-patches/$${p}; done; fi
if [ ! -d $@ ]; then tar xf buildroot-$(BUILDROOT_VERSION).tar.bz2; for p in $(BUILDROOT_PATCHES); do patch -d buildroot-$(BUILDROOT_VERSION) -p1 < $${p}; done; fi

build-$(BOARD): | buildroot-$(BUILDROOT_VERSION) download
mkdir -p build-$(BOARD)
Expand Down
Expand Up @@ -102,3 +102,10 @@
#
# To find out if your driver supports any extra settings, start it with
# the -h option and/or read the driver's documentation.
#
# If you connect your UPS via USB you can try the following section:
#
# [myups]
# driver = usbhid-ups
# port = auto
# desc = "USB UPS"
9 changes: 9 additions & 0 deletions buildroot-external/overlay/base/etc/init.d/S51nut
Expand Up @@ -25,6 +25,15 @@ NUT_CONFIG=/etc/config/nut/nut.conf
case $1 in
start)
echo -n "Starting NUT services: "

# make sure some necessary state dirs exist
mkdir -p /var/state/ups
chown root:nogroup /var/state/ups
chmod 770 /var/state/ups
mkdir -p /var/run/upsd
chown root:nogroup /var/run/upsd
chmod 770 /var/run/upsd

# start the server (upsdrvctl/upsd)
case "${MODE}" in
standalone|netserver)
Expand Down
13 changes: 13 additions & 0 deletions buildroot-patches/0002-nut-mk.patch
@@ -0,0 +1,13 @@
--- buildroot/package/nut/nut.mk.orig 2017-04-15 14:35:11.631620680 +0200
+++ buildroot/package/nut/nut.mk 2017-04-15 21:21:02.292137847 +0200
@@ -18,7 +18,9 @@
# since the default location (/var/state/ups) maybe readonly.
NUT_CONF_OPTS = \
--with-altpidpath=/var/run/upsd \
- --without-hal
+ --without-hal \
+ --with-user=nobody \
+ --with-group=nogroup

# For uClibc-based toolchains, nut forgets to link with -lm
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)

0 comments on commit 0998cb6

Please sign in to comment.