Skip to content

Commit 4b3ee0f

Browse files
authored
Merge pull request #1222 from kernelkit/xpi-boot-time
2 parents 151d04a + 06a4995 commit 4b3ee0f

File tree

11 files changed

+273
-40
lines changed

11 files changed

+273
-40
lines changed

board/aarch64/bananapi-bpi-r3/genimage.cfg.in

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,23 @@ image cfg.ext4 {
44
size = 128M
55
ext4 {
66
label = "cfg"
7+
use-mke2fs = true
8+
features = "uninit_bg"
9+
extraargs = "-m 0 -i 4096"
710
}
811
}
912

13+
# The /var partition will be expanded automatically at first boot
14+
# to use the full size of the SD-card or eMMC media.
1015
image var.ext4 {
1116
empty = true
1217
temporary = true
13-
size = 1G
18+
size = 128M
1419
ext4 {
1520
label = "var"
1621
use-mke2fs = true
22+
features = "uninit_bg"
23+
extraargs = "-m 0 -i 4096"
1724
}
1825
}
1926

board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ image cfg.ext4 {
55

66
ext4 {
77
label = "cfg"
8+
use-mke2fs = true
9+
features = "uninit_bg"
10+
extraargs = "-m 0 -i 4096"
811
}
912
}
1013

14+
# The /var partition will be expanded automatically at first boot
15+
# to use the full size of the SD-card or eMMC media.
1116
image var.ext4 {
1217
empty = true
1318
temporary = true
14-
size = 512M
19+
size = 128M
1520

1621
ext4 {
1722
label = "var"
18-
use-mke2fs = true
23+
use-mke2fs = true
24+
features = "uninit_bg"
25+
extraargs = "-m 0 -i 4096"
1926
}
2027
}
2128

board/aarch64/raspberrypi-rpi64/genimage.cfg.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,24 @@ image cfg.ext4 {
1515

1616
ext4 {
1717
label = "cfg"
18+
use-mke2fs = true
19+
features = "uninit_bg"
20+
extraargs = "-m 0 -i 4096"
1821
}
1922
}
2023

24+
# The /var partition will be expanded automatically at first boot
25+
# to use the full size of the SD-card or eMMC media.
2126
image var.ext4 {
2227
empty = true
2328
temporary = true
24-
size = 512M
29+
size = 128M
2530

2631
ext4 {
2732
label = "var"
28-
use-mke2fs = true
33+
use-mke2fs = true
34+
features = "uninit_bg"
35+
extraargs = "-m 0 -i 4096"
2936
}
3037
}
3138

board/common/mkaux.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ image aux.ext4 {
1111
ext4 {
1212
label = "aux"
1313
use-mke2fs = true
14-
features = "^metadata_csum,^metadata_csum_seed"
14+
features = "^metadata_csum,^metadata_csum_seed,uninit_bg"
15+
extraargs = "-m 0 -i 4096"
1516
}
1617
}
1718

board/common/rootfs/etc/fstab

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ cfgfs /config configfs nofail,noauto 0 0
1515
# The chosen backing storage for the overlays placed on /cfg, /etc,
1616
# /home, /root, and /var, are determined dynamically by /usr/libexec/infix/mnt
1717
# depending on the available devices.
18-
mnttmp /mnt/tmp tmpfs defaults 0 0
19-
LABEL=aux /mnt/aux auto noatime,nodiratime,noauto 0 0
20-
LABEL=var /mnt/var auto noatime,nodiratime,noauto 0 0
21-
LABEL=cfg /mnt/cfg auto noatime,nodiratime,noauto 0 0
22-
hostfs /mnt/host 9p cache=none,msize=16384,noauto 0 0
23-
/usr/libexec/infix/mnt# /cfg helper none 0 0
18+
mnttmp /mnt/tmp tmpfs defaults 0 0
19+
LABEL=aux /mnt/aux auto noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0
20+
LABEL=var /mnt/var auto noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0
21+
LABEL=cfg /mnt/cfg auto noatime,nodiratime,noauto,commit=30,errors=remount-ro 0 0
22+
hostfs /mnt/host 9p cache=none,msize=16384,noauto 0 0
23+
/usr/libexec/infix/mnt# /cfg helper none 0 0

board/common/rootfs/usr/libexec/infix/mnt

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ set -e
1919

2020
nm=$(basename "$0")
2121
err=0
22+
mmc=""
2223
opt="-k"
2324

2425
# External button or bootloader changed kernel command line
@@ -53,17 +54,22 @@ factory_reset()
5354

5455
is_mmc()
5556
{
57+
[ -n "$mmc" ] && return $mmc
58+
5659
# Check if primary or secondary partition (our rootfs) is on MMC
5760
for label in primary secondary; do
5861
devname=$(find_partition_by_label "$label" 2>/dev/null)
5962
if [ -n "$devname" ]; then
6063
case "$devname" in
6164
mmcblk*)
65+
mmc=0
6266
return 0
6367
;;
6468
esac
6569
fi
6670
done
71+
72+
mmc=1
6773
return 1
6874
}
6975

@@ -89,8 +95,15 @@ find_partition_by_label()
8995

9096
for diskpath in /sys/class/block/*; do
9197
devname=$(basename "$diskpath")
98+
99+
# Skip partitions, only check whole disks
92100
[ -f "$diskpath/partition" ] && continue
93101

102+
# Skip ram, loop, and other virtual devices
103+
case "$devname" in
104+
ram*|loop*|nullb*|dm-*) continue ;;
105+
esac
106+
94107
disk="/dev/$devname"
95108
result=$(sgdisk -p "$disk" 2>/dev/null | awk -v label="$label" -v devname="$devname" '
96109
/^ *[0-9]/ {
@@ -133,7 +146,7 @@ status()
133146

134147
print_start()
135148
{
136-
printf '\r%s%s' "$(status 3)" "$*" > /dev/console
149+
printf '\r\033[K%s%s' "$(status 3)" "$*" > /dev/console
137150
}
138151

139152
print_end()
@@ -146,6 +159,12 @@ print_end()
146159
fi
147160
}
148161

162+
# Restore Finit's original progress message so its [ OK ] appears correctly
163+
print_restore()
164+
{
165+
print_start "Mounting filesystems from /etc/fstab"
166+
}
167+
149168
# Helper to log resize error and create failure marker (stage 1)
150169
resize_err()
151170
{
@@ -245,9 +264,7 @@ resize_filesystem()
245264
mv /mnt/aux/resized.pending /mnt/aux/resized
246265
sync
247266

248-
# Restore Finit's original progress message so its [ OK ] appears correctly
249-
print_start "Mounting filesystems from /etc/fstab"
250-
267+
print_restore
251268
return 0
252269
}
253270

@@ -259,15 +276,21 @@ mount_rw()
259276
# Check if /var has been resized to fill the sdcard/eMMC
260277
if [ "$1" = "var" ] && is_mmc; then
261278
if [ -f /mnt/aux/resized ] || [ -f /mnt/aux/resized.failed ]; then
279+
# 3. Already done
262280
:
263281
elif [ -f /mnt/aux/resized.pending ]; then
282+
# 2. After reboot we can resize ext4
264283
resize_filesystem "$1"
265284
else
285+
# 1. Start with resizing the var partition to the end of the media
266286
resize_partition "$1"
267287
fi
268288
fi
269289

270290
# TODO: Also look for UBI partitions
291+
292+
#
293+
tune2fs -c 0 -i 0 LABEL="$1" 2>/dev/null
271294
mount LABEL="$1" 2>/dev/null && return 0
272295

273296
return 1

configs/aarch64_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ BR2_PACKAGE_MG=y
124124
BR2_PACKAGE_NANO=y
125125
BR2_TARGET_ROOTFS_SQUASHFS=y
126126
# BR2_TARGET_ROOTFS_TAR is not set
127+
BR2_PACKAGE_HOST_BMAP_TOOLS=y
127128
BR2_PACKAGE_HOST_E2FSPROGS=y
128129
BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y
129130
BR2_PACKAGE_HOST_GENEXT2FS=y

configs/aarch64_minimal_defconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ BR2_PACKAGE_MG=y
100100
BR2_PACKAGE_NANO=y
101101
BR2_TARGET_ROOTFS_SQUASHFS=y
102102
# BR2_TARGET_ROOTFS_TAR is not set
103+
BR2_PACKAGE_HOST_BMAP_TOOLS=y
103104
BR2_PACKAGE_HOST_E2FSPROGS=y
104105
BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y
105106
BR2_PACKAGE_HOST_GENEXT2FS=y
@@ -114,8 +115,11 @@ INFIX_HOME="https://github.com/kernelkit/infix/"
114115
INFIX_DOC="https://kernelkit.org/infix/"
115116
INFIX_SUPPORT="mailto:[email protected]"
116117
BR2_PACKAGE_ALDER_ALDER=y
118+
BR2_PACKAGE_BANANAPI_BPI_R3=y
119+
BR2_PACKAGE_FRIENDLYARM_NANOPI_R2S=y
117120
BR2_PACKAGE_MARVELL_CN9130_CRB=y
118121
BR2_PACKAGE_MARVELL_ESPRESSOBIN=y
122+
BR2_PACKAGE_RASPBERRYPI_RPI64=y
119123
BR2_PACKAGE_STYX_DCP_SC_28P=y
120124
BR2_PACKAGE_CONFD=y
121125
BR2_PACKAGE_CONFD_TEST_MODE=y

configs/riscv64_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb"
164164
BR2_TARGET_UBOOT_SPL=y
165165
BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl.bin.normal.out"
166166
BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_INFIX_PATH)/board/riscv64/visionfive2/uboot/visionfive2-env.dtsi"
167+
BR2_PACKAGE_HOST_BMAP_TOOLS=y
167168
BR2_PACKAGE_HOST_GENIMAGE=y
168169
BR2_PACKAGE_HOST_RAUC=y
169170
BR2_PACKAGE_HOST_UBOOT_TOOLS=y

doc/ChangeLog.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ Change Log
33

44
All notable changes to the project are documented in this file.
55

6+
[v25.11.0][UNRELEASED]
7+
-------------------------
8+
9+
### Changes
10+
11+
- Improvements to `sdcard.img` generation, useful for developers mostly:
12+
- The NanoPi R2S bootloader is now automatically built and uploaded to
13+
the [`latest-boot` release][lastest-boot] tag
14+
- The `utils/mkimage.sh` script now supports fetching the bootloader
15+
- The raspberrypi-rpi64 board's bootloader is now aptly named rpi64
16+
17+
### Fixes
18+
19+
- Fix #855: User admin sometimes fails to be added to `wheel` group
20+
- Fix serious regression in boot time, introduced in v25.10, delays the
21+
boot step "Mounting filesystems ..." with up to 30 seconds!
22+
23+
[lastest-boot]: https://github.com/kernelkit/infix/releases/latest-boot
24+
625
[v25.10.0][] - 2025-10-31
726
-------------------------
827

@@ -1725,7 +1744,8 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
17251744
- N/A
17261745

17271746
[buildroot]: https://buildroot.org/
1728-
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.09.0...HEAD
1747+
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.10.0...HEAD
1748+
[v25.11.0]: https://github.com/kernelkit/infix/compare/v25.10.0...v26.11.0
17291749
[v25.10.0]: https://github.com/kernelkit/infix/compare/v25.09.0...v26.10.0
17301750
[v25.09.0]: https://github.com/kernelkit/infix/compare/v25.08.0...v26.09.0
17311751
[v25.08.0]: https://github.com/kernelkit/infix/compare/v25.06.1...v26.08.0

0 commit comments

Comments
 (0)