aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* base-files: move sysctl defaults to /etc/sysctl.d/10-default.confMatthias Schiffer2018-04-133-32/+35
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: evaluate /etc/sysctl.d/* before /etc/sysctl.confMatthias Schiffer2018-04-132-2/+2
| | | | | | | We can use /etc/sysctl.d/* for package-supplied sysctl snippets, giving admins the option to use /etc/sysctl.conf to override settings. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: remove /etc/uci-defaults/11_migrate-sysctlMatthias Schiffer2018-04-131-16/+0
| | | | | | | 11_migrate-sysctl has not been updated with new file hashes since 2012. Let's get rid of it. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: change /var link from /tmp to tmpAlexander Couzens2018-04-051-1/+1
| | | | | | | | Some packages are already using $(1)/var on package install. On multiuser systems this breaks the build when multiple users build OpenWrt. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* base-files: get_dt_led: don't warn about missing ledMathias Kresin2018-04-041-2/+1
| | | | | | | | | It's intentional that some boards within a target don't have all LEDs which are tried to be setup in a common script. Don't show a warning in such cases. Fixes: 4f4fc993db4c ("base-files: add more name source to get_dt_led helper function") Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: add more name source to get_dt_led helper functionMathias Kresin2018-03-141-1/+4
| | | | | | | | Not all LED driver are using the label devicetree property for the led name. Add support for the TI/National Semiconductor LP55xx Led Drivers, which are using the chan-name property for the led name, as fallback. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: add function to get binary mac from fileMathias Kresin2018-03-141-6/+13
| | | | | | | Add a fucntion to get the a binary mac address from file. Use the new function for mtd_get_mac_binary() to limit duplicate code. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: tune fragment queue thresholds for available system memoryMatthias Schiffer2018-03-072-10/+21
| | | | | | | | | The default fragment low/high thresholds are 3 and 4 MB. On devices with only 32MB RAM, these settings may lead to OOM when many fragments that cannot be reassembled are received. Decrease fragment low/high thresholds to 384 and 512 kB on devices with less than 64 MB RAM. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: sysupgrade: do not rely on opkg to list changed conffilesMatthias Schiffer2018-03-072-2/+21
| | | | | | | Many packages use the opkg conffiles field to list configuration files that are to be retained on upgrades. Make this work on systems without opkg. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: fix off-by-one in counting seconds for factory resetRafał Miłecki2018-03-011-1/+1
| | | | | | | | | There was a mismatch between indicating factory reset and code actually starting it. After 5 seconds status LED started blinking rapidly letting user know it's ready to release reset button. In practice button had to stay pressed for another second in order to relly start the process. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* base-files: don't evaluate block-device ueventDaniel Golle2018-02-131-4/+8
| | | | | | | | | | | | | Current code and also before commit da52dd0c83 was vulnerable to shell injection using volume lables in the GPT partition table of block devices. Given that partition names can be freely defined in GPT tables we really shouldn't evaluate a string which is potentially crafted with evil intentions. Hence rather use `export -n` to absorb the uevent's variables into the environment. Fixes commit da52dd0c83 (base-files: quote values when evaluating uevent) Signed-off-by: Daniel Golle <daniel@makrotopia.org> [mschiffer@universe-factory.net: suggested export -n usage]
* base-files: quote values when evaluating ueventDaniel Golle2018-02-111-3/+2
| | | | | | | | When sourcing /sys/class/block/*/uevent values have to be quoted as they may contain spaces (e.g. in PARTNAME). Fix this by pre-processing with sed before sourcing. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* treewide: combine VERSION_SED and VERSION_SED_SCRIPTPhilip Prindeville2018-02-021-2/+2
| | | | | | | | | We don't need two versions of this. The escaping quotes is so that the sed commands aren't misinterpreted by shell; it has nothing to do with the contents of the file, thus one version is adequate. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
* base-files: gpio switch: check if direction can be setMathias Kresin2018-01-182-3/+10
| | | | | | | | | | | | Obviously not all GPIO controller allow to change the direction. The issue is around since the beginning of the script but only due to the recent changes error messages are more visible. Add a check if a change of the direction is supported by the GPIO controller and fallback to setting only the value if not. Fixes: FS#1271 Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: gpio switch: fix inverted logicMathias Kresin2018-01-181-1/+1
| | | | | | | | | GPIOs are exported as active high to the sysfs, hence the logic need to be inverted. Fixes: e66c47fb14f5 ("base-files: gpio switch: set output value with direction") Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: sysupgrade: correct command help textKevin Darbyshire-Bryant2018-01-122-2/+1
| | | | | | | | | | Commit 30f61a34b4cfd2c676fea4a919e089d6a77254e9 claimed to drop -d & -p options. In reality only -d was dropped. Update command help text to reflect that -d is no longer a supported option. Fixes FS#1187 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* linux-atm: add br2684ctl option to specify the netdev nameMartin Schiller2018-01-102-2/+5
| | | | | | | | | | | Add the uci option nameprefix to specifc a target netdev name. Patch the br2684ctl code to accept and set a netdev name via commandline parameters. It allows to use the same netdev name for ATM and PTM lines on lantiq xdsl hardware. Signed-off-by: Martin Schiller <ms@dev.tdt.de> Signed-off-by: Mathis Kresin <dev@kresin.me>
* base-files: gpio switch: set output value with directionMathias Kresin2018-01-092-4/+3
| | | | | | | | | | | | Use the "low" and "high" values to configure the GPIO as an output with that initial value. It ensures that the gpio doesn't have a unwanted value during the time the direction is set to ouput and the actual value is applied. We don't need to take care of the GPIO polarity for now, since our exported GPIOs are always active low. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: gpio_switch: start before boot state done is setMathias Kresin2018-01-091-1/+1
| | | | | | | Start gpio_switch before the boot state is set to up/initialised/done. This way the exported GPIOs are available at the time rc.local is started. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: protect stop and reload actions with procd_lockRoman Yeryomin2018-01-021-0/+2
| | | | | Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: Andrejs Hanins <ahanins@gmail.com>
* base-files: rc.common: fix enable() return code and logicRoman Yeryomin2018-01-021-7/+8
| | | | | | | | | | | | | | | In current state, if there is START but no STOP, enbale() will return 1 (failure), which is wrong. Moreover there is no need to check for START/STOP twice. Instead, add err variable to save success state and and return it's value. Also eliminate the need to disable() by using 'ln -sf', which will first delete the old symlink if one exists. Changes from v1: - fixed description Signed-off-by: Roman Yeryomin <roman@advem.lv>
* base-files: fix logic when to show failsafe bannerMatthias Schiffer2017-12-292-2/+2
| | | | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Fixes: 8170f280c4 ("base-files: set FAILSAFE in /etc/profile when /tmp/.failsafe exists")
* base-files: set FAILSAFE in /etc/profile when /tmp/.failsafe existsMatthias Schiffer2017-12-292-2/+5
| | | | | | | Since dropbear clears the environment, FAILSAFE was not set as intended in failsafe mode. This also broke sysupgrade from failsafe mode over SSH. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: fix sysupgrade -b/-l when -c is usedLuiz Angelo Daros de Luca2017-12-141-10/+11
| | | | | | | | | | | | | Since /overlay/upper appeared, -b ignored -c silently (cause it was still checking for /overlay/etc). Now, if /overlay/upper is absent, sysupgrade -c will fail and exit verbosely. Fix -l to consider -c (it never did). Clean up to always use /overlay/upper/xxx instead of still checking for /overlay/xxx. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
* base-files: unify get_dt_led helper functionChristian Lamparter2017-12-141-0/+12
| | | | | | | | | | | | | | Lantiq and IPQ806X (which includes IPQ40XX) both define the same custom function {ipq806x|lantiq}_get_dt_led. This patch moves the function into the base-file package at lib/functions/leds.sh to make it more accessible for other targets as well. Cc: Mathias Kresin <dev@kresin.me> Cc: John Crispin <john@phrozen.org> Cc: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* base-files: make including distfeeds.conf optionalJonas Gorski2017-12-131-3/+5
| | | | | | | | | | | To not clutter the system when building an opkg free image, generate the distfeeds.conf only if CLEAN_IPKG is unset. Since opkg is now a shared package, we can't rely on PACKAGE_opkg, but since opkg is not reasonably usable without the status information, we can tie the distfeeds.conf to it. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: create /etc/opkg before generating distfeeds.confJonas Gorski2017-12-131-0/+1
| | | | | | | | Ensure /etc/opkg exists before trying to write there. This fixes a build failure if SIGNED_PACKAGES is disabled. Reported-by: Matthias Schiffer <mschiffer@universe-factory.net> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* package: move distfeeds.conf from opkg to base-filesJonas Gorski2017-12-131-2/+10
| | | | | | | | | | | All the relevant options used for distfeeds.conf are part of base-files, so it makes more sense to move the file there as well. This has the added benefit that the we can share the opkg package again, reducing the amount of target specific packages. Acked-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: remove remaining uses of %N, and drop VERSION_NICK config symbolMatthias Schiffer2017-12-092-10/+3
| | | | | | Fixes d23e1e1e1a "merge: properly remove %n / %N references" Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* merge: properly remove %n / %N referencesJo-Philipp Wich2017-12-092-4/+1
| | | | | | | | | | - use %d instead of %n for opkg feed identifiers - remove %n / %N references from version files Fixes bf5cef47b3 merge: release/banner: drop release name and update banner. Fixes FS#1213. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* procd: nand: remove nand_board_name platform overrideMathias Kresin2017-12-081-9/+0
| | | | | | It isn't uses anymore by any target. Signed-off-by: Mathias Kresin <dev@kresin.me>
* procd: nand: dont rely on boardname in nand_upgrade_tarMathias Kresin2017-12-081-7/+9
| | | | | | | | | | | | | | | | Kernel and rootfs in a subdirectory matching the userspace boardname, was intended to use a single sysupgrade-tar archive for multiple boards with different kernel/rootfs images. This feature was never used. Use the first found directory in the tar archive instead of relying on a directory named according to the userspace boardname. It allows to change the boardname without adding another compatibility layer - using the nand_board_name() function - for (sub)targets using the metadata based image validation in favour to nand_do_platform_check(). Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: upgrade: make get_partitions() endian agnosticChristian Lamparter2017-12-081-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes two issues with the current get_partitions() function. First: "Invalid partition table on $disk" will pop up on legitimate images on big endian system. This is because the little-endian representation of "55 AA" is assumed in the context of little-endian architectures. On these comparing it to the 16-bit word 0xAA55 does work as intented. Whereas on big-endian systems, this would have to be 0x55AA. This patch fixes the issue by replacing the integer conversion and value match check with just a string comparision. Second: The extraction of the type, start LBA and LBA num from the partition table has the same endianness issue. This has been fixed by using the new hex_le32_to_cpu() function. This function will translate the stored little-endian data to the correct byte-order if necessary. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* merge: release/banner: drop release name and update bannerZoltan HERPAI2017-12-081-10/+8
| | | | Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
* merge: base: update base-files and basic configZoltan HERPAI2017-12-085-12/+12
| | | | Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
* sysupgrade: don't kill our own parentMat Trudel2017-11-151-2/+3
| | | | | | | | Add the parent of the sysupgrade script to the list of pids not getting killed Signed-off-by: Mat Trudel <mat@geeky.net> Signed-off-by: John Crispin <john@phrozen.org>
* procd: service_data: Support data within the service itselfPierre Lebleu2017-11-101-0/+4
| | | | | | Use the same approach than the service_triggers for the service_data. Signed-off-by: Pierre Lebleu <pme.lebleu@gmail.com>
* base-files: fix getting gid from group_add_nextYousong Zhou2017-11-092-8/+7
| | | | | | | | | | | | Shell function return code only has range [0, 255]. Other values will be truncated, e.g. return 65536 will have the same effect as return 0 While at it, drop other "return $rc" where rc will almost always take value 0 and whose value current callers actually do not check Fixes FS#988 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* functions.sh: fix default_postinst functionMarko Ratkaj2017-11-081-1/+1
| | | | | | | | | | | | | | | | | | When we run "opkg install" on a package that installs an uci-defaults script, functions.sh will fail to evaluate that script in its default_postinst function. This happens because there is no "./" present and it searches for the file in paths specified by the PATH variable. This would work on bash, but it will not work on ash and some other shells like sh, zsh. This applys to the ". filename" directive used in this case. This patch will make the path relative to the /etc/uci-defaults directory. Fixes: FS#1021 Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
* include: kernel.mk: simplify module autoloadingJo-Philipp Wich2017-11-071-0/+4
| | | | | | | | | | | | | | | | | | Let the generic postinstall script invoke "kmodloader" when the just installed package contains any /etc/module.d/ entries. This allows us to skip the explicit "insert_module()" calls in the package postinstall. Due to the removed insert_module calls we do not need to assemble a complete list of modules per package anymore, which allows for vast simplification of the package generation code. While we're at it, also support specifying default parameters for modules using either the MODPARAM or MODPARAM.modulename variables in KernelPackage. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: add interval option to netdev LED trigger configurationEdmunt Pienkowsky2017-11-032-1/+2
| | | | | | Add an uci option to set the interval parameter of the netdev trigger. Signed-off-by: Edmunt Pienkowsky <roed@onet.eu>
* base-files: create /etc/config/ directoryHauke Mehrtens2017-09-301-0/+1
| | | | | | | | | | | | | | | The /bin/config_generate script and some other scripts are assuming the /etc/config directory exists in the image. This is true in case for example the package firewall, dropbear or dnsmasq are included, which are adding the files under /etc/config/. Without any of these package the system will not boot up fully because the /etc/config/ directory is missing and some init scripts just fail. Make sure all images with the base-files contain a /etc/config/ directory. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: John Crispin <john@phrozen.org>
* base-files: fix wan6 interface config generation for pppoeHans Dedecker2017-09-182-6/+3
| | | | | | | | | | | | | | | | Setting ipv6 to auto in case of a pppoe interface will trigger the creation of a dynamic wan_6 interface meaning two IPv6 interfaces (wan6 and wan_6) will be active on top of the pppoe interface. This leads to unpredictable behavior in the network; therefore set ipv6 to 1 which will prevent the dynamic creation of the wan_6 interface. Further alias the wan6 interface on top of the wan interface for pppoe as the wan6 interface can only be started when the link local address is ready. In case of pppoe the link local address is negotiated during the Internet Protocol Control Protocol when the PPP link is setup meaning all the IP address info is only available when the wan interface is up. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* basefiles: allow suid coredumpsKevin Darbyshire-Bryant2017-09-122-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set sysctl fs.suid_dumpable = 2 This allows suid processes to dump core according to kernel.core_pattern setting. LEDE typically uses suid to drop root priviledge rather than gain it but without this setting any suid process would be unable to produce coredumps (e.g. dnsmasq) Processes still need to set a non zero core file process limit ('ulimit -c unlimited' or if procd used 'procd_set_param limits core="unlimited"') in order to produce a core. This setting removes an obscure stumbling block along the way. >From https://www.kernel.org/doc/Documentation/sysctl/fs.txt suid_dumpable: This value can be used to query and set the core dump mode for setuid or otherwise protected/tainted binaries. The modes are 0 - (default) - traditional behaviour. Any process which has changed privilege levels or is execute only will not be dumped. 1 - (debug) - all processes dump core when possible. The core dump is owned by the current user and no security is applied. This is intended for system debugging situations only. Ptrace is unchecked. This is insecure as it allows regular users to examine the memory contents of privileged processes. 2 - (suidsafe) - any binary which normally would not be dumped is dumped anyway, but only if the "core_pattern" kernel sysctl is set to either a pipe handler or a fully qualified path. (For more details on this limitation, see CVE-2006-2451.) This mode is appropriate when administrators are attempting to debug problems in a normal environment, and either have a core dump pipe handler that knows to treat privileged core dumps with care, or specific directory defined for catching core dumps. If a core dump happens without a pipe handler or fully qualifid path, a message will be emitted to syslog warning about the lack of a correct setting. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [PKG_RELEASE increase]
* base-files: add /etc/profile.d to conffilesStijn Tintel2017-09-031-0/+1
| | | | Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* base-files: order conffiles alphabeticallyStijn Tintel2017-09-031-10/+10
| | | | Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* base-files: drop unused preinit_echo functionRafał Miłecki2017-08-091-5/+0
| | | | | | It isn't used for years since the old 99_10_run_init has been dropped. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>