Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo on Pi 4b hangs upon initialising /sbin/init
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 62
Location: Cambridge, UK

PostPosted: Thu May 06, 2021 12:40 pm    Post subject: Gentoo on Pi 4b hangs upon initialising /sbin/init Reply with quote

Hello folks,

I have been trying to get this thing to boot since a week now, but I don't really know what else to try. I want to mention that I am not completely new to crossdev and cross building gentoo and alpine for embedded devices, in fact I did successfully build a gentoo image for the Raspberry Pi 3b back in 2018 when it came out.

The resources I used to follow are the followings:
crossdev setup
qemu + binfmt setup
Pi 4 64bit install
Pi 3 64 bit install (cross references)

The only thing I have done differently is I did not install sys-boot/raspberrypi-firmware as mentioned in the Pi 4 64 bit install since I think it is pretty pointless given that I compiled the .dtb's, and just copied over the .dat and .elf files from https://github.com/raspberrypi/firmware.

cmdline.txt, config.txt and fstab output
Code:

gentoo /opt/local/gentoo-arm64-rpi4b-rootfs # cat boot/*.txt; cat etc/fstab
console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait elevator=deadline

[pi4]
max_framebuffers=2
arm_64bit=1
kernel=kernel8-p4.img

enable_uart=1
uart_2ndstage=1
dtparam=uart0=on

/dev/mmcblk0p1          /boot           vfat            noauto,noatime  1 2
/dev/mmcblk0p2          /               ext4            noatime         0 1
gentoo /opt/local/gentoo-arm64-rpi4b-rootfs #


/boot
Code:
gentoo /opt/local/gentoo-arm64-rpi4b-rootfs #
ls boot/
bcm2711-rpi-400.dtb  cmdline.txt   fixup4db.dat  fixup_db.dat  start4cd.elf  start_cd.elf
bcm2711-rpi-400.dts  config.txt    fixup4x.dat   fixup_x.dat   start4db.elf  start_db.elf
bcm2711-rpi-4-b.dtb  fixup4cd.dat  fixup_cd.dat  kernel8.img   start4.elf    start.elf
bcm2711-rpi-4-b.dts  fixup4.dat    fixup.dat     overlays      start4x.elf   start_x.elf
gentoo /opt/local/gentoo-arm64-rpi4b-rootfs #


mmc layout
Code:

gentoo /opt/local/gentoo-arm64-rpi4b-rootfs # fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 14.84 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xd4dc0e88

Device         Boot   Start      End  Sectors  Size Id Type
/dev/mmcblk0p1         2048  1050623  1048576  512M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      1050624 31116287 30065664 14.3G 83 Linux
gentoo /opt/local/gentoo-arm64-rpi4b-rootfs #


boot output
Code:

PM_RSTS: 0x00001000
RPi: BOOTLOADER release VERSION:c305221a DATE: Sep  3 2020 TIME: 13:11:46 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1599135103 0x61426503 0x00d03114
uSD voltage 3.3V
Initialising SDRAM 'Micron' 32Gb x2 total-size: 64 Gbit 3200
VLI: HUB2: 0xfff00000 0x24e6 MCU: 0xfff20000 0x15218
VL805 0xfff00000 0xfff20000
XHCI-STOP
xHC ver: 256 HCS: 05000420 fc000031 00e70004 HCC: 002841eb
xHC ports 5 slots 32 intrs 4
Boot mode: SD (01) order 2
SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080
CID: 0003534453433136478028eb0c520125
CSD: 400e00325b59000076b27f800a404000
SD: bus-width: 4 spec: 2 SCR: 0x02358043 0x00000000
SD HOST: 250000000 CTL0: 0x00000f04 BUS: 50000000 Hz actual: 41666666 HZ div: 6 (3) status: 0x1fff0000 delay: 2
MBR: 0x00000800, 1048576 type: 0x0c
MBR: 0x00100800,30065664 type: 0x83
MBR: 0x00000000,       0 type: 0x00
MBR: 0x00000000,       0 type: 0x00
lba: 2048 oem: 'mkfs.fat' volume: ' NO NAME    '
rsc 32 fat-sectors 1024 c-count 130812 c-size 8 r-dir 2 r-sec 0
PM_RSTS: 0x00001000
Partition: 0
lba: 2048 oem: 'mkfs.fat' volume: ' NO NAME    '
rsc 32 fat-sectors 1024 c-count 130812 c-size 8 r-dir 2 r-sec 0
Read config.txt bytes      108 hnd 0x00000021 hash 'f19718aae7314b76'
recover4.elf not found (6)
recovery.elf not found (6)
Read start4.elf bytes  2228768 hnd 0x00001767 hash 'ad6ec8b0b7b05ce2'
Read fixup4.dat bytes     5446 hnd 0x00000024 hash '5c42d725e0773f47'
0x00d03114 0x00000000 0x000000ff
MEM GPU: 76 ARM: 948 TOTAL: 1024
Starting start4.elf @ 0xfec00200 partition 0

MESS:00:00:08.604873:0: arasan: arasan_emmc_open
MESS:00:00:08.828827:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:08.831563:0: brfs: File read: 108 bytes
MESS:00:00:08.901311:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:08.919604:0: brfs: File read: 108 bytes
MESS:00:00:09.415076:0: gpioman: gpioman_get_pin_num: pin DISPLAY_DSI_PORT not defined
MESS:00:00:09.422364:0: *** Restart logging
MESS:00:00:09.427472:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:09.436824:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:09.442758:0: HDMI0: hdmi_pixel_encoding: 300000000
MESS:00:00:09.448226:0: HDMI1: hdmi_pixel_encoding: 300000000
MESS:00:00:09.458417:0: dtb_file 'bcm2711-rpi-4-b.dtb'
MESS:00:00:09.466680:0: brfs: File read: /mfs/sd/bcm2711-rpi-4-b.dtb
MESS:00:00:09.469927:0: Loading 'bcm2711-rpi-4-b.dtb' to 0x100 size 0xc042
MESS:00:00:09.489000:0: brfs: File read: 49218 bytes
MESS:00:00:09.571111:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:09.573630:0: dtparam: uart0=on
MESS:00:00:09.590864:0: brfs: File read: 108 bytes
MESS:00:00:09.594858:0: brfs: File read: /mfs/sd/cmdline.txt
MESS:00:00:09.597948:0: Read command line from file 'cmdline.txt':
MESS:00:00:09.603828:0: 'console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait elevator=deadline'
MESS:00:00:10.657853:0: brfs: File read: 116 bytes
MESS:00:00:12.218093:0: brfs: File read: /mfs/sd/kernel8.img
MESS:00:00:12.220651:0: Loading 'kernel8.img' to 0x80000 size 0x1461a00
MESS:00:00:12.249438:0: Kernel relocated to 0x200000
MESS:00:00:12.251284:0: Device tree loaded to 0x2eff3a00 (size 0xc530)
MESS:00:00:12.259298:0: uart: Set PL011 baud rate to 103448.300000 Hz
MESS:00:00:12.266613:0: uart: Baud rate change done...
MESS:00:00:12.268630:0:[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]
[    0.000000] Linux version 5.10.33-v8+ (root@gentoo) (aarch64-unknown-linux-gnu-gcc (Gentoo 10.2.0-r5 p6) 10.2.0, GNU ld (Gentoo 2.35.2 p1) 2.35.2) #1 SMP PREEMPT Wed May 5 22:09:20 BST 2021
[    0.000000] Machine model: Raspberry Pi 4 Model B Rev 1.4
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x000000002ac00000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000000000000-0x000000003fffffff]
[    0.000000]   DMA32    [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   Normal   [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000003b3fffff]
[    0.000000]   node   0: [mem 0x0000000040000000-0x00000000fbffffff]
[    0.000000]   node   0: [mem 0x0000000100000000-0x00000001ffffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x00000001ffffffff]
[    0.000000] percpu: Embedded 32 pages/cpu s91224 r8192 d31656 u131072
[    0.000000] Detected PIPT I-cache on CPU0
[    0.000000] CPU features: detected: Spectre-v2
[    0.000000] CPU features: detected: Spectre-v4
[    0.000000] CPU features: detected: ARM errata 1165522, 1319367, or 1530923
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 2028848
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=0 bcm2708_fb.fbheight=0 bcm2708_fb.fbswap=1 smsc95xx.macaddr=DC:A6:32:D5:BA:19 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait elevator=deadline
[    0.000000] Kernel parameter elevator= does not have any effect anymore.
[    0.000000] Please use sysfs to set IO scheduler for individual devices.
[    0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes, linear)
[    0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] software IO TLB: mapped [mem 0x0000000037400000-0x000000003b400000] (64MB)
[    0.000000] Memory: 7931340K/8245248K available (11264K kernel code, 1926K rwdata, 3920K rodata, 3648K init, 1240K bss, 248372K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] ftrace: allocating 35453 entries in 139 pages
[    0.000000] ftrace: allocated 139 pages with 4 groups
[    0.000000] rcu: Preemptible hierarchical RCU implementation.
[    0.000000] rcu:    RCU event tracing is enabled.
[    0.000000] rcu:    RCU restricting CPUs from NR_CPUS=256 to nr_cpu_ids=4.
[    0.000000]    Trampoline variant of Tasks RCU enabled.
[    0.000000]    Rude variant of Tasks RCU enabled.
[    0.000000]    Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] GIC: Using split EOI/Deactivate mode
[    0.000000] random: get_random_bytes called from start_kernel+0x3c8/0x588 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 54.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0xc743ce346, max_idle_ns: 440795203123 ns
[    0.000006] sched_clock: 56 bits at 54MHz, resolution 18ns, wraps every 4398046511102ns
[    0.000247] Console: colour dummy device 80x25
[    0.000774] printk: console [tty1] enabled
[    0.000837] Calibrating delay loop (skipped), value calculated using timer frequency.. 108.00 BogoMIPS (lpj=216000)
[    0.000877] pid_max: default: 32768 minimum: 301
[    0.001022] LSM: Security Framework initializing
[    0.001266] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.001358] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.002683] Disabling memory control group subsystem
[    0.004766] rcu: Hierarchical SRCU implementation.
[    0.005753] EFI services will not be available.
[    0.006225] smp: Bringing up secondary CPUs ...
[    0.007153] Detected PIPT I-cache on CPU1
[    0.007219] CPU1: Booted secondary processor 0x0000000001 [0x410fd083]
[    0.008334] Detected PIPT I-cache on CPU2
[    0.008382] CPU2: Booted secondary processor 0x0000000002 [0x410fd083]
[    0.009423] Detected PIPT I-cache on CPU3
[    0.009469] CPU3: Booted secondary processor 0x0000000003 [0x410fd083]
[    0.009617] smp: Brought up 1 node, 4 CPUs
[    0.009701] SMP: Total of 4 processors activated.
[    0.009724] CPU features: detected: 32-bit EL0 Support
[    0.009747] CPU features: detected: CRC32 instructions
[    0.009769] CPU features: detected: 32-bit EL1 Support
[    0.042733] CPU: All CPU(s) started at EL2
[    0.042809] alternatives: patching kernel code
[    0.044580] devtmpfs: initialized
[    0.054749] Enabled cp15_barrier support
[    0.054808] Enabled setend support
[    0.055012] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.055055] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.057114] pinctrl core: initialized pinctrl subsystem
[    0.057873] DMI not present or invalid.
[    0.058242] NET: Registered protocol family 16
[    0.061167] DMA: preallocated 1024 KiB GFP_KERNEL pool for atomic allocations
[    0.061449] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA pool for atomic allocations
[    0.062370] DMA: preallocated 1024 KiB GFP_KERNEL|GFP_DMA32 pool for atomic allocations
[    0.062477] audit: initializing netlink subsys (disabled)
[    0.062828] audit: type=2000 audit(0.060:1): state=initialized audit_enabled=0 res=1
[    0.063304] thermal_sys: Registered thermal governor 'step_wise'
[    0.063733] cpuidle: using governor menu
[    0.063948] hw-breakpoint: found 6 breakpoint and 4 watchpoint registers.
[    0.064122] ASID allocator initialised with 65536 entries
[    0.064263] Serial: AMBA PL011 UART driver
[    0.090813] bcm2835-mbox fe00b880.mailbox: mailbox enabled
[    0.096264] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-04-30T13:45:52, variant start
[    0.100284] raspberrypi-firmware soc:firmware: Firmware hash is d7f29d96450abfc77cd6cf011af1faf1e03e5e56
[    0.132989] bcm2835-dma fe007000.dma: DMA legacy API manager, dmachans=0x1
[    0.136703] vgaarb: loaded
[    0.137114] SCSI subsystem initialized
[    0.137324] usbcore: registered new interface driver usbfs
[    0.137398] usbcore: registered new interface driver hub
[    0.137474] usbcore: registered new device driver usb
[    0.137780] usb_phy_generic phy: supply vcc not found, using dummy regulator
[    0.139291] clocksource: Switched to clocksource arch_sys_counter
[    1.155257] VFS: Disk quotas dquot_6.6.0
[    1.155396] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
[    1.155562] FS-Cache: Loaded
[    1.155790] CacheFiles: Loaded
[    1.166074] NET: Registered protocol family 2
[    1.167178] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    1.167260] TCP established hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    1.167655] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes, linear)
[    1.168374] TCP: Hash tables configured (established 65536 bind 65536)
[    1.168649] UDP hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    1.168763] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    1.169146] NET: Registered protocol family 1
[    1.170073] RPC: Registered named UNIX socket transport module.
[    1.170099] RPC: Registered udp transport module.
[    1.170119] RPC: Registered tcp transport module.
[    1.170138] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.170168] PCI: CLS 0 bytes, default 64
[    1.172245] hw perfevents: enabled with armv8_cortex_a72 PMU driver, 7 counters available
[    1.172532] kvm [1]: IPA Size Limit: 44 bits
[    1.173642] kvm [1]: vgic interrupt IRQ9
[    1.173924] kvm [1]: Hyp mode initialized successfully
[    1.176050] Initialise system trusted keyrings
[    1.176377] workingset: timestamp_bits=46 max_order=21 bucket_order=0
[    1.182631] zbud: loaded
[    1.184357] FS-Cache: Netfs 'nfs' registered for caching
[    1.184981] NFS: Registering the id_resolver key type
[    1.185026] Key type id_resolver registered
[    1.185046] Key type id_legacy registered
[    1.185168] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.185194] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering...
[    1.186277] Key type asymmetric registered
[    1.186303] Asymmetric key parser 'x509' registered
[    1.186358] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249)
[    1.186620] io scheduler mq-deadline registered
[    1.186645] io scheduler kyber registered
[    1.190395] brcm-pcie fd500000.pcie: host bridge /scb/pcie@7d500000 ranges:
[    1.190438] brcm-pcie fd500000.pcie:   No bus range found for /scb/pcie@7d500000, using [bus 00-ff]
[    1.190521] brcm-pcie fd500000.pcie:      MEM 0x0600000000..0x063fffffff -> 0x00c0000000
[    1.190610] brcm-pcie fd500000.pcie:   IB MEM 0x0000000000..0x00bfffffff -> 0x0400000000
[    1.253387] brcm-pcie fd500000.pcie: link up, 5.0 GT/s PCIe x1 (SSC)
[    1.253766] brcm-pcie fd500000.pcie: PCI host bridge to bus 0000:00
[    1.253797] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.253825] pci_bus 0000:00: root bus resource [mem 0x600000000-0x63fffffff] (bus address [0xc0000000-0xffffffff])
[    1.253918] pci 0000:00:00.0: [14e4:2711] type 01 class 0x060400
[    1.254158] pci 0000:00:00.0: PME# supported from D0 D3hot
[    1.258096] pci 0000:01:00.0: [1106:3483] type 00 class 0x0c0330
[    1.258228] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x00000fff 64bit]
[    1.258623] pci 0000:01:00.0: PME# supported from D0 D3hot
[    1.270613] pci 0000:00:00.0: BAR 8: assigned [mem 0x600000000-0x6000fffff]
[    1.270649] pci 0000:01:00.0: BAR 0: assigned [mem 0x600000000-0x600000fff 64bit]
[    1.270700] pci 0000:00:00.0: PCI bridge to [bus 01]
[    1.270731] pci 0000:00:00.0:   bridge window [mem 0x600000000-0x6000fffff]
[    1.271340] bcm2708_fb soc:fb: Unable to determine number of FBs. Disabling driver.
[    1.271383] bcm2708_fb: probe of soc:fb failed with error -2
[    1.275707] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    1.276506] bcm2835-aux-uart fe215040.serial: there is not valid maps for state default
[    1.278500] iproc-rng200 fe104000.rng: hwrng registered
[    1.278833] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    1.279733] gpiomem-bcm2835 fe200000.gpiomem: Initialised: Registers at 0xfe200000
[    1.280145] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    1.290660] brd: module loaded
[    1.302579] loop: module loaded
[    1.304162] Loading iSCSI transport class v2.0-870.
[    1.307164] libphy: Fixed MDIO Bus: probed
[    1.308732] bcmgenet fd580000.ethernet: GENET 5.0 EPHY: 0x0000
[    1.319353] libphy: bcmgenet MII bus: probed
[    1.367429] unimac-mdio unimac-mdio.-19: Broadcom UniMAC MDIO bus
[    1.368465] usbcore: registered new interface driver r8152
[    1.368539] usbcore: registered new interface driver lan78xx
[    1.368601] usbcore: registered new interface driver smsc95xx
[    1.414519] pci 0000:00:00.0: enabling device (0000 -> 0002)
[    1.414703] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.414753] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[    1.415476] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000060000000890
[    1.416725] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    1.416757] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.416783] usb usb1: Product: xHCI Host Controller
[    1.416804] usb usb1: Manufacturer: Linux 5.10.33-v8+ xhci-hcd
[    1.416826] usb usb1: SerialNumber: 0000:01:00.0
[    1.417496] hub 1-0:1.0: USB hub found
[    1.417601] hub 1-0:1.0: 1 port detected
[    1.418223] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    1.418257] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    1.418292] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[    1.418693] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[    1.418722] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.418747] usb usb2: Product: xHCI Host Controller
[    1.418768] usb usb2: Manufacturer: Linux 5.10.33-v8+ xhci-hcd
[    1.418789] usb usb2: SerialNumber: 0000:01:00.0
[    1.419506] hub 2-0:1.0: USB hub found
[    1.419586] hub 2-0:1.0: 4 ports detected
[    1.421026] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    1.421800] usbcore: registered new interface driver uas
[    1.421896] usbcore: registered new interface driver usb-storage
[    1.422107] mousedev: PS/2 mouse device common for all mice
[    1.423911] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    1.427055] sdhci: Secure Digital Host Controller Interface driver
[    1.427083] sdhci: Copyright(c) Pierre Ossman
[    1.427751] mmc-bcm2835 fe300000.mmcnr: could not get clk, deferring probe
[    1.428143] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.430051] ledtrig-cpu: registered to indicate activity on CPUs
[    1.430190] hid: raw HID events driver (C) Jiri Kosina
[    1.430290] usbcore: registered new interface driver usbhid
[    1.430299] usbhid: USB HID core driver
[    1.433950] Initializing XFRM netlink socket
[    1.433985] NET: Registered protocol family 17
[    1.434052] Key type dns_resolver registered
[    1.434250] registered taskstats version 1
[    1.434270] Loading compiled-in X.509 certificates
[    1.434522] Key type ._fscrypt registered
[    1.434532] Key type .fscrypt registered
[    1.434540] Key type fscrypt-provisioning registered
[    1.439644] uart-pl011 fe201000.serial: there is not valid maps for state default
[    1.439787] uart-pl011 fe201000.serial: cts_event_workaround enabled
[    1.439846] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 21, base_baud = 0) is a PL011 rev2
[    1.446084] bcm2835-aux-uart fe215040.serial: there is not valid maps for state default
[    1.446403] printk: console [ttyS0] disabled
[    1.446463] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 22, base_baud = 62500000) is a 16550
[    1.751291] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    1.759502] printk: console [ttyS0] enabled
[    1.913920] usb 1-1: New USB device found, idVendor=2109, idProduct=3431, bcdDevice= 4.21
[    1.917231] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    1.920783] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    1.924683] mmc-bcm2835 fe300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    1.934107] usb 1-1: Product: USB2.0 Hub
[    1.935252] hub 1-1:1.0: USB hub found
[    1.941083] mmc-bcm2835 fe300000.mmcnr: DMA channel allocated
[    1.967791] of_cfs_init
[    1.970197] hub 1-1:1.0: 4 ports detected
[    1.978256] of_cfs_init: OK
[    2.003798] mmc0: SDHCI controller on fe340000.emmc2 [fe340000.emmc2] using ADMA
[    2.025590] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    2.132456] mmc0: new ultra high speed DDR50 SDHC card at address aaaa
[    2.139626] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.145494] mmcblk0: mmc0:aaaa SC16G 14.8 GiB
[    2.153838] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.161376]  mmcblk0: p1 p2
[    2.165494] mmc1: queuing unknown CIS tuple 0x80 (7 bytes)
[    2.885589] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.890728] random: fast init done
[    2.896081] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    2.904387] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[    2.917978] devtmpfs: mounted
[    2.925968] Freeing unused kernel memory: 3648K
[    2.930825] Run /sbin/init as init process
[    2.980787] mmc1: new high speed SDIO card at address 0001
�������


I have the same exact result using sakaki kernel binary and with alpinelinux. I honestly don't know what I am doing wrong. I am happy to upload the image if you want to give it a spin.

Thanks
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30884
Location: here

PostPosted: Thu May 06, 2021 12:45 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Gentoo on ARM.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54208
Location: 56N 3W

PostPosted: Thu May 06, 2021 3:20 pm    Post subject: Reply with quote

Latrina,

Code:
[    2.930825] Run /sbin/init as init process
[    2.980787] mmc1: new high speed SDIO card at address 0001
�������


That looks like the serial console. The on screen console is probably working as expected.
Code:
console=serial0
Gentoo doesn't call the serial port serial0.
Its /dev/ttyAMA0, which normally drives the bluetooth.

That also requires
/etc/inittab:
 # Architecture specific features
#f0:12345:respawn:/sbin/agetty 115200 ttyAMA0 vt100
at the bottom of /etc/inittab to be uncommented too or you loose the serial console when inittab is processed.

It gets worse ... :)

The serial port baud rate is tied to the ARM CPU core clock, which the kernel and Pi firmware can both change.
You need
Code:
force_turbo=1
in config.txt to stop that or the console turns to gibberish or blank, per the last line of your console output.

If you want to put the console on the mini UART, its all different.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 62
Location: Cambridge, UK

PostPosted: Thu May 06, 2021 9:07 pm    Post subject: Reply with quote

Hey NeddySeagoon,

I tried changing console=serial0 with console=ttyAMA0 and console=/dev/ttyAMA0 but I lose serial as soon as the kernel is booted. The entry related to the serial in /etc/inittab has also been enabled.

Also, I am not sure what you mean with "If you want to put the console on the mini UART, its all different.".

I just need to connect to the PI via serial adapter. Nothing fancy I guess. Also, dhcpcd is installed and enabled into my gentoo build, yet it acquires no DHCP from the router. Which is why I was assuming the system was not booting correctly. Unfortunately I don't have a hdmi adapter for this thing to see whats going on, assuming that the issue is the serial connection.

Thanks
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 62
Location: Cambridge, UK

PostPosted: Thu May 06, 2021 9:35 pm    Post subject: Reply with quote

Okay, I made some progress here. I followed this guide https://wiki.gentoo.org/wiki/Raspberry_Pi_Serial_Ports and made the following changes:

Code:

gentoo ~ # cat /mnt/sd/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 console=ttyS0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait elevator=deadline
gentoo ~ #


Code:
gentoo ~ #
tail -1 /mnt/sd/etc/inittab
s0:12345:respawn:/sbin/agetty 115200 -L ttys0 vt100
gentoo ~ #


Code:

gentoo ~ # cat /mnt/sd/etc/udev/rules.d/99-com.rules
SUBSYSTEM=="input", GROUP="input", MODE="0660"
SUBSYSTEM=="i2c-dev", GROUP="i2c", MODE="0660"
SUBSYSTEM=="spidev", GROUP="spi", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"

SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\
        chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\
        chown -R root:gpio /sys/devices/virtual/gpio && chmod -R 770 /sys/devices/virtual/gpio;\
        chown -R root:gpio /sys$devpath && chmod -R 770 /sys$devpath\
'"

KERNEL=="ttyAMA[01]", GROUP="dialout", PROGRAM="/bin/sh -c '\
        ALIASES=/proc/device-tree/aliases; \
        if cmp -s $ALIASES/uart0 $ALIASES/serial0; then \
                echo 0;\
        elif cmp -s $ALIASES/uart0 $ALIASES/serial1; then \
                echo 1; \
        else \
                exit 1; \
        fi\
'", SYMLINK+="serial%c"

KERNEL=="ttyS0", GROUP="dialout", PROGRAM="/bin/sh -c '\
        ALIASES=/proc/device-tree/aliases; \
        if cmp -s $ALIASES/uart1 $ALIASES/serial0; then \
                echo 0; \
        elif cmp -s $ALIASES/uart1 $ALIASES/serial1; then \
                echo 1; \
        else \
                exit 1; \
        fi \
'", SYMLINK+="serial%c"
gentoo ~ #


but it now hangs here..
Code:

INIT: version 2.98 booting

   OpenRC 0.42.1 is starting up Gentoo Linux (aarch64)

 * Mounting /proc ...
 [ ok ]
 * Mounting /run ...
 * /run/openrc: creating directory
 * /run/lock: creating directory
 * /run/lock: correcting owner
 * Caching service dependencies ...
 [ ok ]
 * Clock skew detected with `(null)'
 * Adjusting mtime of `/run/openrc/deptree' to Wed May  5 10:50:29 2021
 * WARNING: clock skew detected!
 * Mounting /sys ...
 [ ok ]
 * Mounting security filesystem ...
 [ ok ]
 * Mounting debug filesystem ...
 [ ok ]
 * Mounting config filesystem ...
 [ ok ]
 * Mounting cgroup filesystem ...
 [ ok ]
 * Remounting devtmpfs on /dev ...
 [ ok ]
 * Mounting /dev/mqueue ...
 [ ok ]
 * Mounting /dev/pts ...
 [ ok ]
 * Mounting /dev/shm ...
 [ ok ]
 * Creating list of required static device nodes for the current kernel ...
 [ ok ]
 * Setting up tmpfiles.d entries for /dev ...
 [ ok ]
 * Starting udev ...
 [ ok ]
 * Generating a rule to create a /dev/root symlink ...
 [ ok ]
 * Populating /dev with existing devices through uevents ...
 [ ok ]
 * WARNING: clock skew detected!
 * Setting system clock using the hardware clock [UTC] ...
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --verbose option to see the details of our search for an access method.
 * Failed to set the system clock
 [ !! ]
 * The binfmt-misc module needs to be loaded by the modules service or built in.
 * Mounting misc binary format filesystem ...
 [ ok ]
 * Loading custom binary format handlers ...
 [ ok ]
 * Checking local filesystems  ...
/dev/mmcblk0p2: clean, 66505/940240 files, 566863/3758208 blocks
 [ ok ]
 * Remounting root filesystem read/write ...
 [ ok ]
 * Remounting filesystems ...
 [ ok ]
 * Updating /etc/mtab ...
 * Creating mtab symbolic link
 [ ok ]
 * Activating swap devices ...
 [ ok ]
 * Mounting local filesystems ...
 [ ok ]
 * Configuring kernel parameters ...
 [ ok ]
 * Creating user login records ...
 [ ok ]
 * Wiping /tmp directory ...
 [ ok ]
 * Setting hostname to localhost  ...
 [ ok ]
 * Setting terminal encoding [UTF-8] ...
 [ ok ]
 * Setting keyboard mode [UTF-8] ...
 [ ok ]
 * Loading key mappings [us] ...
 [ ok ]
 * Bringing up network interface lo ...
 [ ok ]
 * Saving key mapping ...
 [ ok ]
 * Saving terminal encoding ...
 [ ok ]
 * Setting up tmpfiles.d entries ...
 [ ok ]
 * Initializing random number generator ...
 [ ok ]
INIT: Entering runlevel: 3
 * WARNING: clock skew detected!
 * Starting DHCP Client Daemon ...
 [ ok ]
 * Mounting network filesystems ...
 [ ok ]
 * Starting sshd ...
 [ ok ]
 * Starting local ...
 [ ok ]
INIT: Id "s0" respawning too fast: disabled for 5 minutes


I am really starting to get confused. Again, all I need to do is to connect to the rpi from my laptop via ft232r usb serial adapter.
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
redfish
n00b
n00b


Joined: 27 Apr 2021
Posts: 22

PostPosted: Fri May 07, 2021 6:26 am    Post subject: Reply with quote

Quote:

INIT: Id "s0" respawning too fast: disabled for 5 minutes


Issue seems to be with agetty. To confirm diagnosis, you can try booting directly into the shell, without a getty: add 'init=/bin/sh' to kernel command-line in cmdline.txt.


EDIT: And, then, you can boot with the normal init, but without the agetty: if I remember correctly, you should be able to replace the /sbin/agetty command and its arguments in inittab with a simple /bin/sh.

If these tests boot you into the shell successfully, then check whether /sbin/agetty is there, is executable, try running it, etc.
Back to top
View user's profile Send private message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 62
Location: Cambridge, UK

PostPosted: Fri May 07, 2021 4:44 pm    Post subject: Reply with quote

Hey redfish.

Even by adding init=/bin/sh into the cmdline.txt I still lose the serial connection upon the prompt comes up.

Code:
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
sh-5.0#


Mysteriously it only worked once. I am getting sick at this...
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 62
Location: Cambridge, UK

PostPosted: Sat May 08, 2021 11:49 am    Post subject: Reply with quote

Any idea guys? :(
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
redfish
n00b
n00b


Joined: 27 Apr 2021
Posts: 22

PostPosted: Sun May 16, 2021 12:47 am    Post subject: Reply with quote

Latrina wrote:

Even by adding init=/bin/sh into the cmdline.txt I still lose the serial connection upon the prompt comes up.

Code:
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
sh-5.0#




The above output looks correct for init=/bin/sh. This mode says not to launch the normal init process (systemd) and instead just launch a shell, so that's the output we expect. Does the shell work ok -- you can run commands?

The init=/bin/sh is just a first test, that confirms that everything about the serial port works correctly.

Next test is remove 'init=/bin/sh' so that normal init process is launched, but change /etc/inittab to not launch agetty:

Code:

s0:12345:respawn:/bin/sh


If this also gets you booted into a shell, then you will know that the problem is with the agetty itself, which may be have something to do with it setting options on the tty and breaking it somehow. But, I before jumping to a wrong diagnosis, I would do these tests to confirm whether agetty is the culprit or not.
Back to top
View user's profile Send private message
Latrina
n00b
n00b


Joined: 13 Aug 2017
Posts: 62
Location: Cambridge, UK

PostPosted: Sun May 16, 2021 10:54 am    Post subject: Reply with quote

No I cannot run any command. The boot process halts there and I cannot type anything into the serial console.
_________________
Enslaved by Systemd and all the linuxisms that come with it. :|
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum