aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
Commit message (Collapse)AuthorAgeFilesLines
* OpenWrt v18.06.2: adjust config defaultsv18.06.2Jo-Philipp Wich2019-01-301-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: config_get: prevent filename globbingGünther Kelleter2019-01-302-2/+2
| | | | | | | | | | When config_get is called as "config_get section option" the option is unexpectedly globbed by the shell which differs from the way options are read to a variable with "config_get variable section option". Add another layer of double quotes to fix it. Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de> (backported from commit c3389ab135400fba0cb710d9c6c63df2f563d9d9)
* base-files: install missing /etc/iproute2/ematch_mapTony Ambardar2019-01-081-0/+8
| | | | | | | | | This file is needed to properly use the tc ematch modules present in kmod-sched-core and kmod-sched. It is a read-only index file of ematch methods used only by tc. Signed-off-by: Tony Ambardar <itugrok@yahoo.com> [cherry picked from commit 10a2ccb7fceef3a6dea4ece14e6141a807292d5f]
* base-files: sysupgrade: Allow downloading of firmware images using HTTPSPetr Štetiar2018-12-181-1/+2
| | | | | | | Currently it's only possible to download images over HTTP. Signed-off-by: Petr Štetiar <ynezz@true.cz> (backported from 7c104a83589c3e3fbfdfda2ef68b8695f57dde75)
* base-files: add network_get_metric() to /lib/functions/network.shFlorian Eckert2018-12-182-1/+6
| | | | | | Signed-off-by: Florian Eckert <fe@dev.tdt.de> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase] (backported from 61a59949009993a6b1d634ecbce765b37c4c2560)
* base-files: fix postinstall uci-defaults removalTony Ambardar2018-12-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7f694582 introduced a bug where default_postinst() often fails to remove a uci-defaults script after application, leaving it to run again after a reboot. (Note: commit 7f694582 also introduced FS#1021, now fixed by 73c745f6) The subtle problem arises from the shell logical chain: [ -f "$i" ] && . "$i" && rm -f "$i" Most uci-defaults scripts contain a terminal 'exit 0' statement which, when sourced, results in the logic chain exiting before executing 'rm -f'. This was observed while testing upgrades of 'luci-app-sqm'. The solution is to wrap the shell sourcing in a subshell relative to the command 'rm -f': ( [ -f "$i" ] && . "$i" ) && rm -f "$i" Revert to using 'grep' to prefilter the list of entries from the control file, which yields the full path of uci-defaults scripts. This allows keeping the existence check, directory change and script sourcing inside the subshell, with the script removal correctly outside. This approach avoids adding a second subshell only around the "." (source) command. The change also preserves the fix FS#1021, since the full path is used to source the script, which is POSIX-portable irrespective of PATH variable or reference to the CWD. Run Tested on: LEDE 17.01.4 running ar71xx, while tracing installation of package luci-app-sqm with its associated /etc/uci-defaults/luci-sqm file. Signed-off-by: Tony Ambardar <itugrok@yahoo.com> (backported from 4097ab6a975902b170dd7f7ac6c8025e5f32ef8d)
* base-files: /etc/services: add missing 'rpcbind' aliasAndy Walsh2018-12-181-2/+2
| | | | | | | | | * add missing 'rpcbind' alias to /etc/services Allows rpcbind to open its 111 port and be reachable via lan, this is the default behaviour. Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com> (backported from 4549ab46a85735aa957e05c91dc023228aaa2697)
* base-files: provide more tolerant xterm detectionPaul Wassi2018-12-181-1/+5
| | | | | | | | | Set the window title not only in "xterm", but also in e.g. "xterm-256color", "xterm-color", etc. The case statement is taken from Debian / Ubuntu. Signed-off-by: Paul Wassi <p.wassi@gmx.at> (backported from 1bd6b91e0f9f53f13b5a9fa2939674012fe7193f)
* base-files: create /etc/ethers by defaultLuiz Angelo Daros de Luca2018-12-182-0/+7
| | | | | | | | | | | | /etc/ethers is missing on /rom but always created when dnsmasq runs. It is better to have it in place and avoid an extra change in flash after firstboot. It will generate an extra /etc/ethers-opkg when it has changed. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> (backported from d810d44e5a88e7ed5a72f8cd39fc57639aa6dbd0)
* base-files: add function to get mac as text from flashMathias Kresin2018-12-181-0/+23
| | | | | | | | | | Add a function to get a mac stored as text from flash. The octets of the mac address need to be separated by any separator supported by macaddr_canonicalize(). Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com> Signed-off-by: Mathias Kresin <dev@kresin.me> (backported from dfee452713e6b3c10aafc6174f8087a920b54402)
* base-files: use consistent coding styleMathias Kresin2018-12-181-8/+4
| | | | | | | | | Add the opening bracket right after the function name, to do it the same way for all functions in this file. Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com> Signed-off-by: Mathias Kresin <dev@kresin.me> (backported from ec28d2797c1bff4a3a97e54fee648cc56185839a)
* base-files: make wifi report unknown commandThibaut VARÈNE2018-12-181-2/+3
| | | | | | | | | | | | Avoid having /sbin/wifi silently ignore unknown keywords and execute "up"; instead display the help message and exit with an error. Spell out the "up" keyword (which has users), add it to usage output, and preserve the implicit assumption that runing /sbin/wifi without argument performs "up". Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org> (backported from 78b5764fd8a3c133f0caf170238242b32a97105b)
* base-files: do not add relevant sections & options except when ipv6 is ↵Rosy Song2018-12-181-16/+26
| | | | | | | support in kernel Signed-off-by: Rosy Song <rosysong@rosinson.com> (backported from 2b637e5ab8ae24ff4176930f259dce195983d7ea)
* base-files: sysupgrade: abort if config backup failsAndreas Ziegler2018-12-182-1/+6
| | | | | | | | Sysupgrade shouldn't proceed, if the backup of the configuration fails because tar (or gzip) exit with a non-zero code. Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de> (backported from 72489ebeb65fd1e1d77e8d9fbe105827a98dbf03)
* base-files: fix wrong sysctl parameter orderLuiz Angelo Daros de Luca2018-12-181-1/+1
| | | | | | | | | | | | Restarting service sysctl echos multiple errors like: sysctl: -e: No such file or directory After the first filename, all remaining arguments are treated as files. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> (backported from 4c4288728611d334efb777b74e737e1f98e0dc1b)
* base-files: add menuconfig option for HOME_URLMathias Kresin2018-12-182-1/+7
| | | | | | | | | | | Add a menuconfig option to set the HOME_URL exposed in /usr/lib/os-release independent from the LEDE_DEVICE_MANUFACTURER_URL. Fixes: FS#1123 Signed-off-by: Mathias Kresin <dev@kresin.me> (backported from 52a9edb1bfaf51c250a33303beacba95dd1dbc05)
* base-files: exit if mtd write command fails during sysupgradeRafał Miłecki2018-12-181-0/+1
| | | | | | | | | | | It avoids confusing situations like: > Could not get image magic > Image check failed. > Upgrade completed > Rebooting system... Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (backported from 5b2e20807d2b38de1cc4185d15bb4320b8bd743a)
* base-files: fix prerm return value, align with postinst codeTony Ambardar2018-11-291-5/+10
| | | | | | | | | | | | | | | | The return value of a package prerm script is discarded and not returned correctly by default_prerm(). This allows other operations like service shutdown to "leak" their return value, prompting workarounds like commit 48cfc826 which do not address the root cause. Preserve a package prerm script return value for use by default_prerm(), sharing the corresponding code from default_postinst() for consistency. Also use consistent code for handling of /etc/init.d/ scripts. Run Tested on: LEDE 17.01.4 running ar71xx. Signed-off-by: Tony Ambardar <itugrok@yahoo.com> (cherry picked from commit 8806da86f5da3b1b1e4d24259d168e2219c01a26)
* base-files: fix unkillable processes after restartLinus Kardell2018-11-221-0/+1
| | | | | | | | | | | | | | | | When restart is run on an init script, the script traps SIGTERM. This is done as a workaround for scripts named the same name as the program they start. In that case, the init script process will have the same name as the program process, and so when the init script runs killall, it will kill itself. So SIGTERM is trapped to make the init script unkillable. However, the trap is retained when the init script runs start, and thus processes started by restart will not respond to SIGTERM, and will thus be unkillable unless you use SIGKILL. This fixes that by removing the trap before running start. Signed-off-by: Linus Kardell <linus@telliq.com> (cherry picked from commit 2ac1a57677ce4e21513dca2a8efab1eb6e0a9c58)
* base-files: Reintroduce sysupgrade_pre_upgrade hookSven Eckelmann2018-10-071-0/+3
| | | | | | | | | | | | | | | The sysupgrade_pre_upgrade hook was removed with 6a27c2f4b1a4 ("base-files: drop fwtool_pre_upgrade") while there were still scripts using it: * target/linux/ar71xx/base-files/lib/upgrade/allnet.sh * target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh * target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh Not running the hooks can either prevent a successful upgrade or brick the device because the fw_setenv program cannot be started correctly. Fixes: 6a27c2f4b1a4 ("base-files: drop fwtool_pre_upgrade") Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
* OpenWrt v18.06.1: revert to branch defaultsJo-Philipp Wich2018-08-161-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* OpenWrt v18.06.1: adjust config defaultsv18.06.1Jo-Philipp Wich2018-08-161-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: drop fwtool_pre_upgradeJohn Crispin2018-08-082-7/+0
| | | | | | | | this feature has never worked, the fw image name was not passed and the -t parameter was missing in the tool invocation. drop the feature. Signed-off-by: John Crispin <john@phrozen.org> (cherry picked from commit 5e1b4c57ded7898be5255aef594fa18ec206f0b2)
* basefiles: Reword sysupgrade messageKevin Darbyshire-Bryant2018-08-081-1/+1
| | | | | | | sysupgrade 'upgrade' message more verbose than needs be. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> (cherry picked from commit edf338f248a270f5fd85edc04775ec5ed6d46bca)
* OpenWrt v18.06.0: revert to branch defaultsJo-Philipp Wich2018-07-301-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* OpenWrt v18.06.0: adjust config defaultsv18.06.0Jo-Philipp Wich2018-07-301-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: network.sh: gracefully handle missing network.interface ubus nsJo-Philipp Wich2018-07-302-5/+11
| | | | | | | | | | | | | | | | | | | | | When attempting to use any of the functions in network.sh while netifd is not started yet, the ubus interface dump query will fail with "Not found", yielding an empty response. Subsequently, jsonfilter is invoked with an empty string instead of a valid JSON document, causing it to emit a second "unexpected end of data" error. This caused the dnsmasq init script to log the following errors during early boot on some systems: procd: /etc/rc.d/S19dnsmasq: Command failed: Not found. procd: /etc/rc.d/S19dnsmasq: Failed to parse json data: unexpected end of data. Fix the issue by allowing the ubus query to fail with "Not found" but still logging other failures, and by passing an empty JSON object to jsonfilter if the interface status cache is empty. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: fix wrong sysctl parameter orderLuiz Angelo Daros de Luca2018-07-181-1/+1
| | | | | | | | | | | Restarting service sysctl echos multiple errors like: sysctl: -e: No such file or directory After the first filename, all remaining arguments are treated as files. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
* base-files: fix UCI config parsing and callback handlingTony Ambardar2018-07-162-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several long-standing issues present in the UCI shell API as documented in https://wiki.openwrt.org/doc/devel/config-scripting. They relate both to high-level, user-defined callback functions used to process UCI config files, and also to low-level functions used within scripts generally. The related problems have been encountered now and in the past, e.g. https://forum.openwrt.org/viewtopic.php?id=54295, and include: a) UCI parsing option() function and user-defined option_cb() callbacks being erroneously called during processing of "list" config file entries; b) normal usage of the low-level config_set() unexpectedy calling any defined option_cb() if present; and c) handling of the list_cb() not respecting the NO_CALLBACK variable. Root causes include a function stack "inversion", where the low-level config_set() function incorrectly calls the high-level option() function, intended only for processing the "option" keyword of UCI config files. This change addresses the inversion and other issues, making the option handling code more consistent and smaller, and simplifying developers' usage of UCI callbacks. Signed-off-by: Tony Ambardar <itugrok@yahoo.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
* OpenWrt v18.06.0-rc2: revert to branch defaultsJo-Philipp Wich2018-07-151-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* OpenWrt v18.06.0-rc2: adjust config defaultsv18.06.0-rc2Jo-Philipp Wich2018-07-151-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* include/feeds.mk: rework generation of opkg distfeeds.confMatthias Schiffer2018-07-122-16/+0
| | | | | | | | Allow enabling/commenting/disabling each feed individually by using a tristate config symbol. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> (cherry picked from commit 16035a7dd370671670693af9ae63368ee4dd731f)
* base-files: fix feed list in PKG_CONFIG_DEPENDSMatthias Schiffer2018-07-121-1/+1
| | | | | | | | FEEDS_ENABLED and FEEDS_DISABLED are derived from FEEDS_AVAILABLE, not FEEDS_INSTALLED. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> (cherry picked from commit 6dac434c0011524b9ac01725727faa1a19ea4a48)
* base-files: fix links in banner.failsafeSven Roederer2018-06-241-1/+3
| | | | | | | Update the link to the current section in the documentaion wiki. This fixes https://github.com/openwrt/packages/issues/6282 Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
* OpenWrt v18.06.0-rc1: revert to branch defaultsJo-Philipp Wich2018-06-221-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* OpenWrt v18.06.0-rc1: adjust config defaultsv18.06.0-rc1Jo-Philipp Wich2018-06-221-2/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "LEDE v18.06.0-rc1: adjust config defaults"Jo-Philipp Wich2018-06-221-1/+1
| | | | | | | This reverts commit 97b1765a45499ecc56db44f79453d3c6040bb5e7. The tree is in an inconsistent state and we need to complete some rebranding. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "LEDE v18.06.0-rc1: revert to branch defaults"Jo-Philipp Wich2018-06-221-1/+1
| | | | | | | This reverts commit 55df39e684f8fde90c52212350062440dc6c9754. The tree is in an inconsistent state and we need to complete some rebranding. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* LEDE v18.06.0-rc1: revert to branch defaultsJo-Philipp Wich2018-06-221-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* LEDE v18.06.0-rc1: adjust config defaultsJo-Philipp Wich2018-06-221-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Revert "base-files: fix UCI config parsing and callback handling"Hans Dedecker2018-06-212-6/+9
| | | | | | | This reverts commit 023944853241920c20842c0f4649d1dd4e7e273b as users report Qos scripts are broken (FS#1602) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* base-files: sysupgrade: fix handling get_image unpack commandsMatthias Schiffer2018-06-111-6/+6
| | | | | | | | On bcm53xx and brcm47xx, commands are passed to default_do_upgrade that expect the image to be passed on stdin, rather than as an argument. Fixes: 30f61a34b4cf ("base-files: always use staged sysupgrade") Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: fix UCI config parsing and callback handlingTony Ambardar2018-06-062-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are several long-standing issues present in the UCI shell API as documented in https://wiki.openwrt.org/doc/devel/config-scripting. They relate both to high-level, user-defined callback functions used to process UCI config files, and also to low-level functions used within scripts generally. The related problems have been encountered now and in the past, e.g. https://forum.openwrt.org/viewtopic.php?id=54295, and include: a) UCI parsing option() function and user-defined option_cb() callbacks being erroneously called during processing of "list" config file entries; b) normal usage of the low-level config_set() unexpectedy calling any defined option_cb() if present; and c) handling of the list_cb() not respecting the NO_CALLBACK variable. Root causes include a function stack "inversion", where the low-level config_set() function incorrectly calls the high-level option() function, intended only for processing the "option" keyword of UCI config files. This change addresses the inversion and other issues, making the option handling code more consistent and smaller, and simplifying developers' usage of UCI callbacks. Signed-off-by: Tony Ambardar <itugrok@yahoo.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
* base-files: depend on openwrt-keyringJo-Philipp Wich2018-05-201-1/+1
| | | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 01329877bcb696dcbbda993a51992d468e1e3c74)
* OpenWrt v18.06: set branch defaultsJohn Crispin2018-05-151-1/+1
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* sysctl: Protect hard/symlinks by default.Rosen Penev2018-05-011-0/+3
| | | | | | | There is no usecase for not protecting symlinks that I know of in OpenWrt. Not even on desktop systems where you have multiple users with a shell. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* kernel: disable accept_ra by defaultMatthias Schiffer2018-04-172-1/+9
| | | | | | | | | | | Our commands setting accept_ra to 0 on all interfaces got lost in the transition to procd. This remained unnoticed for a long time, as we also enable forwarding on all interfaces, which prevents RA handling by default. Restore the commands, while also fixing a possible race condition in the old version. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: /lib/functions.sh: remove unused insert_modulesMatthias Schiffer2018-04-172-11/+1
| | | | | | insert_modules has been unused since r5279. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: remove /etc/sysctl.d/ from conffilesMatthias Schiffer2018-04-131-3/+1
| | | | | | | | Let's use /etc/sysctl.d for package-provided snippets and leave /etc/sysctl.conf to the admin. Don't backup /etc/sysctl.d on upgrades, so old defaults get replaced properly. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: move netfilter sysctl defaults to specific kmod packagesMatthias Schiffer2018-04-132-13/+1
| | | | | | | Avoid warnings when applying settings for uninstalled kmods. See also FS#1073. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>