WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Problems booting on CM4  (Read 1316 times)

Offline xsquared

  • Newbie
  • *
  • Posts: 7
Problems booting on CM4
« on: June 06, 2021, 01:41:42 PM »
Hi

I'm having problems during the boot sequence of TinyCore on the Raspberry Pi Compute Module 4. I have a good working installation on the Raspberry Pi Model B. It loads a handful of extensions and boots in under 30 seconds.

On the CM4, the same disk image is causing me a host of problems. If I don't boot with the showapps option, often the extensions aren't loaded and neither is mydata.tgz. Loading with showapps it take a lot longer – minutes not seconds. The disk seems to be incredibly slow. But once logged in, sudo hdparm -tT /dev/mmcblk0 gives sensible outputs. A look at the syslog and there is often a repeat of various mount commands e.g.:

Code: (bash) [Select]
Jan  1 00:00:27 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/imlib2-bin.tcz /tmp/tcloop/imlib2-bin
Jan  1 00:00:28 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/libXrandr.tcz /tmp/tcloop/libXrandr
Jan  1 00:00:28 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/openssl.tcz /tmp/tcloop/openssl
Jan  1 00:00:30 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/pixman.tcz /tmp/tcloop/pixman
Jan  1 00:00:30 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/libXrandr.tcz /tmp/tcloop/libXrandr
Jan  1 00:00:30 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/libXfont2.tcz /tmp/tcloop/libXfont2
Jan  1 00:00:31 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/pixman.tcz /tmp/tcloop/pixman
Jan  1 00:00:32 box authpriv.notice sudo:       tc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/mount -t squashfs -o loop /mnt/mmcblk0p2/tce/optional/libepoxy.tcz /tmp/tcloop/libepoxy

- the repeated extensions seem to correlate with where the debug message "mount: can't setup loop device: File exists" flashes on the console as it loads extensions.

Sometimes I get a stall detected during the extension loading, such as:

Code: (bash) [Select]
Dec 31 20:07:34 SD101 user.err kernel: [  454.251486] rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
Dec 31 20:07:34 SD101 user.err kernel: [  454.251499] rcu: 0-...!: (3 ticks this GP) idle=002/1/0x4000000000000000 softirq=3749/3755 fqs=2
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251499] (detected by 1, t=34737 jiffies, g=1349, q=659)
Dec 31 20:07:34 SD101 user.info kernel: [  454.251499] Task dump for CPU 0:
Dec 31 20:07:34 SD101 user.info kernel: [  454.251499] kworker/0:2     R  running task        0    69      2 0x00000028
Dec 31 20:07:34 SD101 user.info kernel: [  454.251499] Workqueue: events_freezable mmc_rescan
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251499] Call trace:
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251499]  __switch_to+0xd8/0x218
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251499]  __schedule+0x2e0/0x778
Dec 31 20:07:34 SD101 user.err kernel: [  454.251499] rcu: rcu_preempt kthread starved for 32880 jiffies! g1349 f0x0 RCU_GP_WAIT_FQS(5) ->state=0x402 ->cpu=1
Dec 31 20:07:34 SD101 user.err kernel: [  454.251625] rcu: RCU grace-period kthread stack dump:
Dec 31 20:07:34 SD101 user.info kernel: [  454.251682] rcu_preempt     I    0    10      2 0x00000028
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682] Call trace:
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  __switch_to+0xd8/0x218
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  __schedule+0x2e0/0x778
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  schedule+0x40/0xc8
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  schedule_timeout+0x178/0x380
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  rcu_gp_kthread+0x4ec/0x8b8
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  kthread+0x124/0x128
Dec 31 20:07:34 SD101 user.warn kernel: [  454.251682]  ret_from_fork+0x10/0x18

It's not always the same running task that is quoted, sometimes rotdash, sometimes sudo. The machine recovers eventually and continues to boot.

I've reduced my config.txt to a minimum of stuff viable to boot, same with cmdline.txt. I've tried changing a lot of settings, but haven't figured out what is causing it (assuming it's only one issue I have). I am not pulling the power, I'm logging in over ssh most of the time and doing a reboot (that's another thing, my console keyboard rarely works, but openssh is fine). I have tried a different CM4 and have tried a different Compute Module I/O boards and get the same results. Could I be experiencing a bad batch of CM4s?

I'm running out of things to try, so was wondering if anyone else had this issue or similar one on the CM4? And also wondering what other things I can try to narrow this down. I'm conversant with linux and happy to change core rootfs files, try different formatting schemes, anything to try to figure out what is going on. I could also try updating to the latest TC version, if there's something about the CM4 that needs something in that newer kernel. I'm happily using version 12 on the RPi 4 Model B and haven't updated already since I'm using the 64-bit flavour (which gives a little better performance) and that is still release candidate for TC 13 (I see it may have been released today however).

Any suggestions greatly appreciated.
xsquared

Offline xsquared

  • Newbie
  • *
  • Posts: 7
Re: Problems booting on CM4
« Reply #1 on: June 06, 2021, 05:54:48 PM »
Update: I tried TinyCore version 13 and so far it's behaving a lot better. I guess I need to target that o/s for CM4. I'd be curious if anyone knows of the pertinent difference between TC12 and TC13 that would improve the disk handling on CM4, but I'm mainly just happy I have a way forward.  :)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178

Offline xsquared

  • Newbie
  • *
  • Posts: 7
Re: Problems booting on CM4
« Reply #3 on: June 07, 2021, 03:56:23 AM »
Thanks Rich, I hadn't noticed that. It's good to know that it wasn't just my system exhibiting the issue. And great that it's fixed in the latest 64-bit TC. Awesome.