Hi Waldemar,
Here's the result of me trying to update my DS414. Well, actually I also collected some pending fixes and new ports as well so it's not as bad as it seems. :)
The first eight patches are clear fixes. The next three as well, but not as critical as the first ones. Patch 12 merely fixes the existing workaround, I sadly haven't managed to implement a proper fix. Patches 13 and 14 are workarounds to build failures for me, yet are valid by themselves. The remaining ones add new functionality.
Happy new year!
Cheers, Phil
Phil Sutter (19): package: samba: Fix for large files on 32bit target package: ffmpeg: Do not mandatory depend on libressl package: ffmpeg: Fix for build failure with newer binutils package: ffmpeg: Drop outdated synth_filter_vfp.S extra source target: config: Newer kernels moved DTB files package: zlib: Fix for wrong zlib.pc content in host build package: libffi: Fix for wrong libffi.pc content in host build package: libxml2: Also fix for wrong libxml2.pc content in host build package: glib: glib-host to explicitly depend on zlib-host package: mdadm: Update to version 4.4 package: python3-jinja2: Fix for including non-existent file package: ca-certificates: Fix python3 path package: util-linux: Do not build lsfd if not needed package: openssl: Disable docs build package: base-files: Add bonding support to network scripts package: Port libexif package: Port minidlna package: Port apcupsd package: Port zfs package
package/apcupsd/Makefile | 44 ++++ package/apcupsd/files/apccontrol | 74 +++++++ package/apcupsd/files/apcupsd.conffiles | 1 + package/apcupsd/files/apcupsd.init | 38 ++++ package/apcupsd/files/apcupsd.postinst | 3 + package/base-files/files/interfaces-dhcp | 11 +- .../src/etc/network/if-post-down.d/04-bonding | 20 ++ .../src/etc/network/if-pre-up.d/05-bonding | 37 ++++ .../patches/patch-mozilla_Makefile | 2 +- package/ffmpeg/Makefile | 8 +- ...lpdsp_armv5te-fix-label-format-to-wo.patch | 59 +++++ .../src/libavcodec/arm/synth_filter_vfp.S | 206 ------------------ package/glib/Makefile | 2 +- package/libexif/Makefile | 27 +++ package/libffi/Makefile | 1 - package/libxml2/Makefile | 1 - package/mdadm/Makefile | 17 +- package/minidlna/Makefile | 29 +++ package/minidlna/files/minidlna.init | 36 +++ package/minidlna/files/minidlna.postinst | 3 + ...-Try-syslog-if-no-log-path-was-given.patch | 104 +++++++++ package/openssl/Makefile | 2 +- package/python3-jinja2/Makefile | 2 +- package/samba/Makefile | 5 +- package/samba/files/cache.txt | 2 - package/util-linux/Makefile | 5 + package/zfs/Makefile | 70 ++++++ ...t-for-cross-compiling-kernel-modules.patch | 53 +++++ package/zlib/Makefile | 3 +- target/config/Config.in.kernelfmt | 21 +- target/linux/config/Config.in.input | 1 + 31 files changed, 661 insertions(+), 226 deletions(-) create mode 100644 package/apcupsd/Makefile create mode 100644 package/apcupsd/files/apccontrol create mode 100644 package/apcupsd/files/apcupsd.conffiles create mode 100644 package/apcupsd/files/apcupsd.init create mode 100644 package/apcupsd/files/apcupsd.postinst create mode 100755 package/base-files/src/etc/network/if-post-down.d/04-bonding create mode 100755 package/base-files/src/etc/network/if-pre-up.d/05-bonding create mode 100644 package/ffmpeg/patches/0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch delete mode 100644 package/ffmpeg/src/libavcodec/arm/synth_filter_vfp.S create mode 100644 package/libexif/Makefile create mode 100644 package/minidlna/Makefile create mode 100644 package/minidlna/files/minidlna.init create mode 100644 package/minidlna/files/minidlna.postinst create mode 100644 package/minidlna/patches/0001-log-Try-syslog-if-no-log-path-was-given.patch create mode 100644 package/zfs/Makefile create mode 100644 package/zfs/patches/0001-Support-for-cross-compiling-kernel-modules.patch
Configure script incorrectly "detected" no flags are necessary. The odd result is that 'ls <largefile>' prints huge file size (16E) for files larger than 2GB while 'du <largefile>' is correct in mounted shares.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/samba/Makefile | 5 ++++- package/samba/files/cache.txt | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/package/samba/Makefile b/package/samba/Makefile index e47d34af3f83e..63085b06a21dd 100644 --- a/package/samba/Makefile +++ b/package/samba/Makefile @@ -5,7 +5,7 @@ include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= samba PKG_VERSION:= 4.19.4 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_HASH:= 4026d93b866db198c8ca1685b0f5d52793f65c6e63cb364163af661fdff0968c PKG_DESCR:= file and print server PKG_SECTION:= net/fs @@ -68,8 +68,11 @@ CONFIGURE_ENV+= PYTHON_CONFIG="$(STAGING_TARGET_DIR)/usr/bin/python-config" \ echo 'Checking uname machine type: "$(ADK_TARGET_ARCH)"' >>$(WRKSRC)/cache.txt ifneq ($(ADK_LINUX_64),) echo 'Checking for a 64-bit host to support lmdb: OK' >>$(WRKSRC)/cache.txt + echo 'Checking for large file support without additional flags: OK' >>$(WRKSRC)/cache.txt else echo 'Checking for a 64-bit host to support lmdb: NO' >>$(WRKSRC)/cache.txt + echo 'Checking for large file support without additional flags: NO' >>$(WRKSRC)/cache.txt + echo 'Checking for -D_FILE_OFFSET_BITS=64: OK' >>$(WRKSRC)/cache.txt endif
samba-install: diff --git a/package/samba/files/cache.txt b/package/samba/files/cache.txt index 9ab9fcd5bf600..e08011165d508 100644 --- a/package/samba/files/cache.txt +++ b/package/samba/files/cache.txt @@ -2,8 +2,6 @@ Checking simple C program: OK rpath library support: OK -Wl,--version-script support: OK Checking getconf LFS_CFLAGS: NO -Checking for large file support without additional flags: OK -Checking for -D_LARGE_FILES: OK Checking correct behavior of strtoll: NO Checking for working strptime: OK Checking for C99 vsnprintf: OK
There is a package choice for libffmpeg to select the SSL backend library. It was buggy though, the build dependency was not recognized. Looks like the choice has to use PKG_LIBNAME to be recognized by depmaker.
Fixes: b076cd3c45c85 ("ffmpeg: add choice for ssl") Signed-off-by: Phil Sutter phil@nwl.cc --- package/ffmpeg/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/package/ffmpeg/Makefile b/package/ffmpeg/Makefile index 8c00cdef49877..2920791d7c9ff 100644 --- a/package/ffmpeg/Makefile +++ b/package/ffmpeg/Makefile @@ -5,19 +5,19 @@ include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= ffmpeg PKG_VERSION:= 6.1.1 -PKG_RELEASE:= 1 +PKG_RELEASE:= 2 PKG_HASH:= 5e3133939a61ef64ac9b47ffd29a5ea6e337a4023ef0ad972094b4da844e3a20 PKG_DESCR:= record, convert and stream audio & video PKG_SECTION:= libs/video PKG_NEEDS:= threads -PKG_DEPENDS:= libncurses libressl -PKG_BUILDDEP:= ncurses libressl +PKG_DEPENDS:= libncurses +PKG_BUILDDEP:= ncurses PKG_URL:= http://www.ffmpeg.org/ PKG_SITES:= http://www.ffmpeg.org/releases/ PKG_LIBNAME:= libffmpeg PKG_OPTS:= dev
-PKG_CHOICES_FFMPEG:= WITH_LIBRESSL WITH_OPENSSL +PKG_CHOICES_LIBFFMPEG:= WITH_LIBRESSL WITH_OPENSSL PKGCD_WITH_LIBRESSL:= use libressl for crypto PKGCS_WITH_LIBRESSL:= libressl ca-certificates PKGCB_WITH_LIBRESSL:= libressl
Signed-off-by: Phil Sutter phil@nwl.cc --- ...lpdsp_armv5te-fix-label-format-to-wo.patch | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 package/ffmpeg/patches/0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch
diff --git a/package/ffmpeg/patches/0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch b/package/ffmpeg/patches/0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch new file mode 100644 index 0000000000000..a23de2e78c00b --- /dev/null +++ b/package/ffmpeg/patches/0001-libavcodec-arm-mlpdsp_armv5te-fix-label-format-to-wo.patch @@ -0,0 +1,59 @@ +From 654bd47716c4f36719fb0f3f7fd8386d5ed0b916 Mon Sep 17 00:00:00 2001 +From: Ross Burton ross.burton@arm.com +Date: Fri, 9 Aug 2024 11:32:00 +0100 +Subject: [PATCH] libavcodec/arm/mlpdsp_armv5te: fix label format to work with + binutils 2.43 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +binutils 2.43 has stricter validation for labels[1] and results in errors +when building ffmpeg for armv5: + +src/libavcodec/arm/mlpdsp_armv5te.S:232: Error: junk at end of line, first unrecognized character is `0' + +Remove the leading zero in the "01" label to resolve this error. + +[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c60... + +Signed-off-by: Ross Burton ross.burton@arm.com +Signed-off-by: Martin Storsjö martin@martin.st +Signed-off-by: Phil Sutter phil@nwl.cc +--- + libavcodec/arm/mlpdsp_armv5te.S | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libavcodec/arm/mlpdsp_armv5te.S b/libavcodec/arm/mlpdsp_armv5te.S +index 4f9aa485fd21a..d31568611c30f 100644 +--- a/libavcodec/arm/mlpdsp_armv5te.S ++++ b/libavcodec/arm/mlpdsp_armv5te.S +@@ -229,7 +229,7 @@ A .endif + .endif + + // Begin loop +-01: ++1: + .if TOTAL_TAPS == 0 + // Things simplify a lot in this case + // In fact this could be pipelined further if it's worth it... +@@ -241,7 +241,7 @@ A .endif + str ST0, [PST, #-4]! + str ST0, [PST, #4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)] + str ST0, [PSAMP], #4 * MAX_CHANNELS +- bne 01b ++ bne 1b + .else + .if \fir_taps & 1 + .set LOAD_REG, 1 +@@ -333,7 +333,7 @@ T orr AC0, AC0, AC1 + str ST3, [PST, #-4]! + str ST2, [PST, #4 * (MAX_BLOCKSIZE + MAX_FIR_ORDER)] + str ST3, [PSAMP], #4 * MAX_CHANNELS +- bne 01b ++ bne 1b + .endif + b 99f + +-- +2.43.0 +
This file is present in ffmpeg sources since version 2.1 already and due to internal changes, it wont link anymore (undefined reference to ff_imdct_half_c). Just drop it.
Signed-off-by: Phil Sutter phil@nwl.cc --- .../src/libavcodec/arm/synth_filter_vfp.S | 206 ------------------ 1 file changed, 206 deletions(-) delete mode 100644 package/ffmpeg/src/libavcodec/arm/synth_filter_vfp.S
diff --git a/package/ffmpeg/src/libavcodec/arm/synth_filter_vfp.S b/package/ffmpeg/src/libavcodec/arm/synth_filter_vfp.S deleted file mode 100644 index 451fe5ce9a1b0..0000000000000 --- a/package/ffmpeg/src/libavcodec/arm/synth_filter_vfp.S +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2013 RISC OS Open Ltd - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Author: Ben Avison bavison@riscosopen.org - */ - -#include "libavutil/arm/asm.S" - -IMDCT .req r0 -ORIG_P_SB .req r1 -P_SB_OFF .req r2 -I .req r0 -P_SB2_UP .req r1 -OLDFPSCR .req r2 -P_SB2_DN .req r3 -P_WIN_DN .req r4 -P_OUT_DN .req r5 -P_SB .req r6 -J_WRAP .req r7 -P_WIN_UP .req r12 -P_OUT_UP .req r14 - -SCALE .req s0 -SBUF_DAT_REV0 .req s4 -SBUF_DAT_REV1 .req s5 -SBUF_DAT_REV2 .req s6 -SBUF_DAT_REV3 .req s7 -VA0 .req s8 -VA3 .req s11 -VB0 .req s12 -VB3 .req s15 -VC0 .req s8 -VC3 .req s11 -VD0 .req s12 -VD3 .req s15 -SBUF_DAT0 .req s16 -SBUF_DAT1 .req s17 -SBUF_DAT2 .req s18 -SBUF_DAT3 .req s19 -SBUF_DAT_ALT0 .req s20 -SBUF_DAT_ALT1 .req s21 -SBUF_DAT_ALT2 .req s22 -SBUF_DAT_ALT3 .req s23 -WIN_DN_DAT0 .req s24 -WIN_UP_DAT0 .req s28 - - -.macro inner_loop half, tail, head - .if (OFFSET & (64*4)) == 0 @ even numbered call - SBUF_DAT_THIS0 .req SBUF_DAT0 - SBUF_DAT_THIS1 .req SBUF_DAT1 - SBUF_DAT_THIS2 .req SBUF_DAT2 - SBUF_DAT_THIS3 .req SBUF_DAT3 - .ifnc "\head","" - vldr d8, [P_SB, #OFFSET] @ d8 = SBUF_DAT - vldr d9, [P_SB, #OFFSET+8] - .endif - .else - SBUF_DAT_THIS0 .req SBUF_DAT_ALT0 - SBUF_DAT_THIS1 .req SBUF_DAT_ALT1 - SBUF_DAT_THIS2 .req SBUF_DAT_ALT2 - SBUF_DAT_THIS3 .req SBUF_DAT_ALT3 - .ifnc "\head","" - vldr d10, [P_SB, #OFFSET] @ d10 = SBUF_DAT_ALT - vldr d11, [P_SB, #OFFSET+8] - .endif - .endif - .ifnc "\tail","" - .ifc "\half","ab" - vmls.f VA0, SBUF_DAT_REV0, WIN_DN_DAT0 @ all operands treated as vectors - .else - vmla.f VD0, SBUF_DAT_REV0, WIN_DN_DAT0 @ all operands treated as vectors - .endif - .endif - .ifnc "\head","" - vldr d14, [P_WIN_UP, #OFFSET] @ d14 = WIN_UP_DAT - vldr d15, [P_WIN_UP, #OFFSET+8] - vldr d12, [P_WIN_DN, #OFFSET] @ d12 = WIN_DN_DAT - vldr d13, [P_WIN_DN, #OFFSET+8] - vmov SBUF_DAT_REV3, SBUF_DAT_THIS0 - vmov SBUF_DAT_REV2, SBUF_DAT_THIS1 - vmov SBUF_DAT_REV1, SBUF_DAT_THIS2 - vmov SBUF_DAT_REV0, SBUF_DAT_THIS3 - .ifc "\half","ab" - vmla.f VB0, SBUF_DAT_THIS0, WIN_UP_DAT0 - .else - vmla.f VC0, SBUF_DAT_THIS0, WIN_UP_DAT0 - .endif - teq J_WRAP, #J - bne 2f @ strongly predictable, so better than cond exec in this case - sub P_SB, P_SB, #512*4 -2: - .set J, J - 64 - .set OFFSET, OFFSET + 64*4 - .endif - .unreq SBUF_DAT_THIS0 - .unreq SBUF_DAT_THIS1 - .unreq SBUF_DAT_THIS2 - .unreq SBUF_DAT_THIS3 -.endm - - -/* void ff_synth_filter_float_vfp(FFTContext *imdct, - * float *synth_buf_ptr, int *synth_buf_offset, - * float synth_buf2[32], const float window[512], - * float out[32], const float in[32], float scale) - */ -function ff_synth_filter_float_vfp, export=1 - push {r3-r7,lr} - vpush {s16-s31} - ldr lr, [P_SB_OFF] - add a2, ORIG_P_SB, lr, LSL #2 @ calculate synth_buf to pass to imdct_half - mov P_SB, a2 @ and keep a copy for ourselves - bic J_WRAP, lr, #63 @ mangled to make testing for wrap easier in inner loop - sub lr, lr, #32 - and lr, lr, #512-32 - str lr, [P_SB_OFF] @ rotate offset, modulo buffer size, ready for next call - ldr a3, [sp, #(16+6+2)*4] @ fetch in from stack, to pass to imdct_half -VFP vmov s16, SCALE @ imdct_half is free to corrupt s0, but it contains one of our arguments in hardfp case - bl ff_imdct_half_c -VFP vmov SCALE, s16 - - vmrs OLDFPSCR, FPSCR - ldr lr, =0x03030000 @ RunFast mode, short vectors of length 4, stride 1 - vmsr FPSCR, lr - ldr P_SB2_DN, [sp, #16*4] - ldr P_WIN_DN, [sp, #(16+6+0)*4] - ldr P_OUT_DN, [sp, #(16+6+1)*4] -NOVFP vldr SCALE, [sp, #(16+6+3)*4] - -#define IMM_OFF_SKEW 956 /* also valid immediate constant when you add 16*4 */ - add P_SB, P_SB, #IMM_OFF_SKEW @ so we can use -ve offsets to use full immediate offset range - add P_SB2_UP, P_SB2_DN, #16*4 - add P_WIN_UP, P_WIN_DN, #16*4+IMM_OFF_SKEW - add P_OUT_UP, P_OUT_DN, #16*4 - add P_SB2_DN, P_SB2_DN, #16*4 - add P_WIN_DN, P_WIN_DN, #12*4+IMM_OFF_SKEW - add P_OUT_DN, P_OUT_DN, #16*4 - mov I, #4 -1: - vldmia P_SB2_UP!, {VB0-VB3} - vldmdb P_SB2_DN!, {VA0-VA3} - .set J, 512 - 64 - .set OFFSET, -IMM_OFF_SKEW - inner_loop ab,, head - .rept 7 - inner_loop ab, tail, head - .endr - inner_loop ab, tail - add P_WIN_UP, P_WIN_UP, #4*4 - sub P_WIN_DN, P_WIN_DN, #4*4 - vmul.f VB0, VB0, SCALE @ SCALE treated as scalar - add P_SB, P_SB, #(512+4)*4 - subs I, I, #1 - vmul.f VA0, VA0, SCALE - vstmia P_OUT_UP!, {VB0-VB3} - vstmdb P_OUT_DN!, {VA0-VA3} - bne 1b - - add P_SB2_DN, P_SB2_DN, #(16+28-12)*4 - sub P_SB2_UP, P_SB2_UP, #(16+16)*4 - add P_WIN_DN, P_WIN_DN, #(32+16+28-12)*4 - mov I, #4 -1: - vldr.d d4, zero @ d4 = VC0 - vldr.d d5, zero - vldr.d d6, zero @ d6 = VD0 - vldr.d d7, zero - .set J, 512 - 64 - .set OFFSET, -IMM_OFF_SKEW - inner_loop cd,, head - .rept 7 - inner_loop cd, tail, head - .endr - inner_loop cd, tail - add P_WIN_UP, P_WIN_UP, #4*4 - sub P_WIN_DN, P_WIN_DN, #4*4 - add P_SB, P_SB, #(512+4)*4 - subs I, I, #1 - vstmia P_SB2_UP!, {VC0-VC3} - vstmdb P_SB2_DN!, {VD0-VD3} - bne 1b - - vmsr FPSCR, OLDFPSCR - vpop {s16-s31} - pop {r3-r7,pc} -endfunc - - .align 3 -zero: .word 0, 0
They moved in commit 724ba67515320 ("ARM: dts: Move .dts files to vendor sub-directories"), try to cover for it.
Signed-off-by: Phil Sutter phil@nwl.cc --- target/config/Config.in.kernelfmt | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/target/config/Config.in.kernelfmt b/target/config/Config.in.kernelfmt index 2a1fb1e9f7190..b80853385333d 100644 --- a/target/config/Config.in.kernelfmt +++ b/target/config/Config.in.kernelfmt @@ -84,6 +84,25 @@ config ADK_TARGET_KERNEL_LOADADDR default 0x40008000 if ADK_TARGET_SYSTEM_ORANGE_PI0 default 0xc0008000 if ADK_TARGET_SYSTEM_ST_STM32F746G
+config ADK_TARGET_KERNEL_VENDORED_DTB + bool + default y + default n if ADK_TARGET_LINUX_KERNEL_VERSION_6_1 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_5_15 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_5_10 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_5_4 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_4_19 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_4_14 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_4_9 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_4_4 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_3_16 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_3_4 + default n if ADK_TARGET_LINUX_KERNEL_VERSION_2_6_32 + help + Starting with linux-6.5, DTB files sit in vendor-specific + sub-directories. + config ADK_TARGET_KERNEL_APPEND_DTB string - default "armada-xp-synology-ds414" if ADK_TARGET_SYSTEM_SYNOLOGY_DS414 + default "armada-xp-synology-ds414" if ADK_TARGET_SYSTEM_SYNOLOGY_DS414 && !ADK_TARGET_KERNEL_VENDORED_DTB + default "marvell/armada-xp-synology-ds414" if ADK_TARGET_SYSTEM_SYNOLOGY_DS414 && ADK_TARGET_KERNEL_VENDORED_DTB
The file contained 'prefix=/usr' which led to glib host build trying to link against the host's libz.so instead of the built one.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/zlib/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/zlib/Makefile b/package/zlib/Makefile index 9d7cea2ae6c5d..e5de4a036ae48 100644 --- a/package/zlib/Makefile +++ b/package/zlib/Makefile @@ -27,6 +27,7 @@ endif HOST_STYLE:= auto HOST_CONFIG_STYLE:= manual HOST_CONFIGURE_ENV+= uname=Linux +HOST_FAKE_FLAGS+= DESTDIR=/
CONFIG_STYLE:= manual CONFIGURE_ENV+= uname=Linux @@ -45,7 +46,7 @@ endif CPPFLAGS="-I$(STAGING_HOST_DIR)/usr/include" \ LDFLAGS="-L$(STAGING_HOST_DIR)/usr/lib" \ ./configure \ - --prefix=/usr \ + --prefix=$(STAGING_HOST_DIR)/usr \ --shared \ );
This would also contain 'prefix=/usr'. Not sure what this 'auto' HOST_STYLE is supposed to do, but in this case it breaks things.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/libffi/Makefile | 1 - 1 file changed, 1 deletion(-)
diff --git a/package/libffi/Makefile b/package/libffi/Makefile index c6cfe64e94c39..b6dd3c851232a 100644 --- a/package/libffi/Makefile +++ b/package/libffi/Makefile @@ -22,7 +22,6 @@ include ${ADK_TOPDIR}/mk/package.mk $(eval $(call HOST_template,LIBFFI,libffi,${PKG_VERSION}-${PKG_RELEASE})) $(eval $(call PKG_template,LIBFFI,libffi,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
-HOST_STYLE:= auto HOST_CONFIGURE_ARGS+= --disable-builddir --with-pic --disable-symvers CONFIGURE_ARGS+= --disable-builddir --with-pic --disable-symvers
Just like with libffi package, HOST_STYLE=auto led to 'prefix=/usr' in host build libffi.pc.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/libxml2/Makefile | 1 - 1 file changed, 1 deletion(-)
diff --git a/package/libxml2/Makefile b/package/libxml2/Makefile index 20a1428b7310c..078788d7ef774 100644 --- a/package/libxml2/Makefile +++ b/package/libxml2/Makefile @@ -22,7 +22,6 @@ include $(ADK_TOPDIR)/mk/package.mk $(eval $(call HOST_template,LIBXML2,libxml2,$(PKG_VERSION)-$(PKG_RELEASE))) $(eval $(call PKG_template,LIBXML2,libxml2,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS)))
-HOST_STYLE:= auto HOST_CONFIGURE_ARGS+= --without-python \ --with-threads \ --without-iconv \
This is required, make sure things won't break if a config is possible which does not already pull it in via some other dependency.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/glib/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/glib/Makefile b/package/glib/Makefile index f83648bae41f2..188f1fc2e11b5 100644 --- a/package/glib/Makefile +++ b/package/glib/Makefile @@ -13,7 +13,7 @@ PKG_SECTION:= libs/misc PKG_DEPENDS:= pcre2 zlib libffi libiconv PKG_BUILDDEP:= glib-host util-linux libffi zlib dbus pcre2 libiconv HOST_BUILDDEP:= pkgconf-host libiconv-host libffi-host python3-host gettext-host util-linux-host -HOST_BUILDDEP+= pcre2-host meson-host +HOST_BUILDDEP+= pcre2-host meson-host zlib-host PKG_NEEDS:= threads intl iconv PKG_URL:= http://www.gtk.org/ PKG_SITES:= http://ftp.gnome.org/pub/GNOME/sources/glib/$(PKG_EXTRAVER)/
The old one didn't compile for me anymore, probably due to gcc-12.4.0 being more picky than the one used previously.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/mdadm/Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/package/mdadm/Makefile b/package/mdadm/Makefile index 69d17ee2f0059..1301203ccf3a0 100644 --- a/package/mdadm/Makefile +++ b/package/mdadm/Makefile @@ -4,23 +4,32 @@ include ${ADK_TOPDIR}/rules.mk
PKG_NAME:= mdadm -PKG_VERSION:= 4.2 +PKG_VERSION:= 4.4 PKG_RELEASE:= 1 -PKG_HASH:= 461c215670864bb74a4d1a3620684aa2b2f8296dffa06743f26dda5557acf01d +PKG_HASH:= 556266fb8322de465eff2aa7e0f7d2b1056153770c70971834833f571dbc02a2 PKG_DESCR:= tool for managing software raid arrays PKG_DEPENDS:= libudev PKG_BUILDDEP:= eudev PKG_KDEPENDS:= blk-dev-md md md-raid0 md-raid1 md-raid456 PKG_SECTION:= sys/fs PKG_URL:= http://neil.brown.name/blog/mdadm -PKG_SITES:= ${MASTER_SITE_KERNEL:=utils/raid/mdadm/} +PKG_SITES:= https://github.com/md-raid-utilities/mdadm/archive/refs/tags/ + +DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.gz +WRKDIST= ${WRKDIR}/${PKG_NAME}-${PKG_NAME}-${PKG_VERSION}
include ${ADK_TOPDIR}/mk/package.mk
$(eval $(call PKG_template,MDADM,mdadm,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
CONFIG_STYLE:= manual -XAKE_FLAGS+= CROSS_COMPILE="${TARGET_CROSS}" CHECK_RUN_DIR=0 +# gcc-12.4.0 at least seems to get some things wrong +TARGET_CFLAGS+= -Wno-error=uninitialized +# Without this, I get "undefined reference to `__stack_chk_fail'" while linking +TARGET_CFLAGS+= -fno-stack-protector +XAKE_FLAGS+= CROSS_COMPILE="${TARGET_CROSS}" \ + CHECK_RUN_DIR=0 \ + CXFLAGS="${TARGET_CFLAGS}"
mdadm-install: ${INSTALL_DIR} ${IDIR_MDADM}/usr/sbin
The included mk/python.mk was removed by commit 179b687e2f99d ("remove python2 dependencies and packages"). Including python3.mk might be the right alternative?
Signed-off-by: Phil Sutter phil@nwl.cc --- package/python3-jinja2/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/python3-jinja2/Makefile b/package/python3-jinja2/Makefile index 5cde4fc4732aa..3a5108562d4b1 100644 --- a/package/python3-jinja2/Makefile +++ b/package/python3-jinja2/Makefile @@ -22,7 +22,7 @@ include $(ADK_TOPDIR)/mk/package.mk
$(eval $(call HOST_template,PYTHON3_JINJA2,python3-jinja2,${PKG_VERSION}-${PKG_RELEASE}))
-include $(ADK_TOPDIR)/mk/python.mk +include $(ADK_TOPDIR)/mk/python3.mk
HOST_STYLE:= manual
Python is usually installed in /usr/bin.
Actually this should use host-built python binary instead, but porting the dependencies seems non-trivial. Python packaging is such a mess. :(
Signed-off-by: Phil Sutter phil@nwl.cc --- package/ca-certificates/patches/patch-mozilla_Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/ca-certificates/patches/patch-mozilla_Makefile b/package/ca-certificates/patches/patch-mozilla_Makefile index 768f263733ebd..a9cd5ad44ad25 100644 --- a/package/ca-certificates/patches/patch-mozilla_Makefile +++ b/package/ca-certificates/patches/patch-mozilla_Makefile @@ -5,7 +5,7 @@
all: - python3 certdata2pem.py -+ /bin/python3 certdata2pem.py ++ /usr/bin/python3 certdata2pem.py
clean: -rm -f *.crt
This actually works around a problem when building against uClibc which does not seem to provide process_vm_readv syscall and thus compiling lsfd fails.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/util-linux/Makefile | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/package/util-linux/Makefile b/package/util-linux/Makefile index 85c0397e897b1..33c2d1809ca91 100644 --- a/package/util-linux/Makefile +++ b/package/util-linux/Makefile @@ -109,6 +109,11 @@ CONFIGURE_ARGS+= --exec-prefix=/usr \ --enable-libuuid \ --enable-libblkid \ --enable-libmount +ifneq (${ADK_PACKAGE_LSFD},) +CONFIGURE_ARGS+= --enable-lsfd +else +CONFIGURE_ARGS+= --disable-lsfd +endif
TARGET_CFLAGS+= -fPIC FAKE_FLAGS+= INSTALLSUID="install -m 4755"
Building man pages requires pod2man tool. Avoid this extra build dependency.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/openssl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/openssl/Makefile b/package/openssl/Makefile index 01841828c2b1e..6a2eccf64ce2e 100644 --- a/package/openssl/Makefile +++ b/package/openssl/Makefile @@ -38,7 +38,7 @@ OPENSSL_OPTIONS:= shared zlib-dynamic endif
OPENSSL_OPTIONS+= threads no-err no-tests no-fuzz-libfuzzer no-fuzz-afl -OPENSSL_OPTIONS+= no-rc5 no-rc2 no-rc4 no-md2 no-idea +OPENSSL_OPTIONS+= no-rc5 no-rc2 no-rc4 no-md2 no-idea no-docs
HOST_STYLE:= manual CONFIG_STYLE:= manual
Also add a sample LACP configuration and while being at it, fix the documentation URL.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/base-files/files/interfaces-dhcp | 11 +++++- .../src/etc/network/if-post-down.d/04-bonding | 20 ++++++++++ .../src/etc/network/if-pre-up.d/05-bonding | 37 +++++++++++++++++++ 3 files changed, 67 insertions(+), 1 deletion(-) create mode 100755 package/base-files/src/etc/network/if-post-down.d/04-bonding create mode 100755 package/base-files/src/etc/network/if-pre-up.d/05-bonding
diff --git a/package/base-files/files/interfaces-dhcp b/package/base-files/files/interfaces-dhcp index 11174c1529d08..652101214d8d7 100644 --- a/package/base-files/files/interfaces-dhcp +++ b/package/base-files/files/interfaces-dhcp @@ -22,6 +22,15 @@ iface eth0 inet dhcp # bridge-ports eth0 eth1 ##
+## LACP configuration +#auto lacp0 +#iface lacp0 inet dhcp +# bond-ports eth0 eth1 +# bond-mode 802.3ad +# bond-miimon 100 +# bond-lacp-rate slow +# bond-xmit-hash-policy layer2+3 + ## pppoe configuration #auto ppp0 #iface ppp0 inet ppp @@ -55,4 +64,4 @@ iface eth0 inet dhcp # wireless-passphrase xxxxxxxx ##
-# for more special cases see: http://www.openadk.org/doku.php?id=network +# for more special cases see: https://docs.openadk.org/html/manual.html#network-configuration diff --git a/package/base-files/src/etc/network/if-post-down.d/04-bonding b/package/base-files/src/etc/network/if-post-down.d/04-bonding new file mode 100755 index 0000000000000..0b9c9f3626221 --- /dev/null +++ b/package/base-files/src/etc/network/if-post-down.d/04-bonding @@ -0,0 +1,20 @@ +#!/bin/sh + +case "$IF_BOND_PORTS" in +"") + exit 0 + ;; +none) + INTERFACES="" + ;; +*) + INTERFACES="$IF_BOND_PORTS" + ;; +esac + +for IF in $INTERFACES; do + ip link set $IF nomaster + ip link set $IF down +done +ip link del $IFACE +exit 0 diff --git a/package/base-files/src/etc/network/if-pre-up.d/05-bonding b/package/base-files/src/etc/network/if-pre-up.d/05-bonding new file mode 100755 index 0000000000000..489a2fcad55e2 --- /dev/null +++ b/package/base-files/src/etc/network/if-pre-up.d/05-bonding @@ -0,0 +1,37 @@ +#!/bin/sh + +INTERFACES="" +BONDOPTS="" +for var in $(env | grep '^IF_BOND_'); do + val="${var#*=}" + opt="${var%%=*}" + if [ "$opt" == "IF_BOND_PORTS" ]; then + case "$val" in + none) + INTERFACES="" + ;; + *) + INTERFACES="$val" + ;; + esac + continue + fi + opt="$(tr '[A-Z]' '[a-z]' <<< ${opt#IF_BOND_})" + BONDOPTS+=" $opt" + [ -n "$val" ] && BONDOPTS+=" $val" +done + +[ -n "$INTERFACES" ] || exit 0 + +ip link add $IFACE type bond ${BONDOPTS} || exit 1 +for IF in $INTERFACES; do + if ! grep -q $IF /proc/net/dev; then + echo "Error: interface '$IF' does not exist!" + ip link del $IFACE + exit 1 + fi + ip link set $IF master $IFACE + ip link set $IF up +done + +exit 0
Needed by upcoming minidlna package.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/libexif/Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 package/libexif/Makefile
diff --git a/package/libexif/Makefile b/package/libexif/Makefile new file mode 100644 index 0000000000000..f22edca4f5173 --- /dev/null +++ b/package/libexif/Makefile @@ -0,0 +1,27 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= libexif +PKG_VERSION:= 0.6.24 +PKG_RELEASE:= 1 +PKG_HASH:= d47564c433b733d83b6704c70477e0a4067811d184ec565258ac563d8223f6ae +PKG_DESCR:= Library for parsing, editing, and saving EXIF data +PKG_SECTION:= libs/image +PKG_URL:= https://libexif.github.io/ +PKG_SITES:= https://github.com/libexif/libexif/releases/download/v$%7BPKG_VERSION%7D/ +PKG_OPTS:= dev + +DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2 + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,LIBEXIF,libexif,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION),$(PKG_OPTS))) + +libexif-install: + $(INSTALL_DIR) $(IDIR_LIBEXIF)/usr/lib + $(CP) $(WRKINST)/usr/lib/libexif*.so* \ + $(IDIR_LIBEXIF)/usr/lib + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk
This is a more capable alternative to gmediaserver.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/minidlna/Makefile | 29 +++++ package/minidlna/files/minidlna.init | 36 ++++++ package/minidlna/files/minidlna.postinst | 3 + ...-Try-syslog-if-no-log-path-was-given.patch | 104 ++++++++++++++++++ 4 files changed, 172 insertions(+) create mode 100644 package/minidlna/Makefile create mode 100644 package/minidlna/files/minidlna.init create mode 100644 package/minidlna/files/minidlna.postinst create mode 100644 package/minidlna/patches/0001-log-Try-syslog-if-no-log-path-was-given.patch
diff --git a/package/minidlna/Makefile b/package/minidlna/Makefile new file mode 100644 index 0000000000000..69ca4ce49c3da --- /dev/null +++ b/package/minidlna/Makefile @@ -0,0 +1,29 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= minidlna +PKG_VERSION:= 1.3.3 +PKG_RELEASE:= 1 +PKG_HASH:= 39026c6d4a139b9180192d1c37225aa3376fdf4f1a74d7debbdbb693d996afa4 +PKG_DESCR:= DLNA/UPnP-AV compliant media server +PKG_SECTION:= mm/video +PKG_DEPENDS:= libffmpeg libjpeg-turbo libexif libid3tag libogg libflac libvorbis +PKG_BUILDDEP:= ffmpeg libjpeg-turbo libexif libid3tag libogg flac libvorbis +PKG_URL:= http://sourceforge.net/projects/minidlna/ +PKG_SITES:= $(MASTER_SITE_SOURCEFORGE:=minidlna/) +DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.gz + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,MINIDLNA,minidlna,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) + +minidlna-install: + $(INSTALL_DIR) $(IDIR_MINIDLNA)/usr/sbin + $(INSTALL_BIN) $(WRKINST)/usr/sbin/minidlnad \ + $(IDIR_MINIDLNA)/usr/sbin + $(INSTALL_DIR) $(IDIR_MINIDLNA)/etc/ + $(INSTALL_DATA) $(WRKSRC)/minidlna.conf $(IDIR_MINIDLNA)/etc/ + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/minidlna/files/minidlna.init b/package/minidlna/files/minidlna.init new file mode 100644 index 0000000000000..c4a1fe79593a0 --- /dev/null +++ b/package/minidlna/files/minidlna.init @@ -0,0 +1,36 @@ +#!/bin/sh +#PKG minidlna +#INIT 60 +. /etc/rc.conf + +pidfile=$(echo "$minidlna_flags" | sed -n 's/.*-P ([^ ]+).*/\1/p') +[ "$pidfile" ] || pidfile="/var/run/minidlna/minidlna.pid" + +case $1 in +autostop) ;; +autostart) + test x"${minidlna:-NO}" = x"NO" && exit 0 + test x"$minidlna" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start + exec sh $0 start + ;; +start) + /usr/sbin/minidlnad $minidlna_flags + ;; +stop) + if [ -f "$pidfile" ]; then + kill $(<$pidfile) + rm $pidfile + else + kill $(pgrep -f /usr/sbin/minidlnad) + fi + ;; +restart) + sh $0 stop + sleep 1 + sh $0 start + ;; +*) + echo "usage: $0 (start | stop | restart)" + exit 1 +esac +exit $? diff --git a/package/minidlna/files/minidlna.postinst b/package/minidlna/files/minidlna.postinst new file mode 100644 index 0000000000000..6c14ff1e84973 --- /dev/null +++ b/package/minidlna/files/minidlna.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf minidlna NO diff --git a/package/minidlna/patches/0001-log-Try-syslog-if-no-log-path-was-given.patch b/package/minidlna/patches/0001-log-Try-syslog-if-no-log-path-was-given.patch new file mode 100644 index 0000000000000..c42c28097ea81 --- /dev/null +++ b/package/minidlna/patches/0001-log-Try-syslog-if-no-log-path-was-given.patch @@ -0,0 +1,104 @@ +From 989841a0c4e83b0ac1b9d276be3797bcfa83bcb1 Mon Sep 17 00:00:00 2001 +From: Phil Sutter phil@nwl.cc +Date: Sun, 27 Nov 2022 23:45:41 +0100 +Subject: [PATCH] log: Try syslog if no log path was given + +Signed-off-by: Phil Sutter phil@nwl.cc +--- + log.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- + minidlna.c | 2 -- + 2 files changed, 42 insertions(+), 4 deletions(-) + +diff --git a/log.c b/log.c +index a989904a24d93..840a8c02e678b 100644 +--- a/log.c ++++ b/log.c +@@ -23,6 +23,7 @@ + #include <stdio.h> + #include <stdarg.h> + #include <string.h> ++#include <syslog.h> + #include <time.h> + + #include "upnpglobalvars.h" +@@ -147,6 +148,40 @@ log_init(const char *debug) + return 0; + } + ++static int ++syslog_err(int level, enum _log_facility facility, ++ char *fname, int lineno, char *fmt, va_list *ap) ++{ ++ char myfmt[1024]; ++ int level_to_syslog[E_MAXDEBUG + 1] = { ++ /* [E_OFF] = 0, */ ++ [E_FATAL] = LOG_CRIT, ++ [E_ERROR] = LOG_ERR, ++ [E_WARN] = LOG_WARNING, ++ [E_INFO] = LOG_NOTICE, ++ [E_DEBUG] = LOG_INFO, ++ [E_MAXDEBUG] = LOG_DEBUG, ++ }; ++ ++ if (level == E_OFF) ++ return 0; ++ ++ if (level > E_MAXDEBUG) ++ return -1; ++ ++ if (level) ++ snprintf(myfmt, 1024, "%s:%d: %s: %s", fname, lineno, level_name[level], fmt); ++ else ++ snprintf(myfmt, 1024, "%s:%d: %s", fname, lineno, fmt); ++ ++ vsyslog(level_to_syslog[level], myfmt, *ap); ++ ++ if (level == E_FATAL) ++ exit(-1); ++ ++ return 0; ++} ++ + void + log_err(int level, enum _log_facility facility, char *fname, int lineno, char *fmt, ...) + { +@@ -155,8 +190,14 @@ log_err(int level, enum _log_facility facility, char *fname, int lineno, char *f + if (level && level>log_level[facility] && level>E_FATAL) + return; + +- if (!log_fp) ++ va_start(ap, fmt); ++ if (!log_fp) { ++ if (!syslog_err(level, facility, fname, lineno, fmt, &ap)) { ++ va_end(ap); ++ return; ++ } + log_fp = stdout; ++ } + + // timestamp + if (!GETFLAG(SYSTEMD_MASK)) +@@ -176,7 +217,6 @@ log_err(int level, enum _log_facility facility, char *fname, int lineno, char *f + fprintf(log_fp, "%s:%d: ", fname, lineno); + + // user log +- va_start(ap, fmt); + if (vfprintf(log_fp, fmt, ap) == -1) + { + va_end(ap); +diff --git a/minidlna.c b/minidlna.c +index 999adee977353..db29d603d1e28 100644 +--- a/minidlna.c ++++ b/minidlna.c +@@ -817,8 +817,6 @@ init(int argc, char **argv) + optionsfile); + } + } +- if (!log_path[0]) +- strncpyt(log_path, DEFAULT_LOG_PATH, sizeof(log_path)); + if (!db_path[0]) + strncpyt(db_path, DEFAULT_DB_PATH, sizeof(db_path)); + +-- +2.38.1 +
For USB-connected UPSs, kernel's USB_HIDDEV option is required as the daemon communicates via /dev/usb/hiddev* raw HID devices. Therefore make USB_HID select USB_HIDDEV (shouldn't hurt much on other systems) and select the former if the package is enabled.
Ship a config which defaults to USB-based UPSs as they are probably the most common ones. Also install a minimal apccontrol which merely remounts relevant filesystems read-only in case of near blackout. The core OpenADK fs layout should tolerate pulling the plug as-is already.
Signed-off-by: Phil Sutter phil@nwl.cc --- package/apcupsd/Makefile | 44 +++++++++++++++ package/apcupsd/files/apccontrol | 74 +++++++++++++++++++++++++ package/apcupsd/files/apcupsd.conffiles | 1 + package/apcupsd/files/apcupsd.init | 38 +++++++++++++ package/apcupsd/files/apcupsd.postinst | 3 + target/linux/config/Config.in.input | 1 + 6 files changed, 161 insertions(+) create mode 100644 package/apcupsd/Makefile create mode 100644 package/apcupsd/files/apccontrol create mode 100644 package/apcupsd/files/apcupsd.conffiles create mode 100644 package/apcupsd/files/apcupsd.init create mode 100644 package/apcupsd/files/apcupsd.postinst
diff --git a/package/apcupsd/Makefile b/package/apcupsd/Makefile new file mode 100644 index 0000000000000..c6d72cd94de6e --- /dev/null +++ b/package/apcupsd/Makefile @@ -0,0 +1,44 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= apcupsd +PKG_VERSION:= 3.14.14 +PKG_RELEASE:= 1 +PKG_HASH:= db7748559b6b4c3784f9856561ef6ac6199ef7bd019b3edcd7e0a647bf8f9867 +PKG_DESCR:= APC UPS daemon with integrated tcp/ip remote shutdown +PKG_SECTION:= sys/misc +PKG_DEPENDS:= libusb +PKG_BUILDDEP:= libusb +PKG_URL:= http://www.apcupsd.org +PKG_SITES:= $(MASTER_SITE_SOURCEFORGE:=apcupsd/) +DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_CFLINE_APCUPSD:= select BUSYBOX_WALL@ +PKG_CFLINE_APCUPSD+= select ADK_LINUX_KERNEL_USB_HID@ + +include $(ADK_TOPDIR)/mk/package.mk + +$(eval $(call PKG_template,APCUPSD,apcupsd,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) + +CONFIGURE_ARGS+= --prefix="${WRKINST}" --sbindir="/usr/sbin" --enable-usb +CONFIGURE_ENV+= ac_cv_path_WALL=/usr/bin/wall +XAKE_FLAGS:= VERBOSE=1 STRIP="" + +# XXX: custom init script? +apcupsd-install: + $(INSTALL_DIR) $(IDIR_APCUPSD)/usr/sbin + $(INSTALL_BIN) $(WRKINST)/usr/sbin/apc{access,test,upsd} \ + $(IDIR_APCUPSD)/usr/sbin + $(INSTALL_DIR) $(IDIR_APCUPSD)/etc + $(INSTALL_DATA) $(WRKINST)/etc/apcupsd.conf $(IDIR_APCUPSD)/etc + # default to USB-based UPS, avoid writing to /etc to keep cfgfs clean + $(SED) 's/^UPSCABLE smart/UPSCABLE usb/' \ + -e 's/^UPSTYPE apcsmart/UPSTYPE usb/' \ + -e 's,^DEVICE /dev/ttyS0,DEVICE,' \ + -e 's,^PWRFAILDIR /etc,PWRFAILDIR /tmp,' \ + $(IDIR_APCUPSD)/etc/apcupsd.conf + $(INSTALL_BIN) ./files/apccontrol $(IDIR_APCUPSD)/etc/ + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/apcupsd/files/apccontrol b/package/apcupsd/files/apccontrol new file mode 100644 index 0000000000000..e402c513d3d32 --- /dev/null +++ b/package/apcupsd/files/apccontrol @@ -0,0 +1,74 @@ +#!/bin/sh +# +# A custom apccontrol for use in embedded systems: just make sure there's no +# data in-flight and wait for the blackout to shut us down. + +# these filesystems are not relevant +IGNORE_FS="tmpfs proc sysfs devtmpfs devpts nfsd" + +get_rw_mounts() { + local excl='((ro,|type (' + local sep="" + for fs in $IGNORE_FS; do + excl+="${sep}$fs" + sep='|' + done + excl+='))' + mount | grep -v "$excl" | while read dev on mnt opts; do + echo "$mnt" + done +} + +log() { + logger -s -t "$(basename $0)" -p daemon.crit "$*" +} +__mount() { # (ro/rw, txt, mnt) + local opt=$1 + local txt=$2 + local mnt="$3" + + mount -o remount,$opt "$mnt" + rc=$? + case $rc in + 0) log "remounted $mnt $txt" + *) log "failed to remount $mnt $txt: rc=$rc" + esac + return $rc +} +mount_ro() { + __mount ro read-only "$1" +} +mount_rw() { + __mount rw read-write "$1" +} + +romounts="/tmp/apcupsd.romounts" + +case "$1" in + emergency|failing) + log "UPS error condition happening" + ;& # fall through + doshutdown) + log "bracing for upcoming blackout" + + rm -f "$romounts" + sync + get_rw_mounts | while read mnt; do + mount_ro "$mnt" && echo "$mnt" >>"$romounts" + done + ;; + mainsback) + log "returning to routine after near blackout" + + touch "$romounts" + while read mnt; do + mount_rw "$mnt" + done <"$romounts" + rm "$romounts" + ;; + *) + log "Called for $1" + ;; +esac + +exit 0 diff --git a/package/apcupsd/files/apcupsd.conffiles b/package/apcupsd/files/apcupsd.conffiles new file mode 100644 index 0000000000000..7bae4c961dad5 --- /dev/null +++ b/package/apcupsd/files/apcupsd.conffiles @@ -0,0 +1 @@ +/etc/apcupsd.conf diff --git a/package/apcupsd/files/apcupsd.init b/package/apcupsd/files/apcupsd.init new file mode 100644 index 0000000000000..a9817f1be685e --- /dev/null +++ b/package/apcupsd/files/apcupsd.init @@ -0,0 +1,38 @@ +#!/bin/sh +#PKG apcupsd +#INIT 15 +. /etc/rc.conf + +pidfile=$(echo "$apcupsd_flags" | \ + sed -n 's/.*(-P|--pid-file) ([^ ]+).*/\2/p') +[ "$pidfile" ] || pidfile="/var/run/apcupsd.pid" + +case $1 in +autostop) ;; +autostart) + test x"${apcupsd:-NO}" = x"NO" && exit 0 + test x"$apcupsd" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start + exec sh $0 start + ;; +start) + mkdir -p /var/lock + /usr/sbin/apcupsd $apcupsd_flags + ;; +stop) + if [ -f "$pidfile" ]; then + kill $(<$pidfile) + rm -f $pidfile + else + kill $(pgrep -f /usr/sbin/apcupsd) + fi + ;; +restart) + sh $0 stop + sleep 1 + sh $0 start + ;; +*) + echo "usage: $0 (start | stop | restart)" + exit 1 +esac +exit $? diff --git a/package/apcupsd/files/apcupsd.postinst b/package/apcupsd/files/apcupsd.postinst new file mode 100644 index 0000000000000..299fabc0fe38f --- /dev/null +++ b/package/apcupsd/files/apcupsd.postinst @@ -0,0 +1,3 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf apcupsd NO diff --git a/target/linux/config/Config.in.input b/target/linux/config/Config.in.input index 0d7800c92043f..7d4932e412b21 100644 --- a/target/linux/config/Config.in.input +++ b/target/linux/config/Config.in.input @@ -115,6 +115,7 @@ config ADK_LINUX_KERNEL_USB_HID select ADK_LINUX_KERNEL_HID select ADK_LINUX_KERNEL_HID_SUPPORT select ADK_LINUX_KERNEL_HID_GENERIC + select ADK_LINUX_KERNEL_USB_HIDDEV depends on ADK_TARGET_WITH_USB \ || ADK_TARGET_GENERIC \ || ADK_TARGET_QEMU
This still lacks some init scripts to reassemble pools and for other tasks. For now, I just do:
| disks=$(blkid | sed -n 's,^/dev/(sd[a-z]): .* TYPE="crypto_LUKS".*,\1,p') | for disk in $disks; do | [ -b /dev/mapper/$disk ] || cryptsetup luksOpen \ | --key-file=/etc/mykeyfile /dev/$disk $disk | done | zpool import -a
Signed-off-by: Phil Sutter phil@nwl.cc --- package/zfs/Makefile | 70 +++++++++++++++++++ ...t-for-cross-compiling-kernel-modules.patch | 53 ++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 package/zfs/Makefile create mode 100644 package/zfs/patches/0001-Support-for-cross-compiling-kernel-modules.patch
diff --git a/package/zfs/Makefile b/package/zfs/Makefile new file mode 100644 index 0000000000000..0e3db6392ebaa --- /dev/null +++ b/package/zfs/Makefile @@ -0,0 +1,70 @@ +# This file is part of the OpenADK project. OpenADK is copyrighted +# material, please see the LICENCE file in the top-level directory. + +include $(ADK_TOPDIR)/rules.mk + +PKG_NAME:= zfs +PKG_VERSION:= 2.2.6 +PKG_RELEASE:= 1 +PKG_HASH:= c92e02103ac5dd77bf01d7209eabdca55c7b3356aa747bb2357ec4222652a2a7 +PKG_DESCR:= Advanced file system and volume manager +PKG_SECTION:= sys/fs +PKG_DEPENDS:= libcurl +PKG_URL:= https://openzfs.org +PKG_SITES:= https://github.com/openzfs/zfs/releases/download/$%7BPKG_NAME%7D-$%7BPKG_VER... +DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_SUBPKGS:= ZFS ZFS_TESTS +PKGSS_ZFS_TESTS:= bash +PKGSC_ZFS_TESTS:= base/tests +PKGSD_ZFS_TESTS:= OpenZFS testsuite + +include $(ADK_TOPDIR)/mk/package.mk +include $(ADK_TOPDIR)/mk/$(ADK_TARGET_OS)-ver.mk +include ${ADK_TOPDIR}/mk/kernel-vars.mk + +$(eval $(call PKG_template,ZFS,zfs,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION))) +$(eval $(call PKG_template,ZFS_TESTS,zfs-tests,$(PKG_VERSION)-$(PKG_RELEASE),$(PKGSS_ZFS_TESTS),$(PKGSD_ZFS_TESTS),$(PKGSC_ZFS_TESTS))) + +AUTOTOOL_STYLE:= autoreconf +CONFIGURE_ARGS+= --with-linux=${LINUX_DIR} --without-python +CONFIGURE_ENV+= KERNEL_CC="${TARGET_CC}" \ + KERNEL_CROSS_COMPILE="${TARGET_CROSS}" \ + KERNEL_ARCH="${ADK_TARGET_KARCH}" + +zfs-install: + $(INSTALL_DIR) $(IDIR_ZFS)/sbin + $(INSTALL_BIN) $(WRKINST)/sbin/mount.zfs $(IDIR_ZFS)/sbin + $(INSTALL_DIR) $(IDIR_ZFS)/etc/zfs/zed.d + $(CP) $(WRKINST)/etc/zfs/zed.d/* $(IDIR_ZFS)/etc/zfs/zed.d + $(CP) $(WRKINST)/etc/zfs/zfs-functions $(IDIR_ZFS)/etc/zfs + $(INSTALL_DIR) $(IDIR_ZFS)/etc/zfs/zpool.d + $(CP) $(WRKINST)/etc/zfs/zpool.d/* $(IDIR_ZFS)/etc/zfs/zpool.d + $(INSTALL_DIR) $(IDIR_ZFS)/lib/modules/${KERNEL_VERSION}/ + $(CP) $(WRKINST)/lib/modules/${KERNEL_VERSION}/extra/{zfs,spl}.ko \ + $(IDIR_ZFS)/lib/modules/${KERNEL_VERSION}/ + $(INSTALL_DIR) $(IDIR_ZFS)/etc/modules.d/ + printf "spl\nzfs\n" >$(IDIR_ZFS)/etc/modules.d/2-zfs + $(INSTALL_DIR) $(IDIR_ZFS)/usr/bin + $(INSTALL_BIN) $(WRKINST)/usr/bin/* $(IDIR_ZFS)/usr/bin + $(INSTALL_DIR) $(IDIR_ZFS)/usr/sbin + $(INSTALL_BIN) $(WRKINST)/usr/sbin/* $(IDIR_ZFS)/usr/sbin + $(INSTALL_DIR) $(IDIR_ZFS)/usr/libexec/zfs/zed.d + $(INSTALL_BIN) $(WRKINST)/usr/libexec/zfs/zed.d/* \ + $(IDIR_ZFS)/usr/libexec/zfs/zed.d/ + $(INSTALL_DIR) $(IDIR_ZFS)/usr/libexec/zfs/zpool.d + $(INSTALL_BIN) $(WRKINST)/usr/libexec/zfs/zpool.d/* \ + $(IDIR_ZFS)/usr/libexec/zfs/zpool.d/ + $(INSTALL_BIN) $(WRKINST)/usr/libexec/zfs/zpool_influxdb \ + $(IDIR_ZFS)/usr/libexec/zfs/ + $(INSTALL_DIR) $(IDIR_ZFS)/usr/lib + $(CP) $(WRKINST)/usr/lib/*.so* $(IDIR_ZFS)/usr/lib/ + +zfs-tests-install: + $(INSTALL_DIR) $(IDIR_ZFS_TESTS)/usr/share + $(CP) $(WRKINST)/usr/share/zfs $(IDIR_ZFS_TESTS)/usr/share/ + +# XXX: use /usr/share/initramfs-tools for custom init scripts +# or just the files in root/etc/{conf,init}.d + +include $(ADK_TOPDIR)/mk/pkg-bottom.mk diff --git a/package/zfs/patches/0001-Support-for-cross-compiling-kernel-modules.patch b/package/zfs/patches/0001-Support-for-cross-compiling-kernel-modules.patch new file mode 100644 index 0000000000000..b20c3ecf6a02e --- /dev/null +++ b/package/zfs/patches/0001-Support-for-cross-compiling-kernel-modules.patch @@ -0,0 +1,53 @@ +From 1d566bf169297faba7afbe59df151ac479b234d5 Mon Sep 17 00:00:00 2001 +From: Phil Sutter phil@nwl.cc +Date: Fri, 3 Jan 2025 16:30:24 +0100 +Subject: [PATCH] Support for cross-compiling kernel modules + +In order to correctly cross-compile, one has to pass ARCH and +CROSS_COMPILE make flags to kernel module build calls. Facilitate this +in the same way as for custom CC flag by recognizing KERNEL_-prefixed +configure environment variables of same name. + +Signed-off-by: Phil Sutter phil@nwl.cc +--- + config/kernel.m4 | 5 +++++ + module/Makefile.in | 2 ++ + 2 files changed, 7 insertions(+) + +diff --git a/config/kernel.m4 b/config/kernel.m4 +index 173c78a2a561a..c0a8355945dce 100644 +--- a/config/kernel.m4 ++++ b/config/kernel.m4 +@@ -663,11 +663,16 @@ AC_DEFUN([ZFS_LINUX_COMPILE], [ + building kernel modules]) + AC_ARG_VAR([KERNEL_LLVM], [Binary option to + build kernel modules with LLVM/CLANG toolchain]) ++ AC_ARG_VAR([KERNEL_CROSS_COMPILE], [Cross compile prefix ++ for kernel module builds]) ++ AC_ARG_VAR([KERNEL_ARCH], [Architecture to build kernel modules for]) + AC_TRY_COMMAND([ + KBUILD_MODPOST_NOFINAL="$5" KBUILD_MODPOST_WARN="$6" + make modules -k -j$TEST_JOBS ${KERNEL_CC:+CC=$KERNEL_CC} + ${KERNEL_LD:+LD=$KERNEL_LD} ${KERNEL_LLVM:+LLVM=$KERNEL_LLVM} + CONFIG_MODULES=y CFLAGS_MODULE=-DCONFIG_MODULES ++ ${KERNEL_CROSS_COMPILE:+CROSS_COMPILE=$KERNEL_CROSS_COMPILE} ++ ${KERNEL_ARCH:+ARCH=$KERNEL_ARCH} + -C $LINUX_OBJ $ARCH_UM M=$PWD/$1 >$1/build.log 2>&1]) + AS_IF([AC_TRY_COMMAND([$2])], [$3], [$4]) + ]) +diff --git a/module/Makefile.in b/module/Makefile.in +index b6338430e8125..b6e3c8e88ccac 100644 +--- a/module/Makefile.in ++++ b/module/Makefile.in +@@ -54,6 +54,8 @@ FMAKE = env -u MAKEFLAGS make $(FMAKEFLAGS) + list='$(SUBDIR_TARGETS)'; for td in $$list; do $(MAKE) -C $$td; done + $(MAKE) -C @LINUX_OBJ@ $(if @KERNEL_CC@,CC=@KERNEL_CC@) \ + $(if @KERNEL_LD@,LD=@KERNEL_LD@) $(if @KERNEL_LLVM@,LLVM=@KERNEL_LLVM@) \ ++ $(if @KERNEL_CROSS_COMPILE@,CROSS_COMPILE=@KERNEL_CROSS_COMPILE@) \ ++ $(if @KERNEL_ARCH@,ARCH=@KERNEL_ARCH@) \ + M="$$PWD" @KERNEL_MAKE@ CONFIG_ZFS=m modules + + modules-FreeBSD: +-- +2.43.0 +
Hi Phil, Phil Sutter wrote,
Hi Waldemar,
Here's the result of me trying to update my DS414. Well, actually I also collected some pending fixes and new ports as well so it's not as bad as it seems. :)
The first eight patches are clear fixes. The next three as well, but not as critical as the first ones. Patch 12 merely fixes the existing workaround, I sadly haven't managed to implement a proper fix. Patches 13 and 14 are workarounds to build failures for me, yet are valid by themselves. The remaining ones add new functionality.
Happy new year!
Happy new year! Patch series applied including the minidlna v2 patch.
thanks Waldemar