ilbers / isar

Integration System for Automated Root filesystem generation
Other
177 stars 72 forks source link

Nanopi-neo fails to boot with isar-image-base-debian-bookworm-nanopi-neo.wic #100

Closed baprusty closed 9 months ago

baprusty commented 9 months ago

Steps:

Booting stops at:

Begin: Running /scripts/local-block ... mdadm: No arrays found in config file or automatically
done.
Begin: Running /scripts/local-block ... mdadm: No arrays found in config file or automatically
done.
Begin: Running /scripts/local-block ... mdadm: No arrays found in config file or automatically
done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  /dev/mmcblk2p1 does not exist.  Dropping to a shell!
(initramfs)

complete-boot-log-serial-neo.txt

baprusty commented 9 months ago

Root cause seems like: https://github.com/ilbers/isar/commit/fee0c4146aef794b620f715adae042cca78128e1

Checked info from official page: https://wiki.friendlyelec.com/wiki/index.php/NanoPi_NEO3#Running_the_build

cc: @fmoessbauer @WiseLord @chombourger

fmoessbauer commented 9 months ago

Hi @baprusty , thanks for reporting! It either might be, that the inconsistency of the device names in the firmware provided device tree has been fixed, or the names are simply not stable (despite what the documentation states).

As proposed in the commit message, we probably should just rely on partition UUIDs. This also makes it possible to copy the image to the eMMC without any further changes.

Could you please try to replace --ondisk mmcblk2 with --use-uuid in the WKS file and try again?

baprusty commented 9 months ago

Hi @fmoessbauer, Thanks, With the --use-uuid change:

meta-isar/scripts/lib/wic/canned-wks/nanopi-neo.wks.in
@@ -5,6 +5,6 @@

 part u-boot --source rawcopy --sourceparams "file=/usr/lib/u-boot/nanopi_neo/u-boot-sunxi-with-spl.bin" --no-table --align 8

-part / --source rootfs-u-boot --ondisk mmcblk2 --fstype ext4 --mkfs-extraopts "-T default" --sourceparams "builtin_dt=yes" --label platform --align 1024 --active
+part / --source rootfs-u-boot --use-uuid --fstype ext4 --mkfs-extraopts "-T default" --sourceparams "builtin_dt=yes" --label platform --align 1024 --active

Able to boot the nanopi:

Begin: Running /scripts/init-premount ... done.
Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done.
Begin: Running /scripts/local-premount ... done.
Warning: fsck not present, so skipping root file system
[    6.967817] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Quota mode: none.
done.
Begin: Running /scripts/local-bottom ... done.
Begin: Running /scripts/init-bottom ... done.
[    7.230101] Not activating Mandatory Access Control as /sbin/tomoyo-init does not exist.
[    7.721635] systemd[1]: System time before build time, advancing clock.
[    7.789409] systemd[1]: Inserted module 'autofs4'
[    7.888205] systemd[1]: systemd 252.17-1~deb12u1 running in system mode (+PAM +AUDIT +SELINUX +APPARMOR +IMA +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK -XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
[    7.921029] systemd[1]: Detected architecture arm.
[    7.927031] systemd[1]: Detected first boot.

Welcome to Debian GNU/Linux 12 (bookworm)!

complete-boot-log-serial-neo-fix.txt

baprusty commented 9 months ago

Fixes merged in next: https://github.com/ilbers/isar/commit/f0ba8583f2db75dd1736c1d2248d5e6bc86ea17b

Closing the issue.