summaryrefslogtreecommitdiffstats
path: root/package/base-files
Commit message (Collapse)AuthorAgeFilesLines
* base-files: make default_prerm work offlineMatthias Schiffer2016-09-261-4/+12
| | | | | | | IPKG_INSTROOT must be respected for offline removal (used for per-device rootfs). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: fix check for empty password warningMatthias Schiffer2016-09-261-2/+1
| | | | | | | | | | | | | 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:x:' 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>
* treewide: remove bad local shell variable declarationsJo-Philipp Wich2016-09-242-3/+3
| | | | | | | 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>
* base-files: Allow subtargets to define base-files.mkFlorian Fainelli2016-09-191-0/+1
| | | | Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* base-files: remind users to set root passwordJohn Crispin2016-09-191-0/+13
| | | | | | print a warning when a shell spawns, telling users to set a root password. Signed-off-by: John Crispin <john@phrozen.org>
* base-files: reduce vm.min_free_kbytes for devices with 32M RAMFelix Fietkau2016-09-161-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: support oneshot leds properly.Karl Palsson2016-09-051-1/+1
| | | | | | | | | | 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: c0c3f2d4c917 leds: support oneshot as well as timer triggers Signed-off-by: Karl Palsson <karlp@etactica.com>
* base-files: set pi_ifname in board.d case to fix deconfigJonas Gorski2016-08-141-1/+3
| | | | | | | | 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>
* base-files: configure switch in failsafeJonas Gorski2016-08-131-2/+46
| | | | | | | 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>
* base-files: allow failsafe to configure vlansJonas Gorski2016-08-131-3/+29
| | | | | | | 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>
* base-files: add preinit ifname detection based on board.jsonJonas Gorski2016-08-131-0/+29
| | | | | | Make use of the existing board.d to autodetect lan ifname in a generic way. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: split out preinit interface configJonas Gorski2016-08-131-4/+10
| | | | | | | 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>
* base-files: board_detect: allow specifying the generated fileJonas Gorski2016-08-132-4/+6
| | | | | | | Allow passing a filename to change the location of the generated board.json. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* base-files: let config_generate call board_detectJonas Gorski2016-08-133-4/+2
| | | | | | | 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>
* preinit: use only the image config optionsMathias Kresin2016-08-102-19/+0
| | | | | | | | | | 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>
* kernel: remove unused morse led trigger driverFelix Fietkau2016-08-042-16/+0
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* sysupgrade: unmount filesystems before rebootMathias Kresin2016-08-041-0/+1
| | | | | | | | | | | | | | | 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>
* base-files: remove dead codeDaniel Golle2016-08-041-6/+0
| | | | | | | | | /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>
* base-files: increase vm.min_free_kbytesFelix Fietkau2016-08-011-0/+16
| | | | | | | | 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>
* base-files: sysupgrade: fix pseudobridge upgradesConn O'Griofa2016-07-241-1/+1
| | | | | | 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>
* base-files: use procd init for urandom_seedEtienne CHAMPETIER2016-07-272-25/+28
| | | | | | | | | | 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>
* base-files: remove support of profile-specific base-filesFelix Fietkau2016-07-261-15/+0
| | | | | | | It is incompatible with multi-profile builds and has not been used in-tree anyway. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: seed /dev/urandomEtienne CHAMPETIER2016-06-303-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* base-files: use LEDE NTP vendor poolJo-Philipp Wich2016-06-282-5/+5
| | | | | | The vendor NTP pool for the LEDE project got approved, so switch to it now. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: sysfixtime no longer exclude dnsmasq.timeKevin Darbyshire-Bryant2016-06-241-1/+1
| | | | | | | | 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>
* base-files: Add standard os-release fileDaniel Dickinson2016-06-244-6/+38
| | | | | | | | | | | /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>
* base-files: remove fstab symlinkJohn Crispin2016-06-172-1/+2
| | | | | | the symlink no longer gets used since we switched to the block-mount tool. Signed-off-by: John Crispin <john@phrozen.org>
* base-files: increase default system log size to 64 kBHannu Nyman2016-06-072-1/+2
| | | | | | | | 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>
* base-files: maintain LED config stateJo-Philipp Wich2016-06-081-5/+17
| | | | | | | | 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>
* base-files: fix /bin/config_generate breakageFelix Fietkau2016-06-081-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: drop /etc/config/systemJo-Philipp Wich2016-06-081-12/+0
| | | | | | | 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>
* base-files: rework config generation logicJo-Philipp Wich2016-06-082-18/+20
| | | | | | | | | | | | 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>
* base-files: support port_state LED types in board.dJo-Philipp Wich2016-06-082-0/+27
| | | | | | Add support for handling port_state LEDs as used by ADM5120. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: support hostname and ntp servers through board.dJo-Philipp Wich2016-06-081-0/+47
| | | | | | Add support for specifying hostname and NTP servers via /etc/board.d/ scripts. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: reset LED stateJo-Philipp Wich2016-06-071-0/+6
| | | | | | | | 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>
* base-files: rework postinstall uci-defaults handlingJo-Philipp Wich2016-05-271-5/+4
| | | | | | | | | | | | | | | 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>
* x86: generalize partition discovery for sysupgradeJo-Philipp Wich2016-05-241-1/+1
| | | | | | | | | | | | | | | 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>
* Centralize setting of all version info to include/version.mkHannu Nyman2016-05-241-1/+1
| | | | | | | | | 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>
* base-files: fix some failsafe issuesJohn Crispin2016-05-231-0/+1
| | | | | | * if the shell was closed booting continued Signed-off-by: John Crispin <john@phrozen.org>
* base-files: sysfixtime typo in exclude dnsmasq.timeKevin Darbyshire-Bryant2016-05-191-1/+1
| | | | | | | 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>
* base-files: sysfixtime exclude dnsmasq.timeKevin Darbyshire-Bryant2016-05-191-1/+10
| | | | | | | | | | | | | | | | | | | | | 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>
* Revert "base-files: sysfixtime exclude dnsmasq.time"Jo-Philipp Wich2016-05-191-10/+1
| | | | | | | | This reverts commit 382779e009af7c1c688fbd98adf71fb19ce66254. Reverting this commit due to a missing Signed-off-by. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* base-files: sysfixtime exclude dnsmasq.timeKevin Darbyshire-Bryant2016-05-181-1/+10
| | | | | | | | | | | | | | | | | | | 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.
* base-files: Enhancements to /etc/profileVittorio G (VittGam)2016-05-141-0/+4
| | | | | | - 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>
* base-files: Fix config_generate when there are no switch VLANs or ports ↵Vittorio Gambaletta (VittGam)2016-05-111-38/+42
| | | | | | | | | | 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>
* base-files: evaluate uci-defaults on run-time installationsDaniel Golle2016-05-041-0/+11
| | | | | | | | | | | | 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>
* signing: remove unatteded build key and use current keyring insteadJo-Philipp Wich2016-04-301-2/+0
| | | | | | | | 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>
* base-files: fix group/user settings after sysupgradeJohn Crispin2016-04-291-0/+11
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* base-files: split user/group addition code into a functionJohn Crispin2016-04-291-4/+10
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* base-files: add new public key used by unattended buildsJohn Crispin2016-04-292-2/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>