Opened 4 years ago
Closed 4 years ago
#827 closed defect (fixed)
Boot on Raspberry Pi ends prematurely when accessing ramdisk
Reported by: | Jakub Jermář | Owned by: | Martin Decky |
---|---|---|---|
Priority: | major | Milestone: | 0.11.1 |
Component: | helenos-build | Version: | mainline |
Keywords: | Cc: | ||
Blocker for: | Depends on: | ||
See also: |
Description
As of current master, the boot on Raspberry Pi ends prematurely as follows. Seems like it cannot access files on the ramdisk. This happens both during a u-boot boot and a direct boot from the SD card.
U-Boot> loady ## Ready for binary (ymodem) download to 0x00200000 at 115200 bps... CCX)/0(CAN) packets, 29 retries ## Total Size = 0x001a2d78 = 1715576 Bytes U-Boot> bootm ## Booting kernel from Legacy Image at 00200000 ... Image Name: HelenOS-0.9.1 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 1715512 Bytes = 1.6 MiB Load Address: 00008000 Entry Point: 00008000 Verifying Checksum ... OK Loading Kernel Image ... OK Starting kernel ... HelenOS bootloader, release 0.9.1 (Armonia), revision b27553c1c Built on 2021-03-22 17:56:58 for arm32 Copyright (c) 2001-2019 HelenOS project Boot loader: 0x00008000 -> 0x00015d38 Memory statistics 0x00015000|0x00015000: bootstrap stack 0x00010000|0x00010000: bootstrap page table 0x00015830|0x00015830: boot info structure 0x80a08000|0x00a08000: kernel entry point Boot loader: 0x00008000 -> 0x00015d38 Payload: 0x00015d38 -> 0x001aad38 Kernel load address: 0x00a08000 Kernel start: 0x80a08000 RAM end: 0x01a08000 (16777216 bytes available) Inflating components ... 0x80a08000|0x00a08000: kernel.elf.gz image (494232/148931 bytes) 0x80a81000|0x00a81000: ns.gz image (110780/51462 bytes) 0x80a9d000|0x00a9d000: loader.gz image (117256/54739 bytes) 0x80aba000|0x00aba000: init.gz image (139776/64299 bytes) 0x80add000|0x00add000: locsrv.gz image (125980/59087 bytes) 0x80afc000|0x00afc000: rd.gz image (117128/54449 bytes) 0x80b19000|0x00b19000: vfs.gz image (141556/65105 bytes) 0x80b3c000|0x00b3c000: logger.gz image (123456/57180 bytes) 0x80b5b000|0x00b5b000: fat.gz image (187236/87807 bytes) 0x80b89000|0x00b89000: initrd.img.gz image (4024832/999618 bytes) Done. Booting the kernel... SPARTAN kernel, release 0.9.1 (Armonia), revision b27553c1c Built on 2021-03-22 17:56:58 for arm32 Copyright (c) 2001-2019 HelenOS project Detected 1 CPU(s), 196576 KiB free memory Program loader at 0xc0020000 Kernel console ready (press any key to activate) RAM disk at 0x00b89000 (size 4024832 bytes) [init:ns(2)] ns: HelenOS IPC Naming Service [init:ns(2)] ns: Accepting connections [init:init(3)] init: HelenOS init [init:locsrv(4)] loc: HelenOS Location Service [init:rd(5)] rd: HelenOS RAM disk server [init:rd(5)] rd: Found RAM disk at 0x00b89000, 4024832 bytes [init:vfs(6)] vfs: HelenOS VFS server [init:logger(7)] logger: HelenOS Logging Service [init:fat(8)] fat: HelenOS FAT file system server [init:logger(7)] logger: Accepting connections [init:locsrv(4)] loc: Accepting connections [init:rd(5)] rd: Accepting connections [init:vfs(6)] vfs: Accepting connections [init:fat(8)] fat: Accepting connections [init:init(3)] init: Root file system mounted on / (fat at bd/initrd) [init:init(3)] init: Unable to stat /srv/fs/tmpfs [init:init(3)] init: Unable to stat /srv/fs/exfat [init:init(3)] init: Unable to stat /srv/fs/cdfs [init:init(3)] init: Unable to stat /srv/fs/mfs [init:init(3)] init: Starting /srv/klog [init:init(3)] init: Error spawning /srv/klog ([EINVAL] Invalid value) [init:init(3)] init: Starting /srv/fs/locfs [init:init(3)] init: Error spawning /srv/fs/locfs ([EINVAL] Invalid value) [init:init(3)] init: Unable to stat /srv/taskmon
Change History (5)
comment:1 by , 4 years ago
comment:2 by , 4 years ago
I cannot reproduce the issue (in Qemu with latest ew.py) despite rebuilding the OS with the latest toolchain freshly built with toolchain.sh arm32
:
[jirka@omelette build-rpi]$ /usr/local/cross/bin/arm-helenos-ld --version GNU ld (GNU Binutils) 2.31.1 Copyright (C) 2018 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. [jirka@omelette build-rpi]$ /usr/local/cross/bin/arm-helenos-gcc --version arm-helenos-gcc (GCC) 8.2.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
comment:3 by , 4 years ago
Component: | helenos/unspecified → helenos-build |
---|---|
Owner: | set to |
Turns out that with python3, the tools/mkfat.py script builds initrd.img which is missing several subdirectories, including app/ and lib/. This makes the boot process not find /lib/libc.so.0 and manifests as this bug.
It is not clear why it only happens with the Raspberry Pi config though.
comment:4 by , 4 years ago
The problem seems to originate in the mkfat.py
script, which misbehaves with Python3.
More specifically, in function fat_lchar
I had to apply the following path in order to get a correct image:
diff --git a/tools/mkfat.py b/tools/mkfat.py index 0e519b192..ad3647558 100755 --- a/tools/mkfat.py +++ b/tools/mkfat.py @@ -192,8 +192,8 @@ def fat_lchars(name): filtered = False for char in name.encode('ascii', 'replace').upper(): - if char in lchars: - filtered_name += char + if chr(char) in lchars: + filtered_name += str.encode(chr(char)) else: filtered_name += b'_' filtered = True
Without the patch, name
would be always thought of as containing invalid characters and thus a LFN would be created in all cases. This somehow results in the initrd.img being incorrect.
comment:5 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in commit fbc6b6c900ca1732db75de47e7c7148158ce3ac6
It turns out that his problem shows already with 0.9.1 when built with the current toolchain (but not in the released 0.9.1). On the current master the problem goes away for a static build. With RTLD_DEBUG enabled, I get the following boot: