Having Problems Configuring Debian on the HiFive Unleashed


#1

I’m trying to get Debian running on the HiFive Unleashed and I’ve been mostly successful but I’m having some issues with the last stretch.

I want to get the board booting straight into Debian running on the second partition and then ideally there would be no login prompt - the board would just boot straight into root and start up all the services and everything (I need the board to be able to do some things without user interaction).

Here’s what I did so far:

  1. I downloaded Debian from here and put it on the second partition of the SD card as formatted by make DISK=/dev/sdbX format-boot-loader. First I had to format the second partition as ext4 but no problems there. Then I just executed dd if=imagefile.img of=/dev/sdb2

  2. I then edited my uEnv.txt by changing the bootargs line to this:

bootargs=rootdelay=3 debug console=tty0 console=ttySIF0 ip=dhcp root=/dev/mmcblk0p2 rw

and changing the “setupchosen” line to this:

setupchosen=run setupvml

To anyone reading in the future, pay attention to the “rootdelay” line, that’s very important.

  1. I then fire up the board with the SD card and I get the following prompt once Debian is done booting:

[ OK ] Started Permit User Sessions.
[ OK ] Started Getty on tty1.
[ OK ] Started Serial Getty on hvc0.
[ OK ] Started Serial Getty on ttySIF0.
[ OK ] Reached target Login Prompts.
[ OK ] Started Login Service.
[ OK ] Reached target Multi-User System.
[ OK ] Reached target Graphical Interface.
[ 24.580000] systemd-journald[97]: Successfully sent stream file descriptor to service manage
r.
Starting Update UTMP about System Runlevel Changes…
[ OK ] Started Update UTMP about System Runlevel Changes.
[ 29.270000] systemd-journald[97]: Successfully sent stream file descriptor to service manage
r.
[ 29.280000] systemd-journald[97]: Successfully sent stream file descriptor to service manage
r.
[ 29.290000] systemd-journald[97]: Successfully sent stream file descriptor to service manage
r.

Debian GNU/Linux buster
Debian GNU/Linux buster/sid rv-hfu-01 hvc0
rv-hfu-01 login: root

Login incorrect
rv-hfu-01 login: root

Login incorrect
rv-hfu-01 login: su
Password:

Login incorrect
rv-hfu-01 login: su
Password:

Note that it doesn’t even let me provide a password when I try and login as root, it just rejects me immediately. I tried changing the /lib/systemd/system/serial-getty@.service file to autologin with the “–autologin root” flag, but it would just output the following:

Debian GNU/Linux buster
Debian GNU/Linux buster/sid rv-hfu-01 hvc0

rv-hfu-01 login: root (automatic login)

/sid rv-hfu-01 ttySIF0

rv-hfu-01 login: root (automatic login)

Password: roo
Login incorrect
rv-hfu-01 login: t
Password:

Login incorrect
rv-hfu-01 login: root

It would just take a second and reject it again.

So, as a test I change my bootargs to include:

init=/bin/bash

Which bypasses the logging in, but it seems like because the OS didn’t properly get a chance to initialize, none of the services come up or seem to be possible to start up manually or anything.

Does anyone have any ideas for me?


(Nikita) #2

Hi!

It could be that root does not has a password set. You could try to mount that image and try to chroot into it (before that you need to add qemu user riscv64 to the binfmt). Inside that chroot you could set a password for root explicitly. Or, you could try to set a password with init=/bin/bash, which you already did :slight_smile: Also you could try to check /etc/pam.d/login or something.