Commit Graph

1360 Commits (4a6795409d1520fd3da3e909a8bcf9d7fd0927bb)

Author SHA1 Message Date
Jo-Philipp Wich a4232cd4bf build: use SNAPSHOT instead of CURRENT to designate untagged branch builds
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>
8 years ago
Julian Labus b0ac825884 base-files: Changed UCI variable name for GPIO value from 'default' to 'value'
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] d65916047b/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>
8 years ago
Jo-Philipp Wich 9791fb2ac2 build: support adding version code to file names (FS#323)
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>
8 years ago
Felix Fietkau 81b5e8e5d2 base-files: add a hint in sysupgrade that shows what to do when the image metadata check fails
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich 5f3c96c285 build: adjust version number handling
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>
8 years ago
Alberto Bursi d52676d1ea base-files: add a wrapper for init scripts in profile
"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>
8 years ago
Jonas Gorski 48cfc826eb base-files: ignore failure of stopping services on removal
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>
8 years ago
Jonas Gorski afaa34ccd7 base-files: don't modify enabled state of service on upgrade
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>
8 years ago
Felix Fietkau cc853810a4 base-files: validate metadata of sysupgrade images
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>
8 years ago
Marek Lindner 9978a3e2ca base-files: Prefer busybox arp over /proc/net/arp alias
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>
8 years ago
Christian Lamparter 5f8f8a3661 base-files, mac80211, broadcom-wl: wifi detection and configuration
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>
8 years ago
Christian Lamparter 5e35b4562f base-files, mac80211, broadcom-wl: use uci to populate wireless config
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>
8 years ago
Mathias Kresin ba3540db62 base-files: generate /etc/config/wireless, if it doesn't exist
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>
8 years ago
Jo-Philipp Wich 5e0441aaf0 base-files: uci-defaults: support requesting untagged switch port configuration
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>
8 years ago
Petr Štetiar 9e8e8b7253 base-files: sysfixtime: Keep RTC time in UTC timezone
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>
8 years ago
Chris Blake b745bfa6dc base-files: Ensure reset only works if an overlay exists
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>
8 years ago
André Valentin 783875f18b package/basefiles: add mkfs.ext4 and losetup binaries to ramfs list
mkfs.ext4 und losetup are needed for sysupgrade support on mmc devices
with automatic rootfs split (loopback device usage).

Signed-off-by: André Valentin <avalentin@marcant.net>
8 years ago
Rafał Miłecki 2187f57db6 base-files: add ucidef_set_led_usbport for full usbport support
This helper allows using usbport trigger directly. It requires usbport
compatible syntax and supports specifying multiple USB ports, e.g.:
ucidef_set_led_usbport "usb" "USB" "devicename:colour:function" "usb1-port1" "usb2-port1"

This adds a proper object to the board.json, e.g.
"usb": {
	"name": "USB",
	"type": "usbport",
	"sysfs": "devicename:colour:function",
	"ports": [
		"usb1-port1",
		"usb2-port1"
	]
}
and supports translating it into uci section.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Rafał Miłecki 0658527e1e switch to the new usbport LED trigger
This makes init.d script handle existing UCI entries using the new
trigger. It also switches all targets to use its package.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8 years ago
Pierre Lebleu 6bb11d52f3 procd: Allow initscripts to start one daemon instance at a time
Signed-off-by: Pierre Lebleu <pierre.lebleu@technicolor.com>
8 years ago
Koen Vandeputte 0f27096100 base-files: also generate configs when current is empty (FS#193)
Before a configuration is generated, an empty file is created to store
it in. (required by UCI)

If something happens during config generation
(power cut, interruption, ..) an empty file exists and it is never
regenerated again, causing some daemons to fail starting
(NTPD, logread, ..)

Fix this by also generating new configs if a critical file
is empty.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
8 years ago
Christian Lamparter 5a8a986dd5 base-files: remove non-working filter option for wifi detect
This patch removes the non-working wifi driver filter for
the wifi detection script.

I figured that rather than replacing ${2:-$DRIVERS} with
${1:-$DRIVERS}, it would be better to remove it. Nobody
needed it in the previous years.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
8 years ago
Matthias Schiffer 26b4216f95
base-files: make default_prerm work offline
IPKG_INSTROOT must be respected for offline removal (used for per-device
rootfs).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Matthias Schiffer 6c1542787d
base-files: fix check for empty password warning
Now that we know that the password is in /etc/shadow and not in
/etc/passwd, we can properly fix the logic for the empty password check.
Only 'root::' is an empty password, 'root' and 'root:!:' allow no
password login at all.

This fixes the empty password warning still showing after the root password
has been locked using 'passwd -l root' (e.g. to allow public-key auth
only).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
8 years ago
Jo-Philipp Wich 1c09849f6c treewide: remove bad local shell variable declarations
Local variable declarations outside of functions are illegal since the Busybox
update to v1.25.0, therfore remove them from the appropriate places.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Florian Fainelli ef64c8694b base-files: Allow subtargets to define base-files.mk
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
8 years ago
John Crispin 63bd73a5cf base-files: remind users to set root password
print a warning when a shell spawns, telling users to set a root password.

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Felix Fietkau 25dab5d217 base-files: reduce vm.min_free_kbytes for devices with 32M RAM
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Karl Palsson ad8d197b82 base-files: support oneshot leds properly.
oneshot trigger configurations for LEDs are created, but the on/off
timing configurations are ignored.  generate_config is correctly creating
oneshot configs, but the later led script doesn't recognise the trigger
details.

Fixes: c0c3f2d4c9 leds: support oneshot as well as timer triggers
Signed-off-by: Karl Palsson <karlp@etactica.com>
8 years ago
Jonas Gorski 30352e72ff base-files: set pi_ifname in board.d case to fix deconfig
Due to an empty pi_ifname in the generic failsafe setup, the deconfig
never removed the failsafe networking interface, causing broken
networking later on.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 6c9588ddf5 base-files: configure switch in failsafe
Also configure the switch based on the failsafe config, and create the
failsafe interface as tagged if necessary.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 072cf26729 base-files: allow failsafe to configure vlans
In preparation of properly setting up vlans and switches, add
support for configuring failsafe on a vlan tagged interface.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski c18edcec45 base-files: add preinit ifname detection based on board.json
Make use of the existing board.d to autodetect lan ifname in a generic way.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 0f1ae840c9 base-files: split out preinit interface config
Move preinit interface and ip config to its own function to allow
calling it from more than one place.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 780ccbf9f1 base-files: board_detect: allow specifying the generated file
Allow passing a filename to change the location of the generated
board.json.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski e934a129f0 base-files: let config_generate call board_detect
Instead of board_detect generating the config as a side effect, let
config_generate call board_detect as needed.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Mathias Kresin 5fadd4397b preinit: use only the image config options
The pi_* variables and the fs_failsafe_wait_timeout variable are set by
the CONFIG_TARGET_PREINIT_* config options. No need to maintain the same
values twice.

All other fs_ variables were never used.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Felix Fietkau 577f873daf kernel: remove unused morse led trigger driver
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Mathias Kresin 3004298e62 sysupgrade: unmount filesystems before reboot
sysupgrade immediately reboots after flashing an image and doesn't
allow to unmount filesystems. At least in case the image used for
sysupgrade is stored on a FAT formatted usb flash drive, the following
warning is printed during the next mount of the flash drive:

FAT-fs (sda1): Volume was not properly unmounted. Some data may be
corrupt. Please run fsck.

Although a data corruption during read operations is unlikely, there is
no need to scare the users.

Signed-off-by: Mathias Kresin <dev@kresin.me>
8 years ago
Daniel Golle 877168993a base-files: remove dead code
/etc/init.d/boot tried to create /dev/root based on the kernel's
cmdline which won't work on any recent targets. Remove that code now
that fstools can detect the mounted rootfs based on
/proc/self/mountinfo and /dev/root was long gone anyway.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Felix Fietkau 5c9cc7b7f8 base-files: increase vm.min_free_kbytes
Network drivers typically allocate memory in atomic context. For that to
be reliable, there needs to be enough free memory. Set the value
heuristically based on the total amount of system RAM.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Conn O'Griofa e1406cd31a base-files: sysupgrade: fix pseudobridge upgrades
Treat 'relayd' as an essential service to avoid connection interruptions during sysupgrade on devices configured as a pseudobridge.

Signed-off-by: Conn O'Griofa <connogriofa@gmail.com>
8 years ago
Etienne CHAMPETIER 35e423ca41 base-files: use procd init for urandom_seed
Previous implementation was blocking the init and
breaking halt/reboot/sysupgrade (reported by Daniel Golle)

v2: use procd logging, use set -e + trap for error handling

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Tested-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Felix Fietkau 5fd2eabeb2 base-files: remove support of profile-specific base-files
It is incompatible with multi-profile builds and has not been used
in-tree anyway.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Etienne CHAMPETIER 3946a55291 base-files: seed /dev/urandom
This commit:
1) seed /dev/urandom with the saved seeds as early as possible
   (see /lib/preinit/81_urandom_seed)
2) save a seed at /etc/urandom.seed if it doesn't exists
3) save a new seed each boot at "system.@system[0].urandom_seed"
   (see /etc/init.d/urandom_seed)

We use getrandom() so we are sure /dev/urandom pool is initialized

Seed size is 512 bytes (ie /proc/sys/kernel/random/poolsize / 8)
it's the same size as in ubuntu 14.04 and all systemd systems

Seeding /dev/urandom doesn't change entropy estimation, so we still have
"random: ubus urandom read with 4 bits of entropy available"
messages in the logs, but we can now ignore them if
after "urandom-seed: Seeding with ..." message

Saving a new seed on each boot is disabled by default to avoid too much
writes without user consent

v2: log preinit messages to /dev/kmsg
v3: use non generic function name for logging, as /lib/preinit/ files
    are all sourced together in /etc/preinit
v4: after a lot of discussion on the ML, use a uci config param
v5: config param is now the path of the seed

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
Acked-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 8d51706616 base-files: use LEDE NTP vendor pool
The vendor NTP pool for the LEDE project got approved, so switch to it now.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Kevin Darbyshire-Bryant d4ede1c118 base-files: sysfixtime no longer exclude dnsmasq.time
dnsmasq's dnssec time checking method now uses a ntp hotplug mechanism,
therefore dnsmasq.time is redudant and no longer needs to be explicitly
excluded from sysfixtime.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Daniel Dickinson f954f4337b base-files: Add standard os-release file
/etc/os-release is the standard distribution release information
file, therefore add it (and image configuration options for
fields not previously present in LEDE).  Once it is deemed
reasonable the non-standard openwrt_release, openwrt_version,
and device_info files could be removed (that is with this patch
we consider them deprecated in favour of the standard file).

Signed-off-by: Daniel Dickinson <lede@daniel.thecshore.com>
8 years ago
John Crispin 87eb8fad13 base-files: remove fstab symlink
the symlink no longer gets used since we switched to the block-mount tool.

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Hannu Nyman df7581e4c0 base-files: increase default system log size to 64 kB
Increase the default system log buffer size
from 16 kB (built-in default in ubox logd)
to 64 kB by setting the option in /etc/config/system.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
8 years ago
Jo-Philipp Wich 35b33f0413 base-files: maintain LED config state
Record the state of any hardware LED configured through UCI and use that
information to revert the state when applying updated settings while
maintaining default behaviour of system LEDs.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Felix Fietkau d6ad9d3e9c base-files: fix /bin/config_generate breakage
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Jo-Philipp Wich 924302ba36 base-files: drop /etc/config/system
The board_detect framework is now able to create the entire system config from
scratch so we can finally drop the copy shipped by base-files.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich b98f78b1c1 base-files: rework config generation logic
Now that config_generate is able to generate the entire /etc/config/system
from scratch we can apply the same logic as used for /etc/config/network;
when the configuration file exists already then do not do anything, else
generate it from the values provided by /etc/board.json .

In order to facilitate that move the file existance checking inside
/bin/config_generate and call it unconditionally from /bin/board_detect.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 07f03d0833 base-files: support port_state LED types in board.d
Add support for handling port_state LEDs as used by ADM5120.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 528b8f6f93 base-files: support hostname and ntp servers through board.d
Add support for specifying hostname and NTP servers via /etc/board.d/ scripts.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 33a4d22f4c base-files: reset LED state
Attempt to reset all LED states before applying the UCI configuration to
avoid leaving disabled LEDs behind in lingering glowing state, e.g. when
changing the sysfs entry in the config from one hardware LED to another.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 7f69458296 base-files: rework postinstall uci-defaults handling
Some package postinstall operations, e.g. those emitted by the LuCI build
system, source and delete the uci-defaults themselves upon package insteall,
causing the generic defaults apply code to trigger shell errors like:

    .../luci-app-ddns.postinst: .: line 130: can't open './40_luci-ddns'

Rework the generic apply code to check the existence of the uci-defaults
script before trying to source it, use sed to prefilter the list of entries
from the control file and perform the directory change in a subshell,
avoiding the need for cd $OLDPWD.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 1012701014 x86: generalize partition discovery for sysupgrade
Generalize the partition discovery in sysupgrade in order to fix sysupgrade
and config backup/recovery on MMC block devices which use a different naming
scheme compared to mtdblock or sd* devices.

The change also adds the find applet to the ramdisk utilities so that upgrade
code can rely on it.

The commit is based on the initial submission by Russell Senior at
http://patchwork.ozlabs.org/patch/625440/ .

Signed-off-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Hannu Nyman 3193053df7 Centralize setting of all version info to include/version.mk
Centralize setting all version information in include/version.mk
* Set RELEASE env variable in include/version.mk instead of toplevel.mk.
  Stop exporting the variable.
* Remove hardcoded release name from /etc/banner

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
8 years ago
John Crispin a39ac242cc base-files: fix some failsafe issues
* if the shell was closed booting continued

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Kevin Darbyshire-Bryant 8d105653b1 base-files: sysfixtime typo in exclude dnsmasq.time
Typo, missing space before ] in previous commit caused shell syntax
failure and incorrect restoration of time.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Kevin Darbyshire-Bryant 2b1556d3e0 base-files: sysfixtime exclude dnsmasq.time
dnsmasq maintains dnsmasq.time across reboots and uses it as a means of
determining if current time is good enough to validate dnssec time
stamps.  By including /etc/dnsmasq.time as a time source for sysfixtime,
the mechanism was effectively defeated because time was set to the
last time that dnsmasq considered current even though that time is in
the past.  Since that time is out of date, dns(sec) resolution would
fail thus defeating any ntp based mechanisms for setting the clock
correctly.

In theory the process is defeated by any files in /etc that are newer
than /etc/dnsmasq.time however dnsmasq now updates the file's timestamp
on process TERM so hopefully /etc/dnsmasq.time is the latest file
timestamp in /etc as part of LEDE shutdown/reboot.

Either way, including /etc/dnsmasq.time as a time source for
sysfixtime is not helpful.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
8 years ago
Jo-Philipp Wich 21f460e0c1 Revert "base-files: sysfixtime exclude dnsmasq.time"
This reverts commit 382779e009.

Reverting this commit due to a missing Signed-off-by.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Kevin Darbyshire-Bryant 382779e009 base-files: sysfixtime exclude dnsmasq.time
dnsmasq maintains dnsmasq.time across reboots and uses it as a means of
determining if current time is good enough to validate dnssec time
stamps.  By including /etc/dnsmasq.time as a time source for sysfixtime,
the mechanism was effectively defeated because time was set to the
last time that dnsmasq considered current even though that time is in
the past.  Since that time is out of date, dns(sec) resolution would
fail thus defeating any ntp based mechanisms for setting the clock
correctly.

In theory the process is defeated by any files in /etc that are newer
than /etc/dnsmasq.time however dnsmasq now updates the file's timestamp
on process TERM so hopefully /etc/dnsmasq.time is the latest file
timestamp in /etc as part of LEDE shutdown/reboot.

Either way, including /etc/dnsmasq.time as a time source for
sysfixtime is not helpful.
8 years ago
Vittorio G (VittGam) d742e1b513 base-files: Enhancements to /etc/profile
- Update the terminal window title with the current directory and hostname, if using an xterm-compatible terminal emulator.
- Add ll, an useful alias to ls.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
8 years ago
Vittorio Gambaletta (VittGam) 40f933d7ff base-files: Fix config_generate when there are no switch VLANs or ports configured in board.json.
The json_select call fails when there are no roles or ports objects in board.json. "json_select .." must not be executed after failing.

This fixes for example LEDs not being set up in /etc/config/system.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
8 years ago
Daniel Golle 9b9c78e071 base-files: evaluate uci-defaults on run-time installations
Packages may install scripts into /etc/uci-defaults to be executed once
after installation, usually at the first boot of the target. This works
fine if the package was installed to the rootfs during build or using
the ImageBuilder.
If the package is installed using opkg during run-time uci-defaults
were applied only after a reboot of the device. Avoid the need to
reboot by evaluting the package's uci-defaults in default-postinst.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
8 years ago
Jo-Philipp Wich a6f76bffd8 signing: remove unatteded build key and use current keyring instead
Remove the public unatteded buildkey from the opkg package to avoid
having hardcoded keys in tree. Use the external keyring package instead
which can be easily updated by users.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
John Crispin 4a8e960c62 base-files: fix group/user settings after sysupgrade
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin ed07ef1601 base-files: split user/group addition code into a function
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin d72e538e89 base-files: add new public key used by unattended builds
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin a13f47760c base-files: add a conditional dependency to lede-keyring
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin 528ffec3cd base-files: remove ununsed login.sh
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin b4e33a1c08 base-files: Allow to disable failsafe mode
Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
8 years ago
John Crispin dc92917409 image / basefiles: make console password configurable
Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
John Crispin 5e85ae9e4c base-files: fix error message during boot
preinit spews out this message

"cat: can't open '/proc/device-tree/model': No such file or directory"

Signed-off-by: John Crispin <john@phrozen.org>
8 years ago
Jo-Philipp Wich 9e04019024 package: flag essential components as nonshared
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 32a0b8c104 include/version.mk: rework repository url handling
- Add %A placeholder for substituting the package architecture
- Change %U placeholder to refer to the toplevel repository URL
- Construct package feed URLs relative to the toplevel one to match new layout

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
John Crispin fa69553900 branding: add LEDE branding
Signed-off-by: John Crispin <blogic@openwrt.org>
8 years ago
Hauke Mehrtens ea6d36111b base-files: allow to set arbitrary ip address and netmask
Signed-off-by: Roman Yeryomin <roman@advem.lv>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 49179
8 years ago
John Crispin 63c9caaa91 base-files: add function ucidef_set_interface_raw to enable default configuration on interfaces other than lan and wan.
Signed-off-by: Micke Prag <micke.prag@telldus.se>

SVN-Revision: 48976
8 years ago
Felix Fietkau 956794c2e9 base-files: change type of adsl and vdsl to dsl only
Instead of having two different types adsl and vdsl just create one dsl
type. This way we can use the same luci code for adsl and vdsl and the
config parameters are not so different.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 48944
8 years ago
Felix Fietkau 4ac99abeb3 lantiq: do not set default firmware file
We are now shipping a DSL firmware, do not set it by default to some
file name.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 48941
8 years ago
Jo-Philipp Wich eced3b3a35 base-files: support passing mode to ucidef_set_led_netdev()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 48806
8 years ago
Felix Fietkau 285d9e364e base-files: add support for speed mask to switch config init scripts
This patch adds extra parameter to switch LED trigger initialization
functions.  New functionality maintains backward compatibility, so
calling functions without setting new speed_mask parameter works
as expected.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>

SVN-Revision: 48776
8 years ago
John Crispin c0c3f2d4c9 leds: support oneshot as well as timer triggers
oneshot and timer have the same configuration options, just a different
trigger name.

Signed-off-by: Karl Palsson <karlp@etactica.com>

SVN-Revision: 48770
8 years ago
Jo-Philipp Wich 117cef6d44 base-files: add netifd's default prelocal table to /etc/iproute2/rt_tables
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 48685
8 years ago
Jo-Philipp Wich 4aeeead303 x86: preserve partition table on sysupgrade
With this patch sysupgrade will write directly to the partitions
instead of to the main disk.  The UUID is copied from the image
to the MBR as well.  This prevents the mbr from being completely
overwritten and losing the partition table.  The -p option has
been added to maintain the original behavior and overwite the
entire disk with the new image.  Tests have been added to ensure
that the image partitions match up with the active partitions.

Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net>

SVN-Revision: 48682
8 years ago
Jo-Philipp Wich cc289e0adb base-files: honor CONFIG_TARGET_INIT_PATH
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 48678
8 years ago
John Crispin e2fd1adaf5 base-files: For sysfixtime use hwclock if RTC available
On systems that have an RTC prefer it to the file-based time fixup (i.e.
use hwclock when there is a permanent clock instead of the faked up time
logic that is needed when there is not RTC).

We can't rely on hctosys kernel feature either as we're usually using
RTC as kernel modules which are usually being loaded after hctosys was
run, leading in the following error:

  hctosys: unable to open rtc device (rtc0)

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>

SVN-Revision: 48661
8 years ago
Felix Fietkau f70c8ba198 base-files: set mac address in default network config via device sections
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48646
8 years ago
Felix Fietkau 57776e68ce base-files: remove default /etc/config/network, generate it via board.d instead
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48493
8 years ago
Felix Fietkau b7ab6c66cc base-files: fix sysupgrade 'wget' handling for uclient-fetch
change 48451 tried to add support for uclient-fetch by moving
/usr/bin/wget to /bin/wget, but this change kept the symbolic
link to /bin/busybox as install_bin creates links to param 1

the desired fix is to link to uclient-fetch to wget:
  install_bin /bin/uclient-fetch /bin/wget

Signed-off-by: John Clark <inindev@gmail.com>

SVN-Revision: 48483
8 years ago
Felix Fietkau f57419d26e base-files: fix sysupgrade 'wget' handling
with r48379 and r48386 the path of wget changed.
respect that and adjust the dirname.

this fixes #21680

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 48451
8 years ago
Jo-Philipp Wich 740a2ee163 base-files: Fix sysupgrade overlay saving
A previous change to sysupgrade moved the overlay files into upper/
The -c switch generates a list of files to backup, but the sed
calls did not take this into consideration.

Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net>

SVN-Revision: 48281
8 years ago
John Crispin 3f78186f76 base-files: allow timezone to be overriden by zonename (proper zoneinfo support)
Signed-off-by: Roman Yeryomin <roman@advem.lv>

SVN-Revision: 47980
9 years ago
Felix Fietkau 0936f5b0e0 base-files: cleanup mtd_get_mac_binary hexdump
Remove usage of dd, as per request from Yousong Zhou.
<https://lists.openwrt.org/pipermail/openwrt-devel/2015-December/037743.html>

Signed-off-by: Chris R Blake <chrisrblake93@gmail.com>

SVN-Revision: 47949
9 years ago
Felix Fietkau c74a690661 ar71xx: scan nand ubi partition for ath9k eeprom files
The MR18 stores the ath9k eeprom values on the NAND.
This patch makes it possible to retrieve the images
from there.

Signed-off-by: Chris R Blake <chrisrblake93@gmail.com>

SVN-Revision: 47948
9 years ago
Felix Fietkau ce98f1d264 base-files: drop the now unnecessary dependency on opkg/host
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 47886
9 years ago
Jo-Philipp Wich 67e1c87012 all: drop old uci-defaults.sh
Replace former uci-defaults.sh implementation with the uci-defaults-new.sh one
and update all users accordingly.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47867
9 years ago
John Crispin 2f42d9e27d base-file: remove /tmp/.jail (now useless)
Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>

SVN-Revision: 47855
9 years ago
John Crispin ec6b85ca0e base-files: use max_brightness to set LED
LEDs which are controlled by a PWM need to use the supplied
max_brightness instead. Otherwise they might appear to be
very dim / broken.

Signed-off-by: Chris R Blake <chrisrblake93@gmail.com>

SVN-Revision: 47854
9 years ago
Jo-Philipp Wich 08078df83d board.d: add support for gpio_switch sections
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47762
9 years ago
Jo-Philipp Wich 61a99da4f9 base-files: board.d: auto-set model id and name if /tmp/sysinfo is available
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47752
9 years ago
Jo-Philipp Wich 6c8daa6ba3 base-files: board.d: support dsl modems, atm bridges and pppoe protocol
This adds support for specifying the dsl modem, atm bridge configs and setting
the pppoe protocol for wan.

These additions are required to port the Lantiq target to board.d.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47750
9 years ago
Jo-Philipp Wich 527ec2af59 all: remove dummy ucidef_set_interface_loopback() from board.d
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47744
9 years ago
Jo-Philipp Wich f611358870 base-files: board.d: support specifiying the protocol of lan and wan
Some boards, e.g. the Sheeva Plug, require the lan interface to be set
to DHCP instead of a static address, therfore support that.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47732
9 years ago
Jo-Philipp Wich ac9bed4bc0 base-files: board.d: support timer leds
Add ucidef_set_led_timer() and handling for it to config_generate.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47731
9 years ago
Jo-Philipp Wich b3f8340a5e base-files: board.d: support ide leds
Add ucidef_set_led_ide() to define "ide-disk" triggered leds.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47729
9 years ago
Jo-Philipp Wich 734ae1bd17 base-files: uci-defaults-new.sh: fix for handling multiple ifnames
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47728
9 years ago
Jo-Philipp Wich 9b02e73188 board.d: merge ucidef_add_switch() and ucidef_add_switch_ports()
This changes uci-defaults-new.sh, config_generate and all relevant board.d
files in order combine ucidef_add_switch() and ucidef_add_switch_ports() into
a single function.

Also removes now superfluous enable and reset arguments.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47721
9 years ago
Jo-Philipp Wich d17a64c7c0 base-files: uci-defaults-new: remove reset/enable args of ucidef_add_switch()
Out of 69 switch definitions, only 3 pass something different than "1" as
values for reset and enable, with one of those three being invalid.

This change ...

 * removes the reset and enable arguments from ucidef_add_switch()
 * unconditionally writes reset:1 and enable:1 to JSON
 * converts the three users of nonstandard values to ucidef_add_switch_attr()

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47720
9 years ago
Jo-Philipp Wich 80f767d093 base-files: uci-defaults-new, config_generate: refactor code and drop old vlans
Remove support for now unused ucidef_add_switch_vlan(), move port->vlan and
vlan->interfaces conversion to uci-defaults-new.sh and massively simplify
config_generate.

This change prepares the following upcoming steps:

 * Eliminate use of ucidef_set_interface_lan_wan() for switch only devices
 * Merge ucidef_add_switch() with ucidef_add_switch_ports()

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47719
9 years ago
Jo-Philipp Wich 1871619e72 base-files: config_generate: add missing chunks of force tag support
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47718
9 years ago
Jo-Philipp Wich 73a4e0334c base-files: uci-defaults-new, config_generate: allow force tagged cpu ports
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47679
9 years ago
Jo-Philipp Wich a826098e2b base-files: uci-defaults-new: only emit force_link for additional ifaces
Only se4t the force_link property for non-lan, non-wan ifaces as it is
unnecessary in the default cases.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47675
9 years ago
Jo-Philipp Wich b64f953cd8 base-files: uci-defaults-new: fix unquoted variables
Properly quote variables in ucidef_set_interface_lan() and
ucidef_set_interface_lan(), otherwise interfaces with multiple devices
are not properly written into the configuration.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47673
9 years ago
Jo-Philipp Wich cfac7289c7 base-files: uci-defaults-new: add board id and name helpers
Add ucidef_set_board_id() and ucidef_set_model_name() procedures to store
model information in the board.json file.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47671
9 years ago
Jo-Philipp Wich 0e0119b6f0 base-files: uci-defaults-new, config_generate: support for gpio leds
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47660
9 years ago
Jo-Philipp Wich aa4c5fd2b0 base-files: config_generate: regroup led generator code
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47659
9 years ago
Jo-Philipp Wich 8b9e839955 base-files: uci-defaults-new: remove ucidef_set_led_interface()
The only user was the hg255d board and config_generate did not even emit
proper uci for it.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47658
9 years ago
Jo-Philipp Wich 972d3de148 base-files: config_generate: support rssi leds
Add support for emitting rssi monitor and led configuration sections.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47656
9 years ago
Jo-Philipp Wich bd4c757685 base-files: uci-defaults-new: fix storing rssi leds and triggers in board.json
Remove extra nesting of rssi leds in the led object and move rssi monitor
declaration to its own object.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47655
9 years ago
Jo-Philipp Wich 92d414eb07 base-files: config_generate: reformat for better readability and quote variables
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47654
9 years ago
Jo-Philipp Wich 1e591ee6d1 base-files: uci-defaults-new: properly quote variables
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47652
9 years ago
Jo-Philipp Wich a466bfe8f4 base-files: config_generate: handle switch port attributes and better group json_select
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47648
9 years ago
Jo-Philipp Wich 97baeb2fa4 base-files: config_generate: do not remove previously generated interfaces
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47647
9 years ago
Jo-Philipp Wich 63c2111e86 base-files: config_generate: properly handle multiple switches
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47646
9 years ago
Jo-Philipp Wich 04b8b97fff base-files: uci-defaults-new: add ucidef_add_switch_port_attr() helper
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47645
9 years ago
Jo-Philipp Wich 2f69fefc37 base-files: uci-defaults-new: whitespace cleanup
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47644
9 years ago
Jo-Philipp Wich 212feb9ccf base-files: uci-defaults-new: don't store switch attr numbers as strings
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47643
9 years ago
Jo-Philipp Wich 2d5dbf9b47 base-files: config_generate: support autogenerating vlans
Add support for generating vlans solely from the port layout description
given through ucidef_add_switch_ports().

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47639
9 years ago
Jo-Philipp Wich d6b5ce48dd base-files: add ucidef_set_interface_wan() and ucidef_add_switch_ports()
Add further helper functions to uci-defaults-new.sh for easier declarations
of complex switch layouts.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47638
9 years ago
John Crispin 18691109df base-files: show hint when JFFS2-partition is full and overlayfs mounted read-only
since r45833 and r45848 the overlayfs is automatically mounted read-only
(and blocks remounts as r/w) when JFFS2 is full. see ticket #19564

because of this normal file deletion is not possible anymore.
if a user logins interactively (e.g. SSH) show a hint for this,
that files must be removed in /overlay/upper/...

v2: fix subject line

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 47623
9 years ago
Jo-Philipp Wich 6d3901bf76 base-files: config_generate: honour port_mask property (#20963)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47609
9 years ago
Felix Fietkau b61e77aedd base-files: use the correct path in case of modified preinit options
If the user sets any preinit options in .config, the wrong path may get
applied due to wrong default value in image-config.in and due to Makefile
writing also the unchanged options into 00_preinit.conf

Modify the default path in image-config.in to match the current default
path set by r47080. Also modify the fall-back default in Makefile.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>

SVN-Revision: 47590
9 years ago
Hauke Mehrtens f1894ad167 base-files: add DCCP to /etc/protocols
Fixes this conntrackd warning:
WARNING: getprotobyname() cannot find protocol `DCCP' in /etc/protocols

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>

SVN-Revision: 47481
9 years ago
John Crispin 1c74d046ed base-files: create /var/tmp on boot
FHS mandates presence of /var/tmp on compliant systems.

The lack of /var/tmp was discovered when using MIT Kerberos libraries
which default to that location for storing credentials cache.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>

SVN-Revision: 47219
9 years ago
Steven Barth 468c1fb320 base-files: revert to default ECN settings
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 47160
9 years ago
John Crispin ce9da6e6af base-files: add URL option for OEM manufacturer info
This URL can be embedded e.g. within UPnP announcements where a link
to the manufacturer's homepage is desired.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

SVN-Revision: 47135
9 years ago
Steven Barth d7023fc0bc base-files: sanitize and unify $PATH
Previously init and hotplug paths were different from console.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 47080
9 years ago
Felix Fietkau 5da85f7a01 base-files: add a dependency on fstools
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 47066
9 years ago
Felix Fietkau b38194406f base-files: fix ramoverlay function with kernels 3.18+
Even though there are not many users left within the OpenWrt tree it seems
this function broke during the kernel 3.18 transition.

Fix it by providing a workdir as required by overlayfs.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

SVN-Revision: 47015
9 years ago
Jo-Philipp Wich 33b3594332 base-files: refactor default_postinst()
- Simplify user spec parsing code
 - Alias IPKG_INSTROOT to shorten code
 - Quote variables where appropriate
 - Remove a useless-use-of-cat instance
 - Suppress errors in case control or list files are missing

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 46975
9 years ago
John Crispin ef2f50829d base-files: add /etc/profile.d support
OpenWrt should support an optional /etc/profile.d directory like
most other Linux distributions. This allows packages to install
their own scripts into /etc/profile.d/ directory.

The file suffix should make clear, that these scripts
are (sourced) shell-snippets. If the user needs e.g. php or lua,
one must make sure that the interpreter is called.
The reverse failsafe test makes sure, that the effective returncode is 0.

A typcal usecase is the inclusion of private helpers,
special variables or aliases, which at the moment needs
patching the sourcecode and is not well maintainable.
Now the builder can simply add there files.

v1 initial work of Hendrik Lüth <hendrik@linux-nerds.de>
v2 changes regarding RFC (e.g. thomas.langer@lantiq.com)
v3 changes regarding RFC (e.g. mschiffer@universe-factory.net)
v4 keep it simple and mimic OpenWrt style

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 46965
9 years ago
John Crispin 4ef319fad2 base-files: sysupgrade: quote source image name
get_image() eval a filename without quoting it, resulting in errors with
filenames containing characters that need to be escaped.
    $ sysupgrade -T -f ./cfg\(12\).tar.gz img.bin; echo $?
    Image check 'platform_check_image' failed.
    Invalid config file. Please use only .tar.gz files
    1
    $ mv cfg\(12\).tar.gz cfg_12.tar.gz
    $ mv img\(1\).bin img.bin
    sysupgrade -T -f ./cfg_12.tar.gz img.bin; echo $?
    0

Enclose the content of $from in double quotes.

Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me>

SVN-Revision: 46919
9 years ago
Felix Fietkau 796a2d032b base-files: fix typo in core dump pattern sysctl entry (fixes #20489)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 46890
9 years ago
Felix Fietkau ced2b641e2 base-files: set kernel.core_pattern in sysctl.conf
Move the pattern setting from netifd's service script to
/etc/sysctl.conf.  Put the timestamp component '%t' just after
executable name '%e' for more natural order from output of ls command.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 46867
9 years ago
Rafał Miłecki 56c926223e base-files: change banner to Designated Driver release
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 46846
9 years ago
Steven Barth 00045fe9d0 base-files: add /etc/iproute2/rt_tables, replace ifconfig-usage
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46830
9 years ago
Steven Barth d196b1fc2e Disable telnet in favor of passwordless SSH
This enables passworldless login for root via SSH whenever no root
password is set (e.g. after reset, flashing without keeping config
or in failsafe) and removes telnet support alltogether.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 46809
9 years ago
Jonas Gorski e1824f2543 base-files: allow setting ide-disk led trigger
Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 46794
9 years ago
Jo-Philipp Wich 3d1890053c base-files: add /etc/hosts entries for ::1, ff02::1 and ff02::2
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 46771
9 years ago
John Crispin e83643d31c base-files: default_postinst: propagate the real postinst return code
Using the postinst script for sanity checks and expecting opkg to fail
if the postinst didn't return 0 was possible in Barrier Breaker, propagate
the real postinst return code through default_postinst to restore this
behaviour.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 46653
9 years ago
John Crispin 9b0516c9fc base-files: rework reset button script to indicate factory reset
With this change we let user know 5 seconds have passed and reset button
can be released (to trigger factory reset)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 46650
9 years ago
Rafał Miłecki 567d2ab3f8 base-files: buttons: make power script return 0
It was missed in the r46471.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 46582
9 years ago
John Crispin e7b34b2b0d buttons: make all button handler scripts return 0
this is required by the new button timeout feature

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 46471
9 years ago
John Crispin cf4a0d430b base-files: fix /tmp/.jail permissions
We need a+x rights on the path to the root of the jails
so we can use users other than root (like nobody)

This partly fixes jailed dnsmasq

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>

SVN-Revision: 46466
9 years ago
John Crispin d0d3ca2a1b base-files: added option to configure the gpio led trigger in uci-defaults
Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>

SVN-Revision: 46341
9 years ago
John Crispin d65916047b base-files: implemented basic GPIO control
Internal GPIO pins are used for PoE passthrough setups in multi-port
routers. This patch implemnets control over this hardware feature for
Ubiquiti Nanostations and TP-Link CPE510.

Signed-off-by: Lars Kruse <lists@sumpfralle.de>

SVN-Revision: 46271
9 years ago
John Crispin 3787c32183 sysctl: read settings from /etc/sysctl.d/*.conf
This changes makes it possible to store custom settings
in individual files inside the directory /etc/sysctl.d/.

Signed-off-by: Stefan Tomanek <stefan.tomanek+openwrt@wertarbyte.de>

SVN-Revision: 46239
9 years ago
Felix Fietkau 908e1b4c41 base-files: add openwrt snapshot key
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45905
9 years ago
John Crispin f57076956e base-files: default_do_upgrade: accept & forward image extraction command
get_image allows passing 2nd argument that is used in a pipe for
extracting firmware from a non-native format. By accepting such command
in default_do_upgrade we allow platforms to use this helper for vendor
specific images.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45900
9 years ago
Luka Perkov 0a4bcd5be6 base-files: remove ubi tool
ubi tool was removed from fstools in r41128.

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 45813
9 years ago
Jonas Gorski d0af85c9a5 base-files: fix default pre-/postrm for packages with a dot
Instead of stripping everything after the first dot, strip everything
after the last dot.
This fixes pre-/postrm actions for packages with a dot in their name,
like libusb-1.0.

Fixes #19668.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 45702
9 years ago
Felix Fietkau 2659762e62 base-files: fix logic error in led default handling (patch from #19593)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45600
9 years ago
Felix Fietkau 2d4fa6c055 base-files: make the generic sysinfo script run earlier to allow the mount_root script to pick up the board name
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45496
9 years ago
Felix Fietkau 93fb3cac1b base-files: reorder led trigger/brightness writes
Depending on configuration, disable the LED before writing the trigger
and enable it after writing it. Fixes LEDs where the value defaults to 1

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45463
9 years ago
Felix Fietkau b3d699bdd3 base-files: add generic preinit script to extract board/model info from device-tree
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45462
9 years ago
John Crispin bbad3f360e modules: fix postinst generation for kernel modules
Fixes ticket #19352.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 45367
9 years ago
John Crispin 5d8f9e03f1 base-files: add support for platform_pre_upgrade function
Current NAND sysupgrade process is a bit hard to follow due to the way
of triggering stage1. Currently this is done by leaving a /mark/ in the
form of /tmp/sysupgrade-nand-path during nand_do_platform_check.
Existence of this mark stops standard sysupgrade process (as the result
of sysupgrade_pre_upgrade exit). This may be a bit misleading.

Proposed solution adds a new function that will allow platform.sh
trigger NAND sysupgrade consciously. This will also allow cleaning
nand_do_platform_check limiting it to just checking the image.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 45338
9 years ago
Felix Fietkau beca028bd6 build: add integration for managing opkg package feed keys
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 45286
9 years ago
Nicolas Thill fe46689f10 packages: use $(LN) macro, make symlinks relative
Signed-off-by: Nicolas Thill <nico@openwrt.org>

SVN-Revision: 45250
9 years ago
Nicolas Thill 11d4a00c88 base-files: add more config files to conffiles section
Signed-off-by: Nicolas Thill <nico@openwrt.org>

SVN-Revision: 45244
9 years ago
John Crispin 4cf7929869 base-files: add a init.d option that will start the syscall tracer
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 45009
9 years ago
John Crispin 5b23cfab73 base-files: create jail folder on boot
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 45008
9 years ago
Felix Fietkau 889e1e4bff fstools: update to the latest version, makes interrupted first boot more reliable
Use xattr to store the filesystem initialization state of the overlay.
As long as the filesystem is not marked as initialized yet (happens in
/etc/init.d/done), all overlay data (except for sysupgrade.tgz) will be
discarded before the system is allowed to boot

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44942
9 years ago
Felix Fietkau bc1fc688af base-files: keep sysupgrade.tgz until /etc/init.d/done has been called
This makes interrupted boots after sysupgrade more reliable

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44941
9 years ago
Felix Fietkau f30358d41a kernel: remove the netfilter optimization that skips the filter table, it has caused too many issues
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44873
9 years ago
Luka Perkov 17610e7430 base-files: firstboot: pass down arguments such as -y to jffs2reset
This brings back old behavior.

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 44651
9 years ago
John Crispin eea462106f uci-defaults: add ucidef_set_led_mmc
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

SVN-Revision: 44446
9 years ago
Jo-Philipp Wich e3744a7cc7 base-files: fix target/subtarget value in /etc/openwrt_release
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 44409
9 years ago
John Crispin 5cd8a482f3 base-files: default_postinst() fix variable colision
The name variable contains at first the package name,
and after the last group name.
This patch fixes /etc/rc.d symlink creation (at least).

Change name in pkgname, change the other name in ugname
(user group name), and id in ugid (user group id)

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>

SVN-Revision: 44253
9 years ago
Jo-Philipp Wich 4ec8d515b2 include, base-files: align default repository url with changed buildbot structure
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 44091
9 years ago
John Crispin b54f3ad6e7 base-files: fix led script to skip missing triggers
this is based on http://patchwork.ozlabs.org/patch/424451/

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 44087
9 years ago
John Crispin 29207748b9 base-files: Use 200ms LED timing as before for the new phase preinit_regular.
This restores normal pre-r43715 200ms blink-period for the System LED we're all accustomed to see while our OpenWrt routers are booting.

Failsafe possibility will now be signalled with a new 100ms blinking, which is easily recognizable from the normal 200ms booting.

So no existing user will be scared by a new 500ms LED pattern, since such a slow pattern could easily be mistaken for something wrong... I was like "ok why my router is collapsing now, is this a bad flash, a kernel panic, or what else" when I've seen it for the first time ;)

Sorry for not having explained myself better in v1 of this patch.

Original:
Preinit, failsafe is possible: 200ms
Preinit, failsafe not possible anymore, booting normally: 200ms
Failsafe entered: 50ms

Now (after preinit_regular has been introduced):
Preinit, failsafe is possible: 200ms
Preinit, failsafe not possible anymore, booting normally: 500ms *here is the "offending" change*
Failsafe entered: 50ms

With my proposed patch:
Preinit, failsafe is possible: 100ms *indicate this condition with a new timing, that prompts the user to press the key if they want to start failsafe*
Preinit, failsafe not possible anymore, booting normally: 200ms *keep this as before*
Failsafe entered: 50ms

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>

SVN-Revision: 44056
9 years ago
John Crispin 744298b8a0 base-files: Add ucidef_set_led_timer to uci-defaults.sh
Signed-off-by: Gerald Kerma <dreagle@doukki.net>

SVN-Revision: 44000
9 years ago
John Crispin 31eadd07f2 base-files: Fix switch settings for uci-defaults-new.sh.
The enable and reset settings need to be added even when they're false. This is true at least for 'enable', that seems to default to true otherwise.

Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>

SVN-Revision: 43887
9 years ago
Jo-Philipp Wich 3f26960a5c base-files: update default url template and complete kconfig help
Change the kconfig default for the repository url template to use "%s"
instead of "%T" as well.

Also complete the kconfig help text do cover the recently introduced
manufacturer, product and hwrev options.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 43872
9 years ago
Jo-Philipp Wich 15d8db1f8c build: add version number to filenames
This commit introduces a new option CONFIG_VERSION_FILENAMES which causes
OpenWrt to embed the version number in generated image files, SDK- and
ImageBuilder archives.

The option is enabled by default if CONFIG_VERSIONOPT is set.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 43869
9 years ago
John Crispin 019ea725aa add "preinit_regular" diag.sh set_state argument
This new argument is used right after starting regular preinit (which
happens if failsafe wasn't triggered). The main purpose of "preinit"
argument is to indicate that failsafe can be triggered, however we were
missing a way to inform user that we don't wait for a trigger anymore.
With this change it's clear when failsafe mode can be triggered.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 43715
10 years ago
John Crispin f76755da3f packages: fix typo in OpenWrt name
Signed-off-by: Cezary Jackiewicz <cezary.jackiewicz@gmail.com>

SVN-Revision: 43542
10 years ago
John Crispin b0d2a9e77a base-files: default_postinst() - create user:group first (resend)
create user:group before running postinst-pkg. the postinst hook might require
the user:group to already exist.

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

SVN-Revision: 43472
10 years ago
Imre Kaloz 2e3b84c3b5 fix sysupgrade on overlayfs v23+
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 43365
10 years ago
Jonas Gorski 02c6798a0d base-files: supress errors from ldd
ldd might be called for shell scrips during sysupgrade, causing it to
complain that they are not a dynamic executables.

This is a harmless error, so supress it to avoid confusing about them
being serious ones.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 43315
10 years ago
Jonas Gorski 2e95b1fda7 base-files: properly fix copying ld*.so with eglibc
r36107 ("base-files: sysupgrade fail with eglibc") tried to fix
sysupgrade by changing the ld-soname to what is expected, but only
fixed MIPS while breaking ARM.

The underlying issue is that the ld.so name varies widely across
different architectures for eglibc:

eglibc-2.19-r25243$ grep -r "ld-soname :=" . | awk '{ print $3 }' | sort -u
ld64.so.1
ld64.so.2
ld-linux-aarch64_be.so.1
ld-linux-aarch64.so.1
ld-linux-armhf.so.3
ld-linux-mipsn8.so.1
ld-linux.so.2
ld-linux.so.3
ld-linux-x32.so.2
ld-linux-x86-64.so.2
ld.so.1

Instead of adding each different soname to check for and copy it,
replace the awk script with a sed script to extract it properly and
drop the hardcoded so-name.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 43295
10 years ago
Nicolas Thill f4417f7ad8 package/*: replace occurences of 'ln -sf' to '$(LN)'
Signed-off-by: Nicolas Thill <nico@openwrt.org>

SVN-Revision: 43205
10 years ago
John Crispin 74a3a77bcd license info - revert r43155
turns out that r43155 adds duplicate info.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43167
10 years ago
John Crispin c10d97484a Add more license tags with SPDX identifiers
Note, that licensing stuff is a nightmare: many packages does not clearly
state their licenses, and often multiple source files are simply copied
together - each with different licensing information in the file headers.

I tried hard to ensure, that the license information extracted into the OpenWRT's
makefiles fit the "spirit" of the packages, e.g. such small packages which
come without a dedicated source archive "inherites" the OpenWRT's own license
in my opinion.

However, I can not garantee that I always picked the correct information
and/or did not miss license information.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

SVN-Revision: 43155
10 years ago
Steven Barth bec9d38fa4 Add a few SPDX tags
Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 43151
10 years ago
John Crispin 5a6433cc6c base-files: config_generate did not handle setups with more than 1 switch properly
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 43088
10 years ago
Felix Fietkau 7a5002ec9d base-files: add /etc/shadow to list of essential files to keep in sysupgrade (bug 18206)
Based on bug #18206 sysupgrade can lead to loss of password information in
certain situations. Most likely all users who will upgrade from versions
r43017-43040, will lose their current passwords. :-(
https://dev.openwrt.org/ticket/18206

Currently /etc/shadow is defined as a conffile in base-files:
https://dev.openwrt.org/browser/trunk/package/base-files/Makefile#L37

But it is not defined in the default list of essential files to keep in
sysupgrade:
https://dev.openwrt.org/browser/trunk/package/base-files/files/lib/upgrade/keep.d/base-files-essential

If exporting conffiles info fails, /etc/shadow can get lost.

Shadow passwords are now the default, so saying that preserving /etc/passwd
is essential while /etc/shadow is not, makes no sense.

The attached patch adds /etc/shadow to the list of essential files.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>

SVN-Revision: 43061
10 years ago
Felix Fietkau 99a651fd50 base-files: fix telnet login on musl
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43006
10 years ago
John Crispin 829bf6b9a1 failsafe-mode: print short help on commandline
[base-files] failsafe-mode: print short help on commandline

Like mentioned in ticket https://dev.openwrt.org/ticket/11911
this should make the IRC much quieter. Failsafe is somehow
special and even experienced users are helpless, because they
are not used to this seldom situation. Also: likely you have
no internet access in this mode, so you cannot use the wiki.

a failsafe-session now looks like this:
first we see from 'package/base-files/files/bin/login.sh' the hint:

 === IMPORTANT ============================
  Use 'passwd' to set your login password
  this will disable telnet and enable SSH
 ------------------------------------------

after this the /etc/banner ("OpenWrt - wireless freedom")
and then the new text:

================= FAILSAFE MODE active ================
special commands:
* firstboot          reset settings to factory defaults
* mount_root     mount root-partition with config files

after mount_root:
* passwd                         change root's password
* /etc/config               directory with config files

for more help see:
http://wiki.openwrt.org/doc/howto/generic.failsafe
=======================================================

this supersedes the old patches:
http://patchwork.openwrt.org/patch/3337/
http://patchwork.openwrt.org/patch/3553/

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42985
10 years ago
Felix Fietkau 0ef474a118 base-files: fix ldd definition if /usr/bin/ldd exists
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 42976
10 years ago
Jo-Philipp Wich 4f73613c26 build: improve feed handling for opkg.conf
- Consider not installed feeds as well
 - Add option to decide whether to comment disabled feeds

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 42931
10 years ago
John Crispin 666659fb31 default_postinst() fix wrong call of group_add
[base-files] default_postinst() fix wrong call of group_add
after 12bae65d07d29854204715cebc1ef1eae237fd9b group_add is
always called. shell scripting can be tricky...

wrong call:
[ -n "$gid" ] && group_exists $name || group_add $name $gid

this leads to a call of 'group_add' when $gid is emtpy, proof:

root@box:~ functionA() { echo A; }
root@box:~ functionB() { echo B; }
root@box:~ VAR=
root@box:~ [ -n "$VAR" ] && functionA || functionB
B
root@box:~ # functionB was called, but VAR is not filled
root@box:~ VAR=filled
root@box:~ [ -n "$VAR" ] && functionA || functionB
A

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42926
10 years ago
John Crispin d099a34980 base-files: default_postinst() force clear luci-indexcache
Inside every LuCI package you need to clear luci-indexcache and
sometimes when installing non LuCI pacakges it's also needed to clear
it. Easier put it into default_postinst().

Signed-off-by: Christian Schoenebeck <christian.schoenebeck@gmail.com>

SVN-Revision: 42923
10 years ago
John Crispin 5efe2e5e3c base-files: the USERID code path did not check for duplicate groups
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42919
10 years ago
John Crispin 20940138ac scripts: fix wrong usage of '==' operator
[base-files] shell-scripting: fix wrong usage of '==' operator

normally the '==' is used for invoking a regex parser and is a bashism.
all of the fixes just want to compare a string. the used busybox-ash
will silently "ignore" this mistake, but make it portable/clean at least.

this patch does not change the behavior/logic of the scripts.

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42911
10 years ago
Steven Barth 14e6559eee base-files: add network_get_ipaddrs_all()
Return all IPv4 and IPv6 addresses.

Signed-off-by: Mathias Kresin <openwrt@kresin.me>

SVN-Revision: 42856
10 years ago
Steven Barth c118e5edf4 network: Unbind DHCPv6 from underlying interfaces
This allows IPv6 to set up without IPv4 being up thus
IPv6-only or IPv6+DS-Lite working with the default config.

Signed-off-by: Steven Barth <steven@midlink.org>

SVN-Revision: 42848
10 years ago
John Crispin a3bf98495a base-files: extend USERID:=syntax
it is now possible to inlie the uid and gid in the syntax

USERID:=username=uid:group=gid:group2=gid2:...

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42838
10 years ago
John Crispin f9cccd2c14 base-files: make postinst script run inside a subshell
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42800
10 years ago
John Crispin 7860c9707a sysupgrade: preserve symlinks in backups
Signed-off-by: Catalin Patulea <catalinp@google.com>

SVN-Revision: 42783
10 years ago
Steven Barth 8a971b2770 base-files: remove a 'not found' error message during system boot
During boot, a not found message is displayed for systems which do
not have uci 'network.globals.ula_prefix' defined in
/etc/config/network. The error message itself is not used and can
be ignored.

Signed-off-by: Michel Stam <m.stam@fugro.nl>

SVN-Revision: 42755
10 years ago
Florian Fainelli bc96c49c67 base-files: add a protocol argument to ucidef_set_interface_raw
Add a third argument to ucidef_set_interface_raw, which is specifying
the protocol.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 42665
10 years ago
John Crispin 44249f71a8 postinst trigger: the new postinst trigger broke IB
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42571
10 years ago
Luka Perkov a8b6ca8797 base-files: whitespace fixes
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 42542
10 years ago
John Crispin d6dbc22bbc ipkg: add a default postinst/prerm script
the postinst script enables/starts the init.d scripts upon package installation
and installs the users required by the package.

the prerm script stops and disables the init.d scripts.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42470
10 years ago
John Crispin 2ae05c57f8 package/*: remove useless explicit set of function returncode
somebody started to set a function returncode in the validation
stuff and everybody copies it, e.g.

myfunction()
{
	fire_command

	return $?
}

a function automatically returns with the last returncode,
so we can safely remove the command 'return $?'. reference:

http://tldp.org/LDP/abs/html/exit-status.html
"The last command executed in the function or script determines the exit status."

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>

SVN-Revision: 42278
10 years ago
John Crispin 2d286dad6e base-files: properly generate the ula
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42261
10 years ago
Steven Barth 929e73c7b6 base-files: increase igmp_max_memberships to improve multicast-proxy handling
SVN-Revision: 42227
10 years ago
John Crispin 9ba6cd186a base-files: fix inverse logic in board_detect script
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42220
10 years ago
John Crispin db6a292d4c base-files: wan6 should reference wan intead of referencing itself.
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42199
10 years ago
John Crispin 562d9f9582 base-files: add a hardware detection layer
this allows targets to use the new uci-default helper which will generate
a file called /etc/board.json. a tool called /bin/config_generate can then
be used to generate the default uci settings.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 42185
10 years ago
Jo-Philipp Wich f63509ac89 base-files: /lib/functions/network.sh: fix network_get_ipaddr6
When looking for the first ipaddr also consider the current prefix just
like network_get_ipaddrs6 does. If ipv6-address was empty the function
did not return the first ipaddr even if the list was non-empty.

fixes commit 83e9122f88a002871d5cdf421cf6aa6052b7e006

Signed-off-by: Henning Schild <henning@hennsch.de>

SVN-Revision: 42139
10 years ago
Jo-Philipp Wich 01fd962745 build: enable PER_FEED_REPO by default
Enable the separate feed repositories by default to align custom builds with the repositories
available on the snapshot download server.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 42112
10 years ago
Felix Fietkau 517ad9ff0d base-files: enable option to skip the netfilter "filter" table for established connection packets by default
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 42048
10 years ago
Jo-Philipp Wich 960b7643c9 build: add new option to add disabled feeds commented out to opkg.conf
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 42004
10 years ago
Jo-Philipp Wich a720dd209f build: introduce per feed repository support
This changeset implements a new menuconfig option to generate separate
repositories for each enabled package feed instead of one monolithic one.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 42002
10 years ago
Felix Fietkau d5653558ac base-files: properly escape strings for version info
Make sure they don't break the sed command, and also make device_info
and openwrt_release more robust for parsing by scripts

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41885
10 years ago
Felix Fietkau dbb77e39a0 base-files: add extra version configuration options for OEM manufacturer info
Creates /etc/device_info which will be used to fill in information for
WPS and other protocols that need manufacturer/device information

This helps with creating OpenWrt firmware for OEM or rebranded devices.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41884
10 years ago
Imre Kaloz ad27df85b7 BB is branched, get ready for Chaos Calmer
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 41870
10 years ago
John Crispin 3c9cfbeebd base-files: Remove stale calls to start() in initscripts.
based on http://patchwork.openwrt.org/patch/5969/

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41840
10 years ago
Gabor Juhos 69abf630cf base-files: strip quotes from the MAC address in macaddr_canonicalize()
Extracted from http://patchwork.openwrt.org/patch/5716/

Signed-off-by: Forest Crossman <cyrozap@gmail.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 41639
10 years ago
Felix Fietkau 59cfa05bf3 base-files: adjust the default netfilter tcp established connection timeout as per RFC 5382 (#17098)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41599
10 years ago
John Crispin be26421f45 sysupgrade: Enable killing of all processes under upgraded
If the sysupgrade scripts is called under upgraded, it will not kill all
other processes as it should to avoid interference by locked filesystem.
This patch checks the parent and if it is upgraded, it kills all.

Signed-off-by: André Valentin <avalentin@marcant.net>

SVN-Revision: 41563
10 years ago
Felix Fietkau d288a7903d rc.common: when reloading a service using procd, fall back to calling start instead of restart
This avoids unnecessary service restarts

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41490
10 years ago
John Crispin 66ae4803e2 base-files: fix ramfs / nand upgrade
/lib/{imx6,lantiq,...}.sh are needed in the ramfs for sysupgrade to work.

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41440
10 years ago
Luka Perkov be2a057787 base-files: define yes/no as valid boolean options
ubox validate_data defines yes/no as valid boolean options, do the same in
config_get_bool too.

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 41405
10 years ago
John Crispin 818e38625f base-files: add enabled config option for ntp service
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 41354
10 years ago
John Crispin 3a9bfa5938 base-files: add a post start hook to the procd init.d api
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41344
10 years ago
Luka Perkov 3fea61afe8 base-files: update copyright headers
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 41334
10 years ago
John Crispin 09273f5c0a base-files: regenerate the /lib64 symlink when switching to a ramdisk
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41284
10 years ago
Jo-Philipp Wich 7eb721425e base-files: depend on jsonfilter and rewrite network.sh to use it
Switches /lib/functions/network.sh from jshn based json parsing to
jsonfilter expression while keeping the existing api.

Expensive methods like "network_find_wan" are up to 20x faster now.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 41281
10 years ago
John Crispin 4b1c48bc93 base-files: add upgraded to the list of daemons not killed
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41268
10 years ago
John Crispin 3dca5a158d procd: various cleanups to /lib/upgrade/nand.sh
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41222
10 years ago
John Crispin bedd6f44a5 base-files: properly remove stderr from zcat/bzcat
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41135
10 years ago
John Crispin c43d614f89 base-files: add an ugly hack for nand to sysupgrade
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41126
10 years ago
John Crispin e73538ba56 base-files: include more ubi* tools in sysupgrade ramdisk
Also add some more busybox symlinks which are useful for sysupgrade
on UBI-enabled devices.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>

SVN-Revision: 41125
10 years ago
Felix Fietkau 281f415885 base-files: fix argument order to date in sysfixtime so that it also works with musl
Seems like the reverse order relies on GNU specific getopt hackery which
musl does not replicate

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 41045
10 years ago
John Crispin 47cf6f9cd1 base-files: /etc/rc.button/power should be executable
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 40993
10 years ago
John Crispin 0de0310a9c base-files: Allow installation of symlinks using RAMFS_COPY_BIN env var.
http://patchwork.openwrt.org/patch/5086/

Signed-off-by: karl.vogel@gmail.com

SVN-Revision: 40943
10 years ago
John Crispin 37eb27e47d base-files: remove function service_kill
Function service_kill is deprecated and has no user, so remove it.

Signed-off-by: Zhao, Gang <gamerh2o@gmail.com>

SVN-Revision: 40912
10 years ago
John Crispin 36d0a5e3fb base-files: add simple shutdown script
Since svn rev [38557] we support power buttons, for example
the ACPI power button on x86 machines.
Add a simple shutdown script to /etc/rc.button, to gracefully shutdown
the machine after the power button is pressed.

Tested on x86 and x86_64 in a kvm virtual machine.

Signed-off-by: Stefan Hellermann <stefan@the2masters.de>

SVN-Revision: 40909
10 years ago
John Crispin 44e2de03a4 base-files: calling stop_service before procd_kill.
Before this patch, doing `/e/c/network restart' will emit the folloing
error by `ubus network.wireless down "{}"' because netifd already quit
by that time.

	Command failed: not found

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 40906
10 years ago
John Crispin dcf42b40fc base-files: removes logging
Since logd haven't started at this point, logging does not work.

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>

SVN-Revision: 40904
10 years ago
Felix Fietkau bb240b50b6 base-files: enable force_link for lan by default
This allows services to bind to it at boot time instead of waiting for a
cable to be plugged in

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40773
10 years ago
Felix Fietkau c622a37101 base-files: remove duplicate stop_service() function.
It was introduced in commit 2f966e8, "base-files: add a post start hook
for procd managed services".

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>

SVN-Revision: 40576
10 years ago
Felix Fietkau a423055592 base-files: remove duplicate wps button handler (#15621)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40528
10 years ago
Felix Fietkau dd58e15b84 base-files: add back missing function for find_mtd_part to /lib/functions.sh (fixes #15496)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40426
10 years ago
John Crispin 665d39f698 base-files: the ubi tol should be installed when jumping to ram_fs
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 40420
10 years ago
John Crispin 1d5ac95850 base-files: make use of new fstools
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 40416
10 years ago
Felix Fietkau 28f4f4a6d7 /lib/functions.sh: remove config_rename()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40412
10 years ago
Felix Fietkau 4a9ea80ef0 /lib/functions.sh: move rarely used mtd and macaddr related functions to /lib/functions/system.sh
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40411
10 years ago
Felix Fietkau e700dcaf04 /lib/functions.sh: remove jffs2_mark_erase()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40410
10 years ago
Felix Fietkau d368cc63fe base-files: remove config_clear() and list_remove()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40409
10 years ago
Felix Fietkau 3d275a8deb base-files: move uci_apply_defaults() to /etc/init.d/boot
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40408
10 years ago
Felix Fietkau 4a6ad541d8 /lib/functions.sh: remove hotplug_dev()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40406
10 years ago
Felix Fietkau ba2b6f661b /lib/functions.sh: remove strtok()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40405
10 years ago
Felix Fietkau c27c5b9cbc /lib/functions.sh: move preinit related functions to /lib/functions/preinit.sh
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40404
10 years ago
Felix Fietkau e90b695157 /lib/functions.sh: remove pi_include()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40403
10 years ago
Felix Fietkau 1d763171bf /lib/functions.sh: remove jffs2_ready()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40402
10 years ago
Felix Fietkau 0f2524f473 /lib/functions.sh: remove support for non-overlayfs overlay fopivot types
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 40401
10 years ago
John Crispin 08b4924401 ubi-utils: mini version of mtd-utils that only includes ubi tools
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 40367
10 years ago
John Crispin 0dc9d8d6ff fstools: add the new fstools package
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 39895
10 years ago
Imre Kaloz 6a4ecd05f0 the root password should be empty for real, like before
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 39650
10 years ago
John Crispin 7917a87d12 base-files: split /etc/init.d/boot into 2 files
this allows us to bind a procd trigger to system.@system[-1]

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 39615
10 years ago
Jo-Philipp Wich 6ae1433ab9 base-files: expose taint flags in /etc/openwrt_release
SVN-Revision: 39437
10 years ago
Jo-Philipp Wich 73344b9c56 Add sysfixtime init script, replacement of luci_fixtime
Simply scan for the most recent file in /etc and set
system time to this file modification time if it's in the future
It allow some time dependent program to work immediatly
without waiting for ntpd to sync

v1: v2: bad approach
v3: simply scan /etc, thanks to Bastian Bittorf for the idea
v4: use sort -n, thanks to Catalin Patulea
v5: use [] instead of [[]], thanks to Andreas Mohr
v6: use openwrt style, thanks to Bastian Bittorf

Signed-off-by: Etienne CHAMPETIER <etienne.champetier@free.fr>

SVN-Revision: 39422
10 years ago
Luka Perkov d66d2ad104 base-files: add ucidef_add_switch_port function
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 39372
10 years ago
John Crispin f18112883f sysupgrade: do not kill any processes in failsafe
sysugrade killed the lock causing failsafe to stop

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>

SVN-Revision: 39318
10 years ago
John Crispin 834204bda6 base-files: fix mount-utils incompatibility
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>

SVN-Revision: 39169
11 years ago
Jo-Philipp Wich ef0ce72b39 base-files: ipcalc.sh: support bit length as netmask parameter
SVN-Revision: 39100
11 years ago
Jo-Philipp Wich fe230cac18 base-files: add network_get_protocol() to /lib/functions/network.sh
SVN-Revision: 39099
11 years ago
Felix Fietkau b656a56225 /sbin/wifi: reload network/wireless on wifi restart
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39036
11 years ago
Luka Perkov 3ceb6b3274 base-files: fix whitespaces
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 39006
11 years ago
Felix Fietkau 6e0fafd816 wifi: restart netifd wifi interfaces on the "up" command like the old variant
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38990
11 years ago
Felix Fietkau 3c50feca19 wifi: rename the "reload" (restarting non-netifd wifi) command to "reload_legacy"
Add a new "reload" command that reloads the netifd config as well

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38989
11 years ago
Felix Fietkau 498d84fc4e netifd: add wireless configuration support and port mac80211 to the new framework
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38988
11 years ago
John Crispin 93e9a71538 base-files: allow users to delect debug level during boot
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38909
11 years ago
Felix Fietkau 69598dd020 base-files: add the DEVICENAME variable for hotplug scripts
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 38861
11 years ago
Felix Fietkau ff17114ba1 ar71xx: Unifi AP Pro sysupgrade patch
The current implementation of mtd will not append the backup
file created by sysupgrade to the correct partition, as mtd will append
the data to first jffs2 partition it finds. As the kernel is also
stored on a jffs2 partition (which resides before the overlay
partition), the data will be appended to this partition.

To fix this problem, a new option

-s <number>             skip the first n bytes when appending data to the jffs2 partiton, defaults to "0"

is added to mtd.

Signed-off-by: Peter Wagner <tripolar@gmx.at>

SVN-Revision: 38807
11 years ago
Gabor Juhos b7914344ad base-files: add macaddr_canonicalize helper function
In commit r38690, the MAC address canonicalization
has been converted to use 'tr' instead of 'printf'.
This only works if with MAC addresses which uses
the 'xx:xx:xx:xx:xx:xx' format.

However on some boards, the MAC addresses are stored
in different format in the mtd partition. Some vendors
are using hyphens or dots as separators instead of
colons. Also the leading zeroes may be missing from the
individual octets or those are replaced with spaces.

Add a new function which can be used to convert these
into the 'xx:xx:xx:xx:xx:xx' format. Also update the
'mtd_get_mac_ascii' function to use the new helper.

The helper function is based on this code:
  http://isquared.nl/blog/2010/08/11/Bash-function-to-canonicalize-MAC-addresses/

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>

SVN-Revision: 38803
11 years ago
Luka Perkov 1df0179b28 base-files: don't enter failsafe if triggered by switch
Fixes failsafe issues with switches after r38725.

Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 38770
11 years ago
Hauke Mehrtens 0d82bbb1fb base-files: don't kill nas for sysupgrade
Signed-off-by: Nathan Hintz <nlhintz@hotmail.com>

SVN-Revision: 38766
11 years ago
John Crispin c902a76f4d base-files: fix typo in rfkill script
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38742
11 years ago
John Crispin 871744f5de base-files: update rfkill script to work with slider buttons
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38729
11 years ago