Enable the busybox feature to save shell command history.
(.apk size increase 0.5 kB)
To prevent flash wear,
* save history only at the exit from a shell session, and
* set /tmp as the default location for the history file. The history
is kept on ramdisk until a reboot, when the history is then lost.
If the user wants to save history onto flash, he can change the location
definition in /etc/profile.d/busybox-history-file.sh
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/17179
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
47b54cf5a4b6 types: introduce `ucv_array_sort_r()` and `ucv_object_sort_r()`
efeb57806552 types, vm: refactor usage of global variables
f9d2faf67de6 vm: reset signals when freeing VM
4e86847d802d lib: utilize `ucv_array_sort_r()` and `ucv_object_sort_r()`
c71444ea301f types: ucv_resource_create(): rename `typename` parameter to `type`
373df7299c79 nl80211: properly support split_wiphy_dump for single phys
9bcd25f54708 lexer: Preserve keyword, regexp flags until processing non-comment tokens
0a7ff4715cb8 main: pretty-print `-p` output by default
4c3d5b469156 struct: Add new buffer API for incremental packing/unpacking
efc4122124cb struct: do not use global variables for caching types
Fixes: https://github.com/jow-/ucode/issues/248
Fixes: https://github.com/jow-/ucode/issues/250
Fixes: https://github.com/efahl/owut/issues/25
Link: https://github.com/openwrt/openwrt/pull/17191
Signed-off-by: Robert Marko <robimarko@gmail.com>
Change the cron log level in init script from 5 to 7
in order to match previous log behavior and to avoid
log spam every minute.
Busybox cron only uses levels 5,7,8, where 5 is debug and
7 and 8 are normal logging. Use 7 as default.
(Fun note: this is needed because upstream corrected an
ancient bug in their own log level handling and now 5 actually
means something.)
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/17107
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add a patch to fix non-x86 builds, refresh patches and update/fix the
configuration as described in 98b09ba250 (cited here for future reference).
Config refresh:
Refresh commands, run after busybox is first built once:
cd package/utils/busybox/config/
../convert_menuconfig.pl ../../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/busybox-default/busybox-1.37.0
cd ..
./convert_defaults.pl ../../../build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/busybox-default/busybox-1.37.0/.config > Config-defaults.in
Manual edits needed after config refresh:
* Config-defaults.in: OpenWrt config symbol IPV6 logic applied to
BUSYBOX_DEFAULT_FEATURE_IPV6
* Config-defaults.in: OpenWrt config TARGET_bcm53xx logic applied to
BUSYBOX_DEFAULT_TRUNCATE (commit 547f1ec)
* Config-defaults.in: OpenWrt logic applied to
BUSYBOX_DEFAULT_LOGIN_SESSION_AS_CHILD (commit dc92917)
* Config-defaults.in: correct the default ports that get reset
BUSYBOX_DEFAULT_FEATURE_HTTPD_PORT_DEFAULT 80
BUSYBOX_DEFAULT_FEATURE_TELNETD_PORT_DEFAULT 23
* config/editors/Config.in: Add USE_GLIBC dependency to
BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH (commit f141090)
* config/shell/Config.in: change at "Options common to all shells" the conditional symbol
SHELL_ASH --> BUSYBOX_CONFIG_SHELL_ASH
(discussion in http://lists.openwrt.org/pipermail/openwrt-devel/2021-January/033140.html
Apparently our script does not see the hidden option while
prepending config options with "BUSYBOX_CONFIG_" which leads to a
missed dependency when the options are later evaluated.)
* Edit a few Config.in files by adding quotes to sourced items in
config/Config.in, config/networking/Config.in and config/util-linux/Config.in (commit 1da014fcca)
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
[rebased with the change download line commit]
[corrected version in the refresh example in commit message]
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/17107
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
b0b5d93 Merge pull request #234 from IdWV/fs
60e7a88 Merge pull request #232 from sebastianertz/lib-digest
1752779 digest: implement compile time option to exclude less common algorithms
c7268a1 ci: include libmd in MacOS CI builds
fcb6f70 lib: introduce digest library
1323a27 Merge pull request #246 from jow-/fix-upvalue-resolve
ed5ce8f types: resolve upvalue values in arrays and objects
a6e0641 vm: resolve upvalues before pushing them onto the stack
ef1baab ci: drop OpenWrt tests for now
63e18ea fs: eliminate the usage of global variables
b1bd7b5 types: add ucv_resource_create() helper
3408edf Merge pull request #244 from nbd168/nl80211
8af77e7 nl80211: add new attributes for multi-radio support
1423ad7 nl80211: cover extended feature and EHT rate info attributes
ee1d6d8 Merge pull request #237 from sebastianertz/math
4b18a9b Merge pull request #213 from jow-/improve-vector-macros
1f022c0 math: removed global variable for thread safety
e5fe6b1 treewide: refactor vector usage code
20307ee utils: improve vector utilities
aa18952 Merge pull request #241 from jow-/socket-local-fanout-decl
79ccd9c socket: provide local definition of `struct fanout_args`
402280d Merge pull request #239 from jow-/safe-insert-during-obj-iteration
07afe96 Merge pull request #240 from jow-/stricter-number-conversion
736d450 types: fix potential use after free on adding keys during iteration
4134e71 vallist: more thoroughly check for trailing garbage after numeric string
9cf53dd Merge pull request #226 from jow-/lexer-improvements
2b2e732 lexer: make api functions public
855854f lexer: emit comment and template statement block tokens
328a50f lexer: improve token position reporting
fa22732 Merge pull request #225 from jow-/compiler-fix-keyword-property-labels-after-spread
6e88c62 Merge pull request #224 from jow-/lib-fs-readline-leak
94d1211 compiler: properly treat property names after spread expressions
67cd123 fs: fix potential memory leak on i/o errors in .read()
Signed-off-by: John Crispin <john@phrozen.org>
Now that omnia-eeprom is marked nonshared building the cortex-a9 mvebu
subtarget will fail with:
ERROR: unable to select packages:
omnia-eeprom (no such package):
required by: world[omnia-eeprom]
This is because omnia-eeprom depends on TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia
which will not be satisfied in buildbots since CONFIG_TARGET_ALL_PROFILES
and CONFIG_TARGET_PER_DEVICE_ROOTFS are set in which case
CONFIG_TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia is not set.
So, lets simply depend on the mvebu/cortex-a9 subtarget.
Fixes: 371e7bef40 ("omnia-eeprom: Mark it nonshared")
Link: https://github.com/openwrt/openwrt/pull/17007
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add ubihealthd to the nand-utils package, auto-create UCI config for
each UBI device and launch the daemon on boot.
The default time interval between scrubbing a random PED is 120 seconds
which means that a fully used 128 MiB flash chip gets scrubbed in about
a day and a half. The interval can be adjusted in UCI using the
'interval' option.
Suggested-by: Rodrigo Balerdi <lanchon@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/openwrt/pull/16973
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This tool was build in the phase 2 build, there the
TARGET_mvebu_cortexa9_DEVICE_cznic_turris-omnia dependecy was probably
not meat. Mark it as non shared to build it together with the target
where this option is set.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/16975
Signed-off-by: Robert Marko <robimarko@gmail.com>
This tool was build in the phase 2 build, there the TARGET dependencies
are probably not meat. Mark it as non shared to build it together with
the targets where this option is set.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Link: https://github.com/openwrt/openwrt/pull/16975
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add a new utility, `omnia-eeprom`, which can be used to print / set
EEPROM fields on Turris Omnia.
One example when this utility might be useful is if the board
experiences random crashes due to newer versions of the DDR training
algorithm in newer U-Boot. The user can change the DDR speed from 1600K
to 1333H to solve these issues, with
```
omnia-eeprom set ddr_speed 1333H
```
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://github.com/openwrt/openwrt/pull/16264
Signed-off-by: Robert Marko <robimarko@gmail.com>
Since the image builder pulls package lists from metadata directly,
add procd and busybox as depdendencies to base-files.
As for the package manager itself, since it can be disabled it needs
to be added directly in the image builder makefile
Fixes: 44598c233d ("build: remove broken dependency of metadata on toplevel .config variables")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Needed to fix compilation with GCC14.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16912
Signed-off-by: Robert Marko <robimarko@gmail.com>
Instead of relying on .config symbols for metadata, alter the DEFAULT
variable of affected packages. Fixes enabling opkg vs apk among others.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Refactor version of spidev_test for APK.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16917
Signed-off-by: Robert Marko <robimarko@gmail.com>
Both packages `ombnia-mcu-firmware` and `omnia-mcutool` would depend on
a specific device. The buildbots however build all devices and therefore
the package isn't build at all, due to unmet dependencies.
While this didn't cause issues with OPKG, APK fails actively due to the
missing packages. Drop the specific dependency, however wants to install
unrelated firmware on any device can do that anyway.
Signed-off-by: Paul Spooren <mail@aparcar.org>
The mirror hash has changed after 8009342.
Fixes: 8009342f43 ("bcm27xx-utils: fix version for APK")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Refactor version of omnia-mcutool for APK.
Switch to git clone and use hash instead of converting 0.3-rc3 to 0.3.3.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Improve support for power button handling.
d9a2878 - Use /sys/class/gpio/mcu_power for monitoring the MCU power line
02b6005 - Use "halt" instead of "shutdown"
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
The previous host installation fix accidentally moved the rpath settings
out of CMAKE_HOST_OPTIONS and into CMAKE_OPTIONS.
Fixes: ae42ecaad4 ("ucode: fix host installation")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
The busybox built with mips16 enabled has broken seq command.
Disassembling shows that the call to hard-float strtod in mips16
code is generated without the __call_stub_fp:
```
0x00406d6f <+118>: lw v0,32(sp)
0x00406d71 <+120>: sll s0,2
0x00406d73 <+122>: addu s0,v0,s0
0x00406d75 <+124>: lw a0,-4(s0)
0x00406d79 <+128>: jal 0x44ebc1 <strtod@mips16plt>
0x00406d7d <+132>: addiu a1,sp,84
0x00406d7f <+134>: sw v0,64(sp)
0x00406d81 <+136>: lw v0,0(s1)
0x00406d83 <+138>: sw v1,68(sp)
```
As a result, strtod returns the result in float point registers
while the calling mips16 code expect the result in v0/v1.
Disable mips16 on hard-float targets for now. The built .ipk goes
from 213316 bytes to 251419 bytes.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
The path for linking libucode.so was not specified for the ucode binary.
This breaks execution of ucode in the host context.
Signed-off-by: David Bauer <david.bauer@uniberg.com>
The company Zyxel rebranded some years ago.
Currently the casing is according to the old branding even
for newer devices which already use the new branding.
This commit aligns the casing of Zyxel everywhere.
Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15652
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
When running a failsafe shell on a console, job control was unavailable,
and ^C did not function correctly.
This change invokes console failsafe shells via `setsid`, making them
session leaders and allowing them to claim controlling terminals, which
makes job control function properly. To support this, the busybox
`setsid` utility is enabled. This has a minimal 149-byte size impact on
a test x86_64 squashfs rootfs image.
^C was ignored in subprocesses of failsafe shells: it was not possible
to ^C out of a program that would not exit on its own, such as many
typical `ping` invocations. As job control was unavailable, it was not
possible to suspend these subprocesses either, causing a hung program to
tie up a console indefinitely, unless another means to signal the
program was available. This was caused by SIGINT being placed at
disposition SIG_IGN by the shell running preinit, which it did because
the console shell was executed asynchronously with &. That disposition
was inherited by the console shell and its subprocesses, generally
causing ^C to have no effect.
As there is no way in busybox `ash` to reset the disposition of a signal
already ignored at shell entry, and no apparent way to avoid SIGINT
being placed at SIG_IGN when & is used in preinit, an alternative
construct is needed. Now, `start-stop-daemon` is used to start (-S) the
console failsafe shell in the background (-b). This approach does not
alter SIGINT, allowing the console shell to be started with that
signal's handling intact, and normal ^C processing to occur.
busybox `ash` has some behaviors conditional on SHLVL, and while the
console shells ought to run at SHLVL=1, they were not by virtue of being
started by the shell-based preinit system. Additionally, a variety of
detritus was present in the console shell's environment, carried over
from preinit. These conditions are corrected by running the console
shell via `env -i` to clear the environment and establish a minimum and
correct set of environment variables for operation, in the same manner
as `login`. HOME is not explicitly set, because it's addressed in
/etc/profile. For non-failsafe console shells when
system.@system[0].ttylogin = 0, `login -f root` achieves a similar
effect. (`login` already started non-failsafe console shells when
ttylogin = 1 and behaved correctly. This brings the ttylogin = 0 case to
parity.) Note that even `login -f` is somewhat undesirable for failsafe
shells because it requires a viable /etc/passwd, hence the `env -i`
construct in that case.
The TERM environment variable from the preinit environment, with value
"linux", would rarely be correct for serial consoles. Now, the preinit
TERM value is preserved (or set to "linux" if unset) only when the
console is /dev/console or /dev/tty[0-9]*. Otherwise, it will be set to
a safe default appropriate for serial consoles, "vt102", as used for
serial consoles by busybox init. This "linux"/"vt102" TERM setting is
also duplicated for non-failsafe console shells.
This also indicates failsafe mode by showing "- failsafe -" on all
consoles (not just the last-defined one). It sets a hostname of
"OpenWrt-failsafe" in failsafe mode which is rendered in the shell's
prompt as a reminder of the mode during interactive failsafe use.
Previously, no hostname was set, which resulted in the kernel-default
hostname, "(none)", appearing in failsafe shell prompts.
Signed-off-by: Mark Mentovai <mark@mentovai.com>
Link: https://github.com/openwrt/openwrt/pull/16113
Signed-off-by: Robert Marko <robimarko@gmail.com>
To better acommodate with the current browsers' requirements, also
self-signed certificates should have subjectAltName and
extendedKeyUsage defined in the self-signed x509 SSL certificates.
The following case sensitive options are now possible:
-addext subjectAltName=DNS:...
-addext subjectAltName=EMAIL:...
-addext subjectAltName=IP:...
-addext subjectAltName=URI:...
-addext extendedKeyUsage=serverAuth OR -addext extendedKeyUsage=any
Initial draft by Paul Donald <newtwen@gmail.com>
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/15366
Signed-off-by: Robert Marko <robimarko@gmail.com>
Bump omnia-mcutool to 0.3-rc3:
* The `--upgrade` option will now work even if MCU is in bootloader (for
example if previous upgrade was aborted).
* On boards with GD32 MCUs, `omnia-mcutool` will now refuse to upgrade
application firmware to version lower than 4.1 if bootloader version
is 2.0 (the original for first batch of boards with GD32 MCUs) since
these versions of application and bootloader are not compatible.
If user already upgraded to such a combination, an upgrade of
bootloader firmware is required.
The `--upgrade` option will inform about this and will automatically
upgrade bootloader firmware if the `--force` option is given.
(Note that version 4.1 of the MCU firmware was will be released soon,
once it is properly tested.)
* Various other improvements.
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://github.com/openwrt/openwrt/pull/16086
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add a new utility, omnia-mcutool, which main purpose is to upgrade the
firmware on the microcontroller on the Turris Omnia router. Depends on
omnia-mcu-firmware, and the upgrade process is pretty simple:
omnia-mcutool --upgrade
Besides firmware upgrade, the utility can be used to show and configure
various firmware settings.
Signed-off-by: Marek Mojík <marek.mojik@nic.cz>
Signed-off-by: Marek Behún <kabel@kernel.org>
Link: https://github.com/openwrt/openwrt/pull/13799
Signed-off-by: Robert Marko <robimarko@gmail.com>
Mark the package as nonshared to build it in the target specific build
step 1 of the build bots instead of the architecture generic build step
2. In the build step 2 it may be left out if we build it using a
different target.
Fixes: 24d6abe2d7 ("firmware-utils: new package replacing otrx")
Link: https://github.com/openwrt/openwrt/pull/16031
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Mark the package as nonshared to build it in the target specific build
step 1 of the build bots instead of the architecture generic build step
2. In the build step 2 it may be left out if we build it using a
different target.
Fixes: 8619d7af67 ("kirkwood: add D-Link DNS-320L support")
Link: https://github.com/openwrt/openwrt/pull/16031
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Move shell functions used for sysupgrade into /lib/upgrade/fit.sh.
Introduce improved fitblk boot device detection function which
works also in case ubiblock devices have not yet been created or
even UBI itself not yet being attached.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
73644a036f5a nl80211: move access to tb array out of uc_nl_convert_attr and below
6e3cf83a77a7 nl80211: add support for multi-attribute arrays
6ff24d5488a9 nl80211: update nl80211.h to latest wireless-next
abc2aef28641 nl80211: add wiphy multi-radio support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
`f2fslabel` is already built into `f2fs.fsck`, but is missing its symlink
in the final package.
Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/15851
Signed-off-by: Robert Marko <robimarko@gmail.com>
These things already get built and installed by tools/e2fsprogs. No need
to duplicate.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15822
Signed-off-by: Robert Marko <robimarko@gmail.com>
Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-March/104058.html
mtd-utils are currently depending on zlib, however it is not expressed
as a dependency and it is somehow being only pulled-in by lincurses-devel
so mtd-utils were able to compile.
Since 2.2.0 zlib is optional so lets disable support for it like for other
compressors since we dont package the mkfs.ubifs or mkfs.jffs2 that
are only users of compressors anyway.
Link: https://github.com/openwrt/openwrt/pull/15802
Signed-off-by: Robert Marko <robimarko@gmail.com>
Now that we are not patching mtd-utils with JFFS2 LZMA support there
is no need for autoreconf to be run.
Link: https://github.com/openwrt/openwrt/pull/15802
Signed-off-by: Robert Marko <robimarko@gmail.com>
We have been carrying the 100-fix_includes.patch and 130-lzma_jffs2.patch
for a long time but the reason is lost to history.
We dont need to carry the JFFS2 LZMA support patch as mkfs.jffs2 is not
even being packaged so its not even being used.
As for the 100-fix_includes.patch that also seems like a relic of history
as mtd-utils compiles fine without it.
So, lets drop both patches.
Link: https://github.com/openwrt/openwrt/pull/15790
Signed-off-by: Robert Marko <robimarko@gmail.com>