The officially official Devuan Forum!

You are not logged in.

#1 2019-07-05 06:36:57

therion23
Member
Registered: 2019-07-05
Posts: 3  

Devuan on Raspberry Pi 4

If you have a Pi 2 or 3 as well, the easiest way of making a bootable SD card for the Pi 4 is like this:

- Grab a Devuan image for Pi 2 (sorry, 32 bit only for now).
- Boot it on your Pi 2 or 3 and set up networking.
- From http://archive.raspberrypi.org/debian/p … -firmware/ get raspberrypi-bootloader and raspberrypi-kernel - make sure they have matching version numbers and not older than 20190620.
- From http://archive.raspberrypi.org/debian/p … e-nonfree/ get the latest firmware-brcm80211.
- install all three with dpkg.
- Double check your /boot/cmdline.txt - especially the root= setting.
- Reboot.

If it boots right, you should be running 4.19.50-v7l+. Shutdown, put the card into your Pi 4 and boot it up.

Now, if the screen blanks during boot on your Pi 4, it is most likely during switching framebuffers. In this case, wait a bit till you can log in via ssh, and as root, do:

echo blacklist vc4 > /etc/modprobe.d/blacklist-vc4.conf

And reboot. Solved the issue for me (HDMI - haven't tried the analogue output).

If you want the hardware specific bits (which usually live in /opt/vc), from the first URL above, get libraspberrypi0, libraspberrypi-bin and libraspberrypi-dev - all three the same version as the kernel and bootloader you got above! Install via dpkg and edit /etc/ld.so.conf.d/00-vmcs.conf to read this one line:

/opt/vc/lib

Run ldconfig or reboot.

Finally, update your system - but you know all about that already, right? :)

Caveat emptor - the above worked for me. Twice. Enjoy Devuan on your Pi 4!

Offline

#2 2019-11-23 20:38:27

tuxd3v
Member
Registered: 2019-11-14
Posts: 28  

Re: Devuan on Raspberry Pi 4

Hello therion23,
I tried with a Rpi1, compile a kernel, uboot, and try to boot the device..

I am stuck there..

On 'config.txt'
kernel=my-u-boot.bin

then created the boor.cmd, and scr script file, and I can boot the kernel..
The problem is that it hangs waiting for '/dev/mmbblk0p2'

So,
rpi1 execute:
1) - 'bootcode.bin', then bootcode.bin, reads 'config.txt', were it knows about my pseudo kernel( u-boot ) 'kernel=my-u-boot.bin'.
2) - It passes to VC4 to load 'start.elf'
3) - 'start.elf'( I believe ?! ) load my u-boot..
3) - my u-boot is loaded, which instructs to load the Real Kernel..

The problem... Kernel Hangs, waiting for '/dev/mmcblk0p2' sad

Here are the logs taken from ttyAMA0:

port is        : /dev/ttyUSB0
flowcontrol    : none
baudrate is    : 115200
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
)
## Executing script at 02400000
## Error: Can't overwrite "ethaddr"
## Error inserting "ethaddr" variable, errno=1
switch to partitions #0, OK
mmc0 is current device
12655 bytes read in 9 ms (1.3 MiB/s)
4898976 bytes read in 221 ms (21.1 MiB/s)
Kernel image @ 0x008000 [ 0x000000 - 0x4ac0a0 ]
## Flattened Device Tree blob at 02600000
   Booting using the fdt blob at 0x2600000
   Using Device Tree in place at 02600000, end 0260616e

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.3.11 (tuxd3v@desktop0) (gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))) #10 Fri Nov 22 18:58:43 WET 2019
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] OF: fdt: Machine model: Raspberry Pi Model B
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 8 MiB at 0x0e800000
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 60900
[    0.000000] Kernel command line: earlyprintk=serial,ttyAMA0,115200 console=ttyAMA0,115200n8 console=tty1 root=/dev/mmcblk0p2 rw rootwait rootfstype=ext4 elevator=noop fsck.repair=no smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 selinux=0 noinitrd
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 224072K/245760K available (6889K kernel code, 665K rwdata, 2188K rodata, 468K init, 781K bss, 13496K reserved, 8192K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] ftrace: allocating 24939 entries in 49 pages
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] random: get_random_bytes called from start_kernel+0x2e8/0x518 with crng_init=0
[    0.000024] sched_clock: 32 bits at 1000kHz, resolution 1000ns, wraps every 2147483647500ns
[    0.000084] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275 ns
[    0.000181] bcm2835: system timer (irq = 27)
[    0.000717] Console: colour dummy device 80x30
[    0.001220] printk: console [tty1] enabled
[    0.001315] Calibrating delay loop... 697.95 BogoMIPS (lpj=3489792)
[    0.050370] pid_max: default: 32768 minimum: 301
[    0.050974] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.051049] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.052850] CPU: Testing write buffer coherency: ok
[    0.054651] Setting up static identity map for 0x8200 - 0x8238
[    0.055914] devtmpfs: initialized
[    0.063740] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5
[    0.064288] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.064380] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.065901] pinctrl core: initialized pinctrl subsystem
[    0.067862] NET: Registered protocol family 16
[    0.071960] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.076890] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers.
[    0.076971] hw-breakpoint: maximum watchpoint size is 4 bytes.
[    0.077173] Serial: AMBA PL011 UART driver
[    0.119919] SCSI subsystem initialized
[    0.120275] usbcore: registered new interface driver usbfs
[    0.120432] usbcore: registered new interface driver hub
[    0.121020] usbcore: registered new device driver usb
[    0.123563] clocksource: Switched to clocksource timer
[    1.544513] VFS: Disk quotas dquot_6.6.0
[    1.544721] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    1.545158] FS-Cache: Loaded
[    1.545574] CacheFiles: Loaded
[    1.546008] simple-framebuffer f6fb000.framebuffer: framebuffer at 0xf6fb000, 0x300000 bytes, mapped to 0x(ptrval)
[    1.546090] simple-framebuffer f6fb000.framebuffer: format=a8r8g8b8, mode=1024x768x32, linelength=4096
[    1.572117] Console: switching to colour frame buffer device 128x48
[    1.595073] simple-framebuffer f6fb000.framebuffer: fb0: simplefb registered!
[    1.616069] thermal_sys: Registered thermal governor 'step_wise'
[    1.616929] NET: Registered protocol family 2
[    1.618970] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.619515] TCP established hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    1.619977] TCP bind hash table entries: 2048 (order: 1, 8192 bytes, linear)
[    1.620393] TCP: Hash tables configured (established 2048 bind 2048)
[    1.620926] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.621324] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    1.622195] NET: Registered protocol family 1
[    1.624019] RPC: Registered named UNIX socket transport module.
[    1.624377] RPC: Registered udp transport module.
[    1.624644] RPC: Registered tcp transport module.
[    1.635374] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    1.647450] hw perfevents: no irqs for PMU, sampling events not supported
[    1.658382] hw perfevents: enabled with armv6_1176 PMU driver, 3 counters available
[    1.672981] Initialise system trusted keyrings
[    1.684376] workingset: timestamp_bits=14 max_order=16 bucket_order=2
[    1.713463] FS-Cache: Netfs 'nfs' registered for caching
[    1.726013] NFS: Registering the id_resolver key type
[    1.736825] Key type id_resolver registered
[    1.747181] Key type id_legacy registered
[    1.757432] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.770306] Key type asymmetric registered
[    1.780643] Asymmetric key parser 'x509' registered
[    1.790870] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    1.801620] io scheduler mq-deadline registered
[    1.811990] io scheduler kyber registered
[    1.836484] bcm2835-rng 20104000.rng: hwrng registered
[    1.870326] brd: module loaded
[    1.896340] loop: module loaded
[    1.907862] Loading iSCSI transport class v2.0-870.
[    1.919594] usbcore: registered new interface driver smsc95xx
[    1.930373] usbcore: registered new interface driver usb-storage
[    1.941229] mousedev: PS/2 mouse device common for all mice
[    1.953892] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    1.965277] sdhci: Secure Digital Host Controller Interface driver
[    1.975797] sdhci: Copyright(c) Pierre Ossman
[    1.986095] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.997306] ledtrig-cpu: registered to indicate activity on CPUs
[    2.008264] hidraw: raw HID events driver (C) Jiri Kosina
[    2.018757] usbcore: registered new interface driver usbhid
[    2.028797] usbhid: USB HID core driver
[    2.039867] bcm2835-mbox 2000b880.mailbox: mailbox enabled
[    2.050636] Initializing XFRM netlink socket
[    2.060524] NET: Registered protocol family 17
[    2.070349] Key type dns_resolver registered
[    2.081652] registered taskstats version 1
[    2.091048] Loading compiled-in X.509 certificates
[    2.109931] 20201000.serial: ttyAMA0 at MMIO 0x20201000 (irq = 81, base_baud = 0) is a PL011 rev2
[    3.009889] random: fast init done
[    3.912321] printk: console [ttyAMA0] enabled
[    3.927686] raspberrypi-firmware soc:firmware: Attached to firmware from 2019-09-30 14:41
[    3.948148] vchiq: vchiq_init_state: slot_zero = (ptrval)
[    3.971479] Waiting for root device /dev/mmcblk0p2...
[  212.003677] random: crng init done

Can you see the amount of time it took to initialize rng?
Maybe I need to configure it.. don't know, but I already tried, without success..maybe I am doing something wrong..

The objective...
Get Rid of Every Blob RaspberryPi trows at it..
Till now I am unsuccessful on that sad

Have you any advice?

Thanks in Advance,
Best Regards,
tux


Best Regards,
tux

Offline

#3 2019-11-24 08:51:12

therion23
Member
Registered: 2019-07-05
Posts: 3  

Re: Devuan on Raspberry Pi 4

Hello!

I know terribly little about u-boot, however, i see no messages about mmc-bcm2835 and sdhost-bcm2835 (comparing with a Pi Zero here), so it really looks like a missing card reader driver to me.

Now, that delay i do know a little about, but no sureshot fix for it. It is something introduced with kernels 4.16 onwards (i believe), and related to how it gathers random data.

- Try installing haveged and reboot. It fixed things for some people (supposedly works without a hardware RNG).
- Try removing haveged, installing rng-tools and reboot. Fixed things for other people (supposedly requires a hardware RNG).
- Try removing rng-tools, plugging an 802.11 USB adapter and reboot. This fixed it for me on a Pi 2.

Let me know your results.

Offline

#4 2019-11-24 17:09:25

tuxd3v
Member
Registered: 2019-11-14
Posts: 28  

Re: Devuan on Raspberry Pi 4

therion23 wrote:

Hello!
I know terribly little about u-boot, however, i see no messages about mmc-bcm2835 and sdhost-bcm2835 (comparing with a Pi Zero here), so it really looks like a missing card reader driver to me.

Hello,
My kernel '.config'  is yet very crude.. and I trusted it too much( to bad for me..I paid the price ) sad

You were straight to the point smile
My rpi1B v1.0 is up and running smile
its consuming now 17MB of Ram..

So bootcode.bin->start.elf->u-boot-> real kernel.. smile

I still have some annoyances, the iface 'eth0' gets renamed to something very absurd..
and maybe I don't have yet all modules that I need enabled.. :S

For example the CPU Activity led, is only blinking, not reflecting the load, or processing my PI have..
I will recompile also a u-boot with support for HardFloat operations..

I still need to do a lot of checkings on it..

Now, that delay i do know a little about, but no sureshot fix for it. It is something introduced with kernels 4.16 onwards (i believe), and related to how it gathers random data.

- Try installing haveged and reboot. It fixed things for some people (supposedly works without a hardware RNG).
- Try removing haveged, installing rng-tools and reboot. Fixed things for other people (supposedly requires a hardware RNG).
- Try removing rng-tools, plugging an 802.11 USB adapter and reboot. This fixed it for me on a Pi 2.


The driver in Kernel 5.3.11, seems to be working now, about 14 seconds, a lot less from the 211 before.. but more checking is needed..

About rng-tools:
You can use in '/etc/default/rng-tools' a device like '/dev/urandom' it is the only way I could boot a 'Orange PI one Plus', because the TRNG hardware isn't yet supported( will be in kernel 5.4 I believe )..
You can try this solution has a last resort..

I will update, with my findings about what I could optimise smile
Thanks a lot to put me in the right track!!

Last edited by tuxd3v (2019-11-24 17:12:37)


Best Regards,
tux

Offline

#5 2019-11-24 17:37:19

therion23
Member
Registered: 2019-07-05
Posts: 3  

Re: Devuan on Raspberry Pi 4

This both explains and (hopefully) solves your eth0 issue: StackExchange link

This explains how to control the LEDs: Jeff Geerling's blog. Your options for triggers are:

gpio - controlled through GPIO (off by default)
heartbeat - heartbeat-like pulse
timer - pulse every second
input - under-voltage detection
mmc0 - memory I/O
cpu0 - CPU activity

Good luck!

Offline

#6 2019-12-08 18:49:52

tuxd3v
Member
Registered: 2019-11-14
Posts: 28  

Re: Devuan on Raspberry Pi 4

therion23 wrote:

This both explains and (hopefully) solves your eth0 issue: StackExchange link

This explains how to control the LEDs: Jeff Geerling's blog. Your options for triggers are:

gpio - controlled through GPIO (off by default)
heartbeat - heartbeat-like pulse
timer - pulse every second
input - under-voltage detection
mmc0 - memory I/O
cpu0 - CPU activity

Good luck!

Thanks!
I will try that, specially the the ACK les to 'cpu0' smile


Best Regards,
tux

Offline

#7 2019-12-29 19:02:02

ubik
Member
Registered: 2018-05-10
Posts: 3  

Re: Devuan on Raspberry Pi 4

I didn't have an older Pi to modify the Devuan image so I used qemu and chroot on a x86 PC with instructions from https://wiki.debian.org/RaspberryPi/qemu-user-static. Mounting the Devuan image and /dev, /proc, /sys & /dev/pts and chrooting in lets you run apt as if you were running on the Pi itself :-)

To get around the problem of the vc4 module and to get the second monitor output to work you need Mesa 19.1.0 or later, that means an upgrade to beowulf and fixing a few dependancies.

I downloaded libgl1-mesa-dri_19.2.0~rc1-1~bpo10+1~rpt3_armhf.deb
libglapi-mesa_19.2.0~rc1-1~bpo10+1~rpt3_armhf.deb and
libglx-mesa0_19.2.0~rc1-1~bpo10+1~rpt3_armhf.deb from http://archive.raspberrypi.org/debian/pool/main/m/mesa/

And to get those working I needed to install binfmt-support, libpfm4 and some other bits that aren't available in the Devuan archives yet:
libllvm8_8.0.1-3~bpo10+1_armhf.deb
llvm-8_8.0.1-3~bpo10+1_armhf.deb
llvm-8-runtime_8.0.1-3~bpo10+1_armhf.deb from
http://ftp.nl.debian.org/debian/pool/ma … olchain-8/

Finally in /boot/config.txt I commented out dtoverlay=vc4-kms-v3d and added:

dtoverlay=vc4-fkms-v3d 
max_framebuffers=2

So far beowulf seems to be running well and I have Xfce running across two 1600x1200 monitors :-)

The only other problem I had was that the HDMI 1 output on the Pi 4 doesn't seem to be as strong as HDMI 0 and really didn't like the long cable I had.

Thanks to therion23

Offline

#8 2020-01-05 22:22:22

pAul
Member
Registered: 2020-01-05
Posts: 2  

Re: Devuan on Raspberry Pi 4

I followed therion23's description, raspi 4 boots up, looks nice, thanks!
However, I cannot set up WLAN AP. I even played with newer kernels and newest firmware.

Current configs:

# uname -a
Linux devuan 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

# dmesg | grep brcmfmac
[    2.614772] brcmfmac: F1 signature read @0x18000000=0x15264345
[    2.622859] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    2.623389] usbcore: registered new interface driver brcmfmac
[    2.859070] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    2.873290] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04
[    3.018180] brcmfmac mmc1:0001:1 wlan1: renamed from wlan0
[   11.974904] brcmfmac: power management disabled
[   12.039577] brcmfmac: power management disabled

# iw list | grep AP
         * AP
         * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{P2P-device } <= 1,

starting hostapd:

# hostapd -dd /etc/hostapd/hostapd.conf
...
nl80211: Teardown AP(wlan1) - device_ap_sme=1 use_monitor=0
nl80211 driver initialization failed.
hostapd_interface_deinit_free(0xc70cd8)
hostapd_interface_deinit_free: num_bss=1 conf->num_bss=1
hostapd_interface_deinit(0xc70cd8)
wlan1: interface state UNINITIALIZED->DISABLED
hostapd_bss_deinit: deinit bss wlan1
wlan1: AP-DISABLED
hostapd_cleanup(hapd=0xc719a0 (wlan1))
hostapd_free_hapd_data: Interface wlan1 wasn't started
....

# iwconfig 
eth0      no wireless extensions.
lo        no wireless extensions.
br0       no wireless extensions.

wlan1     IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off

as well as

# cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wireless-power off

auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan1
bridge_fd 0
bridge_stp off

and

# cat /etc/hostapd/hostapd.conf 
bridge=br0

interface=wlan1
driver=nl80211

ssid=XSXDX
channel=7
hw_mode=g
preamble=1
ieee80211n=1
ieee80211d=1
country_code=DE
wmm_enabled=1

auth_algs=3
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=XPXPX

Did I miss something or is it due to the 32bit version?

Offline

#9 2020-01-11 17:49:05

pAul
Member
Registered: 2020-01-05
Posts: 2  

Re: Devuan on Raspberry Pi 4

pAul wrote:

I followed therion23's description, raspi 4 boots up, looks nice, thanks!
However, I cannot set up WLAN AP. I even played with newer kernels and newest firmware.

an upgrade of hostapd to version 2.6 did the job:
https://github.com/raspberrypi/firmware/issues/1117

Offline

Board footer