├── LICENSE ├── README.md ├── classes ├── openwrt-base-files.bbclass ├── openwrt-distro-defaults.bbclass ├── openwrt-kmods.bbclass ├── openwrt-lua.bbclass ├── openwrt-services.bbclass ├── openwrt-virtual-runtimes.bbclass └── openwrt.bbclass ├── conf └── layer.conf ├── recipes-core ├── firewall3 │ └── firewall3_git.bb ├── fstools │ ├── files │ │ └── 0001-Define-GLOB_ONLYDIR-if-not-available.patch │ └── fstools_git.bb ├── images │ └── openwrt-image-minimal.bb ├── iwinfo │ ├── iwinfo │ │ ├── 0001-Makefile-LDFLAGS-set-liblua5.1-for-lua-lib.patch │ │ ├── 0002-fix-order-of-linker-cmdline-to-help-linking.patch │ │ └── 0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch │ └── iwinfo_git.bb ├── jsonpath │ ├── files │ │ ├── 0001-sync-lemon-parser.patch │ │ ├── 0002-Declare-ParseTrace.patch │ │ └── 0100-break-lemon-dependency-cycle.patch │ └── jsonpath_git.bb ├── libubox │ ├── libubox │ │ ├── 0001-version-libraries.patch │ │ └── fix-libdir.patch │ └── libubox_git.bb ├── make-ext4fs │ ├── files │ │ └── 0001-Add-missing-space-before-linker-option.patch │ └── make-ext4fs_git.bb ├── netifd │ ├── netifd │ │ ├── 0001-resolv.conf.auto-Use-run-instead-of-tmp.patch │ │ ├── 100-Fix-IFF_LOWER_UP-define.patch │ │ └── network.config │ └── netifd_git.bb ├── odhcp6c │ └── odhcp6c_git.bb ├── odhcpd │ └── odhcpd_git.bb ├── packagegroups │ └── packagegroup-openwrt-minimal.bb ├── procd │ ├── procd-inittab.bb │ ├── procd-inittab │ │ └── inittab │ ├── procd │ │ ├── 00_preinit.conf │ │ ├── 0100-use-sysmacros-where-needed.patch │ │ ├── 0200-fix-build.patch │ │ ├── 10_sysinfo │ │ └── banner.failsafe │ └── procd_git.bb ├── rpcd │ └── rpcd_git.bb ├── ubox │ ├── ubox │ │ ├── 0001-Fix-compilation-problem-warn_unused_result-Wunused-r.patch │ │ ├── 100-insmod-segfault.patch │ │ └── log.init │ └── ubox_git.bb ├── ubus │ └── ubus_git.bb ├── uci │ └── uci_git.bb ├── uclient │ ├── uclient │ │ └── 0001-remove-call-to-deprecated-function-luaL_openlib-in-l.patch │ └── uclient_git.bb ├── ustream-ssl │ └── ustream-ssl_git.bb └── xtables-addons │ ├── files │ ├── 0001-Unset-LDFLAGS-for-kernel-modules.patch │ ├── 001-fix-kernel-version-detection.patch │ ├── 100-add-rtsp-conntrack.patch │ ├── 200-add-lua-packetscript.patch │ ├── 201-fix-lua-packetscript.patch │ ├── 202-add-lua-autoconf.patch │ └── 400-fix-IFF_LOWER_UP-musl.patch │ └── xtables-addons_3.25.bb ├── recipes-extended ├── images │ ├── openwrt-image-base.bb │ ├── openwrt-image-full.bb │ └── openwrt-image-juci.bb ├── libnl-tiny │ └── libnl-tiny_git.bb ├── libroxml │ ├── libroxml_2.3.0.bb │ └── libroxml_git.bb ├── luci │ ├── luci │ │ └── cmake.patch │ └── luci_git.bb ├── lucihttp │ └── lucihttp.bb ├── packagegroups │ ├── packagegroup-openwrt-base.bb │ └── packagegroup-openwrt-full.bb ├── ugps │ └── ugps_git.bb ├── usbmode │ └── usbmode_git.bb └── usign │ └── usign_git.bb ├── recipes-kernel └── linux │ ├── files │ ├── bridge.cfg │ └── ipset.cfg │ └── linux-yocto%.bbappend ├── recipes-networking ├── ipset │ └── ipset_7.9.bb ├── relayd │ ├── relayd │ │ └── 0001-Fix-ignoring-return-value-of-write-declared-with-att.patch │ └── relayd_git.bb ├── uhttpd │ ├── uhttpd │ │ └── 0100-fix-wrong-binaries-found-due-to-inconsistent-path.patch │ └── uhttpd_git.bb ├── umbim │ ├── umbim │ │ └── 0001-remove-call-to-deprecated-function-luaL_openlib-in-l.patch │ └── umbim_git.bb ├── umdnsd │ └── umdnsd_git.bb └── uqmi │ ├── uqmi │ └── 001-fix-uninitialized-variable.patch │ └── uqmi_git.bb ├── recipes-support ├── cgi-io │ └── cgi-io_git.bb ├── lua-socket │ └── lua-socket_git.bb ├── lua │ ├── lua5.1 │ │ ├── 0004-Fix-stack-overflow-in-vararg-functions.patch │ │ ├── bitwise_operators.patch │ │ ├── lua5.1.pc │ │ ├── luaorg_1.patch │ │ ├── luaorg_2.patch │ │ └── uclibc-pthread.patch │ └── lua5.1_5.1.5.bb └── ucode │ └── ucode_git.bb └── recipes-tweaks ├── base-files ├── base-files-scripts.bb └── base-files_3.%.bbappend ├── busybox ├── busybox-1.36.% │ └── z300-fix_off_t_misdetection_triggered_without_LFS.patch ├── busybox │ ├── 220-add_lock_util.patch │ ├── fragment-lock.cfg │ └── fragment-noifupdown.cfg ├── busybox_%.bbappend └── busybox_1.36.%.bbappend ├── dnsmasq ├── dnsmasq │ └── 99-dnsmasq.rules └── dnsmasq_%.bbappend ├── hostapd └── hostapd_%.bbappend ├── iptables ├── iptables │ ├── 200-configurable_builtin.patch │ ├── 600-shared-libext.patch │ └── 601-Fix-out-of-tree-build.patch └── iptables_1.8.%.bbappend ├── modutils-initscripts ├── files │ └── modutils.init └── modutils-initscripts.bbappend ├── packagegroups └── packagegroup-core-boot.bbappend └── udev ├── eudev └── udev.procd └── eudev_%.bbappend /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Khem Raj 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # meta-openwrt 2 | OE metadata layer for OpenWRT 3 | 4 | This layer provides OpenEmbedded metadata for [OpenWRT](http://www.openwrt.org/) packages 5 | 6 | # Getting Started 7 | 8 | ```shell 9 | git clone https://github.com/openembedded/openembedded-core.git 10 | cd openembedded-core 11 | git clone https://github.com/openembedded/meta-openembedded.git 12 | git clone https://github.com/openembedded/bitbake.git 13 | git clone https://github.com/kraj/meta-openwrt.git 14 | 15 | $ . ./oe-init-build-env 16 | 17 | $ bitbake-layers add-layer ../meta-openembedded/meta-oe 18 | $ bitbake-layers add-layer ../meta-openembedded/meta-python 19 | $ bitbake-layers add-layer ../meta-openembedded/meta-networking 20 | $ bitbake-layers add-layer ../meta-openwrt 21 | ``` 22 | 23 | # Building 24 | 25 | Below we build for qemuarm machine as an example. 26 | to local.conf add: 27 | 28 | ``` 29 | INHERIT += " openwrt-distro-defaults " 30 | ``` 31 | 32 | You can then use, for example, one of: 33 | 34 | ```shell 35 | $ TCLIBC=musl MACHINE=qemuarm bitbake openwrt-image-minimal 36 | $ TCLIBC=musl MACHINE=qemuarm bitbake openwrt-image-base 37 | $ TCLIBC=musl MACHINE=qemuarm bitbake openwrt-image-full 38 | 39 | ``` 40 | 41 | * openwrt-image-minimal has openwrt networking and cli but no UI 42 | * openwrt-image-base has openwrt networking, cli, and UI (luci) 43 | 44 | # Running 45 | 46 | ```shell 47 | $ TCLIBC=musl runqemu qemuarm 48 | ``` 49 | 50 | # Limitations 51 | 52 | Works with OE Release >= 2.5 ( Sumo ) 53 | 54 | Currently images are buildable/bootable for mips, arm, aarch64, ppc, x86, x86_64 55 | based qemu machines 56 | MACHINE variable and TCLIBC variables can also be set in conf/local.conf 57 | to avoid typing it on commandline on any bitbake invocation 58 | 59 | # Dependencies 60 | 61 | ``` 62 | URI: https://github.com/openembedded/openembedded-core.git 63 | branch: master 64 | revision: HEAD 65 | 66 | URI: https://github.com/openembedded/meta-openembedded.git 67 | branch: master 68 | revision: HEAD 69 | 70 | URI: https://github.com/openembedded/bitbake.git 71 | branch: master 72 | revision: HEAD 73 | 74 | URI: https://github.com/imyller/meta-nodejs.git 75 | branch: master 76 | revision: HEAD 77 | 78 | URI: https://github.com/imyller/meta-nodejs-contrib.git 79 | branch: master 80 | revision: HEAD 81 | ``` 82 | 83 | # Upstreaming 84 | 85 | ## Mailing List 86 | Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-openwrt]' in the subject' 87 | 88 | When sending single patches, please use something like 89 | 90 | ```shell 91 | git send-email -M -1 --to openembedded-devel@lists.openembedded.org --subject-prefix=meta-openwrt][PATCH 92 | ``` 93 | ## Forking via github 94 | 95 | You are encouraged to fork the mirror on [github](https://github.com/kraj/meta-openwrt/) 96 | to share your patches, this is preferred for patch sets consisting of more than 97 | one patch. Other services like gitorious, repo.or.cz or self hosted setups are 98 | of course accepted as well, 'git fetch ' works the same on all of them. 99 | We recommend github because it is free, easy to use, has been proven to be reliable 100 | and has a really good web GUI. 101 | 102 | Maintainer(s) 103 | 104 | * Khem Raj 105 | -------------------------------------------------------------------------------- /classes/openwrt-base-files.bbclass: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2015 Khem Raj and 2 | # Copyright (C) 2018 Daniel Dickinson 3 | # 4 | # It is released under the MIT license. See COPYING.MIT 5 | # for the terms. 6 | 7 | # Use this git SRCREV for all recipes that pull files out of openwrt repository 8 | # Equivalent to tag v22.03 9 | 10 | OPENWRT_SRCREV = "977f6f36a0121b213f9eee4a7deb7fdf073320e4" 11 | 12 | LICENSE:append = "& GPL-2.0-or-later" 13 | 14 | OPENWRT_BASEPATH ?= "${S}/../git/openwrt" 15 | 16 | LIC_FILES_CHKSUM:append = " file://${OPENWRT_BASEPATH}/COPYING;md5=a8db84c7a073d2878849eee8eb0f5daa" 17 | 18 | SRC_URI:append = "\ 19 | git://github.com/openwrt/openwrt.git;branch=openwrt-22.03;protocol=https;name=openwrt;destsuffix=git/openwrt \ 20 | " 21 | 22 | SRCREV_FORMAT:prepend = "openwrt_" 23 | -------------------------------------------------------------------------------- /classes/openwrt-distro-defaults.bbclass: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2018 Daniel Dickinson 2 | # 3 | # It is released under the MIT license. See COPYING.MIT 4 | # for the terms. 5 | 6 | DISTRO_FEATURES:append = " procd" 7 | DISTRO_FEATURES:remove = "sysvinit systemd" 8 | DISTRO_FEATURES_BACKFILL_CONSIDERED:append = " sysvinit systemd" 9 | 10 | VIRTUAL-RUNTIME_init_manager = "procd" 11 | 12 | inherit openwrt-virtual-runtimes openwrt-kmods openwrt-services 13 | -------------------------------------------------------------------------------- /classes/openwrt-kmods.bbclass: -------------------------------------------------------------------------------- 1 | #/ This file Copyright (C) 2018 Daniel Dickinson 2 | # 3 | # It is released under the MIT license. See COPYING.MIT 4 | # for the terms. 5 | 6 | do_rootfs[depends] += " virtual/kernel:do_shared_workdir" 7 | 8 | ROOTFS_POSTUNINSTALL_COMMAND:append = ' openwrt_flatten_modules_hook; ' 9 | 10 | openwrt_flatten_modules_hook () { 11 | export KERNEL_VERSION="${@oe.utils.read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}" 12 | [ -n "${KERNEL_VERSION}" ] 13 | if [ -d "${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}" ]; then 14 | cd ${IMAGE_ROOTFS} && find lib/modules/${KERNEL_VERSION} -name '*.ko' -exec sh -c 'mod="{}"; ln -sf /$mod ${IMAGE_ROOTFS}/lib/modules/${KERNEL_VERSION}/$(basename "$mod")' \; 15 | fi 16 | } 17 | -------------------------------------------------------------------------------- /classes/openwrt-lua.bbclass: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2015 Khem Raj and 2 | # 3 | # It is released under the MIT license. See COPYING.MIT 4 | # for the terms. 5 | 6 | OECMAKE_C_FLAGS += "-DLUA_COMPAT_5_1" 7 | EXTRA_OECMAKE += "-DLUAPATH=${libdir}/lua/5.1" 8 | 9 | FILES:${PN} += "${libdir}/* ${datadir}/lua/5.*/" 10 | FILES:${PN}-dbg += "${libdir}/lua/5.*/.debug" 11 | 12 | DEPENDS += "lua5.1-native" 13 | OECMAKE_C_FLAGS += "-I${STAGING_INCDIR}/lua5.1" 14 | CFLAGS += "-I${STAGING_INCDIR}/lua5.1" 15 | 16 | do_configure:prepend () { 17 | if [ -e "${S}/CMakeLists.txt" ] ; then 18 | sed -i -e \ 19 | "s:ARCHIVE DESTINATION lib:ARCHIVE DESTINATION \${CMAKE_INSTALL_LIBDIR}:g" \ 20 | -e "s:LIBRARY DESTINATION lib:LIBRARY DESTINATION \${CMAKE_INSTALL_LIBDIR}:g" \ 21 | ${S}/CMakeLists.txt 22 | fi 23 | } 24 | -------------------------------------------------------------------------------- /classes/openwrt-services.bbclass: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2018 Daniel Dickinson 2 | # 3 | # It is released under the MIT license. See COPYING.MIT 4 | # for the terms. 5 | 6 | ROOTFS_POSTUNINSTALL_COMMAND:append = ' openwrt_enable_initscripts_hook; ' 7 | 8 | openwrt_enable_initscripts_hook () { 9 | mkdir -p ${IMAGE_ROOTFS}/etc/rc.d 10 | for script in ${IMAGE_ROOTFS}/etc/init.d/* 11 | do 12 | grep '#!/bin/sh /etc/rc.common' $script > /dev/null || continue 13 | IPKG_INSTROOT=${IMAGE_ROOTFS} /bin/bash ${IMAGE_ROOTFS}/etc/rc.common $script enable || continue 14 | done 15 | } 16 | -------------------------------------------------------------------------------- /classes/openwrt-virtual-runtimes.bbclass: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2018 Daniel Dickinson 2 | # 3 | # It is released under the MIT license. See COPYING.MIT 4 | # for the terms. 5 | 6 | VIRTUAL-RUNTIME_dev_manager ?= "procd" 7 | VIRTUAL-RUNTIME_login_manager ?= "busybox" 8 | VIRTUAL-RUNTIME_init_manager ?= "procd" 9 | VIRTUAL-RUNTIME_kmod_manager ?= "ubox" 10 | VIRTUAL-RUNTIME_syslog ?= "ubox" 11 | VIRTUAL-RUNTIME_base-utils ?= "busybox" 12 | VIRTUAL-RUNTIME_network_manager ?= "netifd" 13 | -------------------------------------------------------------------------------- /classes/openwrt.bbclass: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2015 Khem Raj and 2 | # 3 | # It is released under the MIT license. See COPYING.MIT 4 | # for the terms. 5 | 6 | FILES_SOLIBSDEV = "" 7 | 8 | inherit openwrt-lua 9 | inherit openwrt-virtual-runtimes 10 | -------------------------------------------------------------------------------- /conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, append to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have a recipes directory, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" 6 | 7 | BBFILE_COLLECTIONS += "openwrt-layer" 8 | BBFILE_PATTERN_openwrt-layer := "^${LAYERDIR}/" 9 | BBFILE_PRIORITY_openwrt-layer = "8" 10 | 11 | LAYERDEPENDS_openwrt-layer = "core openembedded-layer networking-layer" 12 | 13 | LAYERSERIES_COMPAT_openwrt-layer = "nanbield scarthgap" 14 | -------------------------------------------------------------------------------- /recipes-core/firewall3/firewall3_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | SUMMARY = "OpenWrt firewall configuration utility" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/firewall3.git;a=summary" 6 | LICENSE = "0BSD" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=17;md5=2a8ffaa9ef41014f236ab859378e8900" 8 | SECTION = "base" 9 | DEPENDS = "libubox uci ubus iptables" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/firewall3.git;protocol=https;branch=master \ 12 | " 13 | 14 | SRCREV = "12f6f143106257e0921c6ebbca2fe329cbeb3de6" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake pkgconfig openwrt openwrt-services openwrt-base-files 19 | 20 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 21 | 22 | EXTRA_OECMAKE = "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', '-DDISABLE_IPV6=OFF', '-DDISABLE_IPV6=ON', d)}" 23 | 24 | CFLAGS += "-Wno-error=format-overflow" 25 | do_install:append() { 26 | install -d ${D}${sysconfdir} 27 | install -d ${D}${sysconfdir}/config 28 | install -d ${D}${sysconfdir}/init.d 29 | install -d ${D}${sysconfdir}/hotplug.d/iface 30 | install -d ${D}${base_sbindir} 31 | 32 | install -m 0755 ${WORKDIR}/git/openwrt/package/network/config/firewall/files/firewall.init ${D}${sysconfdir}/init.d/firewall 33 | install -m 0644 ${WORKDIR}/git/openwrt/package/network/config/firewall/files/firewall.hotplug ${D}${sysconfdir}/hotplug.d/iface/20-firewall 34 | install -m 0644 ${WORKDIR}/git/openwrt/package/network/config/firewall/files/firewall.config ${D}${sysconfdir}/config/firewall 35 | install -m 0644 ${WORKDIR}/git/openwrt/package/network/config/firewall/files/firewall.user ${D}${sysconfdir}/firewall.user 36 | 37 | ln -s ${sbindir}/firewall3 ${D}${base_sbindir}/fw3 38 | 39 | # Be prepared for both procd and sysvinit/systemd style module loading 40 | install -dm 0755 ${D}${sysconfdir}/modules.d ${D}${sysconfdir}/modules-load.d 41 | if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'true', 'false', d)}" = "true" ]; then 42 | 43 | # Can't indent the here-document because leading spaces confuse 44 | # kmodloader 45 | cat >${D}${sysconfdir}/modules.d/40-ip6tables <${D}${sysconfdir}/modules.d/iptables-fw3 < 3 | Date: Fri, 22 Jan 2016 05:07:43 +0000 4 | Subject: [PATCH] Define GLOB_ONLYDIR if not available 5 | 6 | musl does not define GLOB_ONLYDIR 7 | 8 | Signed-off-by: Khem Raj 9 | --- 10 | Upstream-Status: Pending 11 | 12 | libfstools/overlay.c | 4 ++++ 13 | 1 file changed, 4 insertions(+) 14 | 15 | --- a/libfstools/overlay.c 16 | +++ b/libfstools/overlay.c 17 | @@ -34,6 +34,10 @@ 18 | #define GLOB_ONLYDIR 0x100 19 | #endif 20 | 21 | +#ifndef GLOB_ONLYDIR 22 | +#define GLOB_ONLYDIR 0x100 23 | +#endif 24 | + 25 | #define SWITCH_JFFS2 "/tmp/.switch_jffs2" 26 | #define OVERLAYDIR "/rom/overlay" 27 | 28 | -------------------------------------------------------------------------------- /recipes-core/fstools/fstools_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt filesystem utilities" 5 | HOMEPAGE = "https://git.openwrt.org/?p=project/fstools.git;a=summary" 6 | # libubi is under GPL 7 | # libblkid-tiny is PD 8 | # libfstools is LGPL 9 | LICENSE = "LGPL-2.1-only & GPL-2.0-only & PD" 10 | LIC_FILES_CHKSUM = "file://ubi.c;beginline=1;endline=17;md5=8ccc371d64f0b3a8d91065b678dc7095" 11 | SECTION = "base" 12 | DEPENDS += "util-linux ubus" 13 | 14 | SRC_URI = "git://git.openwrt.org/project/fstools.git;protocol=https;branch=master \ 15 | file://0001-Define-GLOB_ONLYDIR-if-not-available.patch \ 16 | " 17 | 18 | SRCREV = "8c213b0416b1a9411725f3c138d6c8b60032fd2b" 19 | 20 | S = "${WORKDIR}/git" 21 | 22 | inherit cmake pkgconfig openwrt 23 | 24 | EXTRA_OECMAKE += "${EXTRA_OECONF}" 25 | 26 | # avoids build breaks when using no-static-libs.inc 27 | DISABLE_STATIC = "" 28 | 29 | PACKAGECONFIG ??= "extroot" 30 | 31 | PACKAGECONFIG[extroot] = "-DCMAKE_UBIFS_EXTROOT=ON,,libubox uci," 32 | 33 | do_install:append() { 34 | install -dm 0755 ${D}/sbin 35 | ln -s /usr/sbin/mount_root ${D}/sbin/mount_root 36 | ln -s /usr/sbin/jffs2reset ${D}/sbin/jffs2reset 37 | } 38 | 39 | FILES:${PN} += "${libdir}/*" 40 | -------------------------------------------------------------------------------- /recipes-core/images/openwrt-image-minimal.bb: -------------------------------------------------------------------------------- 1 | # This file Copyright (C) 2015 Khem Raj and 2 | # Copyright (C) 2018 Daniel Dickinson 3 | # 4 | # It is released under the MIT license. See COPYING.MIT 5 | # for the terms. 6 | 7 | SUMMARY = "OpenWrt Minimal Complete Image" 8 | 9 | LICENSE = "MIT" 10 | 11 | inherit core-image openwrt openwrt-kmods openwrt-services 12 | 13 | CORE_IMAGE_BASE_INSTALL = '\ 14 | packagegroup-core-boot \ 15 | packagegroup-openwrt-minimal \ 16 | \ 17 | ${MACHINE_EXTRA_RDEPENDS} \ 18 | ${CORE_IMAGE_EXTRA_INSTALL} \ 19 | ' 20 | 21 | IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}" 22 | 23 | IMAGE_FSTYPES += "ext4" 24 | -------------------------------------------------------------------------------- /recipes-core/iwinfo/iwinfo/0001-Makefile-LDFLAGS-set-liblua5.1-for-lua-lib.patch: -------------------------------------------------------------------------------- 1 | From fe10e21bab3b73eb9f169849d24913fd77fb0026 Mon Sep 17 00:00:00 2001 2 | From: Kas User 3 | Date: Tue, 4 Oct 2022 22:42:46 +0300 4 | Subject: [PATCH] Makefile-LDFLAGS-set-liblua5.1-for-lua-lib 5 | 6 | --- 7 | Makefile | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/Makefile b/Makefile 11 | index 71b26d8..b52db6e 100644 12 | --- a/Makefile 13 | +++ b/Makefile 14 | @@ -9,7 +9,7 @@ IWINFO_LIB_LDFLAGS = $(LDFLAGS) -shared -Wl,-soname -Wl,$(IWINFO_LIB).$(IWINFO_S 15 | IWINFO_LIB_OBJ = iwinfo_utils.o iwinfo_lib.o 16 | 17 | IWINFO_LUA = iwinfo.so 18 | -IWINFO_LUA_LDFLAGS = $(LDFLAGS) -shared -L. -liwinfo -llua 19 | +IWINFO_LUA_LDFLAGS = $(LDFLAGS) -shared -L. -liwinfo -llua5.1 20 | IWINFO_LUA_OBJ = iwinfo_lua.o 21 | 22 | IWINFO_CLI = iwinfo 23 | -------------------------------------------------------------------------------- /recipes-core/iwinfo/iwinfo/0002-fix-order-of-linker-cmdline-to-help-linking.patch: -------------------------------------------------------------------------------- 1 | From 3db058a1d3a8a948c36f9faec2f9328149e6f46d Mon Sep 17 00:00:00 2001 2 | From: Kas User 3 | Date: Tue, 4 Oct 2022 22:43:34 +0300 4 | Subject: [PATCH] fix-order-of-linker-cmdline-to-help-linking 5 | 6 | --- 7 | Makefile | 8 +++----- 8 | 1 file changed, 3 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/Makefile b/Makefile 11 | index b52db6e..abe17b7 100644 12 | --- a/Makefile 13 | +++ b/Makefile 14 | @@ -46,14 +46,12 @@ compile: clean $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI) 15 | $(CC) $(IWINFO_CFLAGS) $(FPIC) -c -o $@ $< 16 | 17 | $(IWINFO_LIB): $(IWINFO_LIB_OBJ) 18 | - $(CC) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB).$(IWINFO_SOVERSION) $(IWINFO_LIB_OBJ) && \ 19 | + $(CC) $(IWINFO_LIB_OBJ) $(IWINFO_LDFLAGS) $(IWINFO_LIB_LDFLAGS) -o $(IWINFO_LIB).$(IWINFO_SOVERSION) && \ 20 | ln -sf $(IWINFO_LIB).$(IWINFO_SOVERSION) $(IWINFO_LIB) 21 | 22 | $(IWINFO_LUA): $(IWINFO_LUA_OBJ) 23 | - $(CC) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) $(IWINFO_LUA_OBJ) 24 | - 25 | + $(CC) $(IWINFO_LUA_OBJ) $(IWINFO_LDFLAGS) $(IWINFO_LUA_LDFLAGS) -o $(IWINFO_LUA) 26 | $(IWINFO_CLI): $(IWINFO_CLI_OBJ) 27 | - $(CC) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) $(IWINFO_CLI_OBJ) 28 | - 29 | + $(CC) $(IWINFO_CLI_OBJ) $(IWINFO_LDFLAGS) $(IWINFO_CLI_LDFLAGS) -o $(IWINFO_CLI) 30 | clean: 31 | rm -f *.o $(IWINFO_LIB) $(IWINFO_LUA) $(IWINFO_CLI) 32 | -------------------------------------------------------------------------------- /recipes-core/iwinfo/iwinfo/0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch: -------------------------------------------------------------------------------- 1 | From 0dbefc4fa4fc1292fa2c940304a5ec0df204cf98 Mon Sep 17 00:00:00 2001 2 | From: Kas User 3 | Date: Tue, 4 Oct 2022 22:59:16 +0300 4 | Subject: [PATCH] Replace loaL_reg with luaL_Reg according to lua5.1 5 | 6 | --- 7 | iwinfo_lua.c | 10 +++++----- 8 | 1 file changed, 5 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/iwinfo_lua.c b/iwinfo_lua.c 11 | index 996f291..39ac2af 100644 12 | --- a/iwinfo_lua.c 13 | +++ b/iwinfo_lua.c 14 | @@ -807,7 +807,7 @@ LUA_WRAP_STRUCT_OP(wext,hardware_id) 15 | 16 | #ifdef USE_WL 17 | /* Broadcom table */ 18 | -static const luaL_reg R_wl[] = { 19 | +static const luaL_Reg R_wl[] = { 20 | LUA_REG(wl,channel), 21 | LUA_REG(wl,frequency), 22 | LUA_REG(wl,frequency_offset), 23 | @@ -840,7 +840,7 @@ static const luaL_reg R_wl[] = { 24 | 25 | #ifdef USE_MADWIFI 26 | /* Madwifi table */ 27 | -static const luaL_reg R_madwifi[] = { 28 | +static const luaL_Reg R_madwifi[] = { 29 | LUA_REG(madwifi,channel), 30 | LUA_REG(madwifi,frequency), 31 | LUA_REG(madwifi,frequency_offset), 32 | @@ -873,7 +873,7 @@ static const luaL_reg R_madwifi[] = { 33 | 34 | #ifdef USE_NL80211 35 | /* NL80211 table */ 36 | -static const luaL_reg R_nl80211[] = { 37 | +static const luaL_Reg R_nl80211[] = { 38 | LUA_REG(nl80211,channel), 39 | LUA_REG(nl80211,frequency), 40 | LUA_REG(nl80211,frequency_offset), 41 | @@ -906,7 +906,7 @@ static const luaL_reg R_nl80211[] = { 42 | 43 | /* Wext table */ 44 | #ifdef USE_WEXT 45 | -static const luaL_reg R_wext[] = { 46 | +static const luaL_Reg R_wext[] = { 47 | LUA_REG(wext,channel), 48 | LUA_REG(wext,frequency), 49 | LUA_REG(wext,frequency_offset), 50 | @@ -938,7 +938,7 @@ static const luaL_reg R_wext[] = { 51 | #endif 52 | 53 | /* Common */ 54 | -static const luaL_reg R_common[] = { 55 | +static const luaL_Reg R_common[] = { 56 | { "type", iwinfo_L_type }, 57 | { "__gc", iwinfo_L__gc }, 58 | { NULL, NULL } 59 | -------------------------------------------------------------------------------- /recipes-core/iwinfo/iwinfo_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Library for accessing wireless device drivers" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/iwinfo.git;a=summary" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" 8 | SECTION = "base" 9 | DEPENDS += "uci lua5.1 ubus" 10 | 11 | SRCREV = "4a43b0d40ba50a21de1d47e7bf0f759be9cf646a" 12 | 13 | inherit openwrt 14 | 15 | SRC_URI = "git://git.openwrt.org/project/iwinfo.git;protocol=https;branch=master \ 16 | file://0001-Makefile-LDFLAGS-set-liblua5.1-for-lua-lib.patch \ 17 | file://0002-fix-order-of-linker-cmdline-to-help-linking.patch \ 18 | file://0003-Replace-typedef-loaL_reg-with-luaL_Reg.patch \ 19 | " 20 | 21 | S = "${WORKDIR}/git" 22 | 23 | CFLAGS += "-fPIC" 24 | 25 | # iwinfo breaks with parallel make 26 | PARALLEL_MAKE = "" 27 | 28 | FILES:${PN}-dev += "${libdir}/libiwinfo.so" 29 | 30 | do_install() { 31 | install -D -m 0755 ${B}/libiwinfo.so.0 ${D}${libdir}/libiwinfo.so.0 32 | ln -sf libiwinfo.so.0 ${D}${libdir}/libiwinfo.so 33 | install -D -m 0755 ${B}/iwinfo.so ${D}${libdir}/lua/5.1/iwinfo.so 34 | install -D -m 0755 ${B}/iwinfo ${D}${bindir}/iwinfo 35 | install -D -m 0644 ${S}/include/iwinfo.h ${D}${includedir}/iwinfo.h 36 | install -D -m 0644 ${S}/include/iwinfo/utils.h ${D}${includedir}/iwinfo/utils.h 37 | } 38 | -------------------------------------------------------------------------------- /recipes-core/jsonpath/files/0001-sync-lemon-parser.patch: -------------------------------------------------------------------------------- 1 | From b46c4c0c98dddd60cc017dc621fbbd596af1acdc Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Fri, 22 Jan 2016 09:02:19 +0000 4 | Subject: [PATCH 1/2] sync lemon parser 5 | 6 | Soured from 7 | http://sourceforge.net/p/brlcad/code/HEAD/tree/brlcad/trunk/misc/tools/lemon/ 8 | 9 | Signed-off-by: Khem Raj 10 | --- 11 | Upstream-Status: Pending 12 | 13 | contrib/lemon.c | 100 +++++++++++++++++++++++++++++-------------------------- 14 | contrib/lempar.c | 42 ++++++++++++++++++----- 15 | 2 files changed, 85 insertions(+), 57 deletions(-) 16 | 17 | diff --git a/contrib/lemon.c b/contrib/lemon.c 18 | index 85e94f7..89d992c 100644 19 | --- a/contrib/lemon.c 20 | +++ b/contrib/lemon.c 21 | @@ -1114,7 +1114,6 @@ void FindActions(struct lemon *lemp) 22 | /* Resolve conflicts */ 23 | for(i=0; instate; i++){ 24 | struct action *ap, *nap; 25 | - struct state *stp; 26 | stp = lemp->sorted[i]; 27 | /* assert( stp->ap ); */ 28 | stp->ap = Action_sort(stp->ap); 29 | @@ -1497,10 +1496,12 @@ int main(int argc, char **argv) 30 | {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."}, 31 | {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."}, 32 | {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."}, 33 | - {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, 34 | + {OPT_FSTR, "f", 0, "Ignored. (Placeholder for -f compiler options.)"}, 35 | {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."}, 36 | + {OPT_FSTR, "I", 0, "Ignored. (Placeholder for '-I' compiler options.)"}, 37 | {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."}, 38 | {OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."}, 39 | + {OPT_FSTR, "O", 0, "Ignored. (Placeholder for '-O' compiler options.)"}, 40 | {OPT_FLAG, "p", (char*)&showPrecedenceConflict, 41 | "Show conflicts resolved by precedence rules"}, 42 | {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."}, 43 | @@ -1508,6 +1509,8 @@ int main(int argc, char **argv) 44 | {OPT_FLAG, "s", (char*)&statistics, 45 | "Print parser stats to standard output."}, 46 | {OPT_FLAG, "x", (char*)&version, "Print the version number."}, 47 | + {OPT_FSTR, "T", (char*)handle_T_option, "Specify a template file."}, 48 | + {OPT_FSTR, "W", 0, "Ignored. (Placeholder for '-W' compiler options.)"}, 49 | {OPT_FLAG,0,0,0} 50 | }; 51 | int i; 52 | @@ -1727,7 +1730,7 @@ static char *msort( 53 | char *ep; 54 | char *set[LISTSIZE]; 55 | int i; 56 | - offset = (unsigned long)next - (unsigned long)list; 57 | + offset = (unsigned long)((char*)next - (char*)list); 58 | for(i=0; i%*s %s\n",op[i].label, 93 | + fprintf(errstream," -%s%*s %s\n",op[i].label, 94 | (int)(max-lemonStrlen(op[i].label)-9),"",op[i].message); 95 | break; 96 | case OPT_DBL: 97 | case OPT_FDBL: 98 | - fprintf(errstream," %s=%*s %s\n",op[i].label, 99 | + fprintf(errstream," -%s%*s %s\n",op[i].label, 100 | (int)(max-lemonStrlen(op[i].label)-6),"",op[i].message); 101 | break; 102 | case OPT_STR: 103 | case OPT_FSTR: 104 | - fprintf(errstream," %s=%*s %s\n",op[i].label, 105 | + fprintf(errstream," -%s%*s %s\n",op[i].label, 106 | (int)(max-lemonStrlen(op[i].label)-8),"",op[i].message); 107 | break; 108 | } 109 | @@ -2436,7 +2441,7 @@ to follow the previous rule."); 110 | if( x[0]=='{' || x[0]=='\"' || isalnum(x[0]) ){ 111 | const char *zOld, *zNew; 112 | char *zBuf, *z; 113 | - int nOld, n, nLine, nNew, nBack; 114 | + int nOld, n, nLine = 0, nNew, nBack; 115 | int addLineMacro; 116 | char zLine[50]; 117 | zNew = x; 118 | @@ -2635,7 +2640,7 @@ void Parse(struct lemon *gp) 119 | struct pstate ps; 120 | FILE *fp; 121 | char *filebuf; 122 | - int filesize; 123 | + unsigned int filesize; 124 | int lineno; 125 | int c; 126 | char *cp, *nextcp; 127 | @@ -2769,7 +2774,7 @@ void Parse(struct lemon *gp) 128 | c = *cp; 129 | *cp = 0; /* Null terminate the token */ 130 | parseonetoken(&ps); /* Parse the token */ 131 | - *cp = c; /* Restore the buffer */ 132 | + *cp = (char)c; /* Restore the buffer */ 133 | cp = nextcp; 134 | } 135 | free(filebuf); /* Release the buffer after parsing */ 136 | @@ -3392,7 +3397,7 @@ PRIVATE char *append_str(const char *zText, int n, int p1, int p2){ 137 | zText++; 138 | n--; 139 | }else{ 140 | - z[used++] = c; 141 | + z[used++] = (char)c; 142 | } 143 | } 144 | z[used] = 0; 145 | @@ -3742,9 +3747,9 @@ void ReportTable( 146 | /* Generate the include code, if any */ 147 | tplt_print(out,lemp,lemp->include,&lineno); 148 | if( mhflag ){ 149 | - char *name = file_makename(lemp, ".h"); 150 | - fprintf(out,"#include \"%s\"\n", name); lineno++; 151 | - free(name); 152 | + char *incName = file_makename(lemp, ".h"); 153 | + fprintf(out,"#include \"%s\"\n", incName); lineno++; 154 | + free(incName); 155 | } 156 | tplt_xfer(lemp->name,in,out,&lineno); 157 | 158 | @@ -3785,7 +3790,6 @@ void ReportTable( 159 | } 160 | name = lemp->name ? lemp->name : "Parse"; 161 | if( lemp->arg && lemp->arg[0] ){ 162 | - int i; 163 | i = lemonStrlen(lemp->arg); 164 | while( i>=1 && isspace(lemp->arg[i-1]) ) i--; 165 | while( i>=1 && (isalnum(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--; 166 | @@ -4473,18 +4477,18 @@ int Strsafe_insert(const char *data) 167 | } 168 | if( x1a->count>=x1a->size ){ 169 | /* Need to make the hash table bigger */ 170 | - int i,size; 171 | + int i,arrSize; 172 | struct s_x1 array; 173 | - array.size = size = x1a->size*2; 174 | + array.size = arrSize = x1a->size*2; 175 | array.count = x1a->count; 176 | - array.tbl = (x1node*)calloc(size, sizeof(x1node) + sizeof(x1node*)); 177 | + array.tbl = (x1node*)calloc(arrSize, sizeof(x1node) + sizeof(x1node*)); 178 | if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ 179 | - array.ht = (x1node**)&(array.tbl[size]); 180 | - for(i=0; icount; i++){ 184 | x1node *oldnp, *newnp; 185 | oldnp = &(x1a->tbl[i]); 186 | - h = strhash(oldnp->data) & (size-1); 187 | + h = strhash(oldnp->data) & (arrSize-1); 188 | newnp = &(array.tbl[i]); 189 | if( array.ht[h] ) array.ht[h]->from = &(newnp->next); 190 | newnp->next = array.ht[h]; 191 | @@ -4640,18 +4644,18 @@ int Symbol_insert(struct symbol *data, const char *key) 192 | } 193 | if( x2a->count>=x2a->size ){ 194 | /* Need to make the hash table bigger */ 195 | - int i,size; 196 | + int i,arrSize; 197 | struct s_x2 array; 198 | - array.size = size = x2a->size*2; 199 | + array.size = arrSize = x2a->size*2; 200 | array.count = x2a->count; 201 | - array.tbl = (x2node*)calloc(size, sizeof(x2node) + sizeof(x2node*)); 202 | + array.tbl = (x2node*)calloc(arrSize, sizeof(x2node) + sizeof(x2node*)); 203 | if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ 204 | - array.ht = (x2node**)&(array.tbl[size]); 205 | - for(i=0; icount; i++){ 209 | x2node *oldnp, *newnp; 210 | oldnp = &(x2a->tbl[i]); 211 | - h = strhash(oldnp->key) & (size-1); 212 | + h = strhash(oldnp->key) & (arrSize-1); 213 | newnp = &(array.tbl[i]); 214 | if( array.ht[h] ) array.ht[h]->from = &(newnp->next); 215 | newnp->next = array.ht[h]; 216 | @@ -4716,12 +4720,12 @@ int Symbol_count() 217 | struct symbol **Symbol_arrayof() 218 | { 219 | struct symbol **array; 220 | - int i,size; 221 | + int i,arrSize; 222 | if( x2a==0 ) return 0; 223 | - size = x2a->count; 224 | - array = (struct symbol **)calloc(size, sizeof(struct symbol *)); 225 | + arrSize = x2a->count; 226 | + array = (struct symbol **)calloc(arrSize, sizeof(struct symbol *)); 227 | if( array ){ 228 | - for(i=0; itbl[i].data; 229 | + for(i=0; itbl[i].data; 230 | } 231 | return array; 232 | } 233 | @@ -4837,18 +4841,18 @@ int State_insert(struct state *data, struct config *key) 234 | } 235 | if( x3a->count>=x3a->size ){ 236 | /* Need to make the hash table bigger */ 237 | - int i,size; 238 | + int i,arrSize; 239 | struct s_x3 array; 240 | - array.size = size = x3a->size*2; 241 | + array.size = arrSize = x3a->size*2; 242 | array.count = x3a->count; 243 | - array.tbl = (x3node*)calloc(size, sizeof(x3node) + sizeof(x3node*)); 244 | + array.tbl = (x3node*)calloc(arrSize, sizeof(x3node) + sizeof(x3node*)); 245 | if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ 246 | - array.ht = (x3node**)&(array.tbl[size]); 247 | - for(i=0; icount; i++){ 251 | x3node *oldnp, *newnp; 252 | oldnp = &(x3a->tbl[i]); 253 | - h = statehash(oldnp->key) & (size-1); 254 | + h = statehash(oldnp->key) & (arrSize-1); 255 | newnp = &(array.tbl[i]); 256 | if( array.ht[h] ) array.ht[h]->from = &(newnp->next); 257 | newnp->next = array.ht[h]; 258 | @@ -4895,12 +4899,12 @@ struct state *State_find(struct config *key) 259 | struct state **State_arrayof() 260 | { 261 | struct state **array; 262 | - int i,size; 263 | + int i,arrSize; 264 | if( x3a==0 ) return 0; 265 | - size = x3a->count; 266 | - array = (struct state **)calloc(size, sizeof(struct state *)); 267 | + arrSize = x3a->count; 268 | + array = (struct state **)calloc(arrSize, sizeof(struct state *)); 269 | if( array ){ 270 | - for(i=0; itbl[i].data; 271 | + for(i=0; itbl[i].data; 272 | } 273 | return array; 274 | } 275 | @@ -4977,18 +4981,18 @@ int Configtable_insert(struct config *data) 276 | } 277 | if( x4a->count>=x4a->size ){ 278 | /* Need to make the hash table bigger */ 279 | - int i,size; 280 | + int i,arrSize; 281 | struct s_x4 array; 282 | - array.size = size = x4a->size*2; 283 | + array.size = arrSize = x4a->size*2; 284 | array.count = x4a->count; 285 | - array.tbl = (x4node*)calloc(size, sizeof(x4node) + sizeof(x4node*)); 286 | + array.tbl = (x4node*)calloc(arrSize, sizeof(x4node) + sizeof(x4node*)); 287 | if( array.tbl==0 ) return 0; /* Fail due to malloc failure */ 288 | - array.ht = (x4node**)&(array.tbl[size]); 289 | - for(i=0; icount; i++){ 293 | x4node *oldnp, *newnp; 294 | oldnp = &(x4a->tbl[i]); 295 | - h = confighash(oldnp->data) & (size-1); 296 | + h = confighash(oldnp->data) & (arrSize-1); 297 | newnp = &(array.tbl[i]); 298 | if( array.ht[h] ) array.ht[h]->from = &(newnp->next); 299 | newnp->next = array.ht[h]; 300 | diff --git a/contrib/lempar.c b/contrib/lempar.c 301 | index fe56d2d..21d4e50 100644 302 | --- a/contrib/lempar.c 303 | +++ b/contrib/lempar.c 304 | @@ -4,6 +4,7 @@ 305 | /* First off, code is included that follows the "include" declaration 306 | ** in the input grammar file. */ 307 | #include 308 | +#include 309 | %% 310 | /* Next is all token values, in a form suitable for use by makeheaders. 311 | ** This section will be null unless lemon is run with the -m switch. 312 | @@ -238,7 +239,7 @@ static void yyGrowStack(yyParser *p){ 313 | int newSize; 314 | yyStackEntry *pNew; 315 | 316 | - newSize = p->yystksz*2 + 100; 317 | + newSize = p->yystksz*2 + 256; 318 | pNew = realloc(p->yystack, newSize*sizeof(pNew[0])); 319 | if( pNew ){ 320 | p->yystack = pNew; 321 | @@ -305,8 +306,12 @@ static void yy_destructor( 322 | ** inside the C code. 323 | */ 324 | %% 325 | - default: break; /* If no destructor action specified: do nothing */ 326 | + default: 327 | + if (!yypminor) 328 | + return; 329 | + break; /* If no destructor action specified: do nothing */ 330 | } 331 | + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ 332 | } 333 | 334 | /* 335 | @@ -319,9 +324,12 @@ static void yy_destructor( 336 | */ 337 | static int yy_pop_parser_stack(yyParser *pParser){ 338 | YYCODETYPE yymajor; 339 | - yyStackEntry *yytos = &pParser->yystack[pParser->yyidx]; 340 | + yyStackEntry *yytos; 341 | 342 | if( pParser->yyidx<0 ) return 0; 343 | + 344 | + yytos = &pParser->yystack[pParser->yyidx]; 345 | + 346 | #ifndef NDEBUG 347 | if( yyTraceFILE && pParser->yyidx>=0 ){ 348 | fprintf(yyTraceFILE,"%sPopping %s\n", 349 | @@ -483,9 +491,11 @@ static void yyStackOverflow(yyParser *yypParser, YYMINORTYPE *yypMinor){ 350 | #endif 351 | while( yypParser->yyidx>=0 ) yy_pop_parser_stack(yypParser); 352 | /* Here code is inserted which will execute if the parser 353 | - ** stack every overflows */ 354 | + ** stack ever overflows */ 355 | %% 356 | ParseARG_STORE; /* Suppress warning about unused %extra_argument var */ 357 | + yypMinor = NULL; /* quellage */ 358 | + assert(yypMinor == NULL); 359 | } 360 | 361 | /* 362 | @@ -560,14 +570,23 @@ static void yy_reduce( 363 | yyStackEntry *yymsp; /* The top of the parser's stack */ 364 | int yysize; /* Amount to pop the stack */ 365 | ParseARG_FETCH; 366 | + 367 | yymsp = &yypParser->yystack[yypParser->yyidx]; 368 | + 369 | + if( yyruleno>=0 ) { 370 | #ifndef NDEBUG 371 | - if( yyTraceFILE && yyruleno>=0 372 | - && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){ 373 | - fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, 374 | - yyRuleName[yyruleno]); 375 | - } 376 | + if ( yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0]))) { 377 | + if (yyTraceFILE) { 378 | + fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, 379 | + yyRuleName[yyruleno]); 380 | + } 381 | + } 382 | #endif /* NDEBUG */ 383 | + } else { 384 | + /* invalid rule number range */ 385 | + return; 386 | + } 387 | + 388 | 389 | /* Silence complaints from purify about yygotominor being uninitialized 390 | ** in some cases when it is copied into the stack after the following 391 | @@ -623,6 +642,8 @@ static void yy_reduce( 392 | assert( yyact == YYNSTATE + YYNRULE + 1 ); 393 | yy_accept(yypParser); 394 | } 395 | + 396 | + ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ 397 | } 398 | 399 | /* 400 | @@ -658,6 +679,9 @@ static void yy_syntax_error( 401 | #define TOKEN (yyminor.yy0) 402 | %% 403 | ParseARG_STORE; /* Suppress warning about unused %extra_argument variable */ 404 | + yymajor = 0; /* quellage */ 405 | + yyminor.yyinit = 0; /* quellage */ 406 | + assert(yymajor == 0 && yyminor.yyinit == 0); 407 | } 408 | 409 | /* 410 | -- 411 | 2.7.0 412 | 413 | -------------------------------------------------------------------------------- /recipes-core/jsonpath/files/0002-Declare-ParseTrace.patch: -------------------------------------------------------------------------------- 1 | From aeaaa18704672b7cb9ddce34cf8917717566fb84 Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Fri, 22 Jan 2016 09:02:59 +0000 4 | Subject: [PATCH 2/2] Declare ParseTrace 5 | 6 | Fixes errors with newer gcc 7 | | parser.c:283:6: error: no previous declaration for 'ParseTrace' 8 | [-Werror=missing-declarations] 9 | | void ParseTrace(FILE *TraceFILE, char *zTracePrompt){ 10 | 11 | Signed-off-by: Khem Raj 12 | --- 13 | Upstream-Status: Pending 14 | 15 | parser.y | 2 ++ 16 | 1 file changed, 2 insertions(+) 17 | 18 | diff --git a/parser.y b/parser.y 19 | index f77779b..3cb3efb 100644 20 | --- a/parser.y 21 | +++ b/parser.y 22 | @@ -36,6 +36,8 @@ 23 | #define alloc_op(type, num, str, ...) \ 24 | jp_alloc_op(s, type, num, str, ##__VA_ARGS__, NULL) 25 | 26 | +void ParseTrace(FILE*, char*); 27 | + 28 | } 29 | 30 | %syntax_error { 31 | -- 32 | 2.7.0 33 | 34 | -------------------------------------------------------------------------------- /recipes-core/jsonpath/files/0100-break-lemon-dependency-cycle.patch: -------------------------------------------------------------------------------- 1 | Break CMake custom command dependency cycle 2 | 3 | Ninja complains of dependency cycle due to separate custom commands 4 | (which can end up building in parallel but the second has a dependency 5 | on lemon parser build (the first). 6 | 7 | | NOTE: VERBOSE=1 cmake --build oe/build/tmp-musl/work/armv5e-oe-linux-musleabi/jsonpath/git-r0/git --target all -- -j 8 8 | | ninja: error: dependency cycle: contrib/lemon -> contrib/lemon 9 | 10 | We therefore update to a single add_custom_command that issues 11 | the lemon build then uses it to generate the parser.c that we want. 12 | 13 | Signed-of-by: Daniel F. Dickinson 14 | Index: git/CMakeLists.txt 15 | =================================================================== 16 | --- git.orig/CMakeLists.txt 17 | +++ git/CMakeLists.txt 18 | @@ -1,4 +1,4 @@ 19 | -cmake_minimum_required(VERSION 2.6) 20 | +cmake_minimum_required(VERSION 3.0) 21 | 22 | PROJECT(jsonpath C) 23 | ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -Wmissing-declarations -Wno-error=unused-variable -ffunction-sections -D_GNU_SOURCE) 24 | @@ -21,17 +21,11 @@ IF(JSONC_FOUND) 25 | ENDIF() 26 | 27 | ADD_CUSTOM_COMMAND( 28 | - OUTPUT contrib/lemon 29 | - DEPENDS contrib/lemon.c contrib/lempar.c 30 | - COMMAND gcc -o contrib/lemon contrib/lemon.c 31 | - COMMENT "Generating lemon parser generator" 32 | -) 33 | - 34 | -ADD_CUSTOM_COMMAND( 35 | OUTPUT parser.c 36 | - DEPENDS parser.y contrib/lemon 37 | + COMMAND gcc -o contrib/lemon contrib/lemon.c 38 | COMMAND ./contrib/lemon parser.y 39 | - COMMENT "Generating parser.c" 40 | + DEPENDS contrib/lemon.c contrib/lempar.c parser.y 41 | + COMMENT "Generating lemon parser generator and using to generate parser.c" 42 | ) 43 | 44 | FIND_PATH(ubox_include_dir libubox/list.h) 45 | -------------------------------------------------------------------------------- /recipes-core/jsonpath/jsonpath_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt JSON parsing utility" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/jsonpath.git;a=summary" 6 | LICENSE = "BSD-1-Clause" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=15;md5=e1b007aed2273fc3ec1d16560a17aadc" 8 | SECTION = "base" 9 | DEPENDS = "json-c libubox" 10 | 11 | SRCREV = "c7e938d6582a436dddc938539e72dd1320625c54" 12 | SRC_URI = "git://git.openwrt.org/project/jsonpath.git;protocol=https;branch=master;name=jsonpath; \ 13 | file://0001-sync-lemon-parser.patch \ 14 | file://0002-Declare-ParseTrace.patch \ 15 | file://0100-break-lemon-dependency-cycle.patch \ 16 | " 17 | 18 | SRCREV_jsonpath = "c7e938d6582a436dddc938539e72dd1320625c54" 19 | 20 | inherit cmake pkgconfig 21 | 22 | S = "${WORKDIR}/git" 23 | B = "${S}" 24 | 25 | do_install:append() { 26 | ln -s ${bindir}/jsonpath ${D}${bindir}/jsonfilter 27 | } 28 | -------------------------------------------------------------------------------- /recipes-core/libubox/libubox/0001-version-libraries.patch: -------------------------------------------------------------------------------- 1 | Index: git/CMakeLists.txt 2 | =================================================================== 3 | --- git.orig/CMakeLists.txt 4 | +++ git/CMakeLists.txt 5 | @@ -18,6 +18,7 @@ ENDIF() 6 | SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c) 7 | 8 | ADD_LIBRARY(ubox SHARED ${SOURCES}) 9 | +SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION 2.0.0 SOVERSION 2) 10 | ADD_LIBRARY(ubox-static STATIC ${SOURCES}) 11 | SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox) 12 | 13 | @@ -46,6 +47,7 @@ find_library(json NAMES json-c) 14 | IF(EXISTS ${json}) 15 | ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) 16 | TARGET_LINK_LIBRARIES(blobmsg_json ubox ${json}) 17 | + SET_TARGET_PROPERTIES(blobmsg_json PROPERTIES VERSION 2.0.0 SOVERSION 2) 18 | 19 | ADD_LIBRARY(blobmsg_json-static STATIC blobmsg_json.c) 20 | SET_TARGET_PROPERTIES(blobmsg_json-static 21 | @@ -55,6 +57,7 @@ IF(EXISTS ${json}) 22 | TARGET_LINK_LIBRARIES(jshn blobmsg_json ${json}) 23 | 24 | ADD_LIBRARY(json_script SHARED json_script.c) 25 | + SET_TARGET_PROPERTIES(json_script PROPERTIES VERSION 2.0.0 SOVERSION 2) 26 | TARGET_LINK_LIBRARIES(json_script ubox) 27 | 28 | INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script 29 | -------------------------------------------------------------------------------- /recipes-core/libubox/libubox/fix-libdir.patch: -------------------------------------------------------------------------------- 1 | [PATCH] fix the CMAKE_INSTALL_LIBDIR 2 | 3 | Upstream-Status: Pending 4 | 5 | libdir maybe /usr/lib64 for 64bit machine 6 | 7 | Signed-off-by: Roy Li 8 | --- 9 | CMakeLists.txt | 8 ++++---- 10 | 1 file changed, 4 insertions(+), 4 deletions(-) 11 | 12 | Index: git/CMakeLists.txt 13 | =================================================================== 14 | --- git.orig/CMakeLists.txt 15 | +++ git/CMakeLists.txt 16 | @@ -36,8 +36,8 @@ INSTALL(FILES ${headers} 17 | DESTINATION include/libubox 18 | ) 19 | INSTALL(TARGETS ubox ubox-static 20 | - ARCHIVE DESTINATION lib 21 | - LIBRARY DESTINATION lib 22 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 23 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 24 | ) 25 | 26 | ADD_SUBDIRECTORY(lua) 27 | @@ -61,8 +61,8 @@ IF(EXISTS ${json}) 28 | TARGET_LINK_LIBRARIES(json_script ubox) 29 | 30 | INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script 31 | - ARCHIVE DESTINATION lib 32 | - LIBRARY DESTINATION lib 33 | + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 34 | + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 35 | RUNTIME DESTINATION bin 36 | ) 37 | 38 | -------------------------------------------------------------------------------- /recipes-core/libubox/libubox_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | DESCRIPTION = "C utility functions for OpenWrt" 6 | HOMEPAGE = "http://git.openwrt.org/?p=project/libubox.git;a=summary" 7 | 8 | PACKAGECONFIG ??= "lua examples" 9 | 10 | PACKAGECONFIG[lua] = "" 11 | PACKAGECONFIG[examples] = "" 12 | 13 | LICENSE = "BSD-1-Clause&BSD-3-Clause" 14 | LICENSE += "${@bb.utils.contains('PACKAGECONFIG', 'examples', '&GPL-2.0-only', '', d)}" 15 | LICENSE:${PN} = "BSD-1-Clause&BSD-3-Clause" 16 | LICENSE:${PN}-lua = "BSD-1-Clause&BSD-3-Clause" 17 | LICENSE:${PN}-examples = "GPL-2.0-only&BSD-1-Clause&BSD-3-Clause" 18 | 19 | LIC_FILES_CHKSUM = "\ 20 | file://avl.c;endline=39;md5=00810155fed3d604816ec5814523d60a \ 21 | file://avl-cmp.c;endline=15;md5=1603e6094b432a5f3f320877a06f41b5 \ 22 | file://base64.c;endline=61;md5=51fdff010d45b0086ac0a6e035693dc0 \ 23 | file://blobmsg.c;endline=15;md5=7ed64c1570e8c9b46c4fc6fbd16c489e \ 24 | file://list.h;endline=28;md5=2d5f5475fbd0f08741354c5a99c2e983 \ 25 | file://md5.h;endline=39;md5=048bf9f68963c207a0c2b3a94c9d2aaa \ 26 | file://md5.c;endline=51;md5=0a448eea0bcbc89e3c7e6608f2d119a0 \ 27 | file://usock.h;endline=18;md5=f0dfdc8de858e66d66d74036611bba14 \ 28 | file://uloop.c;beginline=1;endline=17;md5=f151c0422668fa4c8f91d2caf5267b3e \ 29 | " 30 | 31 | SECTION = "libs" 32 | 33 | DEPENDS += "json-c" 34 | DEPENDS += "${@bb.utils.contains('PACKAGECONFIG', 'lua', 'lua5.1', '', d)}" 35 | 36 | SRC_URI = "\ 37 | git://git.openwrt.org/project/libubox.git;protocol=https;branch=master \ 38 | file://0001-version-libraries.patch \ 39 | file://fix-libdir.patch \ 40 | " 41 | 42 | SRCREV = "d2223ef9da7172a84d1508733dc58840e1381e3c" 43 | PV = "2.0.0+git${SRCPV}" 44 | 45 | S = "${WORKDIR}/git" 46 | 47 | inherit cmake pkgconfig openwrt-lua 48 | 49 | EXTRA_OECMAKE += "\ 50 | -DBUILD_LUA=${@bb.utils.contains('PACKAGECONFIG', 'lua', 'ON', 'OFF', d)} \ 51 | -DBUILD_EXAMPLES=${@bb.utils.contains('PACKAGECONFIG', 'examples', 'ON', 'OFF', d)} \ 52 | -DCMAKE_SKIP_RPATH=ON \ 53 | " 54 | 55 | OECMAKE_C_FLAGS += "${@bb.utils.contains('PACKAGECONFIG', 'lua', '-I${STAGING_INCDIR}/lua5.1', '', d)}" 56 | 57 | do_install:append() { 58 | install -d ${D}${bindir} ${D}${includedir}/libubox 59 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'examples', 'ON', 'OFF', d)}" = "ON" ]; then 60 | install -m 0755 ${B}/examples/*-example ${D}${bindir} 61 | install -m 0755 ${S}/examples/uloop_pid_test.sh ${D}${bindir} 62 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'lua', 'ON', 'OFF', d)}" = "ON" ]; then 63 | install -m 0755 ${S}/examples/uloop-example.lua ${D}${bindir} 64 | fi 65 | install -m 0755 ${S}/examples/uloop_pid_test.sh ${D}${bindir} 66 | fi 67 | install -m 0644 ${S}/*.h ${D}${includedir}/libubox 68 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'lua', 'ON', 'OFF', d)}" = "ON" ]; then 69 | install -m 0755 ${B}/lua/uloop.so ${D}${libdir}/lua/5.1/uloop.so 70 | fi 71 | } 72 | 73 | PACKAGES =+ "\ 74 | ${@bb.utils.contains('PACKAGECONFIG', 'examples', '${PN}-examples', '', d)} \ 75 | ${@bb.utils.contains('PACKAGECONFIG', 'lua', '${PN}-lua', '', d)} \ 76 | " 77 | 78 | FILES:${PN} += "${datadir}/*" 79 | FILES:${PN}-lua += "${libdir}/lua/5.1/*" 80 | FILES:${PN}-examples += "${bindir}/*-example \ 81 | ${bindir}/uloop-example.lua \ 82 | ${bindir}/uloop_pid_test.sh \ 83 | " 84 | -------------------------------------------------------------------------------- /recipes-core/make-ext4fs/files/0001-Add-missing-space-before-linker-option.patch: -------------------------------------------------------------------------------- 1 | From 484a1e97e3d0fdc67d133d063c6b2cb8cce8256b Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 9 Dec 2020 15:49:54 -0800 4 | Subject: [PATCH] Add missing space before linker option 5 | 6 | Signed-off-by: Khem Raj 7 | --- 8 | Makefile | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/Makefile b/Makefile 12 | index 4b4e4c6..4a22ea1 100644 13 | --- a/Makefile 14 | +++ b/Makefile 15 | @@ -27,7 +27,7 @@ OBJ := \ 16 | $(CC) $(CFLAGS) -c -o $@ $^ 17 | 18 | make_ext4fs: $(OBJ) libsparse/libsparse.a 19 | - $(CC) $(LDFLAGS)-o $@ $^ $(ZLIB) 20 | + $(CC) $(LDFLAGS) -o $@ $^ $(ZLIB) 21 | 22 | libsparse/libsparse.a: 23 | $(MAKE) -C libsparse/ libsparse.a 24 | -- 25 | 2.29.2 26 | 27 | -------------------------------------------------------------------------------- /recipes-core/make-ext4fs/make-ext4fs_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Standalone fork of Android's make_ext4fs utility" 5 | HOMEPAGE = "https://git.openwrt.org/?p=project/make_ext4fs.git;a=summary" 6 | LICENSE = "Apache-2.0" 7 | LIC_FILES_CHKSUM = "file://NOTICE;md5=bb2810bf31da2f6bb39e0bfa86091da3" 8 | SECTION = "tools" 9 | DEPENDS = "zlib" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/make_ext4fs.git;protocol=https;branch=master \ 12 | file://0001-Add-missing-space-before-linker-option.patch \ 13 | " 14 | SRCREV = "5c201be7d72aff735da27e17c29852e0cefe3e52" 15 | 16 | S = "${WORKDIR}/git" 17 | B = "${S}" 18 | 19 | CFLAGS += "-I${S}/include -I${S}/libsparse/include" 20 | TARGET_CFLAGS:append = " -Wno-implicit-function-declaration" 21 | 22 | TARGET_CC_ARCH += "${LDFLAGS}" 23 | 24 | do_install() { 25 | install -Dm 0755 ${B}/make_ext4fs ${D}${bindir}/make_ext4fs 26 | } 27 | -------------------------------------------------------------------------------- /recipes-core/netifd/netifd/0001-resolv.conf.auto-Use-run-instead-of-tmp.patch: -------------------------------------------------------------------------------- 1 | From 587e3af4084e477c244750028937cbfa54bf6c71 Mon Sep 17 00:00:00 2001 2 | From: Parthiban Nallathambi 3 | Date: Fri, 8 Jun 2018 18:41:43 +0200 4 | Subject: [PATCH] [resolv.conf.auto]: Use /run instead of /tmp 5 | 6 | Using netifd as network manager along with systemd provokes the bad usage 7 | of path, in this case /tmp/. All the runtime configuration needs to be 8 | sotored as part of /run 9 | 10 | Problem: 11 | ======== 12 | assuming: ln -fs /tmp/resolv.conf.auto /etc/resolv.conf 13 | 14 | If any application tend to use Filesystem namespace to have separate /tmp and 15 | try to use DNS resolution from netifd, it will not be able to resolve the path/symlink. 16 | 17 | Usage of PrivateTmp=yes: 18 | ------------------------ 19 | For example, systemd-timesyncd.service in systemd uses the option "PrivateTmp=yes" 20 | in the service file to have separate /tmp filesystem namespace and uses glibc 21 | getaddrinfo for name resolution, which in turm follows the symlink to /tmp which 22 | doesn't exit in new namespace 23 | 24 | So moving the runtime configuration to /run here 25 | 26 | Signed-off-by: Parthiban Nallathambi 27 | Signed-off-by: Alejandro Hernandez 28 | 29 | 30 | --- 31 | netifd.h | 2 +- 32 | 1 file changed, 1 insertion(+), 1 deletion(-) 33 | 34 | --- a/netifd.h 35 | +++ b/netifd.h 36 | @@ -38,13 +38,13 @@ 37 | #define DEFAULT_MAIN_PATH "./examples" 38 | #define DEFAULT_CONFIG_PATH "./config" 39 | #define DEFAULT_HOTPLUG_PATH "./examples/hotplug-cmd" 40 | -#define DEFAULT_RESOLV_CONF "./tmp/resolv.conf" 41 | +#define DEFAULT_RESOLV_CONF "./run/resolv.conf" 42 | #define DEFAULT_BOARD_JSON "./config/board.json" 43 | #else 44 | #define DEFAULT_MAIN_PATH "/lib/netifd" 45 | #define DEFAULT_CONFIG_PATH NULL /* use the default set in libuci */ 46 | #define DEFAULT_HOTPLUG_PATH "/sbin/hotplug-call" 47 | -#define DEFAULT_RESOLV_CONF "/tmp/resolv.conf.d/resolv.conf.auto" 48 | +#define DEFAULT_RESOLV_CONF "/run/resolv.conf.d/resolv.conf.auto" 49 | #define DEFAULT_BOARD_JSON "/etc/board.json" 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /recipes-core/netifd/netifd/100-Fix-IFF_LOWER_UP-define.patch: -------------------------------------------------------------------------------- 1 | From 103f2a37cb0d247721d61c075bdd4037ef6b8b83 Mon Sep 17 00:00:00 2001 2 | From: "Theodore A. Roth" 3 | Date: Tue, 10 Jan 2017 11:37:26 -0700 4 | Subject: [PATCH] system-linux: Fix IFF_LOWER_UP define 5 | 6 | The following patch to the linux kernel: 7 | 8 | https://lkml.org/lkml/2016/4/24/57 9 | 10 | causes the following build error: 11 | 12 | | In file included from /usr/include/linux/if_tunnel.h:5:0, 13 | | from system-linux.c:37: 14 | | system-linux.c: In function 'cb_if_check_valid': 15 | | system-linux.c:1455:45: error: 'IFF_LOWER_UP' undeclared (first \ 16 | use in this function) 17 | | device_set_link(chk->dev, ifi->ifi_flags & IFF_LOWER_UP ? true \ 18 | : false); 19 | 20 | It appears that __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO is 21 | getting set to 1, but __UAPI_DEF_IF_NET_DEVICE_FLAGS is set to 0 which 22 | causes IFF_LOWER_UP to get defined with an empty value. 23 | 24 | Signed-off-by: Theodore A. Roth 25 | --- 26 | system-linux.c | 4 ++++ 27 | 1 file changed, 4 insertions(+) 28 | 29 | Index: git/system-linux.c 30 | =================================================================== 31 | --- git.orig/system-linux.c 32 | +++ git/system-linux.c 33 | @@ -16,6 +16,8 @@ 34 | */ 35 | #define _GNU_SOURCE 36 | 37 | +#undef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 38 | +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 39 | #include 40 | #include 41 | #include 42 | @@ -1437,6 +1439,10 @@ struct if_check_data { 43 | int ret; 44 | }; 45 | 46 | +#if IFF_LOWER_UP == 0 47 | +#undef IFF_LOWER_UP 48 | +#endif 49 | + 50 | #ifndef IFF_LOWER_UP 51 | #define IFF_LOWER_UP 0x10000 52 | #endif 53 | -------------------------------------------------------------------------------- /recipes-core/netifd/netifd/network.config: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2006 OpenWrt.org 2 | 3 | config interface loopback 4 | option ifname lo 5 | option proto static 6 | option ipaddr 127.0.0.1 7 | option netmask 255.0.0.0 8 | 9 | config interface lan 10 | option ifname eth0 11 | option proto static 12 | option type bridge 13 | option ipaddr 192.168.1.1 14 | option netmask 255.255.255.0 15 | option ip6assign 60 16 | 17 | config globals globals 18 | option ula_prefix auto 19 | -------------------------------------------------------------------------------- /recipes-core/netifd/netifd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | DESCRIPTION = "OpenWrt Network interface configuration daemon" 6 | HOMEPAGE = "http://git.openwrt.org/?p=project/netifd.git;a=summary" 7 | LICENSE = "GPL-2.0-only" 8 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=13;md5=572cd47ba0e377b26331e67e9f3bc4b3" 9 | SECTION = "base" 10 | DEPENDS = "json-c libubox ubus libnl uci" 11 | 12 | SRC_URI = "\ 13 | git://git.openwrt.org/project/netifd.git;protocol=https;branch=master;name=netifd \ 14 | file://100-Fix-IFF_LOWER_UP-define.patch \ 15 | file://network.config \ 16 | file://0001-resolv.conf.auto-Use-run-instead-of-tmp.patch \ 17 | " 18 | 19 | SRCREV_netifd = "42c48866f1c1fce068f41536baa8dd2e80fc08d7" 20 | 21 | S = "${WORKDIR}/git" 22 | 23 | inherit cmake pkgconfig openwrt openwrt-services update-alternatives openwrt-base-files 24 | 25 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 26 | 27 | OECMAKE_C_FLAGS += "-I${STAGING_INCDIR}/libnl3 -Wno-error=cpp -Wimplicit-fallthrough" 28 | 29 | do_configure:prepend () { 30 | # replace hardcoded '/lib/' with '${base_libdir}/' 31 | grep -rnl "/lib/" ${S}/openwrt/package/network/config/netifd/ | xargs sed -i "s:/lib/:${base_libdir}/:g" 32 | } 33 | 34 | do_install:append() { 35 | install -d ${D}${base_libdir}/netifd/ 36 | # cp because recursive 37 | cp -dR --preserve=mode,links ${S}/openwrt/package/network/config/netifd/files/* ${D}/ 38 | cp -dR --preserve=mode,links ${S}/scripts/* ${D}${base_libdir}/netifd/ 39 | 40 | install -Dm 0644 ${S}/openwrt/package/base-files/files/lib/functions/network.sh ${D}${base_libdir}/functions/network.sh 41 | install -Dm 0755 ${S}/openwrt/package/base-files/files/etc/uci-defaults/12_network-generate-ula ${D}${sysconfdir}/uci-defaults/12_network-generate-ula 42 | 43 | ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'install -Dm 0755 ${S}/openwrt/package/base-files/files/sbin/wifi ${D}${base_sbindir}/wifi', '', d)} 44 | 45 | install -dm 0755 ${D}${sysconfdir}/config 46 | 47 | # If config_generate is not present we need a default network config 48 | ${@bb.utils.contains('IMAGE_INSTALL', 'base-files ', '', 'install -Dm 0644 ${WORKDIR}/network.config ${D}${sysconfdir}/config/network', d)} 49 | # FIXME: Handle wireless case without config_generate 50 | 51 | install -dm 0755 ${D}/sbin 52 | ln -sf /usr/sbin/netifd ${D}/sbin/netifd 53 | 54 | # Be prepared for both procd and systemd/sysvinit style module loading 55 | install -dm 0755 ${D}/etc/modules.d ${D}/etc/modules-load.d 56 | echo "bridge" >${D}/etc/modules.d/30-bridge 57 | echo "bridge" >${D}/etc/modules-load.d/bridge.conf 58 | } 59 | 60 | ALTERNATIVE:${PN} = "ifup ifdown default.script" 61 | 62 | ALTERNATIVE_PRIORITY = "40" 63 | ALTERNATIVE_PRIORITY_pkg[default.script] = "60" 64 | ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup" 65 | ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown" 66 | ALTERNATIVE_LINK_NAME[default.script] = "/usr/share/udhcpc/default.script" 67 | 68 | FILES:${PN} += "\ 69 | /usr/share/udhcpc/default.script* \ 70 | ${base_libdir}/netifd/dhcp.script \ 71 | ${base_libdir}/netifd/utils.sh \ 72 | ${base_libdir}/netifd/netifd-wireless.sh \ 73 | ${base_libdir}/netifd/netifd-proto.sh \ 74 | ${base_libdir}/netifd/proto/dhcp.sh \ 75 | ${base_libdir}/network/config.sh \ 76 | ${base_libdir}/functions/network.sh \ 77 | ${@bb.utils.contains('IMAGE_INSTALL', 'base-files ', '', '${sysconfdir}/config/network', d)} \ 78 | ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', '/sbin/wifi', '', d)} \ 79 | " 80 | 81 | CONFFILES:${PN}:append = "\ 82 | ${sysconfdir}/config/network \ 83 | ${sysconfdir}/config/wireless \ 84 | " 85 | 86 | RDEPENDS:${PN} += "\ 87 | bridge-utils \ 88 | base-files-scripts-openwrt \ 89 | " 90 | -------------------------------------------------------------------------------- /recipes-core/odhcp6c/odhcp6c_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Daniel Dickinson 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | SUMMARY = "OpenWrt DHCPv6 client" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/odhcp63.git;a=summary" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://src/odhcp6c.c;beginline=1;endline=13;md5=41d01a2c8e6a8ef58b8e5f18e68118a8" 8 | SECTION = "base" 9 | DEPENDS = "libubox" 10 | 11 | SRCREV_odhcp6c = "0ffa3a31f7146d320214f431291c1196070a010f" 12 | 13 | SRC_URI = "\ 14 | git://git.openwrt.org/project/odhcp6c.git;protocol=https;branch=master;name=odhcp6c \ 15 | " 16 | 17 | S = "${WORKDIR}/git" 18 | OF = "${S}/openwrt/package/network/ipv6/odhcp6c/files" 19 | 20 | inherit cmake pkgconfig openwrt openwrt-services openwrt-base-files 21 | 22 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 23 | 24 | do_install:append() { 25 | install -Dm 0755 ${OF}/dhcpv6.sh ${D}${base_libdir}/netifd/proto/dhcpv6.sh 26 | install -Dm 0755 ${OF}/dhcpv6.script ${D}${base_libdir}/netifd/dhcpv6.script 27 | } 28 | 29 | FILES:${PN} += "\ 30 | ${base_libdir}/netifd/proto/dhcpv6.sh \ 31 | ${base_libdir}/netifd/dhcpv6.script \ 32 | " 33 | 34 | RRECOMMENDS:${PN} += "netifd" 35 | -------------------------------------------------------------------------------- /recipes-core/odhcpd/odhcpd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Daniel Dickinson 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | SUMMARY = "OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/odhcpd.git;a=summary" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://src/odhcpd.c;beginline=1;endline=13;md5=b5b1da01ca7e1cdd0308c552dc0a1384" 8 | SECTION = "base" 9 | DEPENDS = "libubox ubus libnl-tiny uci" 10 | 11 | FILESEXTRAPATHS:prepend = "${THIDIR}/${PN}:" 12 | 13 | SRC_URI = "git://git.openwrt.org/project/odhcpd.git;protocol=https;branch=master;name=odhcpd \ 14 | " 15 | 16 | SRCREV_odhcpd = "860ca900e41c5d0f98cc85e67b39977f6f2cb355" 17 | 18 | S = "${WORKDIR}/git" 19 | OF = "${S}/openwrt/package/network/services/odhcpd/files" 20 | 21 | inherit cmake pkgconfig openwrt openwrt-services openwrt-base-files 22 | 23 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 24 | 25 | EXTRA_OECMAKE:append = " -DUBUS=1" 26 | 27 | do_install:append() { 28 | install -Dm 0644 ${OF}/odhcpd.defaults ${D}${sysconfdir}/uci-defaults/odhcpd 29 | install -Dm 0755 ${OF}/odhcpd.init ${D}${sysconfdir}/init.d/odhcpd 30 | install -Dm 0755 ${OF}/odhcpd-update ${D}${sbindir}/odhcpd-update 31 | } 32 | 33 | FILES:${PN} += "\ 34 | ${sysconfdir}/uci-defaults/odhcpd.defaults \ 35 | ${sysconfdir}/init.d/odhcpd \ 36 | ${sbindir}/odhcpd-update \ 37 | " 38 | 39 | RDEPENDS:${PN} += "base-files-scripts-openwrt" 40 | -------------------------------------------------------------------------------- /recipes-core/packagegroups/packagegroup-openwrt-minimal.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Minimal complete Openwrt system requirements" 2 | DESCRIPTION = "The set of packages required for core Openwrt system with network but no gui" 3 | LICENSE = "MIT" 4 | 5 | PACKAGE_ARCH = "${MACHINE_ARCH}" 6 | 7 | inherit packagegroup openwrt openwrt-services 8 | 9 | PACKAGES = "\ 10 | packagegroup-openwrt-minimal \ 11 | packagegroup-openwrt-minimal-base \ 12 | packagegroup-openwrt-minimal-network \ 13 | " 14 | 15 | RDEPENDS:${PN} = "\ 16 | packagegroup-openwrt-minimal-base \ 17 | packagegroup-openwrt-minimal-network \ 18 | " 19 | 20 | RDEPENDS:${PN}-base = "\ 21 | packagegroup-core-boot \ 22 | rpcd \ 23 | ubox \ 24 | ubus \ 25 | uci \ 26 | " 27 | 28 | RDEPENDS:${PN}-network = "\ 29 | dnsmasq \ 30 | \ 31 | firewall3 \ 32 | iptables \ 33 | ${VIRTUAL-RUNTIME_network_manager} \ 34 | uclient \ 35 | ustream-ssl \ 36 | ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'iw', '',d)} \ 37 | ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'hostapd', '',d)} \ 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'odhcp6c', '', d)} \ 39 | " 40 | -------------------------------------------------------------------------------- /recipes-core/procd/procd-inittab.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Inittab configuration for procd" 2 | LICENSE = "GPL-2.0-only" 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6" 4 | 5 | SRC_URI = "file://inittab \ 6 | " 7 | 8 | inherit update-alternatives 9 | 10 | S = "${WORKDIR}" 11 | 12 | INHIBIT_DEFAULT_DEPS = "1" 13 | 14 | do_compile() { 15 | : 16 | } 17 | 18 | PROCD_ENABLED_TTYS ?= "${SYSVINIT_ENABLED_GETTYS}" 19 | 20 | do_install() { 21 | install -d ${D}${sysconfdir} 22 | install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab 23 | 24 | set -x 25 | tmp="${SERIAL_CONSOLES}" 26 | for i in $tmp 27 | do 28 | j=`echo ${i} | sed s/\;/\ /g` 29 | l=`echo ${i} | sed -e 's/^.*;//' -e 's/;.*//'` 30 | echo "$l::askfirst:/usr/libexec/login.sh" >> ${D}${sysconfdir}/inittab 31 | done 32 | 33 | if [ "${USE_VT}" = "1" ]; then 34 | for n in ${PROCD_ENABLED_TTYS} 35 | do 36 | echo "tty$n::askfirst:/usr/libexec/login.sh" >> ${D}${sysconfdir}/inittab 37 | done 38 | echo "" >> ${D}${sysconfdir}/inittab 39 | fi 40 | 41 | if [ -z "${SERIAL_CONSOLES}" ] && [ "${USE_VT}" != "1" ]; then 42 | echo "::askconsole:/usr/libexec.sh/login.sh" >> ${D}${sysconfdir}/inittab 43 | echo "" >${D}${sysconfdir}/inittab 44 | fi 45 | } 46 | 47 | pkg_postinst_ontarget:${PN} () { 48 | # run this on the target 49 | if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then 50 | tmp="${SERIAL_CONSOLES_CHECK}" 51 | for i in $tmp 52 | do 53 | j=`echo ${i} | sed -e s/^.*\;//g -e s/\:.*//g` 54 | k=`echo ${i} | sed s/^.*\://g` 55 | if [ -z "`grep ${j} /proc/consoles`" ]; then 56 | if [ -z "${k}" ] || [ -z "`grep ${k} /proc/consoles`" ] || [ ! -e /dev/${j} ]; then 57 | sed -i -e /^.*${j}\ /d -e /^.*${j}$/d /etc/inittab 58 | fi 59 | fi 60 | done 61 | kill -HUP 1 62 | else 63 | if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then 64 | exit 0 65 | else 66 | exit 1 67 | fi 68 | fi 69 | } 70 | 71 | ALTERNATIVE_PRIORITY = "200" 72 | ALTERNATIVE:${PN} = "inittab" 73 | ALTERNATIVE_TARGET[inittab] = "${sysconfdir}/inittab" 74 | 75 | # USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf. 76 | # Set PACKAGE_ARCH appropriately. 77 | PACKAGE_ARCH = "${MACHINE_ARCH}" 78 | 79 | FILES:${PN} = "${sysconfdir}/inittab*" 80 | CONFFILES:${PN} = "${sysconfdir}/inittab" 81 | 82 | USE_VT ?= "1" 83 | SYSVINIT_ENABLED_GETTYS ?= "1" 84 | -------------------------------------------------------------------------------- /recipes-core/procd/procd-inittab/inittab: -------------------------------------------------------------------------------- 1 | ::sysinit:/etc/init.d/rcS S boot 2 | ::shutdown:/etc/init.d/rcS K shutdown 3 | -------------------------------------------------------------------------------- /recipes-core/procd/procd/00_preinit.conf: -------------------------------------------------------------------------------- 1 | pi_suppress_stderr="n" 2 | pi_failsafe_wait_timeout=2 3 | pi_init_path="%PATH%" 4 | pi_init_env="" 5 | pi_init_cmd="/sbin/init" 6 | pi_ifname="" 7 | pi_ip="192.168.1.1" 8 | pi_netmask="255.255.255.0" 9 | pi_broadcast="192.168.1.255" 10 | pi_preinit_net_messages="n" 11 | pi_preinit_no_failsafe_netmsg="y" 12 | pi_preinit_no_failsafe="" 13 | -------------------------------------------------------------------------------- /recipes-core/procd/procd/0100-use-sysmacros-where-needed.patch: -------------------------------------------------------------------------------- 1 | Index: git/initd/early.c 2 | =================================================================== 3 | --- git.orig/initd/early.c 4 | +++ git/initd/early.c 5 | @@ -14,6 +14,7 @@ 6 | 7 | #include 8 | #include 9 | +#include 10 | #include 11 | 12 | #include 13 | Index: git/plug/hotplug.c 14 | =================================================================== 15 | --- git.orig/plug/hotplug.c 16 | +++ git/plug/hotplug.c 17 | @@ -15,6 +15,7 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | 23 | #include 24 | #include 25 | Index: git/initd/mkdev.c 26 | =================================================================== 27 | --- git.orig/initd/mkdev.c 28 | +++ git/initd/mkdev.c 29 | @@ -16,6 +16,7 @@ 30 | 31 | #include 32 | #include 33 | +#include 34 | 35 | #include 36 | #include 37 | -------------------------------------------------------------------------------- /recipes-core/procd/procd/0200-fix-build.patch: -------------------------------------------------------------------------------- 1 | diff --git a/signal.c b/signal.c 2 | index 9974153..d7cc8d2 100644 3 | --- a/signal.c 4 | +++ b/signal.c 5 | @@ -33,7 +33,7 @@ static void do_reboot(void) 6 | static void signal_shutdown(int signal, siginfo_t *siginfo, void *data) 7 | { 8 | int event = 0; 9 | - char *msg = NULL; 10 | + char *msg = "none"; 11 | 12 | #ifndef DISABLE_INIT 13 | switch(signal) { 14 | -------------------------------------------------------------------------------- /recipes-core/procd/procd/10_sysinfo: -------------------------------------------------------------------------------- 1 | do_sysinfo_generic() { 2 | [ -d /proc/device-tree ] || return 3 | mkdir -p /tmp/sysinfo 4 | [ -e /tmp/sysinfo/board_name ] || \ 5 | echo "$(strings /proc/device-tree/compatible | head -n1)" > /tmp/sysinfo/board_name 6 | [ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \ 7 | echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model 8 | } 9 | 10 | boot_hook_add preinit_main do_sysinfo_generic 11 | -------------------------------------------------------------------------------- /recipes-core/procd/procd/banner.failsafe: -------------------------------------------------------------------------------- 1 | ================= FAILSAFE MODE active ================ 2 | special commands: 3 | * mount_root mount root-partition with config files 4 | 5 | after mount_root: 6 | * passwd change root's password 7 | * /etc/config directory with config files 8 | ======================================================= 9 | 10 | -------------------------------------------------------------------------------- /recipes-core/procd/procd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | SUMMARY = "procd is the new OpenWrt process management daemon written in C" 6 | DESCRIPTION = "procd is both both VIRTUAL-RUNTIME-init_manager and \ 7 | VIRTUAL_RUNTIME-dev_manager (like systemd/systemd-udev) \ 8 | " 9 | HOMEPAGE = "http://wiki.openwrt.org/doc/techref/procd" 10 | LICENSE = "LGPL-2.1-only" 11 | LIC_FILES_CHKSUM = "file://procd.c;beginline=1;endline=13;md5=61e3657604f131a859b57a40f27a9d8e" 12 | SECTION = "base" 13 | DEPENDS = "libubox ubus json-c" 14 | 15 | SRC_URI = "git://git.openwrt.org/project/procd.git;protocol=https;branch=master \ 16 | file://0200-fix-build.patch \ 17 | file://00_preinit.conf \ 18 | file://banner.failsafe \ 19 | file://10_sysinfo \ 20 | " 21 | 22 | SRCREV:pn-procd = "7a0096853594874d4c60266ec338ac23728017df" 23 | 24 | S = "${WORKDIR}/git" 25 | PD = "${S}/openwrt/package/system/procd/files" 26 | BF = "${S}/openwrt/package/base-files/files" 27 | 28 | inherit cmake openwrt openwrt-services pkgconfig openwrt-base-files update-alternatives 29 | 30 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 31 | 32 | TARGET_CFLAGS:append = " -Wno-error=array-bounds -Wno-error=unused-result" 33 | 34 | do_install:append() { 35 | # Early init 36 | install -Dm 0755 ${BF}/etc/preinit ${D}${sysconfdir}/preinit 37 | install -Dm 0755 ${BF}/etc/diag.sh ${D}${sysconfdir}/diag.sh 38 | install -Dm 0644 ${BF}/lib/functions/preinit.sh ${D}${base_libdir}/functions/preinit.sh 39 | install -Dm 0644 ${BF}/rom/note ${D}/rom/note 40 | install -Dm 0544 ${WORKDIR}/banner.failsafe ${D}${sysconfdir}/banner.failsafe 41 | 42 | install -d ${D}${base_libdir} 43 | cp --preserve=mode,timestamps -R ${BF}/lib/preinit ${D}${base_libdir} 44 | install -Dm 0644 ${WORKDIR}/10_sysinfo ${D}${base_libdir}/preinit/10_sysinfo 45 | install -Dm 0644 ${WORKDIR}/00_preinit.conf ${D}${base_libdir}/preinit/00_preinit.conf 46 | 47 | # Early init + dev manager / coldplug 48 | install -Dm 0644 ${PD}/hotplug-preinit.json ${D}${sysconfdir}/hotplug-preinit.json 49 | 50 | # Init 51 | install -Dm 0644 ${PD}/procd.sh ${D}${base_libdir}/functions/procd.sh 52 | install -Dm 0755 ${PD}/reload_config ${D}${base_sbindir}/reload_config 53 | install -Dm 0644 ${BF}/lib/functions/service.sh ${D}${base_libdir}/functions/service.sh 54 | install -Dm 0755 ${BF}/etc/rc.common ${D}${sysconfdir}/rc.common 55 | install -Dm 0755 ${BF}/etc/rc.local ${D}${sysconfdir}/rc.local 56 | install -Dm 0755 ${BF}/etc/init.d/done ${D}${sysconfdir}/init.d/done 57 | install -Dm 0755 ${BF}/etc/init.d/sysctl ${D}${sysconfdir}/init.d/sysctl 58 | install -Dm 0755 ${BF}/etc/init.d/umount ${D}${sysconfdir}/init.d/umount 59 | install -Dm 0755 ${BF}/usr/libexec/login.sh ${D}/usr/libexec/login.sh 60 | install -dm 0755 ${D}/etc/rc.d 61 | # FIXME: Need to split openwrt base-files 'boot' script so that 62 | # things that need to be done by procd even when not on a full 63 | # openwrt image get done without errors 64 | # and things which are openwrt-image specific stay in base-files 65 | install -Dm 0755 ${BF}/etc/init.d/boot ${D}${sysconfdir}/init.d/boot 66 | 67 | # Dev manager / hotplug / coldplug 68 | install -Dm 0644 ${PD}/hotplug.json ${D}${sysconfdir}/hotplug.json 69 | install -d ${D}${sysconfdir} 70 | cp --preserve=mode,timestamps -R ${BF}/etc/rc.button ${D}${sysconfdir} 71 | install -Dm 0755 ${BF}/sbin/hotplug-call ${D}${base_sbindir}/hotplug-call 72 | cp -dR --preserve=mode,links ${BF}/etc/hotplug.d ${D}${sysconfdir} 73 | 74 | # Common default PATH 75 | sed -i "s#%PATH%#/usr/sbin:/usr/bin:/sbin:/bin#g" \ 76 | ${D}${sysconfdir}/preinit \ 77 | ${D}${base_libdir}/preinit/00_preinit.conf \ 78 | ${D}${base_sbindir}/hotplug-call 79 | 80 | # Make sure things are where they are expected to be 81 | install -dm 0755 ${D}/sbin ${D}/lib 82 | ln -s /usr/sbin/procd ${D}/sbin/procd 83 | ln -s /usr/sbin/init ${D}/sbin/init 84 | ln -s /usr/sbin/askfirst ${D}/sbin/askfirst 85 | ln -s /usr/sbin/udevtrigger ${D}/sbin/udevtrigger 86 | mv ${D}${libdir}/libsetlbf.so ${D}${base_libdir}/libsetlbf.so 87 | rmdir ${D}/usr/lib 88 | } 89 | 90 | RDEPENDS:${PN} += "\ 91 | fstools \ 92 | base-files-scripts-openwrt \ 93 | ${PN}-inittab \ 94 | " 95 | 96 | FILES:${PN} = "/" 97 | 98 | ALTERNATIVE:${PN} = "init" 99 | 100 | ALTERNATIVE_PRIORITY = "40" 101 | ALTERNATIVE_TARGET[init] = "${base_sbindir}/init" 102 | 103 | python () { 104 | if not bb.utils.contains('DISTRO_FEATURES', 'procd', True, False, d): 105 | raise bb.parse.SkipPackage("'procd' not in DISTRO_FEATURES") 106 | } 107 | -------------------------------------------------------------------------------- /recipes-core/rpcd/rpcd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt UBUS RPC server" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/rpcd.git;a=summary" 6 | LICENSE = "0BSD" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=18;md5=da5faf55ed0618f0dde1c88e76a0fc74" 8 | SECTION = "base" 9 | DEPENDS = "json-c libubox ubus uci ucode iwinfo virtual/crypt" 10 | 11 | SRC_URI = "\ 12 | git://git.openwrt.org/project/rpcd.git;protocol=https;branch=master;name=rpcd; \ 13 | " 14 | 15 | SRCREV_rpcd = "82904bd4f92e5928d047db6396cc14ca2b07d89f" 16 | 17 | S = "${WORKDIR}/git" 18 | OR = "${S}/openwrt/package/system/rpcd/files" 19 | 20 | inherit cmake pkgconfig openwrt-services openwrt openwrt-base-files 21 | 22 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 23 | 24 | do_install:append() { 25 | install -d ${D}${includedir}/rpcd 26 | install -m 0644 ${S}/include/rpcd/* ${D}${includedir}/rpcd/ 27 | install -Dm 0755 ${OR}/rpcd.config ${D}${sysconfdir}/config/rpcd 28 | install -Dm 0755 ${OR}/rpcd.init ${D}${sysconfdir}/init.d/rpcd 29 | 30 | mkdir -p ${D}${datadir}/rpcd/acl.d/ 31 | install -Dm 0644 ${S}/unauthenticated.json ${D}${datadir}/rpcd/acl.d/ 32 | 33 | mkdir -p ${D}/sbin 34 | ln -s /usr/sbin/rpcd ${D}/sbin/rpcd 35 | } 36 | 37 | FILES:${PN} += "${libdir}/*" 38 | 39 | RDEPENDS:${PN} += "ucode iwinfo" 40 | -------------------------------------------------------------------------------- /recipes-core/ubox/ubox/0001-Fix-compilation-problem-warn_unused_result-Wunused-r.patch: -------------------------------------------------------------------------------- 1 | From 3ce3c3ded2cf6ab4d2212f9f7789238c2aa2c79d Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 9 Dec 2020 22:28:20 -0800 4 | Subject: [PATCH] Fix compilation problem warn_unused_result [-Wunused-result] 5 | 6 | Signed-off-by: Khem Raj 7 | --- 8 | log/logd.c | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/log/logd.c b/log/logd.c 12 | index 7d53139..81cc4f7 100644 13 | --- a/log/logd.c 14 | +++ b/log/logd.c 15 | @@ -260,8 +260,8 @@ main(int argc, char **argv) 16 | ubus_auto_connect(&conn); 17 | p = getpwnam("logd"); 18 | if (p) { 19 | - setuid(p->pw_uid); 20 | - setgid(p->pw_gid); 21 | + if(setuid(p->pw_uid)); 22 | + if(setgid(p->pw_gid)); 23 | } 24 | uloop_run(); 25 | log_shutdown(); 26 | -- 27 | 2.29.2 28 | 29 | -------------------------------------------------------------------------------- /recipes-core/ubox/ubox/100-insmod-segfault.patch: -------------------------------------------------------------------------------- 1 | --- a/kmodloader.c 2 | +++ b/kmodloader.c 3 | @@ -605,6 +605,9 @@ static int main_insmod(int argc, char ** 4 | cur += sprintf(cur, "%s", argv[i]); 5 | } 6 | 7 | + if (init_module_folders()) 8 | + return -1; 9 | + 10 | if (get_module_path(argv[1])) { 11 | name = argv[1]; 12 | } else if (!get_module_path(name)) { 13 | -------------------------------------------------------------------------------- /recipes-core/ubox/ubox/log.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2013 OpenWrt.org 3 | 4 | # start after and stop before networking 5 | START=12 6 | STOP=89 7 | PIDCOUNT=0 8 | 9 | USE_PROCD=1 10 | PROG=/sbin/logread 11 | 12 | validate_log_section() 13 | { 14 | uci_validate_section system system "${1}" \ 15 | 'log_file:string' \ 16 | 'log_size:uinteger' \ 17 | 'log_ip:ipaddr' \ 18 | 'log_remote:bool:1' \ 19 | 'log_port:port:514' \ 20 | 'log_proto:or("tcp", "udp"):udp' \ 21 | 'log_prefix:string' 22 | } 23 | 24 | validate_log_daemon() 25 | { 26 | uci_validate_section system system "${1}" \ 27 | 'log_size:uinteger:0' \ 28 | 'log_buffer_size:uinteger:0' 29 | } 30 | 31 | start_service_daemon() 32 | { 33 | local log_buffer_size log_size 34 | validate_log_daemon "${1}" 35 | [ $log_buffer_size -eq 0 -a $log_size -gt 0 ] && log_buffer_size=$log_size 36 | [ $log_buffer_size -eq 0 ] && log_buffer_size=16 37 | procd_open_instance 38 | procd_set_param command "/sbin/logd" 39 | procd_append_param command -S "${log_buffer_size}" 40 | procd_set_param respawn 41 | procd_close_instance 42 | } 43 | 44 | start_service_file() 45 | { 46 | PIDCOUNT="$(( ${PIDCOUNT} + 1))" 47 | local pid_file="/var/run/logread.${PIDCOUNT}.pid" 48 | local log_file log_size 49 | 50 | validate_log_section "${1}" || { 51 | echo "validation failed" 52 | return 1 53 | } 54 | [ -z "${log_file}" ] && return 55 | 56 | procd_open_instance 57 | procd_set_param command "$PROG" -f -F "$log_file" -p "$pid_file" 58 | [ -n "${log_size}" ] && procd_append_param command -S "$log_size" 59 | procd_close_instance 60 | } 61 | 62 | start_service_remote() 63 | { 64 | PIDCOUNT="$(( ${PIDCOUNT} + 1))" 65 | local pid_file="/var/run/logread.${PIDCOUNT}.pid" 66 | local log_ip log_port log_proto log_prefix log_remote 67 | 68 | validate_log_section "${1}" || { 69 | echo "validation failed" 70 | return 1 71 | } 72 | [ "${log_remote}" -ne 0 ] || return 73 | [ -z "${log_ip}" ] && return 74 | 75 | procd_open_instance 76 | procd_set_param command "$PROG" -f -r "$log_ip" "${log_port}" -p "$pid_file" 77 | [ "${log_proto}" != "udp" ] || procd_append_param command -u 78 | [ -z "${log_prefix}" ] || procd_append_param command -P "${log_prefix}" 79 | procd_close_instance 80 | } 81 | 82 | service_triggers() 83 | { 84 | procd_add_reload_trigger "system" 85 | procd_add_validation validate_log_section 86 | } 87 | 88 | start_service() 89 | { 90 | config_load system 91 | config_foreach start_service_daemon system 92 | config_foreach start_service_file system 93 | config_foreach start_service_remote system 94 | } 95 | -------------------------------------------------------------------------------- /recipes-core/ubox/ubox_git.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "OpenWrt system helper toolbox" 2 | HOMEPAGE = "http://wiki.openwrt.org/doc/techref/ubox" 3 | LICENSE = "GPL-2.0-only" 4 | LIC_FILES_CHKSUM = "file://kmodloader.c;beginline=1;endline=13;md5=61e3657604f131a859b57a40f27a9d8e" 5 | SRCREV = "205defb597295a4a8966db3e618cfe41a29bed99" 6 | 7 | DEPENDS = "ubus libubox uci" 8 | 9 | SRC_URI = "\ 10 | git://git.openwrt.org/project/ubox.git;protocol=https;branch=master \ 11 | file://log.init \ 12 | " 13 | 14 | S = "${WORKDIR}/git" 15 | 16 | inherit cmake openwrt-services openwrt 17 | 18 | do_install:append () { 19 | ${@bb.utils.contains('VIRTUAL-RUNTIME_syslog', 'ubox', 'install -Dm 0755 ${WORKDIR}/log.init ${D}/etc/init.d/log', '', d)} 20 | ${@bb.utils.contains('VIRTUAL-RUNTIME_kmod_manager', 'ubox', 'ln -s /sbin/kmodloader ${D}/usr/sbin/rmmod', '', d)} 21 | ${@bb.utils.contains('VIRTUAL-RUNTIME_kmod_manager', 'ubox', 'ln -s /sbin/kmodloader ${D}/usr/sbin/insmod', '', d)} 22 | ${@bb.utils.contains('VIRTUAL-RUNTIME_kmod_manager', 'ubox', 'ln -s /sbin/kmodloader ${D}/usr/sbin/lsmod', '', d)} 23 | ${@bb.utils.contains('VIRTUAL-RUNTIME_kmod_manager', 'ubox', 'ln -s /sbin/kmodloader ${D}/usr/sbin/modinfo', '', d)} 24 | ${@bb.utils.contains('VIRTUAL-RUNTIME_kmod_manager', 'ubox', 'ln -s /sbin/kmodloader ${D}/usr/sbin/modprobe', '', d)} 25 | install -dm 0755 ${D}/sbin 26 | ${@bb.utils.contains('VIRTUAL-RUNTIME_kmod_manager', 'ubox', 'ln -s /usr/sbin/kmodloader ${D}/sbin/kmodloader', '', d)} 27 | ${@bb.utils.contains('VIRTUAL-RUNTIME_syslog', 'ubox', 'ln -s /usr/sbin/logd ${D}/sbin/logd', '', d)} 28 | ${@bb.utils.contains('VIRTUAL-RUNTIME_syslog', 'ubox', 'ln -s /usr/sbin/logread ${D}/sbin/logread', '', d)} 29 | ${@bb.utils.contains('VIRTUAL-RUNTIME_syslog', 'ubox', 'ln -s /usr/sbin/validate_data ${D}/sbin/validate_data', '', d)} 30 | } 31 | 32 | RDEPENDS:${PN} += "\ 33 | ubus \ 34 | libubox \ 35 | " 36 | 37 | FILES:${PN} += "\ 38 | ${libdir} \ 39 | ${base_sbindir} \ 40 | " 41 | -------------------------------------------------------------------------------- /recipes-core/ubus/ubus_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt system message/RPC bus" 5 | HOMEPAGE = "https://git.openwrt.org/?p=project/ubus.git;a=summary" 6 | LICENSE = "LGPL-2.1-only" 7 | LIC_FILES_CHKSUM = "file://ubusd.c;beginline=1;endline=12;md5=1b6a7aecd35bdd25de35da967668485d" 8 | SECTION = "base" 9 | DEPENDS = "json-c libubox" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/ubus.git;protocol=https;branch=master" 12 | 13 | SRCREV = "2bebf93cd3343fe49f22a05ef935e460d2d44f67" 14 | 15 | S = "${WORKDIR}/git" 16 | 17 | inherit cmake pkgconfig openwrt 18 | 19 | do_install:append () { 20 | install -dm 0755 ${D}/sbin 21 | ln -s /usr/sbin/ubusd ${D}/sbin/ubusd 22 | } 23 | 24 | TOOLCHAIN = "gcc" 25 | -------------------------------------------------------------------------------- /recipes-core/uci/uci_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | SUMMARY = "Library and utility for the Unified Configuration Interface for OpenWrt" 5 | HOMEPAGE = "http://wiki.openwrt.org/doc/uci" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://uci.h;beginline=1;endline=13;md5=0ee862ed12171ee619c8c2eb7eff77f2" 8 | SECTION = "base" 9 | DEPENDS = "libubox lua5.1" 10 | 11 | SRCREV = "f84f49f00fb70364f58b4cce72f1796a7190d370" 12 | SRC_URI = "git://git.openwrt.org/project/uci.git;protocol=https;branch=master;name=uci \ 13 | " 14 | 15 | S = "${WORKDIR}/git" 16 | OR = "${S}/openwrt/package/system/uci/files" 17 | 18 | inherit cmake pkgconfig openwrt openwrt-base-files 19 | 20 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 21 | 22 | OECMAKE_C_FLAGS += "-I${STAGING_INCDIR}/lua5.1" 23 | 24 | do_install:append() { 25 | install -Dm 0755 ${OR}/lib/config/uci.sh ${D}${base_libdir}/config/uci.sh 26 | 27 | mkdir -p ${D}/sbin 28 | mkdir -p ${D}/usr/sbin 29 | ln -s /usr/bin/uci ${D}/usr/sbin/uci 30 | ln -s /usr/bin/uci ${D}/sbin/uci 31 | } 32 | 33 | FILES:${PN} += "${base_libdir}" 34 | -------------------------------------------------------------------------------- /recipes-core/uclient/uclient/0001-remove-call-to-deprecated-function-luaL_openlib-in-l.patch: -------------------------------------------------------------------------------- 1 | From 36b919b4b458d11eef408a6464627260545391c4 Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 21 Oct 2015 18:55:07 -0700 4 | Subject: [PATCH] remove call to deprecated function luaL_openlib in lua 5.2 5 | and newer 6 | 7 | Signed-off-by: Khem Raj 8 | --- 9 | lua/uloop.c | 24 +++++++++++++++++++++--- 10 | 1 file changed, 21 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/lua/uloop.c b/lua/uloop.c 13 | index 2a0a516..096ee13 100644 14 | --- a/lua/uloop.c 15 | +++ b/lua/uloop.c 16 | @@ -98,6 +98,24 @@ static const luaL_Reg timer_m[] = { 17 | { NULL, NULL } 18 | }; 19 | 20 | +static void uloop_lua_registerlib(lua_State *L, const char *libname, 21 | + const luaL_Reg *l) 22 | +{ 23 | +#if LUA_VERSION_NUM >= 502 24 | + if (libname) 25 | + { 26 | + lua_newtable(L); 27 | + luaL_setfuncs(L, l, 0); 28 | + lua_pushvalue(L, -1); 29 | + lua_setglobal(L, libname); 30 | + } 31 | + else 32 | + luaL_setfuncs(L, l, 0); 33 | +#else 34 | + luaL_register(L, libname, l); 35 | +#endif 36 | +} 37 | + 38 | static int ul_timer(lua_State *L) 39 | { 40 | struct lua_uloop_timeout *tout; 41 | @@ -129,7 +147,7 @@ static int ul_timer(lua_State *L) 42 | lua_pushvalue(L, -1); 43 | lua_setmetatable(L, -3); 44 | lua_pushvalue(L, -2); 45 | - luaI_openlib(L, NULL, timer_m, 1); 46 | + uloop_lua_registerlib(L, NULL, timer_m); 47 | lua_pushvalue(L, -2); 48 | 49 | memset(tout, 0, sizeof(*tout)); 50 | @@ -248,7 +266,7 @@ static int ul_ufd_add(lua_State *L) 51 | lua_pushvalue(L, -1); 52 | lua_setmetatable(L, -3); 53 | lua_pushvalue(L, -2); 54 | - luaI_openlib(L, NULL, ufd_m, 1); 55 | + uloop_lua_registerlib(L, NULL, ufd_m); 56 | lua_pushvalue(L, -2); 57 | 58 | memset(ufd, 0, sizeof(*ufd)); 59 | @@ -363,7 +381,7 @@ static int ul_end(lua_State *L) 60 | return 1; 61 | } 62 | 63 | -static luaL_reg uloop_func[] = { 64 | +static luaL_Reg uloop_func[] = { 65 | {"init", ul_init}, 66 | {"run", ul_run}, 67 | {"timer", ul_timer}, 68 | -- 69 | 2.6.1 70 | 71 | -------------------------------------------------------------------------------- /recipes-core/uclient/uclient_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "libubox HTTP client library" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/uclient.git;a=summary" 6 | LICENSE = "0BSD" 7 | LIC_FILES_CHKSUM = "file://uclient-backend.h;beginline=1;endline=17;md5=b96bb2c7c7edb5a7cff262e23626e382" 8 | SECTION = "base" 9 | DEPENDS = "libubox ustream-ssl" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/uclient.git;protocol=https;branch=master \ 12 | " 13 | 14 | SRCREV = "6a6011df3429ffa5958d12b1327eeda4fd9daa47" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake pkgconfig openwrt 19 | -------------------------------------------------------------------------------- /recipes-core/ustream-ssl/ustream-ssl_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | SUMMARY = "Small stream SSL library" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/ustream-ssl.git;a=summary" 6 | LICENSE = "0BSD" 7 | LIC_FILES_CHKSUM = "file://ustream-ssl.h;beginline=1;endline=17;md5=f633104677420342f142ab4835e04031" 8 | SECTION = "base" 9 | DEPENDS = "libubox openssl" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/ustream-ssl.git;protocol=https;branch=master \ 12 | " 13 | 14 | SRCREV = "868fd8812f477c110f9c6c5252c0bd172167b94c" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake pkgconfig openwrt 19 | 20 | do_install:append() { 21 | install -d ${D}${includedir}/libubox 22 | install -m 0644 ${S}/*.h ${D}${includedir}/libubox 23 | 24 | install -dm 0755 ${D}${base_libdir} 25 | mv ${D}${libdir}/libustream-ssl.so ${D}${base_libdir}/libustream-ssl.so 26 | rmdir --ignore-fail-on-non-empty ${D}${libdir} 27 | } 28 | 29 | FILES:${PN} += "${base_libdir}/*" 30 | FILES:${PN}-dbg += "${libdir}/lua/5.*/.debug" 31 | 32 | RDEPENDS:${PN} += "libcrypto libssl" 33 | -------------------------------------------------------------------------------- /recipes-core/xtables-addons/files/0001-Unset-LDFLAGS-for-kernel-modules.patch: -------------------------------------------------------------------------------- 1 | From 2bd785bdb4582ccc6350d08e87deb8fc5d9c8b9d Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 2 May 2018 05:50:33 +0000 4 | Subject: [PATCH] Unset LDFLAGS for kernel modules 5 | 6 | In OE we specify LDFLAGS as if CC is used for LD 7 | where options are using -Wl, prefix to pass linker 8 | options, but when building kernel LD linker is used 9 | directly, therefore we do not need this option 10 | 11 | Signed-off-by: Khem Raj 12 | --- 13 | extensions/Makefile.am | 2 +- 14 | 1 file changed, 1 insertion(+), 1 deletion(-) 15 | 16 | diff --git a/extensions/Makefile.am b/extensions/Makefile.am 17 | index a487fd8..1c04ea6 100644 18 | --- a/extensions/Makefile.am 19 | +++ b/extensions/Makefile.am 20 | @@ -3,7 +3,7 @@ 21 | 22 | AM_CPPFLAGS = ${regular_CPPFLAGS} -I${abs_top_srcdir}/extensions 23 | AM_CFLAGS = ${regular_CFLAGS} ${libxtables_CFLAGS} 24 | - 25 | +LDFLAGS = 26 | # Not having Kbuild in Makefile.extra because it will already recurse 27 | .PHONY: modules modules_install clean_modules 28 | 29 | -- 30 | 1.9.1 31 | 32 | -------------------------------------------------------------------------------- /recipes-core/xtables-addons/files/001-fix-kernel-version-detection.patch: -------------------------------------------------------------------------------- 1 | --- a/configure.ac 2 | +++ b/configure.ac 3 | @@ -42,7 +42,7 @@ 4 | 5 | AS_IF([test -n "$kbuilddir"], [ 6 | AC_MSG_CHECKING([kernel version that we will build against]) 7 | - krel="$(make -sC "$kbuilddir" M=$PWD kernelrelease | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')" 8 | + krel="$(make -sC "$kbuilddir" M=$PWD kernelversion | $AWK -v 'FS=[[^0-9.]]' '{print $1; exit}')" 9 | save_IFS="$IFS" 10 | IFS='.' 11 | set x $krel 12 | -------------------------------------------------------------------------------- /recipes-core/xtables-addons/files/201-fix-lua-packetscript.patch: -------------------------------------------------------------------------------- 1 | --- a/extensions/LUA/xt_LUA_target.c 2 | +++ b/extensions/LUA/xt_LUA_target.c 3 | @@ -19,7 +19,7 @@ 4 | #include 5 | #include 6 | #include 7 | -#include 8 | +#include 9 | #include 10 | #include 11 | #include "xt_LUA.h" 12 | @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY 13 | * XT_CONTINUE inside the *register_lua_packet_lib* function. 14 | */ 15 | 16 | -spinlock_t lock = SPIN_LOCK_UNLOCKED; 17 | +DEFINE_SPINLOCK(lock); 18 | 19 | static uint32_t 20 | -lua_tg(struct sk_buff *pskb, const struct xt_target_param *par) 21 | +lua_tg(struct sk_buff *pskb, const struct xt_action_param *par) 22 | { 23 | uint32_t verdict; 24 | lua_packet_segment *p; 25 | @@ -79,7 +79,7 @@ lua_tg(struct sk_buff *pskb, const struc 26 | 27 | L = lua_envs[info->state_id]->L; 28 | 29 | - if (!skb_make_writable(pskb, pskb->len)) 30 | + if (skb_ensure_writable(pskb, pskb->len)) 31 | return NF_DROP; 32 | 33 | /* call the function provided by --function parameter or the default 'process_packet' defined in Lua */ 34 | @@ -88,11 +88,11 @@ lua_tg(struct sk_buff *pskb, const struc 35 | /* push the lua_packet_segment as a parameter */ 36 | p = (lua_packet_segment *)lua_newuserdata(L, sizeof(lua_packet_segment)); 37 | if (pskb->mac_header) 38 | - p->start = pskb->mac_header; 39 | + p->start = skb_mac_header(pskb); 40 | else if (pskb->network_header) 41 | - p->start = pskb->network_header; 42 | + p->start = skb_network_header(pskb); 43 | else if (pskb->transport_header) 44 | - p->start = pskb->transport_header; 45 | + p->start = skb_transport_header(pskb); 46 | p->offset = 0; 47 | p->length = (unsigned long)pskb->tail - (unsigned long)p->start; 48 | p->changes = NULL; 49 | @@ -208,16 +208,16 @@ static bool load_script_into_state(uint3 50 | * some workqueue initialization. So far this is done each time this function 51 | * is called, subject to change. 52 | */ 53 | -static bool 54 | +static int 55 | lua_tg_checkentry(const struct xt_tgchk_param *par) 56 | { 57 | const struct xt_lua_tginfo *info = par->targinfo; 58 | 59 | if (load_script_into_state(info->state_id, info->script_size, (char *)info->buf)) { 60 | lua_state_refs[info->state_id]++; 61 | - return true; 62 | + return 0; 63 | } 64 | - return false; 65 | + return -EINVAL; 66 | } 67 | 68 | /*::* 69 | --- a/extensions/LUA/lua/llimits.h 70 | +++ b/extensions/LUA/lua/llimits.h 71 | @@ -8,7 +8,6 @@ 72 | #define llimits_h 73 | 74 | #include 75 | -#include 76 | 77 | #include "lua.h" 78 | 79 | --- a/extensions/LUA/lua/lapi.c 80 | +++ b/extensions/LUA/lua/lapi.c 81 | @@ -4,9 +4,6 @@ 82 | ** See Copyright Notice in lua.h 83 | */ 84 | 85 | -#include 86 | -#include 87 | -#include 88 | #include 89 | 90 | #define lapi_c 91 | --- a/extensions/LUA/lua/ltable.c 92 | +++ b/extensions/LUA/lua/ltable.c 93 | @@ -18,7 +18,6 @@ 94 | ** Hence even when the load factor reaches 100%, performance remains good. 95 | */ 96 | 97 | -#include 98 | #include 99 | 100 | #define ltable_c 101 | --- a/extensions/LUA/lua/luaconf.h 102 | +++ b/extensions/LUA/lua/luaconf.h 103 | @@ -13,8 +13,12 @@ 104 | #if !defined(__KERNEL__) 105 | #include 106 | #else 107 | +#include 108 | + 109 | +#undef UCHAR_MAX 110 | +#undef BUFSIZ 111 | +#undef NO_FPU 112 | #define UCHAR_MAX 255 113 | -#define SHRT_MAX 32767 114 | #define BUFSIZ 8192 115 | #define NO_FPU 116 | #endif 117 | @@ -637,6 +641,8 @@ union luai_Cast { double l_d; long l_l; 118 | */ 119 | #if defined(__KERNEL__) 120 | #undef LUA_USE_ULONGJMP 121 | +#define setjmp __builtin_setjmp 122 | +#define longjmp __builtin_longjmp 123 | #endif 124 | 125 | #if defined(__cplusplus) 126 | --- a/extensions/LUA/lua/llex.h 127 | +++ b/extensions/LUA/lua/llex.h 128 | @@ -10,6 +10,8 @@ 129 | #include "lobject.h" 130 | #include "lzio.h" 131 | 132 | +/* prevent conflict with definition from asm/current.h */ 133 | +#undef current 134 | 135 | #define FIRST_RESERVED 257 136 | 137 | -------------------------------------------------------------------------------- /recipes-core/xtables-addons/files/202-add-lua-autoconf.patch: -------------------------------------------------------------------------------- 1 | --- a/configure.ac 2 | +++ b/configure.ac 3 | @@ -83,5 +83,5 @@ 4 | AC_SUBST([xtlibdir]) 5 | AC_CONFIG_FILES([Makefile Makefile.iptrules Makefile.mans 6 | extensions/Makefile extensions/ACCOUNT/Makefile 7 | - extensions/pknock/Makefile]) 8 | + extensions/pknock/Makefile extensions/LUA/Makefile]) 9 | AC_OUTPUT 10 | -------------------------------------------------------------------------------- /recipes-core/xtables-addons/files/400-fix-IFF_LOWER_UP-musl.patch: -------------------------------------------------------------------------------- 1 | Index: xtables-addons-2.12/extensions/pknock/xt_pknock.c 2 | =================================================================== 3 | --- xtables-addons-2.12.orig/extensions/pknock/xt_pknock.c 4 | +++ xtables-addons-2.12/extensions/pknock/xt_pknock.c 5 | @@ -7,6 +7,8 @@ 6 | * This program is released under the terms of GNU GPL version 2. 7 | */ 8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9 | +#undef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 10 | +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 11 | #include 12 | #include 13 | #include 14 | Index: xtables-addons-2.12/extensions/pknock/libxt_pknock.c 15 | =================================================================== 16 | --- xtables-addons-2.12.orig/extensions/pknock/libxt_pknock.c 17 | +++ xtables-addons-2.12/extensions/pknock/libxt_pknock.c 18 | @@ -7,6 +7,8 @@ 19 | * 20 | * This program is released under the terms of GNU GPL version 2. 21 | */ 22 | +#undef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 23 | +#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 24 | #include 25 | #include 26 | #include 27 | -------------------------------------------------------------------------------- /recipes-core/xtables-addons/xtables-addons_3.25.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "non-mainline-kernel netfilter extensions" 2 | DESCRIPTION = "Xtables-addons contains a set of possibly useful but not included in the mainline kernel nefilter extensions" 3 | LICENSE = "GPL-2.0-only" 4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" 5 | DEPENDS = "virtual/kernel iptables" 6 | 7 | inherit autotools kernel-module-split module-base pkgconfig 8 | 9 | CFLAGS:append:toolchain-clang = " -Wno-error=implicit-function-declaration" 10 | 11 | SRC_URI = " \ 12 | https://inai.de/files/xtables-addons/${BP}.tar.xz \ 13 | file://001-fix-kernel-version-detection.patch \ 14 | file://100-add-rtsp-conntrack.patch \ 15 | file://200-add-lua-packetscript.patch \ 16 | file://201-fix-lua-packetscript.patch \ 17 | file://202-add-lua-autoconf.patch \ 18 | file://400-fix-IFF_LOWER_UP-musl.patch \ 19 | file://0001-Unset-LDFLAGS-for-kernel-modules.patch \ 20 | " 21 | SRC_URI[sha256sum] = "8c9f4c6a8e92eb7cfbf03f4ebcb1e1e793256c2efd0226d83312bfb0ffe14b84" 22 | 23 | MODULES_MODULE_SYMVERS_LOCATION = "../${BP}/extensions" 24 | 25 | EXTRA_OECONF = "--with-kbuild=${STAGING_KERNEL_DIR}" 26 | 27 | do_compile:prepend () { 28 | # install additional empty wrappers 29 | touch ${S}/extensions/LUA/lua/include/stdarg.h 30 | touch ${S}/extensions/LUA/lua/include/stddef.h 31 | } 32 | 33 | EXTRA_OEMAKE = "M=${S}/extentions DESTDIR=${D} V=1" 34 | MODULES_INSTALL_TARGET = "install" 35 | # make_scripts requires kernel source directory to create 36 | # kernel scripts 37 | do_make_scripts[depends] += "virtual/kernel:do_shared_workdir" 38 | 39 | FILES:${PN} += "${libexecdir}/xtables-addons ${sbindir}/iptaccount ${libdir}/libxt_ACCOUNT_cl.so.* ${libdir}/iptables" 40 | 41 | RDEPENDS:${PN} += "perl" 42 | -------------------------------------------------------------------------------- /recipes-extended/images/openwrt-image-base.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | SUMMARY = "OpenWrt Base Image" 6 | 7 | LICENSE = "MIT" 8 | 9 | require recipes-core/images/openwrt-image-minimal.bb 10 | 11 | CORE_IMAGE_EXTRA_INSTALL += "\ 12 | packagegroup-openwrt-base \ 13 | make-ext4fs \ 14 | " 15 | -------------------------------------------------------------------------------- /recipes-extended/images/openwrt-image-full.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | SUMMARY = "OpenWrt Base Image" 6 | 7 | LICENSE = "MIT" 8 | 9 | require recipes-extended/images/openwrt-image-base.bb 10 | 11 | CORE_IMAGE_EXTRA_INSTALL += "\ 12 | packagegroup-openwrt-full \ 13 | ugps \ 14 | usbmode \ 15 | " 16 | -------------------------------------------------------------------------------- /recipes-extended/images/openwrt-image-juci.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "JUCI based OpenWRT GUI Image" 5 | HOMEPAGE = "" 6 | LICENSE = "MIT" 7 | 8 | require recipes-core/images/openwrt-image-minimal.bb 9 | 10 | IMAGE_FEATURES += "package-management" 11 | 12 | IMAGE_INSTALL:append = "\ 13 | juci \ 14 | jucid \ 15 | lighttpd \ 16 | rpcd \ 17 | uhttpd \ 18 | " 19 | -------------------------------------------------------------------------------- /recipes-extended/libnl-tiny/libnl-tiny_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "This package contains a stripped down version of libnl" 5 | HOMEPAGE = "https://git.openwrt.org/?p=project/libnl-tiny.git;a=summary" 6 | LICENSE = "LGPL-2.1-only" 7 | LIC_FILES_CHKSUM = "file://nl.c;startline=4;endline=7;md5=f16bd5d25e622bb3001bab76be1f9f91" 8 | SECTION = "libs" 9 | 10 | SRCREV = "8e0555fb39f51a5d6436b4f1370850caa03611ea" 11 | SRC_URI = "git://git.openwrt.org/project/libnl-tiny.git;protocol=https;branch=master" 12 | 13 | inherit cmake pkgconfig 14 | S = "${WORKDIR}/git" 15 | 16 | FILES_SOLIBSDEV = "" 17 | FILES:${PN} += "${libdir}/*.so" 18 | -------------------------------------------------------------------------------- /recipes-extended/libroxml/libroxml_2.3.0.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "This library is minimum, easy-to-use, C implementation for xml file parsing." 5 | HOMEPAGE = "http://www.libroxml.net" 6 | LICENSE = "LGPL-2.1-only" 7 | LIC_FILES_CHKSUM = "file://License.txt;md5=81cba52d2de829c8be3d167618e6b8b6" 8 | SECTION = "libs" 9 | DEPENDS = "" 10 | 11 | SRC_URI = "http://download.libroxml.net/pool/v2.x/${PN}-${PV}.tar.gz" 12 | 13 | SRC_URI[sha256sum] = "1da8f20b530eba4409f2b217587d2f1281ff5d9ba45b24aeac71b94c6c621b78" 14 | 15 | inherit cmake pkgconfig 16 | EXTRA_OECMAKE += "-DBUILD_TESTING=OFF" 17 | -------------------------------------------------------------------------------- /recipes-extended/libroxml/libroxml_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "This library is minimum, easy-to-use, C implementation for xml file parsing." 5 | HOMEPAGE = "http://www.libroxml.net" 6 | LICENSE = "LGPL-2.1-only" 7 | LIC_FILES_CHKSUM = "file://License.txt;md5=81cba52d2de829c8be3d167618e6b8b6" 8 | SECTION = "libs" 9 | DEPENDS = "" 10 | 11 | PV = "3.0.2+git${SRCPV}" 12 | SRCREV = "34257124eefe0ca095ed54681c818381070ed549" 13 | SRC_URI = "git://github.com/blunderer/libroxml.git;protocol=https;branch=master \ 14 | " 15 | 16 | inherit cmake pkgconfig 17 | EXTRA_OECMAKE += "-DBUILD_TESTING=OFF" 18 | S = "${WORKDIR}/git" 19 | -------------------------------------------------------------------------------- /recipes-extended/luci/luci/cmake.patch: -------------------------------------------------------------------------------- 1 | --- /dev/null 2 | +++ b/CMakeLists.txt 3 | @@ -0,0 +1,32 @@ 4 | +cmake_minimum_required(VERSION 3.0) 5 | + 6 | +PROJECT(luci) 7 | + 8 | +INCLUDE(GNUInstallDirs) 9 | + 10 | +IF(NOT LUAPATH) 11 | + SET(LUAPATH "${CMAKE_INSTALL_LIBDIR}/lua/5.1") 12 | +ENDIF() 13 | + 14 | +IF(NOT LUA_CFLAGS) 15 | + FIND_PROGRAM(PKG_CONFIG pkg-config) 16 | + IF(PKG_CONFIG) 17 | + EXECUTE_PROCESS( 18 | + COMMAND pkg-config --silence-errors --cflags lua5.1 19 | + OUTPUT_VARIABLE LUA_CFLAGS 20 | + OUTPUT_STRIP_TRAILING_WHITESPACE 21 | + ) 22 | + ENDIF() 23 | +ENDIF() 24 | + 25 | +ADD_DEFINITIONS(${LUA_CFLAGS}) 26 | + 27 | +ADD_SUBDIRECTORY(modules/luci-base) 28 | +ADD_SUBDIRECTORY(modules/luci-mod-system) 29 | +ADD_SUBDIRECTORY(modules/luci-mod-status) 30 | +ADD_SUBDIRECTORY(modules/luci-mod-rpc) 31 | +ADD_SUBDIRECTORY(libs/luci-lib-base) 32 | +ADD_SUBDIRECTORY(libs/luci-lib-nixio) 33 | +ADD_SUBDIRECTORY(libs/luci-lib-ip) 34 | +ADD_SUBDIRECTORY(libs/luci-lib-jsonc) 35 | +ADD_SUBDIRECTORY(themes/luci-theme-bootstrap) 36 | +ADD_SUBDIRECTORY(themes/luci-theme-material) 37 | +ADD_SUBDIRECTORY(applications/luci-app-firewall) 38 | + 39 | --- /dev/null 40 | +++ b/libs/luci-lib-base/CMakeLists.txt 41 | @@ -0,0 +1,9 @@ 42 | +cmake_minimum_required(VERSION 3.0) 43 | + 44 | +PROJECT(luci-lib-base C) 45 | + 46 | +INSTALL(DIRECTORY luasrc/ 47 | + DESTINATION "${LUAPATH}/luci" 48 | + USE_SOURCE_PERMISSIONS 49 | +) 50 | + 51 | +INSTALL(DIRECTORY root/ 52 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 53 | + USE_SOURCE_PERMISSIONS 54 | +) 55 | + 56 | +INSTALL(DIRECTORY htdocs/ 57 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 58 | + USE_SOURCE_PERMISSIONS 59 | +) 60 | + 61 | --- /dev/null 62 | +++ b/libs/luci-lib-ip/CMakeLists.txt 63 | @@ -0,0 +1,15 @@ 64 | +cmake_minimum_required(VERSION 3.0) 65 | + 66 | +PROJECT(luci-lib-ip C) 67 | + 68 | +FIND_PACKAGE(PkgConfig) 69 | + 70 | +ADD_LIBRARY(ip SHARED src/ip.c) 71 | +SET_TARGET_PROPERTIES(ip PROPERTIES PREFIX "") 72 | + 73 | +TARGET_LINK_LIBRARIES(ip nl-3) 74 | + 75 | +INSTALL(TARGETS ip 76 | + LIBRARY DESTINATION "${LUAPATH}/luci" 77 | +) 78 | + 79 | --- /dev/null 80 | +++ b/libs/luci-lib-nixio/CMakeLists.txt 81 | @@ -0,0 +1,26 @@ 82 | +cmake_minimum_required(VERSION 3.0) 83 | + 84 | +PROJECT(luci-lib-nixio C) 85 | + 86 | +ADD_DEFINITIONS(-DNO_TLS) 87 | + 88 | +ADD_LIBRARY(nixio SHARED src/nixio.c src/socket.c src/sockopt.c src/bind.c src/address.c 89 | + src/protoent.c src/poll.c src/io.c src/file.c src/splice.c src/process.c 90 | + src/syslog.c src/bit.c src/binary.c src/fs.c src/user.c) 91 | +SET_TARGET_PROPERTIES(nixio PROPERTIES PREFIX "") 92 | +TARGET_LINK_LIBRARIES(nixio crypt ssl) 93 | + 94 | +INSTALL(DIRECTORY root/usr/lib/lua/ 95 | + DESTINATION ${LUAPATH} 96 | + USE_SOURCE_PERMISSIONS 97 | +) 98 | + 99 | +INSTALL(TARGETS nixio 100 | + LIBRARY DESTINATION ${LUAPATH} 101 | +) 102 | + 103 | +INSTALL(DIRECTORY root/lib 104 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 105 | + USE_SOURCE_PERMISSIONS 106 | +) 107 | + 108 | --- /dev/null 109 | +++ b/modules/luci-base/CMakeLists.txt 110 | @@ -0,0 +1,37 @@ 111 | +cmake_minimum_required(VERSION 3.0) 112 | + 113 | +PROJECT(luci-base C) 114 | + 115 | +ADD_CUSTOM_COMMAND(OUTPUT lemon 116 | + COMMAND gcc -o ${CMAKE_BINARY_DIR}/lemon ${PROJECT_SOURCE_DIR}/src/contrib/lemon.c) 117 | + 118 | +ADD_CUSTOM_COMMAND(OUTPUT plural_formula 119 | + COMMAND cd ${PROJECT_SOURCE_DIR}/src && ${CMAKE_BINARY_DIR}/lemon -q T=${PROJECT_SOURCE_DIR}/src/contrib/lempar.c plural_formula.y && cd - 120 | + DEPENDS lemon) 121 | +add_custom_target(generate_plural_formula ALL 122 | + DEPENDS lemon plural_formula) 123 | +set_source_files_properties(${PROJECT_SOURCE_DIR}/src/plural_formula.c PROPERTIES GENERATED TRUE) 124 | + 125 | +ADD_LIBRARY(parser SHARED src/plural_formula.c src/template_parser.c src/template_utils.c src/template_lmo.c src/template_lualib.c) 126 | +SET_TARGET_PROPERTIES(parser PROPERTIES PREFIX "") 127 | + 128 | +INSTALL(DIRECTORY luasrc/ 129 | + DESTINATION "${LUAPATH}/luci" 130 | + USE_SOURCE_PERMISSIONS 131 | +) 132 | + 133 | +INSTALL(TARGETS parser 134 | + LIBRARY DESTINATION "${LUAPATH}/luci/template" 135 | +) 136 | + 137 | +add_dependencies(parser generate_plural_formula) 138 | + 139 | +INSTALL(DIRECTORY root/ 140 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 141 | + USE_SOURCE_PERMISSIONS 142 | +) 143 | + 144 | +INSTALL(DIRECTORY htdocs/ 145 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 146 | + USE_SOURCE_PERMISSIONS 147 | +) 148 | --- /dev/null 149 | +++ b/modules/luci-mod-admin-full/CMakeLists.txt 150 | @@ -0,0 +1,3 @@ 151 | +cmake_minimum_required(VERSION 3.0) 152 | + 153 | +PROJECT(luci-mod-admin-full C) 154 | --- /dev/null 155 | +++ b/themes/luci-theme-bootstrap/CMakeLists.txt 156 | @@ -0,0 +1,19 @@ 157 | +cmake_minimum_required(VERSION 3.0) 158 | + 159 | +PROJECT(luci-theme-bootstrap C) 160 | + 161 | +INSTALL(DIRECTORY luasrc/ 162 | + DESTINATION "${LUAPATH}/luci" 163 | + USE_SOURCE_PERMISSIONS 164 | +) 165 | + 166 | +INSTALL(DIRECTORY root/ 167 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 168 | + USE_SOURCE_PERMISSIONS 169 | +) 170 | + 171 | +INSTALL(DIRECTORY htdocs/ 172 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 173 | + USE_SOURCE_PERMISSIONS 174 | +) 175 | + 176 | --- /dev/null 177 | +++ b/themes/luci-theme-material/CMakeLists.txt 178 | @@ -0,0 +1,19 @@ 179 | +cmake_minimum_required(VERSION 3.0) 180 | + 181 | +PROJECT(luci-theme-material C) 182 | + 183 | +INSTALL(DIRECTORY luasrc/ 184 | + DESTINATION "${LUAPATH}/luci" 185 | + USE_SOURCE_PERMISSIONS 186 | +) 187 | + 188 | +INSTALL(DIRECTORY root/ 189 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 190 | + USE_SOURCE_PERMISSIONS 191 | +) 192 | + 193 | +INSTALL(DIRECTORY htdocs/ 194 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 195 | + USE_SOURCE_PERMISSIONS 196 | +) 197 | + 198 | --- /dev/null 199 | +++ b/applications/luci-app-firewall/CMakeLists.txt 200 | @@ -0,0 +1,13 @@ 201 | +cmake_minimum_required(VERSION 3.0) 202 | + 203 | +PROJECT(luci-app-firewall C) 204 | + 205 | +INSTALL(DIRECTORY root/ 206 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 207 | + USE_SOURCE_PERMISSIONS 208 | +) 209 | + 210 | +INSTALL(DIRECTORY htdocs/ 211 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 212 | + USE_SOURCE_PERMISSIONS 213 | +) 214 | --- /dev/null 215 | +++ b/libs/luci-lib-jsonc/CMakeLists.txt 216 | @@ -0,0 +1,15 @@ 217 | +cmake_minimum_required(VERSION 3.0) 218 | + 219 | +PROJECT(luci-lib-jsonc C) 220 | + 221 | +FIND_PACKAGE(PkgConfig) 222 | + 223 | +ADD_LIBRARY(jsonc SHARED src/jsonc.c) 224 | +SET_TARGET_PROPERTIES(jsonc PROPERTIES PREFIX "") 225 | + 226 | +TARGET_LINK_LIBRARIES(jsonc json-c) 227 | + 228 | +INSTALL(TARGETS jsonc 229 | + LIBRARY DESTINATION "${LUAPATH}/luci" 230 | +) 231 | + 232 | --- /dev/null 233 | +++ b/modules/luci-mod-status/CMakeLists.txt 234 | @@ -0,0 +1,25 @@ 235 | +cmake_minimum_required(VERSION 3.0) 236 | + 237 | +PROJECT(luci-mod-status C) 238 | + 239 | +ADD_EXECUTABLE(luci-bwc src/luci-bwc.c) 240 | +TARGET_LINK_LIBRARIES(luci-bwc dl) 241 | + 242 | +INSTALL(DIRECTORY luasrc/ 243 | + DESTINATION "${LUAPATH}/luci" 244 | + USE_SOURCE_PERMISSIONS 245 | +) 246 | + 247 | +INSTALL(TARGETS luci-bwc 248 | + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" 249 | +) 250 | + 251 | +INSTALL(DIRECTORY root/ 252 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 253 | + USE_SOURCE_PERMISSIONS 254 | +) 255 | + 256 | +INSTALL(DIRECTORY htdocs/ 257 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 258 | + USE_SOURCE_PERMISSIONS 259 | +) 260 | + 261 | --- /dev/null 262 | +++ b/modules/luci-mod-rpc/CMakeLists.txt 263 | @@ -0,0 +1,9 @@ 264 | +cmake_minimum_required(VERSION 3.0) 265 | + 266 | +PROJECT(luci-mod-rpc C) 267 | + 268 | +INSTALL(DIRECTORY luasrc/ 269 | + DESTINATION "${LUAPATH}/luci" 270 | + USE_SOURCE_PERMISSIONS 271 | +) 272 | + 273 | --- /dev/null 274 | +++ b/modules/luci-mod-system/CMakeLists.txt 275 | @@ -0,0 +1,19 @@ 276 | +cmake_minimum_required(VERSION 3.0) 277 | + 278 | +PROJECT(luci-mod-system C) 279 | + 280 | +INSTALL(DIRECTORY luasrc/ 281 | + DESTINATION "${LUAPATH}/luci" 282 | + USE_SOURCE_PERMISSIONS 283 | +) 284 | + 285 | +INSTALL(DIRECTORY root/ 286 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/" 287 | + USE_SOURCE_PERMISSIONS 288 | +) 289 | + 290 | +INSTALL(DIRECTORY htdocs/ 291 | + DESTINATION "${CMAKE_INSTALL_PREFIX}/www" 292 | + USE_SOURCE_PERMISSIONS 293 | +) 294 | + 295 | -------------------------------------------------------------------------------- /recipes-extended/luci/luci_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt LuCI web user interface" 5 | HOMEPAGE = "https://github.com/openwrt/luci" 6 | LICENSE = "Apache-2.0" 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9" 8 | SECTION = "base" 9 | 10 | DEPENDS = "json-c libubox libnl lua5.1 iwinfo openssl virtual/crypt" 11 | RDEPENDS:${PN} = "lua5.1 lucihttp cgi-io" 12 | 13 | SRCREV = "709d48b72657084a27db1fb6fc0a4a4e8939552f" 14 | 15 | SRC_URI = "git://github.com/openwrt/luci.git;branch=openwrt-22.03;protocol=https \ 16 | file://cmake.patch" 17 | 18 | inherit cmake openwrt pkgconfig 19 | 20 | prefix="" 21 | includedir="/usr/include" 22 | bindir="/usr/bin" 23 | libdir="/usr/${baselib}" 24 | 25 | OECMAKE_C_FLAGS += "-I${STAGING_INCDIR}/libnl3 -DDESTDIR=${D}" 26 | 27 | S = "${WORKDIR}/git" 28 | 29 | FILES:${PN} += "/www ${base_libdir} /usr/share /usr/libexec" 30 | -------------------------------------------------------------------------------- /recipes-extended/lucihttp/lucihttp.bb: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Bosch Sicherheitssysteme GmbH 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | DESCRIPTION = "LuCI HTTP utility library" 6 | HOMEPAGE = "https://github.com/jow-/lucihttp" 7 | 8 | LICENSE = "MIT" 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=a6b7565d075eb26cd08b6ac739db35e3" 10 | 11 | DEPENDS:class-target += " lua5.1 ucode" 12 | 13 | SRCREV = "6e68a1065f3ed1889e5fa053b206bd3aa108bd5f" 14 | SRC_URI = "git://github.com/jow-/lucihttp.git;branch=master;protocol=https" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake pkgconfig openwrt-lua 19 | 20 | # Do not build tests 21 | EXTRA_OECMAKE += "-DBUILD_TESTS=OFF" 22 | 23 | RDEPENDS:${PN} = "lua5.1 ucode" 24 | -------------------------------------------------------------------------------- /recipes-extended/packagegroups/packagegroup-openwrt-base.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | 4 | # Released under the MIT license (see COPYING.MIT for the terms) 5 | 6 | SUMMARY = "Normal Openwrt system requirements" 7 | DESCRIPTION = "The set of packages required for a more traditional full-featured Openwrt system" 8 | LICENSE = "MIT" 9 | 10 | PACKAGE_ARCH = "${MACHINE_ARCH}" 11 | 12 | inherit packagegroup openwrt openwrt-services 13 | 14 | PACKAGES = "\ 15 | packagegroup-openwrt-base \ 16 | packagegroup-openwrt-base-network \ 17 | packagegroup-openwrt-base-luci \ 18 | " 19 | 20 | RDEPENDS:${PN} = "\ 21 | packagegroup-openwrt-minimal \ 22 | packagegroup-openwrt-base-network \ 23 | packagegroup-openwrt-base-luci \ 24 | " 25 | 26 | RDEPENDS:${PN}-network = "\ 27 | dnsmasq \ 28 | \ 29 | ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'iwinfo', '',d)} \ 30 | ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'odhcpd', '', d)} \ 31 | umdnsd \ 32 | " 33 | 34 | RDEPENDS:${PN}-luci = "\ 35 | lua5.1 \ 36 | luci \ 37 | uhttpd \ 38 | " 39 | -------------------------------------------------------------------------------- /recipes-extended/packagegroups/packagegroup-openwrt-full.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | 4 | # Released under the MIT license (see COPYING.MIT for the terms) 5 | 6 | SUMMARY = "Extras Openwrt system requirements" 7 | LICENSE = "MIT" 8 | 9 | inherit packagegroup openwrt openwrt-services 10 | 11 | PACKAGES = "\ 12 | packagegroup-openwrt-full \ 13 | packagegroup-openwrt-full-base \ 14 | packagegroup-openwrt-full-network \ 15 | " 16 | 17 | RDEPENDS:${PN} = "\ 18 | packagegroup-openwrt-base \ 19 | packagegroup-openwrt-full-network \ 20 | " 21 | 22 | RDEPENDS:${PN}-network = "\ 23 | relayd \ 24 | tcpdump \ 25 | umbim \ 26 | umdnsd \ 27 | uqmi \ 28 | " 29 | -------------------------------------------------------------------------------- /recipes-extended/ugps/ugps_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt GPS daemon" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/ugps.git;a=summary" 6 | LICENSE = "GPL-2.0-or-later" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=17;md5=2bf63b09608cf97d9dbafe99c7ea23fe" 8 | SECTION = "base" 9 | DEPENDS = "libubox ubus" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/ugps.git;protocol=https;branch=master \ 12 | " 13 | 14 | SRCREV = "511a5b3c84fa715ef0305cf26c98619c12a4867a" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake pkgconfig openwrt 19 | 20 | FILES:${PN} += "${libdir}/*" 21 | -------------------------------------------------------------------------------- /recipes-extended/usbmode/usbmode_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "usbmode - usb_modeswitch replacement" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/usbmode.git;a=summary" 6 | LICENSE = "PD" 7 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/PD;md5=b3597d12946881e13cb3b548d1173851" 8 | SECTION = "base" 9 | DEPENDS = "libusb libubox" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/usbmode.git;protocol=https;branch=master" 12 | 13 | SRCREV = "f40f84c27534159066c94dadc0c08e0b255c3e26" 14 | 15 | S = "${WORKDIR}/git" 16 | 17 | inherit cmake pkgconfig openwrt 18 | 19 | FILES:${PN} += "${libdir}/*" 20 | FILES:${PN}-dbg += "${libdir}/lua/5.*/.debug" 21 | -------------------------------------------------------------------------------- /recipes-extended/usign/usign_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt tiny signify replacement" 5 | HOMEPAGE = "https://git.openwrt.org/?p=project/usign.git;a=summary" 6 | LICENSE = "BSD" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=17;md5=a51760fc5328fc7e0e27a5af562c6cfa" 8 | SECTION = "base" 9 | 10 | SRC_URI = "git://git.openwrt.org/project/usign.git;protocol=https;branch=master \ 11 | " 12 | SRCREV = "f1f65026a94137c91b5466b149ef3ea3f20091e9" 13 | 14 | S = "${WORKDIR}/git" 15 | 16 | inherit cmake pkgconfig 17 | 18 | EXTRA_OECMAKE += "${EXTRA_OECONF}" 19 | 20 | # avoids build breaks when using no-static-libs.inc 21 | DISABLE_STATIC = "" 22 | 23 | PACKAGECONFIG ??= "ubox" 24 | 25 | PACKAGECONFIG[ubox] = "-DUSE_LIBUBOX=ON,,libubox," 26 | -------------------------------------------------------------------------------- /recipes-kernel/linux/files/bridge.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_BRIDGE=m 2 | -------------------------------------------------------------------------------- /recipes-kernel/linux/files/ipset.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_IP_SET=m 2 | -------------------------------------------------------------------------------- /recipes-kernel/linux/linux-yocto%.bbappend: -------------------------------------------------------------------------------- 1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:${THISDIR}/files:" 2 | 3 | SRC_URI:append = "\ 4 | file://ipset.cfg \ 5 | file://bridge.cfg \ 6 | " 7 | -------------------------------------------------------------------------------- /recipes-networking/ipset/ipset_7.9.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2017 Aaron Brice 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Administration tool for IP sets" 5 | HOMEPAGE = "http://ipset.netfilter.org" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552" 8 | SECTION = "base" 9 | 10 | DEPENDS = "libtool libmnl" 11 | RDEPENDS:${PN} = "kernel-module-ip-set" 12 | 13 | SRC_URI = "http://ftp.netfilter.org/pub/ipset/${BP}.tar.bz2" 14 | SRC_URI[sha256sum] = "b75c13689eddf1d95b396840a69dc04fd7ae4112b10b70594bc0405df7b9b30a" 15 | 16 | inherit autotools pkgconfig module-base 17 | 18 | EXTRA_OECONF += "-with-kbuild=${KBUILD_OUTPUT} --with-ksource=${STAGING_KERNEL_DIR}" 19 | -------------------------------------------------------------------------------- /recipes-networking/relayd/relayd/0001-Fix-ignoring-return-value-of-write-declared-with-att.patch: -------------------------------------------------------------------------------- 1 | From ad0040910f62ebdfe47af750e101787183453bf3 Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 9 Dec 2020 23:09:03 -0800 4 | Subject: [PATCH] Fix ignoring return value of 'write' declared with attribute 5 | 'warn_unused_result' 6 | 7 | Signed-off-by: Khem Raj 8 | --- 9 | route.c | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/route.c b/route.c 13 | index c552d1f..a619576 100644 14 | --- a/route.c 15 | +++ b/route.c 16 | @@ -42,7 +42,7 @@ static void rtnl_flush(void) 17 | if (fd < 0) 18 | return; 19 | 20 | - write(fd, "-1", 2); 21 | + if(write(fd, "-1", 2)); 22 | close(fd); 23 | } 24 | 25 | -- 26 | 2.29.2 27 | 28 | -------------------------------------------------------------------------------- /recipes-networking/relayd/relayd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt IPv4 pseudo-bridge routing daemon" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/relayd.git;a=summary" 6 | LICENSE = "GPL-2.0-or-later" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=17;md5=86aad799085683e0a2e1c2684a20bab2" 8 | SECTION = "base" 9 | DEPENDS = "libubox" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/relayd.git;protocol=https;branch=master \ 12 | file://0001-Fix-ignoring-return-value-of-write-declared-with-att.patch \ 13 | " 14 | 15 | SRCREV = "f4d759be54ceb37714e9a6ca320d5b50c95e9ce9" 16 | 17 | S = "${WORKDIR}/git" 18 | 19 | inherit cmake pkgconfig openwrt 20 | 21 | FILES:${PN} += "${libdir}/*" 22 | -------------------------------------------------------------------------------- /recipes-networking/uhttpd/uhttpd/0100-fix-wrong-binaries-found-due-to-inconsistent-path.patch: -------------------------------------------------------------------------------- 1 | From a579f4da5079b6248fd3cefe0cfa3335c1159e04 Mon Sep 17 00:00:00 2001 2 | From: "Daniel F. Dickinson" 3 | Date: Sat, 20 Jan 2018 20:25:58 -0500 4 | Subject: [PATCH] uhttpd: Fix CGI finds wrong binaries due to inconsistent PATH 5 | 6 | uhttpd: Fix CGI finds wrong binaries due to inconsistent PATH 7 | 8 | The PATH of the uhttpd CGI environment does not match the profile or init PATH 9 | which results in luci finding the wrong binaries compared to the command line or 10 | initscripts, when there is more than one binary of the same name. 11 | --- a/main.c 12 | +++ b/main.c 13 | @@ -190,7 +190,7 @@ static void init_defaults_pre(void) 14 | conf.max_connections = 100; 15 | conf.realm = "Protected Area"; 16 | conf.cgi_prefix = "/cgi-bin"; 17 | - conf.cgi_path = "/sbin:/usr/sbin:/bin:/usr/bin"; 18 | + conf.cgi_path = "/usr/sbin:/usr/bin:/sbin:/bin"; 19 | INIT_LIST_HEAD(&conf.cgi_alias); 20 | INIT_LIST_HEAD(&conf.lua_prefix); 21 | #if HAVE_UCODE 22 | -------------------------------------------------------------------------------- /recipes-networking/uhttpd/uhttpd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2016 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Tiny HTTP server" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/uhttpd.git;a=summary" 6 | LICENSE = "0BSD" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=18;md5=ba30601dd30339f7ff3d0ad681d45679" 8 | SECTION = "base" 9 | DEPENDS = "libubox ubus ucode json-c ustream-ssl virtual/crypt" 10 | 11 | SRC_URI = "\ 12 | git://git.openwrt.org/project/uhttpd.git;protocol=https;branch=master \ 13 | file://0100-fix-wrong-binaries-found-due-to-inconsistent-path.patch \ 14 | " 15 | 16 | SRCREV = "e3395cd90bed9b7b9fc319e79528fedcc0d947fe" 17 | S = "${WORKDIR}/git" 18 | 19 | inherit cmake pkgconfig openwrt-services openwrt openwrt-base-files 20 | 21 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 22 | 23 | CFLAGS += "-D_DEFAULT_SOURCE" 24 | 25 | EXTRA_OECMAKE = "-DTLS_SUPPORT=ON -DLUA_SUPPORT=ON -DUBUS_SUPPORT=ON" 26 | 27 | do_install:append() { 28 | install -Dm 0755 ${S}/openwrt/package/network/services/uhttpd/files/uhttpd.init ${D}${sysconfdir}/init.d/uhttpd 29 | install -Dm 0644 ${S}/openwrt/package/network/services/uhttpd/files/uhttpd.config ${D}${sysconfdir}/config/uhttpd 30 | install -Dm 0644 ${S}/openwrt/package/network/services/uhttpd/files/ubus.default ${D}${sysconfdir}/uci-defaults/00_uhttpd_ubus 31 | install -dm 0755 ${D}/usr/sbin 32 | ln -s /usr/bin/uhttpd ${D}/usr/sbin/uhttpd 33 | install -dm 0755 ${D}/www 34 | } 35 | 36 | FILES:${PN} += "${libdir}/* /www" 37 | 38 | RDEPENDS:${PN} += "\ 39 | openssl \ 40 | base-files-scripts-openwrt \ 41 | " 42 | -------------------------------------------------------------------------------- /recipes-networking/umbim/umbim/0001-remove-call-to-deprecated-function-luaL_openlib-in-l.patch: -------------------------------------------------------------------------------- 1 | From 36b919b4b458d11eef408a6464627260545391c4 Mon Sep 17 00:00:00 2001 2 | From: Khem Raj 3 | Date: Wed, 21 Oct 2015 18:55:07 -0700 4 | Subject: [PATCH] remove call to deprecated function luaL_openlib in lua 5.2 5 | and newer 6 | 7 | Signed-off-by: Khem Raj 8 | --- 9 | lua/uloop.c | 24 +++++++++++++++++++++--- 10 | 1 file changed, 21 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/lua/uloop.c b/lua/uloop.c 13 | index 2a0a516..096ee13 100644 14 | --- a/lua/uloop.c 15 | +++ b/lua/uloop.c 16 | @@ -98,6 +98,24 @@ static const luaL_Reg timer_m[] = { 17 | { NULL, NULL } 18 | }; 19 | 20 | +static void uloop_lua_registerlib(lua_State *L, const char *libname, 21 | + const luaL_Reg *l) 22 | +{ 23 | +#if LUA_VERSION_NUM >= 502 24 | + if (libname) 25 | + { 26 | + lua_newtable(L); 27 | + luaL_setfuncs(L, l, 1); 28 | + lua_pushvalue(L, -1); 29 | + lua_setglobal(L, libname); 30 | + } 31 | + else 32 | + luaL_setfuncs(L, l, 1); 33 | +#else 34 | + luaL_register(L, libname, l); 35 | +#endif 36 | +} 37 | + 38 | static int ul_timer(lua_State *L) 39 | { 40 | struct lua_uloop_timeout *tout; 41 | @@ -129,7 +147,7 @@ static int ul_timer(lua_State *L) 42 | lua_pushvalue(L, -1); 43 | lua_setmetatable(L, -3); 44 | lua_pushvalue(L, -2); 45 | - luaI_openlib(L, NULL, timer_m, 1); 46 | + uloop_lua_registerlib(L, NULL, timer_m); 47 | lua_pushvalue(L, -2); 48 | 49 | memset(tout, 0, sizeof(*tout)); 50 | @@ -248,7 +266,7 @@ static int ul_ufd_add(lua_State *L) 51 | lua_pushvalue(L, -1); 52 | lua_setmetatable(L, -3); 53 | lua_pushvalue(L, -2); 54 | - luaI_openlib(L, NULL, ufd_m, 1); 55 | + uloop_lua_registerlib(L, NULL, ufd_m); 56 | lua_pushvalue(L, -2); 57 | 58 | memset(ufd, 0, sizeof(*ufd)); 59 | @@ -363,7 +381,7 @@ static int ul_end(lua_State *L) 60 | return 1; 61 | } 62 | 63 | -static luaL_reg uloop_func[] = { 64 | +static luaL_Reg uloop_func[] = { 65 | {"init", ul_init}, 66 | {"run", ul_run}, 67 | {"timer", ul_timer}, 68 | -- 69 | 2.6.1 70 | 71 | -------------------------------------------------------------------------------- /recipes-networking/umbim/umbim_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt MBIM modem utility" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/umbim.git;a=summary" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://mbim.h;beginline=1;endline=13;md5=8c7ce85ebfe23634010c75c30c3eb223" 8 | SECTION = "base" 9 | DEPENDS = "libubox" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/umbim.git;protocol=https;branch=master \ 12 | " 13 | SRCREV = "184b707ddaa0acee84d02e0ffe599cb8b67782bd" 14 | 15 | S = "${WORKDIR}/git" 16 | 17 | inherit cmake pkgconfig openwrt 18 | 19 | TARGET_CFLAGS:append = " -Wno-error=address-of-packed-member" 20 | 21 | FILES:${PN} += "${libdir}/*" 22 | -------------------------------------------------------------------------------- /recipes-networking/umdnsd/umdnsd_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt MDNS daemon" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/mdnsd.git;a=summary" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=12;md5=ce0be9da20a926574bf76c1285343bef" 8 | SECTION = "base" 9 | DEPENDS = "json-c libcap libubox ubus" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/mdnsd.git;protocol=https;branch=master \ 12 | " 13 | SRCREV = "78aa36b0e9808e801c527c6dc47320e593309522" 14 | 15 | S = "${WORKDIR}/git" 16 | 17 | inherit cmake pkgconfig openwrt-services openwrt 18 | 19 | TARGET_CFLAGS:append = " -Wno-error=array-bounds" 20 | 21 | FILES:${PN} += "${libdir}/*" 22 | -------------------------------------------------------------------------------- /recipes-networking/uqmi/uqmi/001-fix-uninitialized-variable.patch: -------------------------------------------------------------------------------- 1 | diff --git a/commands-nas.c b/commands-nas.c 2 | index 476cd61..9c0a626 100644 3 | --- a/commands-nas.c 4 | +++ b/commands-nas.c 5 | @@ -710,7 +710,7 @@ static void 6 | cmd_nas_get_cell_location_info_cb(struct qmi_dev *qmi, struct qmi_request *req, struct qmi_msg *msg) 7 | { 8 | struct qmi_nas_get_cell_location_info_response res; 9 | - void *c, *t, *cell, *freq; 10 | + void *c = NULL, *t, *cell, *freq; 11 | int i, j; 12 | 13 | qmi_parse_nas_get_cell_location_info_response(msg, &res); 14 | -------------------------------------------------------------------------------- /recipes-networking/uqmi/uqmi_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "OpenWrt uqmi utility" 5 | HOMEPAGE = "http://git.openwrt.org/?p=project/uqmi.git;a=summary" 6 | LICENSE = "GPL-2.0-only" 7 | LIC_FILES_CHKSUM = "file://main.c;beginline=1;endline=20;md5=3f7041e5710007661d762bb6043a69c6" 8 | SECTION = "base" 9 | DEPENDS = "libubox json-c" 10 | 11 | SRC_URI = "git://git.openwrt.org/project/uqmi.git;protocol=https;branch=master \ 12 | file://001-fix-uninitialized-variable.patch \ 13 | " 14 | SRCREV = "56cb2d4056fef132ccf78dfb6f3074ae5d109992" 15 | 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake pkgconfig openwrt 19 | 20 | B = "${S}" 21 | 22 | # temporary solution until upstream gets fixed 23 | # dev.c:217: error: storing the address of local variable 'complete' in '*req.complete' 24 | CFLAGS += "-Wno-error=dangling-pointer" 25 | 26 | FILES:${PN} += "${libdir}/*" 27 | -------------------------------------------------------------------------------- /recipes-support/cgi-io/cgi-io_git.bb: -------------------------------------------------------------------------------- 1 | # Recipe created by recipetool 2 | # This is the basis of a recipe and may need further editing in order to be fully functional. 3 | # (Feel free to remove these comments when editing.) 4 | 5 | # Unable to find any files that looked like license statements. Check the accompanying 6 | # documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly. 7 | # 8 | # NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if 9 | # this is not accurate with respect to the licensing of the software being built (it 10 | # will not be in most cases) you must specify the correct value before using this 11 | # recipe for anything other than initial testing/development! 12 | LICENSE = "CLOSED" 13 | LIC_FILES_CHKSUM = "" 14 | 15 | SRC_URI = "git://git.openwrt.org/project/cgi-io.git;protocol=https;branch=master" 16 | 17 | # Modify these as desired 18 | PV = "1.0+git${SRCPV}" 19 | SRCREV = "901b0f0463c9d16a8cf5b9ed37118d8484bc9176" 20 | PROVIDES = "cgi-io" 21 | DEPENDS = "libubox ubus" 22 | RDEPENDS:${PN} = "libubox ubus" 23 | S = "${WORKDIR}/git" 24 | 25 | inherit cmake python3native 26 | 27 | do_install:append() { 28 | install -dm 0755 ${D}/www/cgi-bin 29 | ln -s /usr/sbin/cgi-io ${D}/www/cgi-bin/cgi-upload 30 | ln -s /usr/sbin/cgi-io ${D}/www/cgi-bin/cgi-download 31 | ln -s /usr/sbin/cgi-io ${D}/www/cgi-bin/cgi-backup 32 | ln -s /usr/sbin/cgi-io ${D}/www/cgi-bin/cgi-exec 33 | } 34 | 35 | FILES:${PN} += "/www/cgi-bin/*" 36 | 37 | # Specify any options you want to pass to cmake using EXTRA_OECMAKE: 38 | EXTRA_OECMAKE = "" 39 | 40 | -------------------------------------------------------------------------------- /recipes-support/lua-socket/lua-socket_git.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | 4 | # Released under the MIT license (see COPYING.MIT for the terms) 5 | 6 | DESCRIPTION = "Networking extension library for Lua" 7 | HOMEPAGE = "https://github.com/diegonehab/luasocket" 8 | LICENSE = "MIT" 9 | LIC_FILES_CHKSUM = "file://LICENSE;md5=ab6706baf6d39a6b0fa2613a3b0831e7" 10 | 11 | DEPENDS += "lua5.1-native lua5.1" 12 | 13 | SRC_URI = "git://github.com/diegonehab/luasocket.git;protocol=https;branch=master \ 14 | " 15 | 16 | SRCREV = "5b18e475f38fcf28429b1cc4b17baee3b9793a62" 17 | 18 | S = "${WORKDIR}/git" 19 | 20 | inherit openwrt 21 | 22 | TARGET_CC_ARCH += "${LDFLAGS}" 23 | 24 | CFLAGS += "-I${STAGING_INCDIR}/lua5.1" 25 | EXTRA_OEMAKE += "PLAT=linux LUAINC_linux_base=${STAGING_INCDIR} LUAPREFIX_linux=${prefix} DESTDIR=${D} \ 26 | CC_linux='${CC}' LD_linux='${CC}' LUAV=5.1" 27 | 28 | do_install() { 29 | oe_runmake install 30 | } 31 | 32 | FILES:${PN} += "${libdir}/* ${datadir}/lua/5.*/" 33 | FILES:${PN}-dbg += "${libdir}/lua/5.*/.debug ${libdir}/lua/5.*/*/.debug" 34 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1/0004-Fix-stack-overflow-in-vararg-functions.patch: -------------------------------------------------------------------------------- 1 | Upstream-Status: Backport 2 | 3 | Not needed in lua 5.3 4 | 5 | From: Enrico Tassi 6 | Date: Tue, 26 Aug 2014 16:20:55 +0200 7 | Subject: Fix stack overflow in vararg functions 8 | 9 | --- 10 | src/ldo.c | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/src/ldo.c b/src/ldo.c 14 | index d1bf786..30333bf 100644 15 | --- a/src/ldo.c 16 | +++ b/src/ldo.c 17 | @@ -274,7 +274,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { 18 | CallInfo *ci; 19 | StkId st, base; 20 | Proto *p = cl->p; 21 | - luaD_checkstack(L, p->maxstacksize); 22 | + luaD_checkstack(L, p->maxstacksize + p->numparams); 23 | func = restorestack(L, funcr); 24 | if (!p->is_vararg) { /* no varargs? */ 25 | base = func + 1; 26 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1/bitwise_operators.patch: -------------------------------------------------------------------------------- 1 | diff -Nurd lua-5.1.5/src/lcode.c lua-5.1.5/src/lcode.c 2 | --- lua-5.1.5/src/lcode.c 2011-01-31 16:53:16.000000000 +0200 3 | +++ lua-5.1.5/src/lcode.c 2012-11-28 21:12:23.958419501 +0200 4 | @@ -642,6 +642,17 @@ 5 | case OP_POW: r = luai_numpow(v1, v2); break; 6 | case OP_UNM: r = luai_numunm(v1); break; 7 | case OP_LEN: return 0; /* no constant folding for 'len' */ 8 | +#if defined(LUA_BITWISE_OPERATORS) 9 | + case OP_BOR: luai_logor(r, v1, v2); break; 10 | + case OP_BAND: luai_logand(r, v1, v2); break; 11 | + case OP_BXOR: luai_logxor(r, v1, v2); break; 12 | + case OP_BLSHFT: luai_loglshft(r, v1, v2); break; 13 | + case OP_BRSHFT: luai_logrshft(r, v1, v2); break; 14 | + case OP_BNOT: luai_lognot(r, v1); break; 15 | + case OP_INTDIV: 16 | + if (v2 == 0) return 0; /* do not attempt to divide by 0 */ 17 | + r = luai_numintdiv(v1, v2); break; 18 | +#endif 19 | default: lua_assert(0); r = 0; break; 20 | } 21 | if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */ 22 | @@ -654,7 +665,11 @@ 23 | if (constfolding(op, e1, e2)) 24 | return; 25 | else { 26 | +#if defined(LUA_BITWISE_OPERATORS) 27 | + int o2 = (op != OP_UNM && op != OP_LEN && op != OP_BNOT) ? luaK_exp2RK(fs, e2) : 0; 28 | +#else 29 | int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; 30 | +#endif 31 | int o1 = luaK_exp2RK(fs, e1); 32 | if (o1 > o2) { 33 | freeexp(fs, e1); 34 | @@ -690,6 +705,14 @@ 35 | expdesc e2; 36 | e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; 37 | switch (op) { 38 | +#if defined(LUA_BITWISE_OPERATORS) 39 | + case OPR_BNOT: { 40 | + if (e->k == VK) 41 | + luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ 42 | + codearith(fs, OP_BNOT, e, &e2); 43 | + break; 44 | + } 45 | +#endif 46 | case OPR_MINUS: { 47 | if (!isnumeral(e)) 48 | luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ 49 | @@ -770,6 +793,14 @@ 50 | case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break; 51 | case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break; 52 | case OPR_POW: codearith(fs, OP_POW, e1, e2); break; 53 | +#if defined(LUA_BITWISE_OPERATORS) 54 | + case OPR_BOR: codearith(fs, OP_BOR, e1, e2); break; 55 | + case OPR_BAND: codearith(fs, OP_BAND, e1, e2); break; 56 | + case OPR_BXOR: codearith(fs, OP_BXOR, e1, e2); break; 57 | + case OPR_BLSHFT: codearith(fs, OP_BLSHFT, e1, e2); break; 58 | + case OPR_BRSHFT: codearith(fs, OP_BRSHFT, e1, e2); break; 59 | + case OPR_INTDIV: codearith(fs, OP_INTDIV, e1, e2); break; 60 | +#endif 61 | case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break; 62 | case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break; 63 | case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break; 64 | diff -Nurd lua-5.1.5/src/lcode.h lua-5.1.5/src/lcode.h 65 | --- lua-5.1.5/src/lcode.h 2007-12-27 15:02:25.000000000 +0200 66 | +++ lua-5.1.5/src/lcode.h 2012-11-28 21:12:23.958419501 +0200 67 | @@ -25,6 +25,9 @@ 68 | */ 69 | typedef enum BinOpr { 70 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, 71 | +#if defined(LUA_BITWISE_OPERATORS) 72 | + OPR_BOR, OPR_BAND, OPR_BXOR, OPR_BLSHFT, OPR_BRSHFT, OPR_INTDIV, 73 | +#endif 74 | OPR_CONCAT, 75 | OPR_NE, OPR_EQ, 76 | OPR_LT, OPR_LE, OPR_GT, OPR_GE, 77 | @@ -33,8 +36,11 @@ 78 | } BinOpr; 79 | 80 | 81 | +#if defined(LUA_BITWISE_OPERATORS) 82 | +typedef enum UnOpr { OPR_BNOT, OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; 83 | +#else 84 | typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; 85 | - 86 | +#endif 87 | 88 | #define getcode(fs,e) ((fs)->f->code[(e)->u.s.info]) 89 | 90 | diff -Nurd lua-5.1.5/src/ldebug.c lua-5.1.5/src/ldebug.c 91 | --- lua-5.1.5/src/ldebug.c 2008-05-08 19:56:26.000000000 +0300 92 | +++ lua-5.1.5/src/ldebug.c 2012-11-28 21:12:23.958419501 +0200 93 | @@ -592,6 +592,16 @@ 94 | luaG_typeerror(L, p2, "perform arithmetic on"); 95 | } 96 | 97 | +#if defined (LUA_BITWISE_OPERATORS) 98 | +void luaG_logicerror (lua_State *L, const TValue *p1, const TValue *p2) { 99 | + TValue temp; 100 | + if (luaV_tonumber(p1, &temp) == NULL) 101 | + p2 = p1; /* first operand is wrong */ 102 | + luaG_typeerror(L, p2, "perform bitwise operation on"); 103 | +} 104 | +#endif 105 | + 106 | + 107 | 108 | int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { 109 | const char *t1 = luaT_typenames[ttype(p1)]; 110 | diff -Nurd lua-5.1.5/src/ldebug.h lua-5.1.5/src/ldebug.h 111 | --- lua-5.1.5/src/ldebug.h 2007-12-27 15:02:25.000000000 +0200 112 | +++ lua-5.1.5/src/ldebug.h 2012-11-28 21:12:23.958419501 +0200 113 | @@ -30,4 +30,9 @@ 114 | LUAI_FUNC int luaG_checkcode (const Proto *pt); 115 | LUAI_FUNC int luaG_checkopenop (Instruction i); 116 | 117 | +#if defined (LUA_BITWISE_OPERATORS) 118 | +LUAI_FUNC void luaG_logicerror (lua_State *L, const TValue *p1, 119 | + const TValue *p2); 120 | +#endif 121 | + 122 | #endif 123 | diff -Nurd lua-5.1.5/src/llex.c lua-5.1.5/src/llex.c 124 | --- lua-5.1.5/src/llex.c 2009-11-23 16:58:22.000000000 +0200 125 | +++ lua-5.1.5/src/llex.c 2012-11-28 21:12:23.958419501 +0200 126 | @@ -39,7 +39,11 @@ 127 | "end", "false", "for", "function", "if", 128 | "in", "local", "nil", "not", "or", "repeat", 129 | "return", "then", "true", "until", "while", 130 | +#if defined(LUA_BITWISE_OPERATORS) 131 | + "..", "...", "==", ">=", ">>", "<=", "<<", "^^", "~=", "!=" 132 | +#else 133 | "..", "...", "==", ">=", "<=", "~=", 134 | +#endif 135 | "", "", "", "", 136 | NULL 137 | }; 138 | @@ -373,6 +377,30 @@ 139 | if (ls->current != '=') return '='; 140 | else { next(ls); return TK_EQ; } 141 | } 142 | +#if defined(LUA_BITWISE_OPERATORS) 143 | + case '<': { 144 | + next(ls); 145 | + if (ls->current == '=') { next(ls); return TK_LE; } 146 | + else if (ls->current == '<') { next(ls); return TK_LSHFT; } 147 | + else return '<'; 148 | + } 149 | + case '>': { 150 | + next(ls); 151 | + if (ls->current == '=') { next(ls); return TK_GE; } 152 | + else if (ls->current == '>') { next(ls); return TK_RSHFT; } 153 | + else return '>'; 154 | + } 155 | + case '^': { 156 | + next(ls); 157 | + if (ls->current != '^') return '^'; 158 | + else { next(ls); return TK_XOR; } 159 | + } 160 | + case '!': { 161 | + next(ls); 162 | + if (ls->current != '=') return '!'; 163 | + else { next(ls); return TK_NE; } 164 | + } 165 | +#else 166 | case '<': { 167 | next(ls); 168 | if (ls->current != '=') return '<'; 169 | @@ -381,8 +409,9 @@ 170 | case '>': { 171 | next(ls); 172 | if (ls->current != '=') return '>'; 173 | - else { next(ls); return TK_GE; } 174 | + else { next(ls); return TK_GE; } 175 | } 176 | +#endif 177 | case '~': { 178 | next(ls); 179 | if (ls->current != '=') return '~'; 180 | diff -Nurd lua-5.1.5/src/llex.h lua-5.1.5/src/llex.h 181 | --- lua-5.1.5/src/llex.h 2007-12-27 15:02:25.000000000 +0200 182 | +++ lua-5.1.5/src/llex.h 2012-11-28 21:12:23.962419499 +0200 183 | @@ -28,7 +28,11 @@ 184 | TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, 185 | TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, 186 | /* other terminal symbols */ 187 | +#if defined(LUA_BITWISE_OPERATORS) 188 | + TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LSHFT, TK_LE, TK_RSHFT, TK_XOR, TK_NE, TK_CNE, TK_NUMBER, 189 | +#else 190 | TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER, 191 | +#endif 192 | TK_NAME, TK_STRING, TK_EOS 193 | }; 194 | 195 | diff -Nurd lua-5.1.5/src/lopcodes.c lua-5.1.5/src/lopcodes.c 196 | --- lua-5.1.5/src/lopcodes.c 2007-12-27 15:02:25.000000000 +0200 197 | +++ lua-5.1.5/src/lopcodes.c 2012-11-28 21:12:23.962419499 +0200 198 | @@ -32,6 +32,15 @@ 199 | "DIV", 200 | "MOD", 201 | "POW", 202 | +#if defined(LUA_BITWISE_OPERATORS) 203 | + "BOR", 204 | + "BAND", 205 | + "OP_BXOR" 206 | + "BLSHFT", 207 | + "BRSHFT", 208 | + "BNOT", 209 | + "INTDIV", 210 | +#endif 211 | "UNM", 212 | "NOT", 213 | "LEN", 214 | @@ -78,6 +87,15 @@ 215 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ 216 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ 217 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ 218 | +#if defined(LUA_BITWISE_OPERATORS) 219 | + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BOR */ 220 | + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BAND */ 221 | + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BXOR */ 222 | + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BLSHFT */ 223 | + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_BRSHFT */ 224 | + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_BNOT */ 225 | + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_INTDIV */ 226 | +#endif 227 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ 228 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ 229 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ 230 | diff -Nurd lua-5.1.5/src/lopcodes.h lua-5.1.5/src/lopcodes.h 231 | --- lua-5.1.5/src/lopcodes.h 2007-12-27 15:02:25.000000000 +0200 232 | +++ lua-5.1.5/src/lopcodes.h 2012-11-28 21:12:23.962419499 +0200 233 | @@ -174,10 +174,20 @@ 234 | OP_DIV,/* A B C R(A) := RK(B) / RK(C) */ 235 | OP_MOD,/* A B C R(A) := RK(B) % RK(C) */ 236 | OP_POW,/* A B C R(A) := RK(B) ^ RK(C) */ 237 | +#if defined(LUA_BITWISE_OPERATORS) 238 | +OP_BOR,/* A B C R(A) := RK(B) | RK(C) */ 239 | +OP_BAND,/* A B C R(A) := RK(B) & RK(C) */ 240 | +OP_BXOR,/* A B C R(A) := RK(B) ^| RK(C) */ 241 | +OP_BLSHFT,/* A B C R(A) := RK(B) << RK(C) */ 242 | +OP_BRSHFT,/* A B C R(A) := RK(B) >> RK(C) */ 243 | +OP_BNOT,/* A B R(A) := ~ R(B) */ 244 | +OP_INTDIV,/* A B C R(A) := RK(B) \ RK(C) */ 245 | +#endif 246 | OP_UNM,/* A B R(A) := -R(B) */ 247 | OP_NOT,/* A B R(A) := not R(B) */ 248 | OP_LEN,/* A B R(A) := length of R(B) */ 249 | 250 | + 251 | OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ 252 | 253 | OP_JMP,/* sBx pc+=sBx */ 254 | @@ -186,8 +196,8 @@ 255 | OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ 256 | OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ 257 | 258 | -OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ 259 | -OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ 260 | +OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ 261 | +OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ 262 | 263 | OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ 264 | OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ 265 | @@ -197,8 +207,8 @@ 266 | if R(A) =) R(A)*/ 276 | diff -Nurd lua-5.1.5/src/lparser.c lua-5.1.5/src/lparser.c 277 | --- lua-5.1.5/src/lparser.c 2011-10-21 22:31:42.000000000 +0300 278 | +++ lua-5.1.5/src/lparser.c 2012-11-28 21:12:23.962419499 +0200 279 | @@ -780,6 +780,9 @@ 280 | case TK_NOT: return OPR_NOT; 281 | case '-': return OPR_MINUS; 282 | case '#': return OPR_LEN; 283 | +#if defined(LUA_BITWISE_OPERATORS) 284 | + case '~': return OPR_BNOT; 285 | +#endif 286 | default: return OPR_NOUNOPR; 287 | } 288 | } 289 | @@ -793,6 +796,14 @@ 290 | case '/': return OPR_DIV; 291 | case '%': return OPR_MOD; 292 | case '^': return OPR_POW; 293 | +#if defined(LUA_BITWISE_OPERATORS) 294 | + case '|': return OPR_BOR; 295 | + case '&': return OPR_BAND; 296 | + case TK_XOR: return OPR_BXOR; 297 | + case TK_LSHFT: return OPR_BLSHFT; 298 | + case TK_RSHFT: return OPR_BRSHFT; 299 | + case '\\': return OPR_INTDIV; 300 | +#endif 301 | case TK_CONCAT: return OPR_CONCAT; 302 | case TK_NE: return OPR_NE; 303 | case TK_EQ: return OPR_EQ; 304 | @@ -812,6 +823,9 @@ 305 | lu_byte right; /* right priority */ 306 | } priority[] = { /* ORDER OPR */ 307 | {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `/' `%' */ 308 | +#if defined(LUA_BITWISE_OPERATORS) 309 | + {6, 6}, {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `|' `&' `!' `<<' `>>' `\' */ 310 | +#endif 311 | {10, 9}, {5, 4}, /* power and concat (right associative) */ 312 | {3, 3}, {3, 3}, /* equality and inequality */ 313 | {3, 3}, {3, 3}, {3, 3}, {3, 3}, /* order */ 314 | diff -Nurd lua-5.1.5/src/ltm.c lua-5.1.5/src/ltm.c 315 | --- lua-5.1.5/src/ltm.c 2007-12-27 15:02:25.000000000 +0200 316 | +++ lua-5.1.5/src/ltm.c 2012-11-28 21:12:23.962419499 +0200 317 | @@ -34,6 +34,9 @@ 318 | "__add", "__sub", "__mul", "__div", "__mod", 319 | "__pow", "__unm", "__len", "__lt", "__le", 320 | "__concat", "__call" 321 | +#if defined(LUA_BITWISE_OPERATORS) 322 | + ,"__or", "__and", "__xor", "__shl", "__shr", "__not", "__intdiv" 323 | +#endif 324 | }; 325 | int i; 326 | for (i=0; i> ~, arithmetic operator \ (integer division) and != as an alternative to ~= 354 | */ 355 | 356 | 357 | @@ -209,6 +210,12 @@ 358 | */ 359 | #define LUA_IDSIZE 60 360 | 361 | +/* 362 | +@@ LUA_BITWISE_OPERATORS enable logical operators | & ^| >> << ~ on lua_Number 363 | +@* but also arithmetic operator \ (integer division) and != as an alernative to ~= 364 | +*/ 365 | +#define LUA_BITWISE_OPERATORS 366 | + 367 | 368 | /* 369 | ** {================================================================== 370 | @@ -216,6 +223,7 @@ 371 | ** =================================================================== 372 | */ 373 | 374 | + 375 | #if defined(lua_c) || defined(luaall_c) 376 | 377 | /* 378 | @@ -526,25 +534,6 @@ 379 | 380 | 381 | /* 382 | -@@ The luai_num* macros define the primitive operations over numbers. 383 | -*/ 384 | -#if defined(LUA_CORE) 385 | -#include 386 | -#define luai_numadd(a,b) ((a)+(b)) 387 | -#define luai_numsub(a,b) ((a)-(b)) 388 | -#define luai_nummul(a,b) ((a)*(b)) 389 | -#define luai_numdiv(a,b) ((a)/(b)) 390 | -#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) 391 | -#define luai_numpow(a,b) (pow(a,b)) 392 | -#define luai_numunm(a) (-(a)) 393 | -#define luai_numeq(a,b) ((a)==(b)) 394 | -#define luai_numlt(a,b) ((a)<(b)) 395 | -#define luai_numle(a,b) ((a)<=(b)) 396 | -#define luai_numisnan(a) (!luai_numeq((a), (a))) 397 | -#endif 398 | - 399 | - 400 | -/* 401 | @@ lua_number2int is a macro to convert lua_Number to int. 402 | @@ lua_number2integer is a macro to convert lua_Number to lua_Integer. 403 | ** CHANGE them if you know a faster way to convert a lua_Number to 404 | @@ -560,7 +549,7 @@ 405 | /* On a Microsoft compiler, use assembler */ 406 | #if defined(_MSC_VER) 407 | 408 | -#define lua_number2int(i,d) __asm fld d __asm fistp i 409 | +#define lua_number2int(i,d) { __asm fld d __asm fistp i } 410 | #define lua_number2integer(i,n) lua_number2int(i, n) 411 | 412 | /* the next trick should work on any Pentium, but sometimes clashes 413 | @@ -582,6 +571,38 @@ 414 | 415 | #endif 416 | 417 | + 418 | +/* 419 | +@@ The luai_num* macros define the primitive operations over numbers. 420 | +*/ 421 | +#if defined(LUA_CORE) 422 | +#include 423 | +#define luai_numadd(a,b) ((a)+(b)) 424 | +#define luai_numsub(a,b) ((a)-(b)) 425 | +#define luai_nummul(a,b) ((a)*(b)) 426 | +#define luai_numdiv(a,b) ((a)/(b)) 427 | +#ifdef LUA_BITWISE_OPERATORS 428 | +#define luai_numintdiv(a,b) (floor((a)/(b))) 429 | +#endif 430 | +#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) 431 | +#define luai_numpow(a,b) (pow(a,b)) 432 | +#define luai_numunm(a) (-(a)) 433 | +#define luai_numeq(a,b) ((a)==(b)) 434 | +#define luai_numlt(a,b) ((a)<(b)) 435 | +#define luai_numle(a,b) ((a)<=(b)) 436 | +#define luai_numisnan(a) (!luai_numeq((a), (a))) 437 | + 438 | +#if defined(LUA_BITWISE_OPERATORS) 439 | +#define luai_logor(r, a, b) { lua_Integer ai,bi; lua_number2int(ai,a); lua_number2int(bi,b); r = ai|bi; } 440 | +#define luai_logand(r, a,b) { lua_Integer ai,bi; lua_number2int(ai,a); lua_number2int(bi,b); r = ai&bi; } 441 | +#define luai_logxor(r, a,b) { lua_Integer ai,bi; lua_number2int(ai,a); lua_number2int(bi,b); r = ai^bi; } 442 | +#define luai_lognot(r,a) { lua_Integer ai; lua_number2int(ai,a); r = ~ai; } 443 | +#define luai_loglshft(r, a,b) { lua_Integer ai,bi; lua_number2int(ai,a); lua_number2int(bi,b); r = ai<>bi; } 445 | +#endif 446 | + 447 | +#endif 448 | + 449 | /* }================================================================== */ 450 | 451 | 452 | diff -Nurd lua-5.1.5/src/lua.h lua-5.1.5/src/lua.h 453 | --- lua-5.1.5/src/lua.h 2012-01-13 22:36:20.000000000 +0200 454 | +++ lua-5.1.5/src/lua.h 2012-11-28 21:13:01.266418680 +0200 455 | @@ -17,7 +17,7 @@ 456 | 457 | 458 | #define LUA_VERSION "Lua 5.1" 459 | -#define LUA_RELEASE "Lua 5.1.5" 460 | +#define LUA_RELEASE "Lua 5.1.5+bitwiseops" 461 | #define LUA_VERSION_NUM 501 462 | #define LUA_COPYRIGHT "Copyright (C) 1994-2012 Lua.org, PUC-Rio" 463 | #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" 464 | diff -Nurd lua-5.1.5/src/lvm.c lua-5.1.5/src/lvm.c 465 | --- lua-5.1.5/src/lvm.c 2011-08-17 23:43:11.000000000 +0300 466 | +++ lua-5.1.5/src/lvm.c 2012-11-28 21:12:23.966419498 +0200 467 | @@ -329,6 +329,9 @@ 468 | case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break; 469 | case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break; 470 | case TM_UNM: setnvalue(ra, luai_numunm(nb)); break; 471 | +#if defined(LUA_BITWISE_OPERATORS) 472 | + case TM_INTDIV: setnvalue(ra, luai_numintdiv(nb, nc)); break; 473 | +#endif 474 | default: lua_assert(0); break; 475 | } 476 | } 477 | @@ -336,7 +339,30 @@ 478 | luaG_aritherror(L, rb, rc); 479 | } 480 | 481 | - 482 | +#if defined(LUA_BITWISE_OPERATORS) 483 | +static void Logic (lua_State *L, StkId ra, const TValue *rb, 484 | + const TValue *rc, TMS op) { 485 | + TValue tempb, tempc; 486 | + const TValue *b, *c; 487 | + if ((b = luaV_tonumber(rb, &tempb)) != NULL && 488 | + (c = luaV_tonumber(rc, &tempc)) != NULL) { 489 | + lua_Number nb = nvalue(b), nc = nvalue(c); 490 | + lua_Integer r; 491 | + switch (op) { 492 | + case TM_BLSHFT: luai_loglshft(r, nb, nc); break; 493 | + case TM_BRSHFT: luai_logrshft(r, nb, nc); break; 494 | + case TM_BOR: luai_logor(r, nb, nc); break; 495 | + case TM_BAND: luai_logand(r, nb, nc); break; 496 | + case TM_BXOR: luai_logxor(r, nb, nc); break; 497 | + case TM_BNOT: luai_lognot(r, nb); break; 498 | + default: lua_assert(0); r = 0; break; 499 | + } 500 | + setnvalue(ra, r); 501 | + } 502 | + else if (!call_binTM(L, rb, rc, ra, op)) 503 | + luaG_logicerror(L, rb, rc); 504 | +} 505 | +#endif 506 | 507 | /* 508 | ** some macros for common tasks in `luaV_execute' 509 | @@ -373,6 +399,22 @@ 510 | } 511 | 512 | 513 | +#if defined(LUA_BITWISE_OPERATORS) 514 | +#define logic_op(op,tm) { \ 515 | + TValue *rb = RKB(i); \ 516 | + TValue *rc = RKC(i); \ 517 | + if (ttisnumber(rb) && ttisnumber(rc)) { \ 518 | + lua_Integer r; \ 519 | + lua_Number nb = nvalue(rb), nc = nvalue(rc); \ 520 | + op(r, nb, nc); \ 521 | + setnvalue(ra, r); \ 522 | + } \ 523 | + else \ 524 | + Protect(Logic(L, ra, rb, rc, tm)); \ 525 | + } 526 | +#endif 527 | + 528 | + 529 | 530 | void luaV_execute (lua_State *L, int nexeccalls) { 531 | LClosure *cl; 532 | @@ -506,6 +548,45 @@ 533 | } 534 | continue; 535 | } 536 | +#if defined(LUA_BITWISE_OPERATORS) 537 | + case OP_BOR: { 538 | + logic_op(luai_logor, TM_BOR); 539 | + continue; 540 | + } 541 | + case OP_BAND: { 542 | + logic_op(luai_logand, TM_BAND); 543 | + continue; 544 | + } 545 | + case OP_BXOR: { 546 | + logic_op(luai_logxor, TM_BXOR); 547 | + continue; 548 | + } 549 | + case OP_BLSHFT: { 550 | + logic_op(luai_loglshft, TM_BLSHFT); 551 | + continue; 552 | + } 553 | + case OP_BRSHFT: { 554 | + logic_op(luai_logrshft, TM_BRSHFT); 555 | + continue; 556 | + } 557 | + case OP_BNOT: { 558 | + TValue *rb = RB(i); 559 | + if (ttisnumber(rb)) { 560 | + lua_Integer r; 561 | + lua_Number nb = nvalue(rb); 562 | + luai_lognot(r, nb); 563 | + setnvalue(ra, r); 564 | + } 565 | + else { 566 | + Protect(Logic(L, ra, rb, rb, TM_BNOT)); 567 | + } 568 | + continue; 569 | + } 570 | + case OP_INTDIV: { 571 | + arith_op(luai_numintdiv, TM_DIV); 572 | + continue; 573 | + } 574 | +#endif 575 | case OP_NOT: { 576 | int res = l_isfalse(RB(i)); /* next assignment may change this value */ 577 | setbvalue(ra, res); 578 | diff -Nurd lua-5.1.5/test/bitwisepatchtest.lua lua-5.1.5/test/bitwisepatchtest.lua 579 | --- lua-5.1.5/test/bitwisepatchtest.lua 1970-01-01 02:00:00.000000000 +0200 580 | +++ lua-5.1.5/test/bitwisepatchtest.lua 2012-11-28 21:12:23.966419498 +0200 581 | @@ -0,0 +1,24 @@ 582 | +hex=function (i) return "0x"..string.format("%X", i) end 583 | +print(hex(0x54|0x55)) 584 | +print(hex(0x54&0x66)) 585 | +print(hex(0x54^|0x66)) 586 | +print(hex(~0x54)) 587 | +print(hex(0xF<< 4)) 588 | +print(hex(0xF0>> 4)) 589 | +a,b=0x54,0x55 590 | +print(hex(a),"|",hex(b), "=",hex(a|b)) 591 | +print(hex(a),"|","0x55", "=",hex(a|0x55)) 592 | +print(hex(a),"|","0x5|0x50 (", hex(0x5|0x50), ") =",hex(a|(0x5|0x50))) 593 | +a,b=0x54,0x66 594 | +print(hex(a),"&",hex(b), "=",hex(a&b)) 595 | +print(hex(a),"&","0x66", "=",hex(a&0x66)) 596 | +print(hex(a),"^|",hex(b), "=",hex(a^|b)) 597 | +print(hex(a),"^|","0x66", "=",hex(a^|0x66)) 598 | +print("~"..hex(a),"=",hex(~a)) 599 | +a,b=0xF,0xF0 600 | +print(hex(a).."<<4","=",hex(a<<4)) 601 | +print(hex(b)..">>4","=",hex(b>>4)) 602 | +a,b=0xF,4 603 | +print(hex(a).."<<"..b,"=",hex(a<>"..b,"=",hex(a>>b)) 606 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1/lua5.1.pc: -------------------------------------------------------------------------------- 1 | prefix=/usr 2 | libdir=${prefix}/lib 3 | includedir=${prefix}/include/lua5.1 4 | 5 | Name: Lua 6 | Description: Lua language engine 7 | Version: 5.1.5 8 | Requires: 9 | Libs: -L${libdir} -llua5.1 10 | Libs.private: -lm 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1/luaorg_1.patch: -------------------------------------------------------------------------------- 1 | lua.org patch 1 for lua-5.1.5. 2 | from http://www.lua.org/bugs.html 3 | 4 | Upstream-Status: Backport 5 | 6 | Signed-off-by: Marko Lindqvist 7 | diff -Nurd lua-5.1.5/src/Makefile lua-5.1.5/src/Makefile 8 | --- lua-5.1.5/src/Makefile 2012-02-13 22:41:22.000000000 +0200 9 | +++ lua-5.1.5/src/Makefile 2013-10-25 11:29:49.769540434 +0300 10 | @@ -48,7 +48,7 @@ 11 | a: $(ALL_A) 12 | 13 | $(LUA_A): $(CORE_O) $(LIB_O) 14 | - $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files 15 | + $(AR) $@ $(CORE_O) $(LIB_O) 16 | $(RANLIB) $@ 17 | 18 | $(LUA_T): $(LUA_O) $(LUA_A) 19 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1/luaorg_2.patch: -------------------------------------------------------------------------------- 1 | lua.org patch 2 for lua-5.1.5. 2 | from http://www.lua.org/bugs.html 3 | 4 | Upstream-Status: Backport 5 | 6 | Signed-off-by: Marko Lindqvist 7 | diff -Nurd lua-5.1.5/src/lzio.c lua-5.1.5/src/lzio.c 8 | --- lua-5.1.5/src/lzio.c 2007-12-27 15:02:25.000000000 +0200 9 | +++ lua-5.1.5/src/lzio.c 2013-10-25 11:32:45.773536572 +0300 10 | @@ -22,10 +22,14 @@ 11 | size_t size; 12 | lua_State *L = z->L; 13 | const char *buff; 14 | + if (z->eoz) return EOZ; 15 | lua_unlock(L); 16 | buff = z->reader(L, z->data, &size); 17 | lua_lock(L); 18 | - if (buff == NULL || size == 0) return EOZ; 19 | + if (buff == NULL || size == 0) { 20 | + z->eoz = 1; /* avoid calling reader function next time */ 21 | + return EOZ; 22 | + } 23 | z->n = size - 1; 24 | z->p = buff; 25 | return char2int(*(z->p++)); 26 | @@ -51,6 +55,7 @@ 27 | z->data = data; 28 | z->n = 0; 29 | z->p = NULL; 30 | + z->eoz = 0; 31 | } 32 | 33 | 34 | diff -Nurd lua-5.1.5/src/lzio.h lua-5.1.5/src/lzio.h 35 | --- lua-5.1.5/src/lzio.h 2007-12-27 15:02:25.000000000 +0200 36 | +++ lua-5.1.5/src/lzio.h 2013-10-25 11:31:50.301537789 +0300 37 | @@ -59,6 +59,7 @@ 38 | lua_Reader reader; 39 | void* data; /* additional data */ 40 | lua_State *L; /* Lua state (for reader) */ 41 | + int eoz; /* true if reader has no more data */ 42 | }; 43 | 44 | 45 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1/uclibc-pthread.patch: -------------------------------------------------------------------------------- 1 | Index: lua-5.1.4/src/Makefile 2 | =================================================================== 3 | --- lua-5.1.4.orig/src/Makefile 2010-10-16 09:51:52.000000000 +0200 4 | +++ lua-5.1.4/src/Makefile 2010-10-16 09:52:15.000000000 +0200 5 | @@ -12,7 +12,7 @@ 6 | AR= ar rcu 7 | RANLIB= ranlib 8 | RM= rm -f 9 | -LIBS= -lm $(MYLIBS) 10 | +LIBS= -lm -lpthread $(MYLIBS) 11 | 12 | MYCFLAGS= 13 | MYLDFLAGS= 14 | -------------------------------------------------------------------------------- /recipes-support/lua/lua5.1_5.1.5.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | DESCRIPTION = "Lua is a powerful light-weight programming language designed \ 6 | for extending applications." 7 | LICENSE = "MIT" 8 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=59bdd99bb82238f238cf5c65c21604fd" 9 | HOMEPAGE = "http://www.lua.org/" 10 | 11 | PR = "r2" 12 | 13 | V = "5.1" 14 | 15 | DEPENDS += "readline" 16 | SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz \ 17 | file://${BPN}.pc \ 18 | file://bitwise_operators.patch \ 19 | file://luaorg_1.patch \ 20 | file://luaorg_2.patch \ 21 | file://0004-Fix-stack-overflow-in-vararg-functions.patch \ 22 | " 23 | SRC_URI[md5sum] = "2e115fe26e435e33b0d5c022e4490567" 24 | SRC_URI[sha256sum] = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333" 25 | 26 | inherit pkgconfig binconfig 27 | 28 | S = "${WORKDIR}/lua-${PV}" 29 | 30 | UCLIBC_PATCHES += "file://uclibc-pthread.patch" 31 | SRC_URI:append_libc-uclibc = "${UCLIBC_PATCHES}" 32 | 33 | TARGET_CC_ARCH += " -fPIC ${LDFLAGS}" 34 | EXTRA_OEMAKE = "'CC=${CC} -fPIC' 'MYCFLAGS=${CFLAGS} -DLUA_USE_LINUX -fPIC' MYLDFLAGS='${LDFLAGS}'" 35 | 36 | do_configure:prepend() { 37 | sed -i -e s:/usr/local:${prefix}:g src/luaconf.h 38 | } 39 | 40 | do_compile () { 41 | oe_runmake linux 42 | } 43 | 44 | do_install () { 45 | oe_runmake \ 46 | 'INSTALL_TOP=${D}${prefix}' \ 47 | 'INSTALL_BIN=${D}${bindir}' \ 48 | 'INSTALL_INC=${D}${includedir}/${BPN}' \ 49 | 'INSTALL_MAN=${D}${mandir}/man1' \ 50 | 'INSTALL_SHARE=${D}${datadir}/lua' \ 51 | 'INSTALL_LIB=${D}${libdir}' \ 52 | 'INSTALL_CMOD=${D}${libdir}/lua/${V}' \ 53 | install 54 | mv ${D}${bindir}/lua ${D}${bindir}/lua${V} 55 | mv ${D}${bindir}/luac ${D}${bindir}/luac${V} 56 | mv ${D}${libdir}/liblua.a ${D}${libdir}/lib${BPN}.a 57 | install -D -m 644 ${WORKDIR}/${BPN}.pc ${D}${libdir}/pkgconfig/${BPN}.pc 58 | rmdir ${D}${datadir}/lua/${V} 59 | rmdir ${D}${datadir}/lua 60 | 61 | } 62 | 63 | FILES:${PN} += "${libdir}/lua ${libdir}/lua/${V}" 64 | 65 | BBCLASSEXTEND = "native" 66 | 67 | inherit update-alternatives 68 | 69 | ALTERNATIVE_PRIORITY = "100" 70 | 71 | ALTERNATIVE:${PN} = "lua luac" 72 | 73 | ALTERNATIVE_TARGET[lua] = "${bindir}/lua${V}" 74 | ALTERNATIVE_TARGET[luac] = "${bindir}/luac${V}" 75 | -------------------------------------------------------------------------------- /recipes-support/ucode/ucode_git.bb: -------------------------------------------------------------------------------- 1 | LICENSE = "ISC" 2 | LIC_FILES_CHKSUM = "file://LICENSE;md5=b42eb47dc3802282b0d1be1bc8f5336c \ 3 | file://debian/copyright;md5=1675ccb2fa4c1fba3c778fd07a40b472" 4 | 5 | SRC_URI = "git://github.com/jow-/ucode.git;protocol=https;branch=master" 6 | 7 | # Modify these as desired 8 | PV = "1.0+git${SRCPV}" 9 | SRCREV = "344fa9e69da43ecdc4d8f7768d85d42639352405" 10 | PROVIDES = "ucode" 11 | 12 | S = "${WORKDIR}/git" 13 | 14 | DEPENDS = "json-c" 15 | 16 | inherit cmake pkgconfig python3native 17 | 18 | # Specify any options you want to pass to cmake using EXTRA_OECMAKE: 19 | EXTRA_OECMAKE = "\ 20 | -DFS_SUPPORT=ON \ 21 | -DMATH_SUPPORT=ON \ 22 | -DNL80211_SUPPORT=OFF \ 23 | -DRESOLV_SUPPORT=OFF \ 24 | -DRTNL_SUPPORT=OFF \ 25 | -DSTRUCT_SUPPORT=ON \ 26 | -DUBUS_SUPPORT=OFF \ 27 | -DUCI_SUPPORT=OFF \ 28 | -DULOOP_SUPPORT=OFF \ 29 | " 30 | 31 | -------------------------------------------------------------------------------- /recipes-tweaks/base-files/base-files-scripts.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Daniel Dickinson 2 | # Released under the MIT license. See COPYING.MIT for terms 3 | 4 | inherit openwrt openwrt-base-files 5 | 6 | DESCRIPTION = "Subpackages from base-files from OpenWrt core" 7 | HOMEPAGE = "http://wiki.openwrt.org/" 8 | LICENSE = "GPL-2.0-only" 9 | LIC_FILES_CHKSUM = "file://COPYING;md5=a8db84c7a073d2878849eee8eb0f5daa" 10 | 11 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-scripts:" 12 | 13 | SRC_URI += "git://github.com/openwrt/openwrt.git;protocol=https;branch=openwrt-22.03 \ 14 | " 15 | 16 | SRCREV = "${OPENWRT_SRCREV}" 17 | 18 | S = "${WORKDIR}/git" 19 | SC = "${WORKDIR}/git/package/base-files/files" 20 | 21 | do_configure[noexec] = "1" 22 | do_compile[noexec] = "1" 23 | 24 | PACKAGES = "\ 25 | ${PN}-openwrt \ 26 | ${PN}-sysupgrade \ 27 | " 28 | 29 | do_install:append () { 30 | mkdir -p ${D}${sysconfdir}/config 31 | 32 | install -Dm 0644 ${SC}/lib/functions.sh ${D}/lib/functions.sh 33 | install -Dm 0644 ${SC}/lib/functions/uci-defaults.sh ${D}/lib/functions/uci-defaults.sh 34 | install -Dm 0644 ${SC}/lib/functions/system.sh ${D}/lib/functions/system.sh 35 | install -Dm 0755 ${SC}/bin/ipcalc.sh ${D}/bin/ipcalc.sh 36 | install -Dm 0644 ${SC}/etc/sysupgrade.conf ${D}/etc/sysupgrade.conf 37 | install -Dm 0755 ${SC}/sbin/sysupgrade ${D}/sbin/sysupgrade 38 | install -Dm 0755 ${SC}/sbin/firstboot ${D}/sbin/firstboot 39 | 40 | install -dm 0755 ${D}/lib 41 | cp -dR --preserve=mode,links ${SC}/lib/upgrade ${D}/lib 42 | } 43 | 44 | FILES:${PN}-openwrt = "\ 45 | /lib/functions.sh \ 46 | /lib/functions/uci-defaults.sh \ 47 | /lib/functions/system.sh \ 48 | /bin/ipcalc.sh \ 49 | ${sysconfdir}/config \ 50 | " 51 | 52 | FILES:${PN}-sysupgrade = "\ 53 | /etc/sysupgrade.conf \ 54 | /sbin/sysupgrade \ 55 | /lib/upgrade/* \ 56 | /sbin/firstboot \ 57 | " 58 | 59 | CONFFILES:${PN}-openwrt += "\ 60 | ${sysconfdir}/config \ 61 | " 62 | 63 | CONFFILES:${PN}-sysupgrade += "\ 64 | ${sysconfdir]/sysupgrade.conf \ 65 | " 66 | 67 | PACKAGE_ARCH = "${MACHINE_ARCH}" 68 | -------------------------------------------------------------------------------- /recipes-tweaks/base-files/base-files_3.%.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | 4 | # Released under the MIT license (see COPYING.MIT for the terms) 5 | 6 | SUMMARY = "Base files from openembedded and openwrt projects" 7 | HOMEPAGE = "http://wiki.openwrt.org/" 8 | 9 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-openwrt:" 10 | 11 | SRCREV = "${OPENWRT_SRCREV}" 12 | 13 | S = "${WORKDIR}" 14 | SG = "${WORKDIR}/git/openwrt" 15 | STMP = "${WORKDIR}/stmp" 16 | OPENWRT_BASEPATH = "${SG}" 17 | 18 | inherit openwrt-virtual-runtimes openwrt-base-files 19 | 20 | do_configure[noexec] = "1" 21 | do_compile[noexec] = "1" 22 | 23 | PACKAGECONFIG ??= "includeopenwrt" 24 | 25 | PACKAGECONFIG[includeopenwrt] = "" 26 | PACKAGECONFIG[preferopenwrt] = "" 27 | PACKAGECONFIG[oeoveropenwrt] = "" 28 | 29 | BASEFILESISSUEINSTALL ?= "${@bb.utils.contains('PACKAGECONFIG', 'preferopenwrt', '', 'do_install_basefilesissue', d)}" 30 | 31 | do_install:append () { 32 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'includeopenwrt', 'true', 'false', d)}" = "true" ]; then 33 | # We need to munge openwrt base-files before copying 34 | # Some file come from regular OE base-files and others 35 | # belong in other recipes, or are not applicable 36 | rm -rf ${STMP} 37 | mkdir -p ${STMP} 38 | cp -dR --preserve=mode,links ${SG}/package/base-files/files/* ${STMP}/ 39 | 40 | rm -f ${STMP}/etc/passwd 41 | rm -f ${STMP}/etc/shadow 42 | rm -f ${STMP}/etc/group 43 | 44 | # procd - earlyinit 45 | rm -f ${STMP}/etc/inittab 46 | rm -f ${STMP}/etc/preinit 47 | rm -f ${STMP}/etc/diag.sh 48 | rm -f ${STMP}/lib/functions/preinit.sh 49 | rm -rf ${STMP}/lib/preinit 50 | rm -f ${STMP}/rom/note 51 | rm -f ${STMP}/etc/banner.failsafe 52 | # We want these to fail if Openwrt adds more to these dirs, so no rm -rf 53 | rmdir ${STMP}/rom 54 | 55 | # procd - init 56 | rm -f ${STMP}/lib/functions/service.sh 57 | rm -f ${STMP}/etc/rc.common 58 | rm -f ${STMP}/etc/rc.local 59 | rm -f ${STMP}/usr/libexec/login.sh 60 | rm -f ${STMP}/usr/libexec/validate_firmware_image 61 | rm -f ${STMP}/etc/init.d/done 62 | rm -f ${STMP}/etc/init.d/sysctl 63 | rm -f ${STMP}/etc/init.d/umount 64 | rm -f ${STMP}/etc/init.d/boot 65 | # We want these to fail if Openwrt adds more to these dirs, so no rm -rf 66 | rmdir ${STMP}/usr/libexec 67 | 68 | # procd - devmanager 69 | rm -rf ${STMP}/etc/rc.button 70 | rm -rf ${STMP}/etc/hotplug.d 71 | rm -f ${STMP}/sbin/hotplug-call 72 | 73 | # From OE base-files or netbase 74 | rm -f ${STMP}/etc/hosts 75 | rm -f ${STMP}/etc/rpc 76 | rm -f ${STMP}/etc/services 77 | rm -f ${STMP}/etc/protocols 78 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'preferopenwrt', 'true', 'false', d)}" != "true" ]; then 79 | rm -f ${STMP}/etc/banner 80 | ln -sf /etc/issue ${STMP}/etc/banner 81 | else 82 | rm -f ${D}/etc/issue 83 | ln -sf /etc/banner ${D}/etc/issue 84 | fi 85 | 86 | # For netifd package 87 | rm -f ${STMP}/lib/functions/network.sh 88 | rm -f ${STMP}/sbin/wifi 89 | rm -f ${STMP}/etc/uci-defaults/12_network-generate-ula 90 | 91 | # Not applicable to OE flavour 92 | rm -f ${STMP}/etc/uci-defaults/10_migrate-shadow 93 | rm -f ${STMP}/etc/uci-defaults/11_migrate-sysctl 94 | 95 | # These depend on mechanisms not in OE build process 96 | rm -f ${STMP}/etc/openwrt_version 97 | rm -f ${STMP}/etc/openwrt_release 98 | rm -f ${STMP}/etc/uci-defaults/13_fix-group-user 99 | # We want this to fail if Openwrt adds more to this dir, so no rm -rf 100 | rmdir ${STMP}/etc/uci-defaults 101 | 102 | # In base-files-scripts-openwrt 103 | rm -f ${STMP}/lib/functions.sh 104 | rm -f ${STMP}/lib/functions/uci-defaults.sh 105 | rm -f ${STMP}/lib/functions/system.sh 106 | rm -f ${STMP}/bin/ipcalc.sh 107 | 108 | # In base-files-scripts-sysupgrade 109 | rm -f ${STMP}/etc/sysupgrade.conf 110 | rm -f ${STMP}/sbin/sysupgrade 111 | rm -rf ${STMP}/lib/upgrade 112 | rm -f ${STMP}/sbin/firstboot 113 | 114 | # Some files in standard base-files don't apply to openwrt flavour 115 | # These two are about avoiding flash writes 116 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'preferopenwrt', 'true', 'false', d)}" = "true" ]; then 117 | rm -f ${D}${sysconfdir}/fstab 118 | rm -f ${D}${sysconfdir}/mtab 119 | fi 120 | 121 | # Copy what is applicable to rootfs 122 | cp -dR --preserve=mode,links ${STMP}/* ${D} 123 | rm -rf ${STMP} 124 | 125 | # FIXME: Should be OE's busybox crontabs dir 126 | mkdir -p ${D}${sysconfdir}/crontabs 127 | 128 | # FIXME: Should this change for OE? 129 | mkdir -p ${D}/overlay 130 | 131 | mkdir -p ${D}/run/lock 132 | 133 | # Avoid flash writes 134 | ln -sf /tmp/resolv.conf /tmp/TZ ${D}${sysconfdir}/ 135 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'oeoveropenwrt', 'true', 'false', d)}" != "true" ]; then 136 | ln -sf /tmp/fstab ${D}${sysconfdir}/fstab 137 | ln -sf /proc/mounts ${D}${sysconfdir}/mtab 138 | fi 139 | 140 | # chmod 0600 ${D}${sysconfdir}/shadow 141 | chmod 1777 ${D}/tmp 142 | 143 | sed -i "s#%PATH%#/usr/sbin:/sbin:/usr/bin:/bin#g" \ 144 | ${D}${sysconfdir}/profile 145 | 146 | fi 147 | } 148 | 149 | FILES:${PN} = "/" 150 | 151 | RDEPENDS:${PN} += "\ 152 | ${@bb.utils.contains('PACKAGECONFIG', 'includeopenwrt', '${PN}-scripts-openwrt', '', d)} \ 153 | " 154 | 155 | RSUGGESTS:${PN} += "\ 156 | ${@bb.utils.contains('PACKAGECONFIG', 'preferopenwrt', '${PN}-scripts-sysupgrade', '', d)} \ 157 | ${@bb.utils.contains('PACKAGECONFIG', 'oeoveropenwrt', '', 'procd ubox', d)} \ 158 | " 159 | 160 | CONFFILES:${PN} += "\ 161 | ${sysconfdir}/fstab \ 162 | ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} \ 163 | ${sysconfdir}/shells \ 164 | " 165 | 166 | PACKAGE_ARCH = "${MACHINE_ARCH}" 167 | -------------------------------------------------------------------------------- /recipes-tweaks/busybox/busybox-1.36.%/z300-fix_off_t_misdetection_triggered_without_LFS.patch: -------------------------------------------------------------------------------- 1 | Author: Daniel F. Dickinson 2 | Date: Tue Jan 16 03:06:33 2018 -0500 3 | 4 | busybox: Fix compilation for musl on 32-bit archs 5 | 6 | At least with core-image-minimal busybox triggers the recently 7 | added off_t misdetection alert even when LFS is not enabled; 8 | this is due to a bug in busybox handling of the case...this 9 | patch should get upstremed. 10 | 11 | Signed-off-by: Daniel F. Dickinson 12 | 13 | Upstream-Status: Pending 14 | 15 | --- a/include/libbb.h 16 | +++ b/include/libbb.h 17 | @@ -303,6 +303,14 @@ 18 | # define STRTOOFF strtoull 19 | # define OFF_FMT "ll" 20 | # endif 21 | +/* scary. better ideas? (but do *test* them first!) */ 22 | +#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) 23 | +/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested. 24 | + * We misdetected that. Don't let it build: 25 | + */ 26 | +struct BUG_off_t_size_is_misdetected { 27 | + char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1]; 28 | +}; 29 | #else 30 | /* CONFIG_LFS is off */ 31 | /* sizeof(off_t) == sizeof(long). 32 | @@ -324,16 +332,8 @@ 33 | # define STRTOOFF strtol 34 | # define OFF_FMT "l" 35 | # endif 36 | +#define OFF_T_MAX UINT_MAX 37 | #endif 38 | -/* scary. better ideas? (but do *test* them first!) */ 39 | -#define OFF_T_MAX ((off_t)~((off_t)1 << (sizeof(off_t)*8-1))) 40 | -/* Users report bionic to use 32-bit off_t even if LARGEFILE support is requested. 41 | - * On musl, !ENABLE_LFS on 32-bit arches thinks that off_t is 32-bit. 42 | - * We misdetected that. Don't let it build: 43 | - */ 44 | -struct BUG_off_t_size_is_misdetected { 45 | - char BUG_off_t_size_is_misdetected[sizeof(off_t) == sizeof(uoff_t) ? 1 : -1]; 46 | -}; 47 | 48 | /* Some useful definitions */ 49 | #undef FALSE 50 | -------------------------------------------------------------------------------- /recipes-tweaks/busybox/busybox/220-add_lock_util.patch: -------------------------------------------------------------------------------- 1 | Upstream-Status: Pending 2 | 3 | Index: busybox-1.27.2/miscutils/lock.c 4 | =================================================================== 5 | --- /dev/null 6 | +++ busybox-1.27.2/miscutils/lock.c 7 | @@ -0,0 +1,145 @@ 8 | +/* 9 | + * Copyright (C) 2006 Felix Fietkau 10 | + * 11 | + * This is free software, licensed under the GNU General Public License v2. 12 | + */ 13 | +#include 14 | +#include 15 | +#include 16 | +#include 17 | +#include 18 | +#include 19 | +#include 20 | +#include "busybox.h" 21 | + 22 | +//config:config LOCK 23 | +//config: bool "lock" 24 | +//config: default n 25 | +//config: help 26 | +//config: Small utility for using locks in scripts 27 | + 28 | +//applet:IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) 29 | + 30 | +//kbuild:lib-$(CONFIG_LOCK) += lock.o 31 | + 32 | +//usage:#define lock_trivial_usage NOUSAGE_STR 33 | +//usage:#define lock_full_usage "" 34 | + 35 | +static int unlock = 0; 36 | +static int shared = 0; 37 | +static int waitonly = 0; 38 | +static int fd; 39 | +static char *file; 40 | + 41 | +static void usage(char *name) 42 | +{ 43 | + fprintf(stderr, "Usage: %s [-suw] \n" 44 | + " -s Use shared locking\n" 45 | + " -u Unlock\n" 46 | + " -w Wait for the lock to become free, don't acquire lock\n" 47 | + "\n", name); 48 | + exit(1); 49 | +} 50 | + 51 | +static void exit_unlock(int sig) 52 | +{ 53 | + flock(fd, LOCK_UN); 54 | + exit(0); 55 | +} 56 | + 57 | +static int do_unlock(void) 58 | +{ 59 | + FILE *f; 60 | + int i; 61 | + 62 | + if ((f = fopen(file, "r")) == NULL) 63 | + return 0; 64 | + 65 | + fscanf(f, "%d", &i); 66 | + if (i > 0) 67 | + kill(i, SIGTERM); 68 | + 69 | + fclose(f); 70 | + 71 | + return 0; 72 | +} 73 | + 74 | +static int do_lock(void) 75 | +{ 76 | + int pid; 77 | + char pidstr[8]; 78 | + 79 | + if ((fd = open(file, O_RDWR | O_CREAT | O_EXCL, 0700)) < 0) { 80 | + if ((fd = open(file, O_RDWR)) < 0) { 81 | + fprintf(stderr, "Can't open %s\n", file); 82 | + return 1; 83 | + } 84 | + } 85 | + 86 | + if (flock(fd, (shared ? LOCK_SH : LOCK_EX)) < 0) { 87 | + fprintf(stderr, "Can't lock %s\n", file); 88 | + return 1; 89 | + } 90 | + 91 | + pid = fork(); 92 | + 93 | + if (pid < 0) 94 | + return -1; 95 | + 96 | + if (pid == 0) { 97 | + signal(SIGKILL, exit_unlock); 98 | + signal(SIGTERM, exit_unlock); 99 | + signal(SIGINT, exit_unlock); 100 | + if (waitonly) 101 | + exit_unlock(0); 102 | + else 103 | + while (1) 104 | + sleep(1); 105 | + } else { 106 | + if (!waitonly) { 107 | + lseek(fd, 0, SEEK_SET); 108 | + ftruncate(fd, 0); 109 | + sprintf(pidstr, "%d\n", pid); 110 | + write(fd, pidstr, strlen(pidstr)); 111 | + close(fd); 112 | + } 113 | + 114 | + return 0; 115 | + } 116 | + return 0; 117 | +} 118 | + 119 | +int lock_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 120 | +int lock_main(int argc, char **argv) 121 | +{ 122 | + char **args = &argv[1]; 123 | + int c = argc - 1; 124 | + 125 | + while ((*args != NULL) && (*args)[0] == '-') { 126 | + char *ch = *args; 127 | + while (*(++ch) > 0) { 128 | + switch(*ch) { 129 | + case 'w': 130 | + waitonly = 1; 131 | + break; 132 | + case 's': 133 | + shared = 1; 134 | + break; 135 | + case 'u': 136 | + unlock = 1; 137 | + break; 138 | + } 139 | + } 140 | + c--; 141 | + args++; 142 | + } 143 | + 144 | + if (c != 1) 145 | + usage(argv[0]); 146 | + 147 | + file = *args; 148 | + if (unlock) 149 | + return do_unlock(); 150 | + else 151 | + return do_lock(); 152 | +} 153 | -------------------------------------------------------------------------------- /recipes-tweaks/busybox/busybox/fragment-lock.cfg: -------------------------------------------------------------------------------- 1 | CONFIG_LOCK=y 2 | # CONFIG_INSMOD is not set 3 | # CONFIG_RMMOD is not set 4 | # CONFIG_LSMOD is not set 5 | # CONFIG_MODPROBE is not set 6 | # CONFIG_DEPMOD is not set 7 | -------------------------------------------------------------------------------- /recipes-tweaks/busybox/busybox/fragment-noifupdown.cfg: -------------------------------------------------------------------------------- 1 | # CONFIG_IFUP is not set 2 | # CONFIG_IFDOWN is not set 3 | -------------------------------------------------------------------------------- /recipes-tweaks/busybox/busybox_%.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | 4 | # Released under the MIT license (see COPYING.MIT for the terms) 5 | 6 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 7 | 8 | PACKAGECONFIG ??= "" 9 | PACKAGECONFIG[oeoveropenwrt] = "" 10 | 11 | SRC_URI += "\ 12 | file://fragment-lock.cfg \ 13 | ${@bb.utils.contains('PACKAGECONFIG', 'oeoveropenwrt', '', 'file://fragment-noifupdown.cfg', d)} \ 14 | file://220-add_lock_util.patch \ 15 | " 16 | 17 | do_install:append () { 18 | rm -f ${D}/usr/share/udhcpc/default.script 19 | } 20 | -------------------------------------------------------------------------------- /recipes-tweaks/busybox/busybox_1.36.%.bbappend: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Bosch Sicherheitssysteme GmbH 2 | # 3 | # SPDX-License-Identifier: MIT 4 | 5 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-${PV}:" 6 | 7 | SRC_URI += "file://z300-fix_off_t_misdetection_triggered_without_LFS.patch" 8 | -------------------------------------------------------------------------------- /recipes-tweaks/dnsmasq/dnsmasq/99-dnsmasq.rules: -------------------------------------------------------------------------------- 1 | SUBSYSTEM=="net", ACTION=="add", KERNEL=="br-lan", RUN+="/etc/init.d/dnsmasq start" 2 | -------------------------------------------------------------------------------- /recipes-tweaks/dnsmasq/dnsmasq_%.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | # Copyright (C) 2018 Daniel Dickinson 3 | 4 | # Released under the MIT license (see COPYING.MIT for the terms) 5 | 6 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 7 | 8 | OPENWRT_BASEPATH = "../git/openwrt" 9 | 10 | SRC_URI += "file://99-dnsmasq.rules" 11 | 12 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 13 | 14 | inherit openwrt openwrt-services useradd openwrt-base-files gettext 15 | DEPENDS = "ubus" 16 | 17 | EXTRA_OEMAKE = "\ 18 | 'COPTS=${@bb.utils.contains('PACKAGECONFIG', 'dbus', '-DHAVE_DBUS', '', d)} \ 19 | ${@bb.utils.contains('PACKAGECONFIG', 'idn', '-DHAVE_IDN', '', d)} \ 20 | ${@bb.utils.contains('PACKAGECONFIG', 'conntrack', '-DHAVE_CONNTRACK', '', d)} \ 21 | ${@bb.utils.contains('PACKAGECONFIG', 'lua', '-DHAVE_LUASCRIPT', '', d)} \ 22 | -DHAVE_UBUS' \ 23 | 'CFLAGS=${CFLAGS}' \ 24 | 'LDFLAGS=${LDFLAGS}' \ 25 | " 26 | do_install:append() { 27 | install -d ${D}${sysconfdir} 28 | install -d ${D}${sysconfdir}/config 29 | install -d ${D}${sysconfdir}/init.d 30 | install -d ${D}${sysconfdir}/rc.d 31 | install -d ${D}${sysconfdir}/udev 32 | install -d ${D}${sysconfdir}/udev/rules.d 33 | install -d ${D}${sbindir} 34 | 35 | install -m 0755 ${WORKDIR}/git/openwrt/package/network/services/dnsmasq/files/dnsmasq.conf ${D}${sysconfdir}/ 36 | install -m 0755 ${WORKDIR}/git/openwrt/package/network/services/dnsmasq/files/dhcp.conf ${D}${sysconfdir}/config/dhcp 37 | install -m 0755 ${WORKDIR}/git/openwrt/package/network/services/dnsmasq/files/dnsmasq.init ${D}${sysconfdir}/init.d/dnsmasq 38 | install -m 0644 ${WORKDIR}/99-dnsmasq.rules ${D}${sysconfdir}/udev/rules.d/99-dnsmasq.rules 39 | 40 | # dnsmasq installs in /usr/bin, openwrt looks for it in /usr/sbin 41 | ln -s ${bindir}/dnsmasq ${D}${sbindir}/dnsmasq 42 | } 43 | 44 | USERADD_PACKAGES = "${PN}" 45 | 46 | USERADD_PARAM:${PN} = "--system -d /var/lib/dnsmasq --no-create-home \ 47 | --shell /bin/false --user-group dnsmasq" 48 | 49 | RDEPENDS:dnsmasq += "jsonpath" 50 | -------------------------------------------------------------------------------- /recipes-tweaks/hostapd/hostapd_%.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 6 | 7 | SRCREV_openwrt = "${OPENWRT_SRCREV}" 8 | 9 | inherit openwrt openwrt-base-files 10 | 11 | do_install:append() { 12 | install -d ${D}${base_libdir}/netifd 13 | install -d ${D}${base_libdir}/netifd/wireless 14 | install -d ${D}${base_libdir}/wifi 15 | 16 | install -m 0755 ${WORKDIR}/git/openwrt/package/kernel/mac80211/files/lib/wifi/mac80211.sh ${D}${base_libdir}/wifi/mac80211.sh 17 | install -m 0755 ${WORKDIR}/git/openwrt/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh ${D}${base_libdir}/netifd/wireless/mac80211.sh 18 | } 19 | 20 | FILES:${PN} += "\ 21 | ${base_libdir}/netifd/hostapd.sh \ 22 | ${base_libdir}/wifi/mac80211.sh \ 23 | ${base_libdir}/netifd/wireless/mac80211.sh \ 24 | " 25 | -------------------------------------------------------------------------------- /recipes-tweaks/iptables/iptables/200-configurable_builtin.patch: -------------------------------------------------------------------------------- 1 | Upstream-Status: Pending 2 | 3 | --- a/extensions/GNUmakefile.in 4 | +++ b/extensions/GNUmakefile.in 5 | @@ -50,11 +50,31 @@ 6 | pfa_build_mod := $(filter-out @blacklist_modules@ @blacklist_a_modules@,${pfa_build_mod}) 7 | pf4_build_mod := $(filter-out @blacklist_modules@ @blacklist_4_modules@,${pf4_build_mod}) 8 | pf6_build_mod := $(filter-out @blacklist_modules@ @blacklist_6_modules@,${pf6_build_mod}) 9 | -pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod}) 10 | -pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_mod}) 11 | -pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_mod}) 12 | -pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod}) 13 | -pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod}) 14 | +ifdef BUILTIN_MODULES 15 | +pfx_build_static := $(filter $(BUILTIN_MODULES),${pfx_build_mod}) 16 | +pfb_build_static := $(filter $(BUILTIN_MODULES),${pfb_build_mod}) 17 | +pfa_build_static := $(filter $(BUILTIN_MODULES),${pfa_build_mod}) 18 | +pf4_build_static := $(filter $(BUILTIN_MODULES),${pf4_build_mod}) 19 | +pf6_build_static := $(filter $(BUILTIN_MODULES),${pf6_build_mod}) 20 | +else 21 | +@ENABLE_STATIC_TRUE@ pfx_build_static := $(pfx_build_mod) 22 | +@ENABLE_STATIC_TRUE@ pfb_build_static := $(pfb_build_mod) 23 | +@ENABLE_STATIC_TRUE@ pfa_build_static := $(pfa_build_mod) 24 | +@ENABLE_STATIC_TRUE@ pf4_build_static := $(pf4_build_mod) 25 | +@ENABLE_STATIC_TRUE@ pf6_build_static := $(pf6_build_mod) 26 | +endif 27 | + 28 | +pfx_build_mod := $(filter-out $(pfx_build_static),$(pfx_build_mod)) 29 | +pfb_build_mod := $(filter-out $(pfb_build_static),$(pfb_build_mod)) 30 | +pfa_build_mod := $(filter-out $(pfa_build_static),$(pfa_build_mod)) 31 | +pf4_build_mod := $(filter-out $(pf4_build_static),$(pf4_build_mod)) 32 | +pf6_build_mod := $(filter-out $(pf6_build_static),$(pf6_build_mod)) 33 | + 34 | +pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_static}) 35 | +pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_static}) 36 | +pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_static}) 37 | +pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_static}) 38 | +pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_static}) 39 | pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod}) 40 | pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod}) 41 | pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod}) 42 | @@ -68,14 +88,14 @@ 43 | # 44 | targets := libiptext.so libiptext4.so libiptext6.so libiptext_ebt.so libiptext_arpt.so matches.man targets.man 45 | targets_install := 46 | -@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs} 47 | -@ENABLE_STATIC_TRUE@ libext_ebt_objs := ${pfb_objs} 48 | -@ENABLE_STATIC_TRUE@ libext_arpt_objs := ${pfa_objs} 49 | -@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs} 50 | -@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs} 51 | -@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} ${pfx_symlink_files} 52 | -@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} 53 | -@ENABLE_STATIC_FALSE@ symlinks_install := ${pfx_symlink_files} 54 | +libext_objs := ${pfx_objs} 55 | +libext_ebt_objs := ${pfb_objs} 56 | +libext_arpt_objs := ${pfa_objs} 57 | +libext4_objs := ${pf4_objs} 58 | +libext6_objs := ${pf6_objs} 59 | +targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} ${pfx_symlink_files} 60 | +targets_install := $(strip ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}) 61 | +symlinks_install := ${pfx_symlink_files} 62 | 63 | .SECONDARY: 64 | 65 | @@ -170,11 +190,11 @@ 66 | libiptext6.so: initext6.o ${libext6_objs} 67 | ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L${top_builddir}/libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 68 | 69 | -initext_func := $(addprefix xt_,${pfx_build_mod}) 70 | -initextb_func := $(addprefix ebt_,${pfb_build_mod}) 71 | -initexta_func := $(addprefix arpt_,${pfa_build_mod}) 72 | -initext4_func := $(addprefix ipt_,${pf4_build_mod}) 73 | -initext6_func := $(addprefix ip6t_,${pf6_build_mod}) 74 | +initext_func := $(addprefix xt_,${pfx_build_static}) 75 | +initextb_func := $(addprefix ebt_,${pfb_build_static}) 76 | +initexta_func := $(addprefix arpt_,${pfa_build_static}) 77 | +initext4_func := $(addprefix ipt_,${pf4_build_static}) 78 | +initext6_func := $(addprefix ip6t_,${pf6_build_static}) 79 | 80 | initexts := ext exta extb ext4 ext6 81 | initext_depfiles = $(patsubst %,.init%.dd,${initexts}) 82 | -------------------------------------------------------------------------------- /recipes-tweaks/iptables/iptables/600-shared-libext.patch: -------------------------------------------------------------------------------- 1 | Upstream-Status: Pending 2 | 3 | --- a/extensions/GNUmakefile.in 4 | +++ b/extensions/GNUmakefile.in 5 | @@ -66,7 +66,7 @@ 6 | # 7 | # Building blocks 8 | # 9 | -targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man 10 | +targets := libiptext.so libiptext4.so libiptext6.so libiptext_ebt.so libiptext_arpt.so matches.man targets.man 11 | targets_install := 12 | @ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs} 13 | @ENABLE_STATIC_TRUE@ libext_ebt_objs := ${pfb_objs} 14 | @@ -113,7 +113,7 @@ 15 | distclean: clean 16 | 17 | init%.o: init%.c 18 | - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init ${CFLAGS} -o $@ -c $<; 19 | + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<; 20 | 21 | -include .*.d 22 | 23 | @@ -153,22 +153,22 @@ 24 | # handling code in the Makefiles. 25 | # 26 | lib%.o: ${srcdir}/lib%.c 27 | - ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init ${CFLAGS} -o $@ -c $<; 28 | + ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<; 29 | 30 | -libext.a: initext.o ${libext_objs} 31 | - ${AM_VERBOSE_AR} ${AR} crs $@ $^; 32 | +libiptext.so: initext.o ${libext_objs} 33 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 34 | 35 | -libext_ebt.a: initextb.o ${libext_ebt_objs} 36 | - ${AM_VERBOSE_AR} ${AR} crs $@ $^; 37 | +libiptext_ebt.so: initextb.o ${libext_ebt_objs} 38 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 39 | 40 | -libext_arpt.a: initexta.o ${libext_arpt_objs} 41 | - ${AM_VERBOSE_AR} ${AR} crs $@ $^; 42 | +libiptext_arpt.so: initexta.o ${libext_arpt_objs} 43 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 44 | 45 | -libext4.a: initext4.o ${libext4_objs} 46 | - ${AM_VERBOSE_AR} ${AR} crs $@ $^; 47 | +libiptext4.so: initext4.o ${libext4_objs} 48 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 49 | 50 | -libext6.a: initext6.o ${libext6_objs} 51 | - ${AM_VERBOSE_AR} ${AR} crs $@ $^; 52 | +libiptext6.so: initext6.o ${libext6_objs} 53 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 54 | 55 | initext_func := $(addprefix xt_,${pfx_build_mod}) 56 | initextb_func := $(addprefix ebt_,${pfb_build_mod}) 57 | --- a/iptables/Makefile.am 58 | +++ b/iptables/Makefile.am 59 | @@ -7,25 +7,29 @@ 60 | BUILT_SOURCES = 61 | 62 | common_sources = iptables-xml.c xtables-multi.h xshared.c xshared.h 63 | -common_ldadd = ../extensions/libext.a ../libxtables/libxtables.la -lm 64 | +common_ldadd = ../libxtables/libxtables.la -lm 65 | common_cflags = ${AM_CFLAGS} 66 | if ENABLE_STATIC 67 | common_cflags += -DALL_INCLUSIVE 68 | endif 69 | +common_ldflags = -L../extensions/ -liptext 70 | 71 | xtables_legacy_multi_SOURCES = ${common_sources} xtables-legacy-multi.c \ 72 | iptables-restore.c iptables-save.c 73 | xtables_legacy_multi_CFLAGS = ${common_cflags} 74 | xtables_legacy_multi_LDADD = ${common_ldadd} 75 | +xtables_legacy_multi_LDFLAGS = ${common_ldflags} 76 | if ENABLE_IPV4 77 | xtables_legacy_multi_SOURCES += iptables-standalone.c iptables.c iptables-multi.h 78 | xtables_legacy_multi_CFLAGS += -DENABLE_IPV4 79 | -xtables_legacy_multi_LDADD += ../libiptc/libip4tc.la ../extensions/libext4.a 80 | +xtables_legacy_multi_LDADD += ../libiptc/libip4tc.la 81 | +xtables_legacy_multi_LDFLAGS += -liptext4 82 | endif 83 | if ENABLE_IPV6 84 | xtables_legacy_multi_SOURCES += ip6tables-standalone.c ip6tables.c ip6tables-multi.h 85 | xtables_legacy_multi_CFLAGS += -DENABLE_IPV6 86 | -xtables_legacy_multi_LDADD += ../libiptc/libip6tc.la ../extensions/libext6.a 87 | +xtables_legacy_multi_LDADD += ../libiptc/libip6tc.la 88 | +xtables_legacy_multi_LDFLAGS += -liptext6 89 | endif 90 | 91 | # iptables using nf_tables api 92 | @@ -33,12 +37,9 @@ 93 | xtables_nft_multi_SOURCES = ${common_sources} xtables-nft-multi.c 94 | xtables_nft_multi_CFLAGS = ${common_cflags} 95 | xtables_nft_multi_LDADD = ${common_ldadd} \ 96 | - ../extensions/libext_arpt.a \ 97 | - ../extensions/libext_ebt.a \ 98 | - ../extensions/libext4.a \ 99 | - ../extensions/libext6.a \ 100 | ${libmnl_LIBS} ${libnftnl_LIBS} \ 101 | ${libnetfilter_conntrack_LIBS} 102 | +xtables_nft_multi_LDFLAGS = ${common_ldflags} -liptext_arpt -liptext_ebt -liptext4 -liptext6 103 | xtables_nft_multi_CFLAGS += -DENABLE_NFTABLES -DENABLE_IPV4 -DENABLE_IPV6 104 | xtables_nft_multi_SOURCES += nft.c nft.h \ 105 | nft-arp.c nft-ipv4.c nft-ipv6.c \ 106 | -------------------------------------------------------------------------------- /recipes-tweaks/iptables/iptables/601-Fix-out-of-tree-build.patch: -------------------------------------------------------------------------------- 1 | Upstream-Status: Pending 2 | 3 | --- a/extensions/GNUmakefile.in 4 | +++ b/extensions/GNUmakefile.in 5 | @@ -122,7 +122,7 @@ 6 | # Shared libraries 7 | # 8 | lib%.so: lib%.oo 9 | - ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} ${LDFLAGS} -shared -o $@ $< -L../libxtables/.libs -lxtables ${$*_LIBADD}; 10 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} ${LDFLAGS} -shared -o $@ $< -L${top_builddir}/libxtables/.libs -lxtables ${$*_LIBADD}; 11 | 12 | lib%.oo: ${srcdir}/lib%.c 13 | ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<; 14 | @@ -156,19 +156,19 @@ 15 | ${AM_VERBOSE_CC} ${CC} ${AM_CPPFLAGS} ${AM_DEPFLAGS} ${AM_CFLAGS} -DNO_SHARED_LIBS=1 -D_INIT=lib$*_init -DPIC -fPIC ${CFLAGS} -o $@ -c $<; 16 | 17 | libiptext.so: initext.o ${libext_objs} 18 | - ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 19 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L${top_builddir}/libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 20 | 21 | libiptext_ebt.so: initextb.o ${libext_ebt_objs} 22 | - ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 23 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L${top_builddir}/libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 24 | 25 | libiptext_arpt.so: initexta.o ${libext_arpt_objs} 26 | - ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 27 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L${top_builddir}/libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 28 | 29 | libiptext4.so: initext4.o ${libext4_objs} 30 | - ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 31 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L${top_builddir}/libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 32 | 33 | libiptext6.so: initext6.o ${libext6_objs} 34 | - ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 35 | + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L${top_builddir}/libxtables/.libs -lxtables $(foreach obj,$^,${$(patsubst lib%.o,%,$(obj))_LIBADD}); 36 | 37 | initext_func := $(addprefix xt_,${pfx_build_mod}) 38 | initextb_func := $(addprefix ebt_,${pfb_build_mod}) 39 | --- a/iptables/Makefile.am 40 | +++ b/iptables/Makefile.am 41 | @@ -12,7 +12,7 @@ 42 | if ENABLE_STATIC 43 | common_cflags += -DALL_INCLUSIVE 44 | endif 45 | -common_ldflags = -L../extensions/ -liptext 46 | +common_ldflags = -L${top_builddir}/extensions/ -liptext 47 | 48 | xtables_legacy_multi_SOURCES = ${common_sources} xtables-legacy-multi.c \ 49 | iptables-restore.c iptables-save.c 50 | -------------------------------------------------------------------------------- /recipes-tweaks/iptables/iptables_1.8.%.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 6 | 7 | XTLIBDIR = "${libdir}/iptables" 8 | 9 | EXTRA_OECONF += "--enable-shared --disable-static --with-xtlibdir=${XTLIBDIR}" 10 | 11 | SRC_URI += "file://600-shared-libext.patch \ 12 | file://601-Fix-out-of-tree-build.patch \ 13 | file://200-configurable_builtin.patch \ 14 | " 15 | 16 | LDFLAGS += "-fuse-ld=bfd" 17 | 18 | python populate_packages:prepend() { 19 | modules = do_split_packages(d, '${XTLIBDIR}', r'lib(.*)\.so$', '${PN}-module-%s', '${PN} module %s', extra_depends='', prepend=True) 20 | if modules: 21 | metapkg = d.getVar('PN') + '-modules' 22 | d.appendVar('RDEPENDS:' + metapkg, ' ' + ' '.join(modules)) 23 | } 24 | 25 | do_install:append() { 26 | install -d ${D}${libdir} 27 | install -m 0644 ${B}/extensions/libiptext*.so ${D}${libdir} 28 | } 29 | 30 | FILES:${PN} += "${libdir}/*.so" 31 | FILES_SOLIBSDEV = "" 32 | INSANE_SKIP:${PN} = "dev-so" 33 | 34 | -------------------------------------------------------------------------------- /recipes-tweaks/modutils-initscripts/files/modutils.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=00 4 | 5 | boot() { 6 | LOAD_MODULE=modprobe 7 | [ -f /proc/modules ] || exit 0 8 | [ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0 9 | [ -e /sbin/modprobe ] || LOAD_MODULE=insmod 10 | 11 | if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then 12 | [ "$VERBOSE" != no ] && echo "Calculating module dependencies ..." 13 | depmod -Ae 14 | fi 15 | 16 | loaded_modules=" " 17 | 18 | process_file() { 19 | file=$1 20 | 21 | (cat $file; echo; ) | 22 | while read module args 23 | do 24 | case "$module" in 25 | \#*|"") continue ;; 26 | esac 27 | [ -n "$(echo $loaded_modules | grep " $module ")" ] && continue 28 | [ "$VERBOSE" != no ] && echo -n "$module " 29 | eval "$LOAD_MODULE $module $args >/dev/null 2>&1" 30 | loaded_modules="${loaded_modules}${module} " 31 | done 32 | } 33 | 34 | [ "$VERBOSE" != no ] && echo -n "Loading modules: " 35 | [ -f /etc/modules ] && process_file /etc/modules 36 | 37 | [ -d /etc/modules-load.d ] || exit 0 38 | 39 | for f in /etc/modules-load.d/*.conf; do 40 | process_file $f 41 | done 42 | [ "$VERBOSE" != no ] && echo 43 | 44 | exit 0 45 | } 46 | -------------------------------------------------------------------------------- /recipes-tweaks/modutils-initscripts/modutils-initscripts.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Daniel Dickinson 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | FILESEXTRAPATHS:prepend := "${THISDIR}/files:" 6 | 7 | SRC_URI += "\ 8 | file://modutils.init \ 9 | " 10 | 11 | inherit openwrt openwrt-services 12 | 13 | do_install:append() { 14 | install -dm 0755 ${D}/etc/init.d 15 | install -Dm 0755 ${S}/modutils.init ${D}/etc/init.d/modutils 16 | } 17 | -------------------------------------------------------------------------------- /recipes-tweaks/packagegroups/packagegroup-core-boot.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2018 Daniel Dickinson 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | 6 | # Note that VIRTUAL-RUNTIME_network_manager nor VIRTUAL-RUNTIME_syslog 7 | # are essential for booting a standalone system so not included here. 8 | 9 | inherit openwrt 10 | 11 | RDEPENDS:${PN}:append = "\ 12 | ${VIRTUAL-RUNTIME_kmod_manager} \ 13 | " 14 | -------------------------------------------------------------------------------- /recipes-tweaks/udev/eudev/udev.procd: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | 3 | START=05 4 | STOP=95 5 | 6 | USE_PROCD=1 7 | 8 | PROG=/sbin/udevd 9 | 10 | start_service() { 11 | procd_open_instance 12 | procd_set_param command $PROG 13 | procd_set_param respawn 14 | procd_close_instance 15 | } 16 | 17 | service_started() { 18 | /sbin/udevadm control --env=STARTUP=1 19 | /sbin/udevadm trigger --action=add 20 | /sbin/udevadm settle 21 | } 22 | 23 | stop() { 24 | service_stop $PROG 25 | } 26 | 27 | reload() { 28 | service_reload $PROG 29 | } 30 | 31 | -------------------------------------------------------------------------------- /recipes-tweaks/udev/eudev_%.bbappend: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Khem Raj 2 | 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" 6 | 7 | SRC_URI += "file://udev.procd" 8 | 9 | do_install:append() { 10 | install -d ${D}${sysconfdir}/init.d 11 | 12 | install -m 0755 ${WORKDIR}/udev.procd ${D}${sysconfdir}/init.d/udev 13 | 14 | mkdir -p ${D}${sysconfdir}/rc.d 15 | ln -s ../init.d/udev ${D}${sysconfdir}/rc.d/S05udev 16 | ln -s ../init.d/udev ${D}${sysconfdir}/rc.d/K95udev 17 | } 18 | --------------------------------------------------------------------------------