Commit Graph

109 Commits

Author SHA1 Message Date
Bob Cantor
1688dda0ba base-files: wifi: for wifi up, scan_wifi after network reload
Commit b82cc8071366 included an unintended change and we now call
scan_wifi before a network reload.

Restore the original behaviour and call scan_wifi only after a network
reload.

Fixes: b82cc8071366 ("base-files: wifi: swap the order of some ubus calls")
Signed-off-by: Bob Cantor <bobc@confidesk.com>
2022-12-08 17:41:33 +08:00
Olliver Schinagl
cb419fc847 base-files: Actually set default name
The currently used shell expansion doesn't seem to exist [0] and also
does not work. This surely was not intended, so lets allow default
naming to actually work.

[0]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

Fixes: be09c5a3cd65 ("base-files: add board.d support for bridge device")
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2022-12-08 17:39:42 +08:00
Rucke Teg
fb92a12a00 base-file: remove password aging feature form /etc/shadow
In the default shadow file, as visible in the failsafe mode, the user
root has value of `0` set in  the 3rd field, the date of last password
change. This setting means that the password needs to be changed the
next time the user will log in the system. `dropbear` server is ignoring
this setting but `openssh-server` tries to enforce it and fails in the
failsafe mode because the rootfs is R/O.

Disable the password aging feature for user root by setting the 3rd
filed empty.

Signed-off-by: Rucke Teg <rucketeg@protonmail.com>
2022-12-08 17:38:14 +08:00
Rosen Penev
7c60c21768 base-files: replace fgrep with grep -F
fgrep is deprecated and replaced by grep -F. The latter is used
throughout the tree whereas this is the only usage of the former.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-12-08 17:36:23 +08:00
Paul Spooren
86e7043d56 base-files: fix /tmp/TZ when zoneinfo not installed
The zoneinfo packages are not installed per default so neither
/tmp/localtime nor /tmp/TZ is generated.

This patch mostly reverts the previous fix and instead incooperates a
solution suggested by Jo.

Fixes "base-files: fix zoneinfo support " 8af62ed

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-12-08 17:35:37 +08:00
Rosen Penev
d8f60f0b7f base-files: fix zoneinfo support
The system init script currently sets /tmp/localinfo when zoneinfo is
populated. However, zoneinfo has spaces in it whereas the actual files
have _ instead of spaces. This made the if condition never return true.

Example failure when removing the if condition:

/tmp/localtime -> /usr/share/zoneinfo/America/Los Angeles

This file does not exist. America/Los_Angeles does.

Ran through shfmt -w -ci -bn -sr -s

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-12-08 17:35:37 +08:00
Rafał Miłecki
bf08ffb051 base-files: call "sync" after initial setup
OpenWrt uses a lot of (b)ash scripts for initial setup. This isn't the
best solution as they almost never consider syncing files / data. Still
this is what we have and we need to try living with it.

Without proper syncing OpenWrt can easily get into an inconsistent state
on power cut. It's because:
1. Actual (flash) inode and data writes are not synchronized
2. Data writeback can take up to 30 seconds (dirty_expire_centisecs)
3. ubifs adds extra 5 seconds (dirty_writeback_centisecs) "delay"

Some possible cases (examples) for new files:
1. Power cut during 5 seconds after write() can result in all data loss
2. Power cut happening between 5 and 35 seconds after write() can result
   in empty file (inode flushed after 5 seconds, data flush queued)

Above affects e.g. uci-defaults. After executing some migration script
it may get deleted (whited out) without generated data getting actually
written. Power cut will result in missing data and deleted file.

There are three ways of dealing with that:
1. Rewriting all user-space init to proper C with syncs
2. Trying bash hacks (like creating tmp files & moving them)
3. Adding sync and hoping for no power cut during critical section

This change introduces the last solution that is the simplest. It
reduces time during which things may go wrong from ~35 seconds to
probably less than a second. Of course it applies only to IO operations
performed before /etc/init.d/boot . It's probably the stage when the
most new files get created.

All later changes are usually done using smarter C apps (e.g. busybox or
uci) that creates tmp files and uses rename() that is expected to be
atomic.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
2022-12-08 17:32:22 +08:00
naoki66
c910efbac4
system.ntp.enable_server default (#10158) 2022-09-20 19:50:09 +08:00
lean
35ae8c152e Revert "base-file: remove password aging feature form /etc/shadow"
This reverts commit ae7f2dbf40.
2022-02-25 23:17:10 +08:00
Rucke Teg
ae7f2dbf40 base-file: remove password aging feature form /etc/shadow
In the default shadow file, as visible in the failsafe mode, the user
root has value of `0` set in  the 3rd field, the date of last password
change. This setting means that the password needs to be changed the
next time the user will log in the system. `dropbear` server is ignoring
this setting but `openssh-server` tries to enforce it and fails in the
failsafe mode because the rootfs is R/O.

Disable the password aging feature for user root by setting the 3rd
filed empty.

Signed-off-by: Rucke Teg <rucketeg@protonmail.com>
2022-02-24 17:18:43 +00:00
Javier Marcet
33a4c251a2 base-files: upgrade: fix efi partitions size calculation
We were missing (not using) the last sector of each partition,
compared with the output of gparted.

Signed-off-by: Javier Marcet <javier@marcet.info>
[moved the dot]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-31 10:40:40 +08:00
aakkll
2972a0502d
base-files: add eMMC sysupgrade support (#8400)
Signed-off-by: aakkll <94471752+aakkll@users.noreply.github.com>

Co-authored-by: Enrico Mioso <mrkiko.rs@gmail.com>
2021-12-08 16:09:15 +08:00
Hugo Yuan
010702bc1a
base-file: Add mmc support (#8329) 2021-11-27 18:14:36 +08:00
Beginner
a763fe4e88
base-files: chmod 1777 /var/lock (#8120)
Per FHS 3.0, /var/lock is the location for lock files [1].
However its current permissions (755) are too restrictive
for use by unprivileged processes.
Debian and Ubuntu set them to 1777, and now so do we.

[1] <https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html#varlockLockFiles>

Signed-off-by: Deomid Ryabkov <rojer@rojer.me>
[fixed typo in commit message, had to remove "rojer" due to git hooks]
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>

Co-authored-by: Deomid Ryabkov <rojer@rojer.me>
2021-10-26 22:22:11 +08:00
AmadeusGhost
56c4a5e91c base-files: switch the banner to lede 2021-10-08 11:40:18 +08:00
Beginner
c85f84bfde
base-files: reduce sed calls (#7924)
* base-files: reduce `sed` calls

The `sed`-script shouldn't be called multiple times, especially not with
the same files.

This commit merges all files together in a single `sed`-script call.

Signed-off-by: Paul Spooren <mail@aparcar.org>

* base-files: reduce number of `mkdir` calls

The `mkdir` commands supports passing multiple arguments to batch create
multiple folders, instead of calling the tool every single time.

If the creation of one of the folders fails, all other folder are still
created and therefore doesn't change the error handling.

Also stop creating `/etc/` explicitly after subfolders of `/etc/` were
already created.

Signed-off-by: Paul Spooren <mail@aparcar.org>

Co-authored-by: Paul Spooren <mail@aparcar.org>
2021-09-25 01:40:03 +08:00
Beginner
9b519e7747
base-files: add option to make /var persistent (#7719)
* base-files: add option to make /var persistent

In OpenWrt, /var is symlinked to /tmp by default. This is done to reduce
the amount of writes to the flash chip, which often have not the
greatest durability. As a result, things like DHCP or UPnP lease files,
are not persistent across reboots.

Since OpenWrt can run on devices with more durable storage, it makes
sense to have an option for a persistent /var. Add an option to make
/var persistent. When enabled, /var will no longer be symlinked to /tmp,
but /var/run will be symlink to /tmp/run, as it should contains only
files that should not be kept during reboot. The option is off by
default, to maintain the current behaviour.

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

* base-files: fix option to make /var persistent

The option was initially named TARGET_ROOTFS_LN_VAR_TMP, and the check
was correct. When renaming the option to something more suitable, the
check was changed to check for n, but when an option is not set, it's
not n but empty. This results in the check always evaluating to false.
Fix the check by checking for y with ifneq.

Fixes: 57807f50ded6 ("base-files: add option to make /var persistent")

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

Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-08-24 19:13:55 +08:00
Beginner
401af3c26f
base-files: sysupgrade stage2: fix losetup detection (#7601)
If the busybox applet losetup was selected, `command -v` selects that
during sysupgrade. As this applet is in another path and doesn't cover
the '-D' option which is used to make sure user-defined loop devices
are no longer active during sysupgrade.
Detect losetup at the path of the full utility to avoid error messages
in case of the busybox applet being selected.

Reported-by: fda77 <fda77@users.noreply.github.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>

Co-authored-by: Daniel Golle <daniel@makrotopia.org>
2021-08-06 09:29:44 +08:00
qianxu2001
0deda920ef
base-files: NTP change (#7252)
https://help.aliyun.com/document_detail/92704.html
2021-07-02 21:39:39 +08:00
Bob Cantor
d444b78fc9 base-files: wifi: tidy up the reconf code
commit 5edbd390d321532d9a697d6895a1a7c71c40bd5d rearranged the
"wifi up" code.

This commit tidies up the "wifi reconf" code so as to
keep it aligned with the "wifi up" code.

branches affected: trunk, 21.02

Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
2021-06-29 11:17:51 +08:00
Bob Cantor
420bd45ca2 base-files: wifi: swap the order of some ubus calls
"/sbin/wifi up" makes three ubus calls:
1. ubus call network reload
2. ubus call network.wireless down
3. ubus call network.wireless up

The first and third ubus calls call drv_mac80211_setup,
while the second ubus call triggers wireless_device_setup_cancel,
so the call sequence becomes,

1. drv_mac80211_setup
2. wireless_device_setup_cancel
3. drv_mac80211_setup

This commit swaps the order of the first two ubus calls,
1. ubus call network.wireless down
2. ubus call network reload
3. ubus call network.wireless up

Consequently drv_mac80211_setup is only called once,
and two related bugs (#FS3784 and #FS3902) are no longer triggered
by /sbin/wifi.

branches affected: trunk, 21.02

Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
2021-06-29 11:17:32 +08:00
dansir
7143083908
base-files: NTP servers set for CN users (#7101) 2021-06-20 05:28:04 +00:00
lean
a3f1e837fd x64: fix grub2 booting 2021-06-15 17:58:07 +08:00
lean
7a50383ab6 add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
acooler15
22cfbe7faa
add function extra_command (#6357) 2021-02-11 09:19:12 +08:00
AmadeusGhost
5b1838d04d
kernel: bump 5.4 to 5.4.95 (#6340) 2021-02-08 17:13:28 +08:00
AmadeusGhost
404209f6c4
kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350)
kernel: bump to 4.14.193, 4.19.138, 5.4.59 (#5350)
  431fb8c mac80211: add AQL improvements
  6bdd4c9 mac80211: add missing backports for building with 4.14 kernels
  0106820 mac80211: add missing return code checks in AQL improvements
  e7f7101 mac80211: rework encapsulation offload support

[package]
  base-files: add function for generating random MAC
  dnsmasq: abort dhcp_check on interface state
  boot: sync upstream source code
  ath10k-ct-firmware/mt76/sch_cake: update to latest git HEAD

[script]
  download: add China Mirror Station

[target]
  Sync: arc770, ath79, bcm63xx, kirkwood, lantiq, layerscape,
        mediatek, mvebu, octeon, oxnas, pistachio, uml
  Sync most of the target patches.

Run-compiled-on: ipq40xx (4.19 & 5.4), ramips
2020-08-26 11:31:50 +08:00
coolsnowwolf
33abeff31c Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
AmadeusGhost
463b6ac050
mac80211: fixed slow wireless startup (#4420)
* hostapd: reduce to a single instance per service

* mac80211: sync upstream source code

* iw: bump to 5.4
2020-04-23 16:42:46 +08:00
lean
aadf217f55 dropbear: bump to 2019.78 2020-03-22 18:35:41 +08:00
AmadeusGhost
6901278ef0
kernel: bump to 4.14.169, 4.19.101 (#2963)
* kernel: bump to 4.14.169, 4.19.101

* uboot: update to latest

* mediatek: bump to v4.19

* ath79: switch to wpad

* Revert 'grub2: update to latest'
2020-02-06 21:45:40 +08:00
coolsnowwolf
ecea39f109 Revert "files: sync from openwrt v19.07 (#2690)"
This reverts commit 2289184a62.
2020-02-03 12:33:25 +08:00
coolsnowwolf
4f81d5b082 Revert "OpenWrt v19.07.1: adjust config defaults"
This reverts commit b7007324c0.
2020-02-03 12:33:12 +08:00
coolsnowwolf
b7007324c0 OpenWrt v19.07.1: adjust config defaults 2020-02-01 19:25:36 +08:00
coolsnowwolf
bffe4e4f82 import urandom-seed and urngd for v19.07 2020-02-01 18:35:27 +08:00
AmadeusGhost
2289184a62
files: sync from openwrt v19.07 (#2690) 2020-02-01 16:50:37 +08:00
LEAN-ESX
7655ad367f fstool: mount/umount fs without reboot 2019-12-08 09:30:10 -08:00
LEAN-ESX
7983beada3 base-files: add 'wifi reconf' 2019-11-23 19:03:29 -08:00
70599
bce1bc143d fix wrong permissions after sysupgrade on ext4 2019-04-17 11:21:02 +08:00
coolsnowwolf
472192311a fix vhdx and kvm qcow2 support 2019-01-03 21:06:34 +08:00
coolsnowwolf
347daa04b2 Merge branch master of https://github.com/coolsnowwolf/lede 2019-01-03 19:29:28 +08:00
coolsnowwolf
55fcee2e7c enable x64 EFI image sysupgrade 2018-10-14 13:05:42 +08:00
coolsnowwolf
9d54c42ced update base-files sync with upstream 2018-10-14 12:59:07 +08:00
coolsnowwolf
fa33774bdc Enable x86/x64 to Generate EFI grub images 2018-10-09 00:13:34 +08:00
coolsnowwolf
4535f6199d sync disk after boot done to make sure data/config store to flash/disk 2018-10-08 23:40:45 +08:00
coolsnowwolf
1d7825e64b change software repo to OpenWrt v18.06.1 2018-09-27 11:11:16 +08:00
coolsnowwolf
806f5db174 sync with OpenWrt trunk 2018-09-07 13:43:55 +08:00
coolsnowwolf
9ba04fd0d7 sync with OpenWrt v18.06.1 stable new R8.1 version 2018-08-23 17:40:23 +08:00
coolsnowwolf
8fe0636b8a Merge branch 'master' of github.com:lede-project/source 2018-04-23 18:50:49 +08:00
coolsnowwolf
2881c86f2b enable EFI+GPT grub2 images for x86/x64 platforms (such as Atom N2600) 2018-03-29 22:41:20 +08:00
coolsnowwolf
20f7e75789 update to R7.5.4 2018-01-15 18:26:41 +08:00
coolsnowwolf
b1266c659b fix some target VLAN switch untagged settings 2018-01-13 16:14:03 +08:00
coolsnowwolf
b0f643aa87 update to R7.5.3 stable to fix firewall freeze 2018-01-10 20:55:06 +08:00
coolsnowwolf
229cde62a4 Merge branch 'master' of https://github.com/lede-project/source 2018-01-09 14:38:15 +08:00
coolsnowwolf
9e5e9c5c84 change feeds from LEDE to OpenWrt 2017-12-12 17:11:36 +08:00
coolsnowwolf
7185e1ceb2 merge: change branding for LEDE to OpenWrt 2017-12-12 16:57:14 +08:00
coolsnowwolf
c682ebad62 enable generate EFI+GPT grub2 ext4 images for x86/x64 platforms 2017-10-20 13:23:12 +08:00
coolsnowwolf
a0b7b59431 change default package 2017-09-12 22:09:24 +08:00
coolsnowwolf
97a4ffcc12 update source 2017-09-06 19:19:45 +08:00