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>
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>
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>
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
oneshot and timer have the same configuration options, just a different
trigger name.
Signed-off-by: Karl Palsson <karlp@etactica.com>
SVN-Revision: 48770
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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
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
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