Regular/riscv64: Difference between revisions

From ALT Linux Wiki
m (→‎Feedback: Sync w/ ru)
(REFACTOR)
Line 1: Line 1:


'''<big>Regular image builds for SoC with RISC-V (rv64gc) CPU</big>
'''
{| style="border:1px solid #AAA; background:#F9F9FF; width:100px; margin: 0 0 1em 1em; padding:.2em; text-align:left; float: right;" class=noprint
{| style="border:1px solid #AAA; background:#F9F9FF; width:100px; margin: 0 0 1em 1em; padding:.2em; text-align:left; float: right;" class=noprint
| __TOC__
| __TOC__
Line 7: Line 5:
| [[:ru:Regular/riscv64|Русский]]
| [[:ru:Regular/riscv64|Русский]]
|}
|}
= '''Overview''' =
[[Regular|Regular image]] builds are intended to test and develop the RISC-V (rv64gc) [https://en.altlinux.org/Ports/riscv64 port] of the [https://en.altlinux.org/Sisyphus Sisyphus] repository. Please refer to [[Ports/riscv64|this page]] for more information about this port.


To make a bug report or discuss any suggestions please refer to the [[#Feedback|"Feedback"]] section on this page.
[[Regular|Regular image]] builds are intended to test and develop the [[Ports/riscv64|RISC-V (rv64gc) port]] of [[Sisyphus]] repository.


To enter the system, after the boot with one of the images listed below, please use the following username/password:  
Additional information:
<br>
* on Regular images: [[Regular]];
'''<tt>login: root</tt>'''
* on riscv64 Sisyphus port: [[Ports/riscv64]];
<br>
* #Feedback.
'''<tt>password: alt</tt>'''


The graphical image with [https://en.wikipedia.org/wiki/Xfce XFCE] does not provides
Аfter booting from one of the images below, use the following credentials to login:
a preset password for the root user. At the first boot the user will be asked to setup
system manually through visual menu.


In the case of the developer image ('''builder''') there is an another user:
  login: root
<br>
  password: alt
'''<tt>login: altlinux</tt>'''
<br>
'''<tt>password: alt</tt>'''


{{Attention|It is recommended to '''change the password as soon as possible''' after the first log-in to the system.}}
For the recent images with graphics support (both [https://en.wikipedia.org/wiki/Xfce XFCE] and [https://ru.wikipedia.org/wiki/MATE MATE]), these credentials work for the first boot. All images with graphics support have a graphical setup wizard that is activated on the first boot and allows to do initial configuration of the system, including setting the root password.


== HiFive Unleashed ==
The developer image ('''builder''') has another pre-created user:
Four types of the images for the [https://www.sifive.com SiFive's] [https://www.crowdsupply.com/sifive/hifive-unleashed HiFive Unleashed] board currently available:


* Minimal system with systemd -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-jeos-systemd-latest-riscv64.tar.xz link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
  login: altlinux
* Minimal system with SysV -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-jeos-sysv-latest-riscv64.tar.xz link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
  password: alt
* Minimal system for developer (rpmbuild, [https://www.altlinux.org/Hasher hasher], gcc, ssh) -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-builder-latest-riscv64.tar.xz link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
 
* Graphical system with XFCE (VNC, X11) -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-xfce-latest-riscv64.tar.xz link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
{{Attention|It is recommended to '''change the password as soon as possible''' after the first log-in into the system.}}
<br>
 
The instructions on how to run these images on HiFive Unleashed in [[#How to run on HiFive Unleashed|this section]].
== HiFive Unmatched and Unleashed ==
 
For [[HiFive Unmatched]] and [[HiFive Unleashed]] boards we recommend fresh images build by jqt4@: http://ftp.altlinux.org/pub/people/jqt4/images/hifive/
 
Setup instructions are available on the corresponding board page in this wiki: [[HiFive Unmatched]], [[HiFive Unleashed]]
 
See [[#VNC]] section below on how to access graphical setup for Xfce and MATE images.


== QEMU ==
== QEMU ==
Line 46: Line 41:
* Minimal system for developer (rpmbuild, [https://www.altlinux.org/Hasher hasher], gcc, ssh) -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-builder-latest-riscv64.qcow2c link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
* Minimal system for developer (rpmbuild, [https://www.altlinux.org/Hasher hasher], gcc, ssh) -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-builder-latest-riscv64.qcow2c link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
* Graphical system with XFCE (VNC, X11) -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-xfce-latest-riscv64.qcow2c link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
* Graphical system with XFCE (VNC, X11) -- [http://nightly.altlinux.org/sisyphus-riscv64/alpha/regular-xfce-latest-riscv64.qcow2c link] ([http://nightly.altlinux.org/sisyphus-riscv64/alpha/MD5SUM MD5], [http://nightly.altlinux.org/sisyphus-riscv64/alpha/SHA1SUM SHA1])
<br>
The instructions on how to run these images on QEMU in [[#How to run on QEMU|this section]].
= '''How to run on QEMU''' =
In order to run the image on the QEMU system one need to follow these steps:
'''Step 1.''' Install QEMU with riscv64 support. For example, in the case of ALT Sisyphus system: [http://sisyphus.ru/en/srpm/Sisyphus/qemu qemu-system-riscv-core].
'''Step 2.'''
==== <p style="color:#337569;">ALT</p> ====
Install or download and extract a package with [https://github.com/riscv/opensbi OpenSBI] and [https://www.denx.de/wiki/U-Boot/ U-Boot]. In the case of '''ALT''' (if it is not the case, please [[#Other system|see here]]) one could add noarch repository sisyphus-riscv64 to the system and install the package <code>opensbi-firmware-generic</code>:
<source lang="shell">
$ apt-repo add 'rpm [sisyphus-riscv64] http://ftp.altlinux.org/pub/distributions/ALTLinux ports/riscv64/Sisyphus/noarch classic'
$ apt-get update
$ apt-get install opensbi-firmware-generic
</source>
After that, the firmware will be at the path <code>/usr/share/opensbi/generic/firmware/fw_payload.elf</code>.
==== <p style="color:#337569;">Other system</p> ====
In that case one could download a package <code>opensbi-firmware-generic-.*</code> from the [http://ftp.altlinux.org/pub/distributions/ALTLinux/ports/riscv64/Sisyphus/noarch/RPMS.classic/ sisyphus-riscv64  noarch repository sisyphus-riscv64]. After that it is possible to install the package <code>rpm -i</code> or extract it <code>rpm2cpio</code>.
Besides that it is possible to get the firmware from the qcow2c image with <code>qemu-nbd</code>.
'''Step 3.''' Download one of the images for QEMU listed ([[#QEMU|above]]) and just replace <code><IMAGE></code> to the path of just downloaded qcow2c image and <code><FIRMWARE></code> to the <code>fw_payload.elf</code>:
<source lang="shell">
$ qemu-system-riscv64 -nographic -machine virt \
                      -bios <FIRMWARE> \
                      -m 2G -smp cpus=4 \
                      -drive file=<IMAGE>,id=hd0 -device virtio-blk-device,drive=hd0 \
                      -netdev user,id=eth0 -device virtio-net-device,netdev=eth0
</source>
In the case of the XFCE graphical image, the user needs to redirect incoming
TCP connections to the host port 5900 (VNC) to the guest port. One could do it
with the following command:
<source lang="shell">
$ qemu-system-riscv64 -nographic -machine virt \
                      -bios <FIRMWARE> \
                      -m 2G -smp cpus=4 \
                      -drive file=<IMAGE>,id=hd0 -device virtio-blk-device,drive=hd0 \
                      -netdev user,id=eth0,hostfwd=tcp::5900-:5900 -device virtio-net-device,netdev=eth0
</source>
For information about how to connect to the VNC server please refer to the [[#VNC|"VNC" section]].
= '''How to run on HiFive Unleashed''' =
This instruction assumes that the user is working on the computer with ALT Sisyphus installed on it.
In order to run the image on the HiFive Unleashed one need to follow these steps:
'''Step 1.''' [[#HiFive Unleashed|Download]] minimal system image with systemd, which is a ''tar'' archive with rootfs. To install the system one could choose between two options: [[#Automatic install on ALT Sisyphus|automatic install on ALT Sisyphus]] and [[#Manual install|manual]].
==== <p style="color:#337569;">Automatic install on ALT Sisyphus</p> ====
'''Step 2.''' Install the [http://sisyphus.ru/en/srpm/Sisyphus/alt-rootfs-installer alt-rootfs-installer].
'''Step 3.''' The <code>alt-rootfs-installer</code> will automatically install the system on microSD card. For example, to install <code>regular-builder-latest-riscv64.tar.xz</code> image on <code>/dev/sdX</code> with log output to <code>/home/user/alt-rootfs-installer.log</code>:
<source lang="shell">
$ alt-rootfs-installer --rootfs=/home/user/images/regular-builder-latest-riscv64.tar.xz \
                      --media=/dev/sdX \
                      --target=HiFive-Unleashed-opensbi --log=/home/user/alt-rootfs-installer.log
</source>
<br>
After this procedure the <code>/dev/sdX</code> disk will contain two partitions:
<ol>
<li>[https://github.com/sifive/freedom-u540-c000-bootloader FSBL (First Stage Bootloader)]</li>
<li>[https://github.com/riscv/opensbi OpenSBI] + [https://www.denx.de/wiki/U-Boot/ U-Boot]</li>
<li>rootfs</li>
</ol>


Now, microSD card is ready to use with HiFive Unleashed.
The instructions on how to run these images on QEMU are on a separate page: [[Ports/riscv64/QEMU]].


==== <p style="color:#337569;">Manual install</p> ====
For information about how to connect to the VNC server please refer to the [[#VNC]] section below.
'''Step 2.''' Untar two files from the archive from ''step 1''. For example, in the case of <code>regular-builder-latest-riscv64.tar.xz</code>:
<source lang="shell">
$ tar -xJf regular-jeos-latest-riscv64.tar.xz ./usr/share/fu540_boot/fsbl.bin ./usr/share/opensbi/sifive/fu540/firmware/fw_payload.bin
</source>


These two files <code>./usr/share/fu540_boot/fsbl.bin</code> и
== VNC ==
<code>./usr/share/opensbi/sifive/fu540/firmware/fw_payload.bin</code>
are [https://github.com/sifive/freedom-u540-c000-bootloader FSBL] and
[https://github.com/riscv/opensbi OpenSBI] +
[https://www.denx.de/wiki/U-Boot/ U-Boot], acoordingly.
 
'''Step 3.''' Create the GPT table with three partitions on the microSD card:
* FSBL partition [https://github.com/sifive/freedom-u540-c000-bootloader/blob/master/gpt/gpt.c with GUID] 5B193300-FC78-40CD-8002-E86C45580B47
* OpenSBI partition [https://github.com/sifive/freedom-u540-c000-bootloader/blob/master/gpt/gpt.c with GUID] 2E54B353-1271-4842-806F-E436D6AF6985
* Linux Filesystem partition with GUID 0FC63DAF-8483-4772-8E79-3D69D8477DE4
The example command for <code>/dev/sdX</code>:
<source lang="shell">
$ sgdisk \
--new=1:2048:4095 --change-name=1:fsbl \
--typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \
--new=2:4096:32767 --change-name=2:opensbi-uboot \
--typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
--new=3:32768: --change-name=3:rootfs \
--typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \
/dev/sdX
</source>
 
'''Step 4.''' Write the FSBL to the partition with FSBL GUID (first partition in the example above):
<source lang="shell">
$ dd if=./usr/share/fu540_boot/fsbl.bin of=/dev/sdX1 bs=4M status=progress
</source>
 
'''Step 5.''' Write the OpenSBI + U-Boot to the partition with OpenSBI GUID (second partition in the example above):
<source lang="shell">
$ dd if=./usr/share/opensbi/sifive/fu540/firmware/fw_payload.bin of=/dev/sdX2 bs=4M status=progress
</source>
 
'''Step 6.''' Create a filesystem on the third partition of the microSD. Mount it and untar the archive with rootfs:
<source lang="shell">
$ mkfs.ext4 /dev/sdX3
$ mount /dev/sdX3 /mnt
$ tar -xpJvf regular-builder-latest-riscv64.tar.xz -C /mnt/
$ sync; umount /dev/sdX3
</source>
 
Now, the microSD is ready to use with HiFive Unleashed.
 
= '''VNC''' =
At the first boot the user will be asked to setup
At the first boot the user will be asked to setup
system manually through visual menu. One could setup the timezone, root password,
system manually through visual menu. One could setup the timezone, root password,
add a new user, setup VNC password, etc.
add a new user, setup VNC password, etc.
In the case of QEMU the connection procedure to VNC is straightforward.
In the case of QEMU, if port forwarding for port 5900 is used, connecting to VNC is straightforward. For example, in the case of [https://en.wikipedia.org/wiki/TigerVNC tigerVNC]:
For example, in the case of [https://en.wikipedia.org/wiki/TigerVNC tigerVNC]:
<source lang="shell">
<source lang="shell">
$ vncviewer 127.0.0.1
$ vncviewer 127.0.0.1
Line 195: Line 76:
</source>
</source>


= '''Feedback''' =
== Feedback ==
'''• Bug reports''' submission form at [https://bugzilla.altlinux.org bugzilla].
'''• Bug reports''' submission form at [https://bugzilla.altlinux.org bugzilla].
* In the case of any issue with a package please choose ''Sisyphus''.
* In the case of any issue with a package please choose ''Sisyphus''.
* In the case of an issue with the images please choose ''Regular''.
* In the case of an issue with the images please choose ''Regular''.


Set ''riscv64'' as a platform (drop-down list at the right). In the field "''Assign to''" set <tt>iv@altlinux.org</tt>.
'''IMPORTANT''':
<br>
* set platform field (drop-down list at the right) to ''riscv64'';
'''• IRC''' channel [http://irc.netsplit.de/channels/details.php?room=%23altlinux-riscv&net=freenode #altlinux-riscv] at [https://freenode.net/ freenode].
* assign the issue to <tt>iv@altlinux.org</tt>.
<br>
 
'''• Mailing list:''' riscv-devel@lists.altlinux.org
'''• Mailing list:''' riscv-devel@lists.altlinux.org



Revision as of 12:07, 11 November 2021

Русский

Regular image builds are intended to test and develop the RISC-V (rv64gc) port of Sisyphus repository.

Additional information:

Аfter booting from one of the images below, use the following credentials to login:

 login: root
 password: alt

For the recent images with graphics support (both XFCE and MATE), these credentials work for the first boot. All images with graphics support have a graphical setup wizard that is activated on the first boot and allows to do initial configuration of the system, including setting the root password.

The developer image (builder) has another pre-created user:

 login: altlinux
 password: alt
Attention! It is recommended to change the password as soon as possible after the first log-in into the system.


HiFive Unmatched and Unleashed

For HiFive Unmatched and HiFive Unleashed boards we recommend fresh images build by jqt4@: http://ftp.altlinux.org/pub/people/jqt4/images/hifive/

Setup instructions are available on the corresponding board page in this wiki: HiFive Unmatched, HiFive Unleashed

See #VNC section below on how to access graphical setup for Xfce and MATE images.

QEMU

The images for the QEMU listed below:

The instructions on how to run these images on QEMU are on a separate page: Ports/riscv64/QEMU.

For information about how to connect to the VNC server please refer to the #VNC section below.

VNC

At the first boot the user will be asked to setup system manually through visual menu. One could setup the timezone, root password, add a new user, setup VNC password, etc. In the case of QEMU, if port forwarding for port 5900 is used, connecting to VNC is straightforward. For example, in the case of tigerVNC:

$ vncviewer 127.0.0.1

In the case of HiFive Unleashed one needs to find out what is the IP address of this machine. The HiFive Unleashed obtains an IP address from DHCP during boot time. One way to do this is to connect HiFive Unleashed and PC with a microUSB-USB cord. This allows one to connect to the serial console. To connect to the serial console (usually it is /dev/ttyUSB1) with GNU/screen, please use the following command:

$ screen /dev/ttyUSB1 115200

During first boot time the information about IPv4 and IPv6 addresses will be prompted to the console (e.g.):

[  128.084540] xinit[276]: ALTERATOR SETUP === Default device: "eth0"
[  128.084888] xinit[276]: ALTERATOR SETUP === IPv4: "192.168.88.216/24"
[  128.085110] xinit[276]: ALTERATOR SETUP === IPv6: "fe80::72b3:d5ff:fe92:f229/64"

To connect to the VNC server:

$ vncviewer 192.168.88.216

Feedback

• Bug reports submission form at bugzilla.

  • In the case of any issue with a package please choose Sisyphus.
  • In the case of an issue with the images please choose Regular.

IMPORTANT:

  • set platform field (drop-down list at the right) to riscv64;
  • assign the issue to iv@altlinux.org.

• Mailing list: riscv-devel@lists.altlinux.org