initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,39 @@
From 81b491e60affd67f4ec2feccbee1cdf98dc57b81 Mon Sep 17 00:00:00 2001
From: Emil Mikulic <emikulic@gmail.com>
Date: Sun, 21 Mar 2021 15:03:14 +1100
Subject: [PATCH] Declare vars outside of for() loop for -std=c90.
Fixes #2.
[Retrieved from:
https://github.com/emikulic/darkhttpd/commit/81b491e60affd67f4ec2feccbee1cdf98dc57b81]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
darkhttpd.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/darkhttpd.c b/darkhttpd.c
index 219a8a3..268628a 100644
--- a/darkhttpd.c
+++ b/darkhttpd.c
@@ -966,8 +966,9 @@ static char *base64_encode(char *str) {
char *encoded_data = malloc(output_length+1);
if (encoded_data == NULL) return NULL;
- for (int i = 0, j = 0; i < input_length;) {
-
+ int i;
+ int j;
+ for (i = 0, j = 0; i < input_length;) {
uint32_t octet_a = i < input_length ? (unsigned char)str[i++] : 0;
uint32_t octet_b = i < input_length ? (unsigned char)str[i++] : 0;
uint32_t octet_c = i < input_length ? (unsigned char)str[i++] : 0;
@@ -981,7 +982,7 @@ static char *base64_encode(char *str) {
}
const int mod_table[] = {0, 2, 1};
- for (int i = 0; i < mod_table[input_length % 3]; i++)
+ for (i = 0; i < mod_table[input_length % 3]; i++)
encoded_data[output_length - 1 - i] = '=';
encoded_data[output_length] = '\0';
+14
View File
@@ -0,0 +1,14 @@
config BR2_PACKAGE_DARKHTTPD
bool "darkhttpd"
depends on BR2_USE_MMU # fork()
help
Darkhttpd is a simple, fast HTTP 1.1 web server which only
serves static content. It does not support PHP or CGI.
The behavior of darkhttpd can be altered by setting some
variables in /etc/default/darkhttpd:
- DARKHTTPD_ROOT: path to the server document root.
- DARKHTTPD_FLAGS: options to pass to darkhttpd.
https://unix4lyfe.org/darkhttpd/
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh
#
# Starts darkhttpd.
#
# Allow a few customizations from a config file
test -r /etc/default/darkhttpd && . /etc/default/darkhttpd
DARKHTTPD_PROG=/usr/sbin/darkhttpd
DARKHTTPD_PIDFILE=/var/run/darkhttpd.pid
DARKHTTPD_ARGS="${DARKHTTPD_ROOT:-/var/www} --log /var/log/darkhttpd.log $DARKHTTPD_FLAGS --chroot --uid nobody --gid www-data"
start() {
printf "Starting darkhttpd: "
start-stop-daemon -S -q -b -p $DARKHTTPD_PIDFILE -m --exec $DARKHTTPD_PROG -- $DARKHTTPD_ARGS
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
stop() {
printf "Stopping darkhttpd: "
start-stop-daemon -K -q -p $DARKHTTPD_PIDFILE
[ $? = 0 ] && echo "OK" || echo "FAIL"
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
+3
View File
@@ -0,0 +1,3 @@
# Locally generated
sha256 1d88c395ac79ca9365aa5af71afe4ad136a4ed45099ca398168d4a2014dc0fc2 darkhttpd-1.13.tar.gz
sha256 44e784df460954c7760e2eeae69aecb12a3d23ca1c0a4f6047c3c6452b2e2f49 darkhttpd.c
+31
View File
@@ -0,0 +1,31 @@
################################################################################
#
# darkhttpd
#
################################################################################
DARKHTTPD_VERSION = 1.13
DARKHTTPD_SITE = $(call github,emikulic,darkhttpd,v$(DARKHTTPD_VERSION))
DARKHTTPD_LICENSE = MIT
DARKHTTPD_LICENSE_FILES = darkhttpd.c
define DARKHTTPD_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)
endef
define DARKHTTPD_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0755 $(@D)/darkhttpd \
$(TARGET_DIR)/usr/sbin/darkhttpd
endef
define DARKHTTPD_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 package/darkhttpd/darkhttpd.service \
$(TARGET_DIR)/usr/lib/systemd/system/darkhttpd.service
endef
define DARKHTTPD_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/darkhttpd/S50darkhttpd \
$(TARGET_DIR)/etc/init.d/S50darkhttpd
endef
$(eval $(generic-package))
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Darkhttpd Web Server
After=syslog.target network.target auditd.service
[Service]
Environment="DARKHTTPD_ROOT=/var/www"
EnvironmentFile=-/etc/default/darkhttpd
ExecStart=/usr/sbin/darkhttpd $DARKHTTPD_ROOT $DARKHTTPD_FLAGS --chroot --uid nobody --gid www-data
[Install]
WantedBy=multi-user.target