Commit Graph

306 Commits (899a23227e5587078e71b599ca447ccfb9b8af79)

Author SHA1 Message Date
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
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 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 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 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 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
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
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
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
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
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
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
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 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
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
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 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
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
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
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 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 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 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
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
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