main/postmarketos-initramfs: start mdev/udev before setting up USB (MR 5852)

There might be additional kernel modules needed for the USB UDC to show up.
This used to work fine, but broke when the initramfs was unified with the
minimal one. We need to load modules/start udev before setting up USB.

Fix this by duplicating the setup calls in both init.sh and init_2nd.sh.
Both calls already have checks to allow calling them multiple times,
so we don't need to handle the initramfs-extra case in a special way.
[ci:skip-build]: already built successfully in CI
This commit is contained in:
Stephan Gerhold 2024-11-22 20:15:26 +01:00 committed by Oliver Smith
parent 49e70bd5f5
commit 85e0c1f0ba
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
3 changed files with 11 additions and 8 deletions

View File

@ -1,7 +1,7 @@
# Maintainer: Caleb Connolly <caleb@postmarketos.org>
# Co-Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=postmarketos-initramfs
pkgver=3.4.5
pkgver=3.4.6
pkgrel=0
pkgdesc="Base files for the postmarketOS initramfs / initramfs-extra"
url="https://postmarketos.org"
@ -105,9 +105,9 @@ sha512sums="
9c0e8f6f61d5da191e03a1aa9d5d0ceb5baf1eae6dbb9bfb0af59817783525119ac8394b135f303f7b6434a3eab0b49185fb90379e06823db847a4999c75ce33 00-initramfs-base.dirs
c0233d22858a5901db64e1d2fe1f6d39a2e2cfd1b94a10932483f55fed9461e9b8aa2d73b154b9d99a7a8b49ee02abfbddfe917ce0c6d7576601ba2668589c01 00-initramfs-base.files
d0f35562365756d93066ce45924d17fb347b54095179c3262daa2f073e12743505cd5d9372ad30485915ca754d95a8edba9a74314e7949e0b3cf6978a87d03a5 00-initramfs-extra-base.files
966284e8ef8f840258a84019db4a6ddd436cdc50193e0673532f70fef86a6e4c1bfd21b682f3708251b6b670ca569c90016926d0926babc5a0257bb33ae55d79 init.sh
c497ace6f3d183c48722b9e4fd2b6fed21338d68a9e729c1423d3c3de3eaae7366d8dd75a11f78b7072a6795dcc5380c10d8b390738372ede6dc78074ae87a76 init.sh
522e3e52921ad7e9ab689f37888ac439583bab2ee73455508262fbcbe06a85a8f3be753518f2706c5d20bb56ae28587cd61ac23e6602a7f17758147d4b6e3fe0 init_functions.sh
18a0ca97bca094aeb8cb1c2582205ac0aff131085c39f1715246541cacfb35434aba515cd5d338703843efb36b9effd494a51361c51fb39be6052ad866346d3d init_2nd.sh
8be2d5876629365e20b1daf9faabe28b038f330d20cc4ea6b95aa400279e56117e3c4b034b9b71d3c5c9a26c18dc3398013151ab3b8e92f9c994558c227fb608 init_2nd.sh
30fb52456376020e70116169752582d25a011a858111a347c2e53eccaddea8765fab502371cfdc0c2a8ca93034795b7e689e4cd3393ad601268c02024c4e84ab init_functions_2nd.sh
675e7d5bee39b2df7d322117f8dcaccc274d61beaf4d50ead19bbf2109446d64b1c0aa0c5b4f9846eb6c1c403418f28f6364eff4537ba41120fbfcbc484b7da7 mdev.conf
ba3275a9af788c7c782322a22a0f144d5e50e3498ea6886486a29331f23ae89cd32d500a3635cfa7cab369afba92edc18aeca64ccbf0cd589061cce23d15b46c unudhcpd.conf

View File

@ -32,9 +32,6 @@ echo " ❬❬ PMOS STAGE 1 ❭❭"
echo "initramfs version: $INITRAMFS_PKG_VERSION"
setup_firmware_path
setup_usb_network
start_unudhcpd
# Jump straight to the 2nd stage init if available
# (no separate -extra) or no-op otherwise
jump_init_2nd
@ -44,13 +41,16 @@ echo "Loading initramfs-extra..."
# We need mdev to find the boot partition
setup_mdev
load_modules /lib/modules/initramfs.load
setup_usb_network
start_unudhcpd
if [ "$IN_CI" = "false" ]; then
setup_framebuffer
show_splash "Loading..."
fi
load_modules /lib/modules/initramfs.load
# Discover the partitions if they're "subpartitions"
# (where the whole disk image is flashed to a partition)
mount_subpartitions

View File

@ -13,6 +13,9 @@
# loaded in time
setup_udev
setup_usb_network
start_unudhcpd
# Splash is already running if we're loaded from initramfs-extra
if [ "$deviceinfo_create_initfs_extra" != "true" ] && [ "$IN_CI" = "false" ]; then
setup_framebuffer