Skip to content

Commit

Permalink
Build openwrt packages with correct rundir
Browse files Browse the repository at this point in the history
It turns out that the openwrt systems that I have been using to test my
OpenWRT package builds (All Turris Omnia systems) appears to have had a
vendor patch applied to create a symlink from "/run" to "/var/run".  On
a vanilla OpenWRT system, there is no "/run".  Use the new configure
option to set the correct run dir location.

(Also deal with the OpenWRT auto conf tools being too old to include the
runstatedir option)

(See PR #48, #49)
  • Loading branch information
hamishcoleman committed Aug 2, 2024
1 parent 0847c26 commit dae535a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ case "$host_os" in
;;
esac

AC_ARG_WITH([rundir],
AS_HELP_STRING([--with-rundir=DIR], [location of the system /run dir]),
[rundir=$withval],
[rundir="/run"]
)

AC_ARG_WITH([systemddir],
AS_HELP_STRING([--with-systemddir=DIR], [Where to install systemd units]),
[systemddir=$withval],
Expand Down Expand Up @@ -120,10 +126,6 @@ AS_IF([test "x$prefix" = "xNONE" ],
prefix=/usr/local
)

AS_IF([test "x$runstatedir" = 'x${localstatedir}/run' ],
runstatedir=/run
)

# The systemd unit dir should be in a sane location (based on the prefix) but
# that is not always a dir underneath the prefix. Apply another hack
AS_IF([test "x$systemddir" = "x" ],
Expand All @@ -138,7 +140,7 @@ AS_IF([test "x$systemddir" = "x" ],
CONFIG_DOCDIR=$(eval echo $(eval echo $docdir))
CONFIG_MANDIR=$(eval echo $(eval echo $mandir))
CONFIG_PREFIX=$prefix
CONFIG_RUNDIR=$runstatedir
CONFIG_RUNDIR=$rundir
CONFIG_SYSTEMDDIR=$systemddir

configure_command=$0$ac_configure_args_raw
Expand Down
2 changes: 1 addition & 1 deletion packages/openwrt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ endef
define Build/Configure
( cd $(PKG_BUILD_DIR); \
./autogen.sh; \
LDFLAGS=--static ./configure )
LDFLAGS=--static ./configure --with-rundir=/var/run )
endef

define Package/n3n-edge/conffiles
Expand Down

1 comment on commit dae535a

@small-5
Copy link
Contributor

@small-5 small-5 commented on dae535a Aug 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test is ok

Please sign in to comment.