aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
Commit message (Collapse)AuthorAgeFilesLines
...
* base-files: network.sh: properly report local IPv6 addressesJo-Philipp Wich2017-06-082-18/+14
| | | | | | | | | | Rework the network_get_ipaddr6() and network_get_ipaddrs6() functions to fetch the effective local IPv6 address of delegated prefix from the "local-address" field instead of naively hardcoding ":1" as static suffix. Fixes FS#829. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* mvebu: fix sysupgradeMatthias Schiffer2017-06-011-1/+1
| | | | | | | | | | | | | | | | | mvebu was modifying RAMFS_COPY_BIN and RAMFS_COPY_DATA from a sysupgrade_pre_upgrade hook. As the ramfs is created from stage2, this did not have an effect anymore after the staged sysupgrade changes. As it doesn't really hurt to copy fw_printenv and fw_setenv unconditionally, simply add them in /lib/upgrade/platform.sh, so stage2 will see them. Config copying is moved to a function called by platform_copy_config, where it belongs. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Fixes: FS#821 Fixes: 30f61a34b4cf "base-files: always use staged sysupgrade"
* base-files: nand: use CI_KERNPART whenever the kernel volume is neededChristian Lamparter2017-05-311-4/+4
| | | | | | | | | | | | | | | | | | The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. This patch is in continuation of: commit 93aa86040523 "procd: nand: make it possible to configure kernel and ubi partition" The $CI_KERNPART variable should be used in place of the fixed "kernel" partition name. This allows targets to specifiy alternate names for the kernel partition. Cc: Chris Blake <chrisrblake93@gmail.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
* base-files: add support for staged sysupgrades from failsafe modeMatthias Schiffer2017-05-293-10/+25
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: sysupgrade cleanupMatthias Schiffer2017-05-293-105/+102
| | | | | | | | | | | | Some functions only used by stage2 are moved there from common.sh. One piece that could still use more cleanup is platform_pre_upgrade: many targets reference files from there are aren't available in the ramfs, so we need to evaluate it before the switch; conversely, flash writes happen in that function on some targets. Targets that do the latter should be fixed eventually to use platform_do_upgrade for that purpose. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: always use staged sysupgradeMatthias Schiffer2017-05-294-148/+162
| | | | | | | | | | | Support for the -d and -p options is dropped; it may be added again at some point by adding these flags to the ubus sysupgrade call. A downside of this is that we get a lot less information about the progress of the upgrade: as soon as the actual upgrade starts, all shell sessions are killed to allow unmounting the root filesystem. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* procd: remove procd-nand packageMatthias Schiffer2017-05-292-2/+387
| | | | | | | | | | | We always want to support staged upgrades now, so it's better to include upgraded into the main package. /lib/upgrade/nand.sh is moved to base-files. The procd-nand-firstboot package is removed for now, it may return later as a separate package. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* Revert "sysupgrade: run only one instance at a time."Jo-Philipp Wich2017-05-261-14/+0
| | | | | | | | | | | | | This reverts commit e96a9a9af82c00dcce606a84a7bb87a00411385d. The change breaks sysupgrade through LuCI and two-stage sysupgrade on NAND targets. There is also a mismatch of file paths in lock and unlock operations. This commit was apparently neither properly tested, nor reviewed, so drop it for now. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* sysupgrade: run only one instance at a time.Kenneth Johansson2017-05-251-0/+14
| | | | | | | Things do not work well if running multiple instances of upgrade at the same time. Signed-off-by: Kenneth Johansson <kenneth.johansson@inteno.se>
* base-files: fix default procd reloadAlexandru Ardelean2017-05-201-1/+1
| | | | | | | | | | | | | | | | | | Bug introduced with 6713694. I did not count on procd handling reload as mentioned in this doc: https://wiki.openwrt.org/inbox/procd-init-scripts ``` procd_set_param file /var/etc/your_service.conf # /etc/init.d/your_service reload will restart the daemon if these files have changed procd_set_param netdev dev # likewise, except if dev's ifindex changes. procd_set_param data name=value ... # likewise, except if this data changes. ``` The service would be restarted regardless of any of those params. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* base-files: add led functions to uci-defaults.shAlberto Bursi2017-05-141-0/+8
| | | | | | | | | | | | | uci_set_leds_ataport() allows to set a led to show activity on a specific (s)ata port, which is needed for devices that have a Sata led for each sata port. The led trigger is from the 834-ledtrig-libata.patch LEDE kernel patch. uci_set_leds_usbhost() allows to set a led to show total usb activity. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it> [Jo-Philipp Wich: use a single underscore to denote private functions] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: cleanup led functions in uci-defaults.shAlberto Bursi2017-05-141-145/+91
| | | | | | | | | | create a function with code common to all led functions, create another function with code common to functions setting a simple led trigger, restore alphabetical order in function names. Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it> [Jo-Philipp Wich: use a single underscore to denote private functions] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: implement ucidef_set_hostname(), ucidef_set_ntpserver()Jo-Philipp Wich2017-05-031-0/+20
| | | | | | | | | | | | | | Commit 2036ae4 (base-files: support hostname and ntp servers through board.d) was supposed to implement these procedures but lacked the required changes to uci-defaults.sh. Add the missing procedures now to fix config generation on targets relying on hostname or NTP server presetting. Fixes FS#754. Reported-by: Cristian Morales Vega <cristian@samknows.com> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: use restart if no reload hook for serviceAlexandru Ardelean2017-04-121-4/+3
| | | | | | | | | | | | | | | | | | | | | | | This was also working before, with a slightly different semantic. [ Original semantic ] If no reload hooks was implemented, the default one would kick in, it would return fail, and restart would happen. This would happen also in the case where a reload hook would be implemented, it would fail, and it would restart the service. [ New semantic ] The default reload hook calls restart. Services can implement their own reload. If reload fails, then the '/etc/init.d/<service> reload' would return a non-zero code, and the caller can choose a way to handle this. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* base-files: add generic board_name function to functions.shFelix Fietkau2017-03-221-0/+4
| | | | | | | This will be used to replace all those nasty board specific scripts that do basically the same thing Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add devel option to store build config in firmwareVitaly Chekryzhev2017-03-181-0/+4
| | | | | | Store config.seed in firmware /etc/build.config Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
* base-files: always set proto passed to _ucidef_set_interface()Mathias Kresin2017-03-111-1/+1
| | | | | | | | | | | | | | | Overwrite an already set proto if a new one is passed to _ucidef_set_interface() similar to what is done for the interface. It is required when using ""ucidef_set_interface_wan 'ptm0' 'pppoe'" after some initial wan interface configuration is already done by ucidef_add_switch. The "json_is_a protocol string" guard is meant to not reset an earlier set interface proto in case something like "ucidef_set_interface_lan 'eth0'" is used afterwards. Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: add submission service portLucian Cristian2017-03-111-0/+2
| | | | | | prevent postfix start failure fatal: 0.0.0.0:submission: Unrecognized service Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
* build: add buildbot specific config option for setting defaultsFelix Fietkau2017-02-141-1/+1
| | | | | | | | | | This can be used to tweak the buildbot behavior without having to change buildbot's configuration. It will also allow us to add more aggressive clean steps (e.g. on toolchain changes), which would break developers' workflows if enable by default. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: Added a deprecation notice on wifi detectDavid Pinilla Caparrós2017-02-131-1/+7
| | | | | | | | When running wifi detect, the user will be told on error output that wifi detect is deprecated, that wifi config must be used instead. Also the commit that changes it is referenced for further info. Signed-off-by: David Pinilla Caparrós <dpinitux@gmail.com>
* base-files: Add wifi config to wifi command usageDavid Pinilla Caparrós2017-02-131-2/+2
| | | | | | | | | | Since commit 5f8f8a366136a07df661e31decce2458357c167a wifi detect does not longer work and wifi config it's used to configure not yet configured wireless devices. This commit changes command usage to reflect that change. Signed-off-by: David Pinilla Caparrós <dpinitux@gmail.com>
* base-files: emit tagged switch configuration by defaultJo-Philipp Wich2017-02-021-1/+1
| | | | | | | | | | | | | | | | | | | Instead of only using tagged CPU port configurations when more than one VLAN is present on the switch, always emit tagged configurations unless a board explicitely opts out of this behaviour by using the previously introduced [0-9]u@netdev syntax. Emitting default tagged configurations has the following benefits: - Relation of switch vlans to netdevs is easier to understand, especially for multi-cpu-port switches - Adding additional VLANs (e.g. to break out a LAN port for other purposes) becomes easier as users are not forced to change the existing untagged VLAN to tagged and the existing ifname notation from ethX to ethX.Y anymore, drastly reducing the likelyhood of soft-bricks. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: don't overwrite model name set by targetMathias Kresin2017-01-301-1/+1
| | | | | | | | | | | The condition is always true due to the literal string followed the -n test parameter. A model name set by target scripts always gets overwritten this way. Change the condition to check for an already existing destination file as it was before 5e85ae9 ("base-files: fix error message during boot"). Signed-off-by: Mathias Kresin <dev@kresin.me>
* base-files: uppercase default hostname: LEDEYousong Zhou2017-01-261-1/+1
| | | | | | | The name will appear in shell prompt and LuCI page title. Uppercase letters seem to be more vigorous Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* base-files: fix user creation on sysupgrade with few opkg control filesMatthias Schiffer2017-01-241-1/+1
| | | | | | | | | | | If only a single opkg control file exists (which can happen with CONFIG_CLEAN_IPKG), grep would not print the file name by default. Instead of forcing it using -H, we just switch to -l (print only file names) and get rid of the cut. Add -s to suppress an error message when no control files exist. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: add /etc/iproute2/rt_protosHans Dedecker2017-01-182-1/+20
| | | | Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* base-files: add ARCH_PACKAGES to openwrt_release and os-releaseMatthias Schiffer2017-01-162-0/+2
| | | | | | | | | Knowing the package architecture at runtime can be useful, e.g. to configure opkg repository URLs. The value of ARCH_PACKAGES ("%A" in VERSION_SED) as added to openwrt_release (as DISTRIB_ARCH) and os-release (as LEDE_ARCH). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* opkg: drop S/MIME supportFelix Fietkau2017-01-101-39/+0
| | | | | | | | | | It has never been used by default (due to being too bloated), and it is properly replaced by usign (which has been the default for a long time now). Remove this feature to simplify the build system Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: save /bin/mknod for sysupgradeFelix Fietkau2017-01-061-1/+2
| | | | | | It is used on NAND devices in case hotplug is too slow Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: export x86 platform upgrade functions to common.shYousong Zhou2017-01-051-0/+90
| | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* build: use mkhash to replace various quirky md5sum/openssl callsFelix Fietkau2017-01-051-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: fix message of initscript wrapperAlberto Bursi2017-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | currently (after blogic's edit to my commit) it prints like this: root@lede:/# service aa aa does not exist. the following services are available :adblock dnsmasq gpio_switch rpcd system boot done led sqm uhttpd crelay dropbear log sysctl umount cron firewall network sysfixtime urandom_seed ddns fstab odhcpd sysntpd which looks pretty bad, and is even worse if someone writes only "service" without arguments, as it will print " does not exist. " which is confusing. with this commit it looks like this: root@lede:/# service service "" not found, the following services are available: adblock dnsmasq gpio_switch rpcd system boot done led sqm uhttpd crelay dropbear log sysctl umount cron firewall network sysfixtime urandom_seed ddns fstab odhcpd sysntpd Yes there is some play with " and ', it is to display "name" or just "" if no service name is entered (like in the example). Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
* base-files: add support for overlaying rootfs contentRafał Miłecki2016-12-201-0/+5
| | | | | | | | | This adds support for install-overlay define. When used in package it allows installing files to a special directory that gets copied to the root when installing it. It allows overwriting files provided by other packages. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* base-files: fix CONFIG_VERSION_DIST defaultJo-Philipp Wich2016-12-141-1/+1
| | | | | | Fix the default value of CONFIG_VERSION_DIST to use uppercase "LEDE". Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: use SNAPSHOT instead of CURRENT to designate untagged branch buildsJo-Philipp Wich2016-12-141-4/+4
| | | | | | | Calling a build ##.##-CURRENT might mislead users into thinking that this build is the most current release of a branch. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: Changed UCI variable name for GPIO value from 'default' to 'value'Julian Labus2016-12-121-1/+1
| | | | | | | | | | | This changes the UCI variable for the GPIO value from system.$cfg.default back to system.$cfg.value as it was before the change from uci-defaults [1] to board.d. /etc/init.d/gpio_switch [2] still expects the value to be in system.$cfg.value. [1] https://github.com/lede-project/source/blob/d65916047b44d6d157d88d15e8e3d92555c5e6f8/package/base-files/files/lib/functions/uci-defaults.sh#L197 [2] https://github.com/lede-project/source/blob/master/package/base-files/files/etc/init.d/gpio_switch#L17 Signed-off-by: Julian Labus <julian@labus-online.de>
* build: support adding version code to file names (FS#323)Jo-Philipp Wich2016-12-091-0/+9
| | | | | | | | | | | | | | Now that the VERSION_NUMBER variable holds the human friendly name and not the commit ID anymore, we need to support adding the revision ID as well. Introduce a new config variable CONFIG_VERSION_CODE_FILENAMES which, if set, causes the resulting file names to contain a commit ID designation as printed by scripts/getver.sh. Also sanitize the input variables to ensure that the resulting strings are lowercased and no not contain spaces. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: add a hint in sysupgrade that shows what to do when the image ↵Felix Fietkau2016-12-041-0/+3
| | | | | | metadata check fails Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: adjust version number handlingJo-Philipp Wich2016-12-025-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the revision info to the VERSION_CODE variable and default VERSION_NUMBER to CURRENT for master branch builds. Also introduce a new menuconfig option CONFIG_VERSION_CODE which allows users to override the revision value put into VERSION_CODE and adjust the template files used by the base-files package to accomodate for the changed semantics. While we're at it, also adjust the various URLs to match the current web site. After this commit, the relevent files will look like the examples given below: # cat /etc/openwrt_version r2398+1 # cat /etc/openwrt_release DISTRIB_ID='LEDE' DISTRIB_RELEASE='CURRENT' DISTRIB_REVISION='r2398+1' DISTRIB_CODENAME='reboot' DISTRIB_TARGET='x86/64' DISTRIB_DESCRIPTION='LEDE Reboot CURRENT r2398+1' DISTRIB_TAINTS='no-all override' # cat /usr/lib/os-release NAME="LEDE" VERSION="CURRENT, Reboot" ID="lede" ID_LIKE="lede openwrt" PRETTY_NAME="LEDE Reboot CURRENT" VERSION_ID="current" HOME_URL="http://lede-project.org/" BUG_URL="http://bugs.lede-project.org/" SUPPORT_URL="http://forum.lede-project.org/" BUILD_ID="r2398+1" LEDE_BOARD="x86/64" LEDE_TAINTS="no-all override" LEDE_DEVICE_MANUFACTURER="LEDE" LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/" LEDE_DEVICE_PRODUCT="Generic" LEDE_DEVICE_REVISION="v0" LEDE_RELEASE="LEDE Reboot CURRENT r2398+1" On a release branch, those files would look like: # cat /etc/openwrt_version r2399 # cat /etc/openwrt_release DISTRIB_ID='LEDE' DISTRIB_RELEASE='16.12-CURRENT' DISTRIB_REVISION='r2399' DISTRIB_CODENAME='test_release' DISTRIB_TARGET='x86/64' DISTRIB_DESCRIPTION='LEDE Test Release 16.12-CURRENT r2399' DISTRIB_TAINTS='no-all override' # cat /usr/lib/os-release NAME="LEDE" VERSION="16.12-CURRENT, Test Release" ID="lede" ID_LIKE="lede openwrt" PRETTY_NAME="LEDE Test Release 16.12-CURRENT" VERSION_ID="16.12-current" HOME_URL="http://lede-project.org/" BUG_URL="http://bugs.lede-project.org/" SUPPORT_URL="http://forum.lede-project.org/" BUILD_ID="r2399" LEDE_BOARD="x86/64" LEDE_TAINTS="no-all override" LEDE_DEVICE_MANUFACTURER="LEDE" LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/" LEDE_DEVICE_PRODUCT="Generic" LEDE_DEVICE_REVISION="v0" LEDE_RELEASE="LEDE Test Release 16.12-CURRENT r2399" On a release tag, those files would look like: # cat /etc/openwrt_version r2500 # cat /etc/openwrt_release DISTRIB_ID='LEDE' DISTRIB_RELEASE='17.02.1' DISTRIB_REVISION='r2500' DISTRIB_CODENAME='mighty_unicorn' DISTRIB_TARGET='x86/64' DISTRIB_DESCRIPTION='LEDE Mighty Unicorn 17.02.1 r2500' DISTRIB_TAINTS='no-all override' # cat /usr/lib/os-release NAME="LEDE" VERSION="17.02.1, Mighty Unicorn" ID="lede" ID_LIKE="lede openwrt" PRETTY_NAME="LEDE Mighty Unicorn 17.02.1" VERSION_ID="17.02.1" HOME_URL="http://lede-project.org/" BUG_URL="http://bugs.lede-project.org/" SUPPORT_URL="http://forum.lede-project.org/" BUILD_ID="r2500" LEDE_BOARD="x86/64" LEDE_TAINTS="no-all override" LEDE_DEVICE_MANUFACTURER="LEDE" LEDE_DEVICE_MANUFACTURER_URL="http://lede-project.org/" LEDE_DEVICE_PRODUCT="Generic" LEDE_DEVICE_REVISION="v0" LEDE_RELEASE="LEDE Mighty Unicorn 17.02.1 r2500" Signed-off-by: Jo-Philipp Wich <jo@mein.io> Acked-by: Felix Fietkau <nbd@nbd.name>
* base-files: add a wrapper for init scripts in profileAlberto Bursi2016-11-291-0/+9
| | | | | | | | | | | "service" is a simple wrapper that will allow to call init.d scripts current method: # /etc/init.d/network reload with the wrapper: # service network reload If the wrapper is called without arguments or with a wrong init script name, it will print an error and list the content of /etc/init.d/ folder Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
* base-files: ignore failure of stopping services on removalJonas Gorski2016-11-211-1/+1
| | | | | | | | | Packages that do a killall <cmd> with the same name as the init script will fail the prerm step when the service isn't running. Do make them removable without having to restart the service, ignore the return code. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Jo-Philipp Wich <jo@mein.io>
* base-files: don't modify enabled state of service on upgradeJonas Gorski2016-11-212-11/+13
| | | | | | | | Properly stop/start services on upgrade, but don't change the enabled state. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Jo-Philipp Wich <jo@mein.io>
* base-files: validate metadata of sysupgrade imagesFelix Fietkau2016-11-193-2/+43
| | | | | | | | | | | Use fwtool to extract it, only require metadata to be present if the platform sysupgrade script sets REQUIRE_IMAGE_METADATA=1 Image metadata is in JSON format and contains a list of supported devices, along with version information that could be displayed by a UI later before the actual upgrade happens. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: Prefer busybox arp over /proc/net/arp aliasMarek Lindner2016-11-101-1/+1
| | | | | | | | | A firmware compiled with BUSYBOX_CONFIG_ARP should also use by default the arp binary from busybox. Otherwise the extra functionality the user requested can only be used when running arp with the path to the binary. Signed-off-by: Marek Lindner <marek.lindner@open-mesh.com> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
* base-files, mac80211, broadcom-wl: wifi detection and configurationChristian Lamparter2016-11-032-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the wifi detection script is executed as part of the (early) boot process. Pluggable wifi USB devices, which are inserted at a later time are not automatically detected and therefore they don't show up in LuCI. A user has to deal with wifi detection manually, or restart the router. However, the current "sleep 1" window - which the boot process waits for wifi devices to "settle down" - is too short to detect wifi devices for some routers anyway. For example, this can happen with USB WLAN devices on the WNDR4700. This is because the usb controller needs to load its firmware from UBI and initialize, before it can operate. The issue can be seen on a BT HomeHub 5A as well as soon as the caldata are on an ubi volume. This is because the ath9k card has to be initialized by owl-loader first. Which has to wait for the firmware extraction script to retrieve the pci initialization values inside the caldata. This patch moves the wifi configuration to hotplug scripts. For mac80211, the wifi configuration will now automatically run any time a "ieee80211" device is added. Likewise broadcom-wl's script checks for new "net" devices which have the "wl$NUMBER" moniker. Issues with spawning multiple interface configuration - in case the detection script is run concurrently - have been resolved by using a named section for the initial configuration. Concurrent configuration scripts will now simply overwrite the same existing configuration. A workaround which preserves the "sleep 1" window for just the first boot has been added. This allows the existing brcm47xx boot and mvebu uci-default scripts to correctly setup the initial mac addresses and regulatory domain. And finally, the patch renames the "wifi detect" into "wifi config". As the script no longer produces any output that has to be redirected or appended to the configuration file. Thanks to Martin Blumenstingl for helping with the implementation and testing of the patch. Acked-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Mathias Kresin <dev@kresin.me> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files, mac80211, broadcom-wl: use uci to populate wireless configChristian Lamparter2016-11-031-5/+1
| | | | | | | | | | | | | | | | | | | | Previously, wifi detect simply dumped its generated wireless configuration to STDOUT. A second step was needed to append the configuration to /etc/config/wireless (or create it, if it didn't exist). With this patch, The wifi detection script will now use uci to update the wireless configuration directly. This patch also makes the initially created wifi-iface a named section ('default_radio$X' for mac80211 and 'default_wl$X' for broadcom). With this change, uci will not print the cfgHASH to STDOUT (which would now corrupt the wireless configuration). It will also prevent adding duplicated wifi interface configurations, if the wifi configuration is run concurrently. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* base-files: generate /etc/config/wireless, if it doesn't existMathias Kresin2016-11-031-0/+2
| | | | | | | | | | | | This patch adds a check in "wifi detect" to test if the wireless configuration file does exist. If it doesn't exist, an empty /etc/config/wireless file will be created. This is necessary because uci doesn't create new files, instead the tool just exits with "uci: Entry not found". Signed-off-by: Mathias Kresin <dev@kresin.me> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* base-files: uci-defaults: support requesting untagged switch port configurationJo-Philipp Wich2016-11-021-8/+14
| | | | | | | | | | | | | Introduce support for a new [0-9]u@netdev syntax to ucidev_add_switch() to let board.d network files request default network switch configurations which do not use tagged CPU ports. This commit itself has no effect on generated configurations at the moment since we still emit untagged configurations by default but it allows boards to opt-out from default tagged configs in case we start emitting tagged settings by default. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: sysfixtime: Keep RTC time in UTC timezonePetr Štetiar2016-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to tell hwclock with -u commandline option, that we would like to keep our RTC clock in UTC timezone. Linux kernel expects RTC in UTC timezone anyway. In current state of things, we don't tell hwclock to load/store time from/to RTC in UTC timezone so it uses the timezone from the system time. If it's set to different timezone then UTC, sysfixtime is going to screw the time in RTC. I've following in the setup script: uci set system.@system[0].timezone='CET-1CEST,M3.5.0,M10.5.0/3' uci set system.@system[0].zonename='Europe/Prague' I've this RTC setup (rtc1 is RTC on i.MX6 SoC, rtc0 is battery backed RTC mcp7941x): rtc-ds1307 3-006f: rtc core: registered mcp7941x as rtc0 snvs_rtc 20cc000.snvs:snvs-rtc-lp: rtc core: registered 20cc000.snvs:snvs-r as rtc1 Then we can experience following (current time is 10:15am): $ date Fri Oct 21 10:15:07 CEST 2016 $ hwclock -r -f /dev/rtc0 Fri Oct 21 08:14:46 2016 0.000000 seconds $ hwclock -u -r -f /dev/rtc0 Fri Oct 21 10:14:46 2016 0.000000 seconds And after current broken sysfixtime: $ /etc/init.d/sysfixtime stop $ date Fri Oct 21 10:15:25 CEST 2016 $ hwclock -r -f /dev/rtc0 Fri Oct 21 10:15:31 2016 0.000000 seconds Now we've time in our battery backed RTC in CEST timezone instead of UTC. Then once again, but with this patch applied to sysfixtime, where hwclock is using correctly the -u parameter: $ /etc/init.d/sysfixtime stop $ date Fri Oct 21 10:15:53 CEST 2016 $ hwclock -r -f /dev/rtc0 Fri Oct 21 08:15:55 2016 0.000000 seconds Signed-off-by: Petr Štetiar <ynezz@true.cz> Acked-by: Jo-Philipp Wich <jo@mein.io>
* base-files: Ensure reset only works if an overlay existsChris Blake2016-10-271-1/+5
| | | | | | | | | | | | | | Currently the reset script will try to run jffs2reset on boards that are running a rw rootfs, such as ext4. This will cause jffs2reset to fail and the board to never reboot while the LED blinks until a manual reboot. This commit does two different things: 1. Disables reset on boards that do not have an overlay mount 2. Disables the Blinking LED after 5 seconds if the board does not support reset Signed-off-by: Chris Blake <chrisrblake93@gmail.com>