Initial Commit

- initial default booting image
This commit is contained in:
2026-11-06 20:45:42 +01:00
commit b8783708ae
15201 changed files with 602532 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
Fix compilation with uClibc
Ported from
https://github.com/stschake/buildroot-grasshopper/blob/master/package/torsmo/torsmo-0.18-uclibc-getloadavg.patch
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
diff -uwNr vdr-2.3.1.org/skinlcars.c vdr-2.3.1/skinlcars.c
--- vdr-2.3.1.org/skinlcars.c 2015-09-01 12:07:07.000000000 +0200
+++ vdr-2.3.1/skinlcars.c 2016-07-31 21:00:11.000000000 +0200
@@ -1100,6 +1100,44 @@
}
}
+/* uclibc and dietlibc do not have this junk -ReneR */
+#if defined (__UCLIBC__) || defined (__dietlibc__)
+int getloadavg (double loadavg[], int nelem)
+{
+ int fd;
+
+ fd = open ("/proc/loadavg", O_RDONLY);
+ if (fd < 0)
+ return -1;
+ else
+ {
+ char buf[65], *p;
+ ssize_t nread;
+ int i;
+
+ nread = read (fd, buf, sizeof buf - 1);
+ close (fd);
+ if (nread <= 0)
+ return -1;
+ buf[nread - 1] = '\0';
+
+ if (nelem > 3)
+ nelem = 3;
+ p = buf;
+ for (i = 0; i < nelem; ++i)
+ {
+ char *endp;
+ loadavg[i] = strtod (p, &endp);
+ if (endp == p)
+ return -1;
+ p = endp;
+ }
+
+ return i;
+ }
+}
+#endif
+
void cSkinLCARSDisplayMenu::DrawLoad(void)
{
if (yb04) {

View File

@@ -0,0 +1,159 @@
From fb44386acc2497ac250364bc08cebc26ded816cf Mon Sep 17 00:00:00 2001
From: Carlo Landmeter <clandmeter@gmail.com>
Date: Tue, 16 May 2023 19:57:39 +0200
Subject: [PATCH] Fix musl build
Downloaded from
https://git.alpinelinux.org/aports/tree/community/vdr/musl-compat.patch
Initial commit:
https://git.alpinelinux.org/aports/commit/?id=140248605cee4a0160f80b47ce77a823be2f740a
Upstream: https://www.linuxtv.org/pipermail/vdr/2023-May/029744.html
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
i18n.h | 2 +-
osd.c | 2 +-
thread.c | 4 +++-
tools.c | 4 ++--
tools.h | 14 ++++++++++++--
vdr.c | 6 ++++++
6 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/i18n.h b/i18n.h
index 03deb6f2..85ce4077 100644
--- a/i18n.h
+++ b/i18n.h
@@ -46,7 +46,7 @@ const cStringList *I18nLanguages(void);
///< have an actual locale installed. The rest are just dummy entries
///< to allow having three letter language codes for other languages
///< that have no actual locale on this system.
-const char *I18nTranslate(const char *s, const char *Plugin = NULL) __attribute_format_arg__(1);
+const char *I18nTranslate(const char *s, const char *Plugin = NULL) __attribute__((__format_arg__ (1)));
///< Translates the given string (with optional Plugin context) into
///< the current language. If no translation is available, the original
///< string will be returned.
diff --git a/osd.c b/osd.c
index 47bda686..0d360c81 100644
--- a/osd.c
+++ b/osd.c
@@ -12,7 +12,7 @@
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-#include <sys/unistd.h>
+#include <unistd.h>
#include "device.h"
#include "tools.h"
diff --git a/thread.c b/thread.c
index 93eb8c0d..6e854541 100644
--- a/thread.c
+++ b/thread.c
@@ -160,7 +160,9 @@ cRwLock::cRwLock(bool PreferWriter)
writeLockThreadId = 0;
pthread_rwlockattr_t attr;
pthread_rwlockattr_init(&attr);
+#if defined(__GLIBC__)
pthread_rwlockattr_setkind_np(&attr, PreferWriter ? PTHREAD_RWLOCK_PREFER_WRITER_NP : PTHREAD_RWLOCK_PREFER_READER_NP);
+#endif
pthread_rwlock_init(&rwlock, &attr);
}
@@ -210,7 +212,7 @@ cMutex::cMutex(void)
locked = 0;
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK_NP);
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
pthread_mutex_init(&mutex, &attr);
}
diff --git a/tools.c b/tools.c
index d04033b1..8b161eec 100644
--- a/tools.c
+++ b/tools.c
@@ -672,7 +672,7 @@ char *ReadLink(const char *FileName)
{
if (!FileName)
return NULL;
- char *TargetName = canonicalize_file_name(FileName);
+ char *TargetName = realpath(FileName, NULL);
if (!TargetName) {
if (errno == ENOENT) // file doesn't exist
TargetName = strdup(FileName);
@@ -1562,7 +1562,7 @@ cReadDir::~cReadDir()
struct dirent *cReadDir::Next(void)
{
if (directory) {
-#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
+#if __GLIBC__
while (readdir_r(directory, &u.d, &result) == 0 && result) {
#else
while ((result = readdir(directory)) != NULL) {
diff --git a/tools.h b/tools.h
index ff6169ee..60eda179 100644
--- a/tools.h
+++ b/tools.h
@@ -28,6 +28,16 @@
#include <sys/types.h>
#include "thread.h"
+#ifndef ACCESSPERMS
+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
+#endif
+#ifndef ALLPERMS
+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
+#endif
+#ifndef DEFFILEMODE
+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
+#endif
+
typedef unsigned char uchar;
extern int SysLogLevel;
@@ -444,7 +454,7 @@ class cReadDir {
private:
DIR *directory;
struct dirent *result;
-#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
+#if __GLIBC__
union { // according to "The GNU C Library Reference Manual"
struct dirent d;
char b[offsetof(struct dirent, d_name) + NAME_MAX + 1];
@@ -818,7 +828,7 @@ public:
data[i] = T(0);
size = 0;
}
- void Sort(__compar_fn_t Compare)
+ void Sort(int (*Compare)(const void *, const void *))
{
qsort(data, size, sizeof(T), Compare);
}
diff --git a/vdr.c b/vdr.c
index 1bdc51ab..0f426e61 100644
--- a/vdr.c
+++ b/vdr.c
@@ -661,12 +661,18 @@ int main(int argc, char *argv[])
}
}
else if (Terminal) {
+#ifdef __GLIBC__
// Claim new controlling terminal
stdin = freopen(Terminal, "r", stdin);
stdout = freopen(Terminal, "w", stdout);
stderr = freopen(Terminal, "w", stderr);
HasStdin = true;
tcgetattr(STDIN_FILENO, &savedTm);
+#else
+ // stdin, stdout, stderr are declared FILE const* by musl C library
+ fprintf(stderr, "Option '-t' is only supported if VDR has been built against glibc.\n");
+ return 2;
+#endif
}
// Set user id in case we were started as root:
--
2.39.2

View File

@@ -0,0 +1,51 @@
From a4a3d9b012c12cd8aaa2526f0eacdcffcdd9f8f1 Mon Sep 17 00:00:00 2001
From: Roberto Oliveira <robertoguimaraes8@gmail.com>
Date: Tue, 16 May 2023 20:01:18 +0200
Subject: [PATCH] Include limits.h
vdr package uses some macros like HOST_NAME_MAX, NAME_MAX, which are defined
in limits.h.
Needs to be explicitly included on ppc64le and for all archs for debug build.
Downloaded from
https://git.alpinelinux.org/aports/tree/community/vdr/include-missing-limits.patch
Initial commits:
https://git.alpinelinux.org/aports/commit/?id=c9d8942ccf4825fd734b5f37157a49fc4f0b4339
https://git.alpinelinux.org/aports/commit/?id=47965644c390b1be1117769b1e08b31858267e9a
Upstream: https://www.linuxtv.org/pipermail/vdr/2023-May/029743.html
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
config.h | 1 +
tools.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/config.h b/config.h
index 72dd3d2a..b9ea769f 100644
--- a/config.h
+++ b/config.h
@@ -19,6 +19,7 @@
#include "i18n.h"
#include "font.h"
#include "tools.h"
+#include <limits.h>
// VDR's own version number:
diff --git a/tools.c b/tools.c
index 8b161eec..56a2e0dd 100644
--- a/tools.c
+++ b/tools.c
@@ -27,6 +27,7 @@ extern "C" {
#include <utime.h>
#include "i18n.h"
#include "thread.h"
+#include <limits.h>
int SysLogLevel = 3;
--
2.39.2

View File

@@ -0,0 +1,37 @@
From 8711ce9c4ded311705f281c99e013a26987fbf1d Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: Sat, 1 Jan 2022 23:35:29 +0100
Subject: [PATCH] i18n.c: _nl_msg_cat_cntr is an internal symbol of some intl
implementation
It is supported by glibc and uClibc (which both define __GLIBC__) but
not musl (which doesn't define __GLIBC__). On musl, it doesn't do
anything because musl has a basic NLS implementation. Even
gettext-tiny defines _nl_msg_cat_cntr as a dummy symbol in its stub
libintl-musl implementation.
Upstream: https://www.linuxtv.org/pipermail/vdr/2023-May/029745.html
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
i18n.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/i18n.c b/i18n.c
index 0ef08fd4..da2a3ede 100644
--- a/i18n.c
+++ b/i18n.c
@@ -123,8 +123,10 @@ static const char *SkipContext(const char *s)
static void SetEnvLanguage(const char *Locale)
{
setenv("LANGUAGE", Locale, 1);
+#if defined(__GLIBC__)
extern int _nl_msg_cat_cntr;
++_nl_msg_cat_cntr;
+#endif
}
static void SetLanguageNames(void)
--
2.31.1

View File

@@ -0,0 +1,37 @@
From 075472ec580e03cc89971f0c118cb363776a304d Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd.kuhls@t-online.de>
Date: Tue, 16 May 2023 20:22:12 +0200
Subject: [PATCH] Fix musl build
malloc_trim is a GNU extension and therefore not present in non-glibc C
libraries such as musl. Wrapping this in an ifdef fixes musl builds.
Upstream: https://www.linuxtv.org/pipermail/vdr/2023-May/029742.html
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
vdr.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/vdr.c b/vdr.c
index 0f426e61..bc4902de 100644
--- a/vdr.c
+++ b/vdr.c
@@ -1588,12 +1588,14 @@ int main(int argc, char *argv[])
cSchedules::Cleanup();
// Plugins housekeeping:
PluginManager.Housekeeping();
+#if defined(__GLIBC__)
// Memory cleanup:
static time_t LastMemoryCleanup = 0;
if ((Now - LastMemoryCleanup) > MEMCLEANUPDELTA) {
malloc_trim(0);
LastMemoryCleanup = Now;
}
+#endif
}
}
--
2.39.2

25
package/vdr/Config.in Normal file
View File

@@ -0,0 +1,25 @@
config BR2_PACKAGE_VDR
bool "vdr"
depends on BR2_INSTALL_LIBSTDCPP
depends on !BR2_STATIC_LIBS
depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL
depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9
depends on BR2_USE_MMU # fork()
depends on BR2_USE_WCHAR
select BR2_PACKAGE_FONTCONFIG
select BR2_PACKAGE_FREETYPE
select BR2_PACKAGE_JPEG
select BR2_PACKAGE_LIBCAP
select BR2_PACKAGE_LIBEXECINFO if !BR2_TOOLCHAIN_USES_GLIBC
help
This project describes how to build your own digital
satellite receiver and Video Disk Recorder.
http://www.tvdr.de
comment "vdr needs a toolchain w/ C++, dynamic library, NPTL, wchar, headers >= 3.9"
depends on BR2_USE_MMU
depends on !BR2_INSTALL_LIBSTDCPP || BR2_STATIC_LIBS || \
!BR2_TOOLCHAIN_HAS_THREADS_NPTL || \
!BR2_USE_WCHAR || \
!BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_9

3
package/vdr/vdr.hash Normal file
View File

@@ -0,0 +1,3 @@
# Locally computed
sha256 293e355b2cc22e6152dae9c315d5b8903f3e647a2e60b6217d306ff4bceb83e1 vdr-2.6.5.tar.gz
sha256 ddb9db7630752f8fdc6898f7c99a99eaeeac5213627ecb093df9c82f56175dc7 COPYING

66
package/vdr/vdr.mk Normal file
View File

@@ -0,0 +1,66 @@
################################################################################
#
# vdr
#
################################################################################
VDR_VERSION = 2.6.5
VDR_SITE = $(call github,vdr-projects,vdr,$(VDR_VERSION))
VDR_LICENSE = GPL-2.0+
VDR_LICENSE_FILES = COPYING
VDR_CPE_ID_VENDOR = tvdr
VDR_INSTALL_STAGING = YES
VDR_DEPENDENCIES = \
host-pkgconf \
freetype \
fontconfig \
jpeg \
libcap \
$(TARGET_NLS_DEPENDENCIES)
VDR_MAKE_FLAGS = \
NO_KBD=yes \
PKG_CONFIG=$(PKG_CONFIG_HOST_BINARY) \
PLUGINLIBDIR=/usr/lib/vdr \
PREFIX=/usr \
VIDEODIR=/var/lib/vdr
VDR_LDFLAGS = $(TARGET_NLS_LIBS)
ifeq ($(BR2_PACKAGE_LIBEXECINFO),y)
VDR_DEPENDENCIES += libexecinfo
VDR_LDFLAGS += -lexecinfo
endif
ifeq ($(BR2_PACKAGE_LIBFRIBIDI),y)
VDR_DEPENDENCIES += libfribidi
VDR_MAKE_FLAGS += BIDI=1
endif
ifeq ($(BR2_PACKAGE_LIBICONV),y)
VDR_DEPENDENCIES += libiconv
VDR_LDFLAGS += -liconv
endif
VDR_MAKE_ENV = \
LDFLAGS="$(VDR_LDFLAGS)" \
$(VDR_MAKE_FLAGS)
define VDR_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) $(VDR_MAKE_ENV) \
vdr vdr.pc include-dir
endef
define VDR_INSTALL_STAGING_CMDS
$(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D) $(VDR_MAKE_ENV) \
DESTDIR=$(STAGING_DIR) \
install-dirs install-bin install-conf install-includes \
install-pc
endef
define VDR_INSTALL_TARGET_CMDS
$(MAKE1) $(TARGET_CONFIGURE_OPTS) -C $(@D) $(VDR_MAKE_ENV) \
DESTDIR=$(TARGET_DIR) \
install-dirs install-bin install-conf
endef
$(eval $(generic-package))