Regular/riscv64: Difference between revisions

From ALT Linux Wiki
m (→‎QEMU: Add SysV image. Replace .qcow2 to .qcow2c.)
(3 intermediate revisions by the same user not shown)
Line 50: Line 50:
'''Step 1.''' Install QEMU with riscv64 support. For example, in the case of ALT x86_64 system: [http://sisyphus.ru/en/srpm/Sisyphus/qemu qemu-system-riscv-core].
'''Step 1.''' Install QEMU with riscv64 support. For example, in the case of ALT x86_64 system: [http://sisyphus.ru/en/srpm/Sisyphus/qemu qemu-system-riscv-core].


'''Step 2.''' Get the [http://ftp.altlinux.org/pub/distributions/ALTLinux/ports/riscv64/Sisyphus/noarch/RPMS.classic/kernel-image-qemu-un-def-4.19.6-alt5.noarch.rpm Linux kernel for QEMU] and install it:
'''Step 2.''' Get the [http://ftp.altlinux.org/pub/distributions/ALTLinux/ports/riscv64/Sisyphus/noarch/RPMS.classic/kernel-image-qemu-un-def-5.0.19-alt2.rv64gc.noarch.rpm Linux kernel for QEMU] and install it:
<source lang="shell">rpm --install <kernel package>.rpm</source>
<source lang="shell">rpm --install <kernel package>.rpm</source>
After that, the Linux kernel for QEMU could be found at /usr/share/qemu-riscv64/vmlinux.
After that, the Linux kernel for QEMU compressed with gzip could be found at /usr/share/qemu-riscv64/vmlinuz.
Decompress the Linux kernel:
<source lang="shell">$ gzip -d -c /usr/share/qemu-riscv64/vmlinuz > ~/vmlinux</source>


'''Step 3.''' Download one of the images for QEMU listed ([[#QEMU|above]]) and just replace <IMAGE> to the path of just downloaded qcow2 image:
'''Step 3.''' Download one of the images for QEMU listed ([[#QEMU|above]]) and just replace <IMAGE> to the path of just downloaded qcow2c image:
<source lang="shell">
<source lang="shell">
$ qemu-system-riscv64 -nographic -machine virt \
$ qemu-system-riscv64 -nographic -machine virt \
                       -kernel /usr/share/qemu-riscv64/vmlinux \
                       -kernel ~/vmlinux \
                       -m 2G -smp cpus=4,threads=2,maxcpus=8 \
                       -m 2G -smp cpus=4,threads=2,maxcpus=8 \
                       -drive file=<IMAGE>.qcow2,id=hd0 -device virtio-blk-device,drive=hd0 \
                       -drive file=<IMAGE>.qcow2c,id=hd0 -device virtio-blk-device,drive=hd0 \
                       -append "earlyprintk root=/dev/vda1 fastboot rootwait console=ttyS0 debug sunrpc.debug" \
                       -append "earlyprintk root=/dev/vda1 fastboot rootwait console=ttyS0 debug sunrpc.debug" \
                       -netdev user,id=eth0 -device virtio-net-device,netdev=eth0
                       -netdev user,id=eth0 -device virtio-net-device,netdev=eth0
Line 73: Line 75:
'''Step 2.''' Install the [http://sisyphus.ru/en/srpm/Sisyphus/alt-rootfs-installer alt-rootfs-installer].
'''Step 2.''' Install the [http://sisyphus.ru/en/srpm/Sisyphus/alt-rootfs-installer alt-rootfs-installer].


'''Step 3.''' Run the <tt>alt-rootfs-installer</tt>. This script will automatically install the system on microSD card. For example, to install <tt>regular-builder-alpha20190329-riscv64.tar</tt> image on <tt>/dev/sdX</tt> with log output to <tt>/home/user/alt-rootfs-installer.log</tt>:
'''Step 3.''' Run the <tt>alt-rootfs-installer</tt>. This script will automatically install the system on microSD card. For example, to install <tt>regular-builder-alpha20190329-riscv64.tar.xz</tt> image on <tt>/dev/sdX</tt> with log output to <tt>/home/user/alt-rootfs-installer.log</tt>:
<source lang="shell">
<source lang="shell">
$ alt-rootfs-installer --rootfs=/home/user/images/regular-builder-alpha20190329-riscv64.tar \
$ alt-rootfs-installer --rootfs=/home/user/images/regular-builder-alpha20190329-riscv64.tar.xz \
                       --media=/dev/sdX \
                       --media=/dev/sdX \
                       --target=HiFive-Unleashed-bbl --log /home/user/alt-rootfs-installer.log
                       --target=HiFive-Unleashed-bbl --log /home/user/alt-rootfs-installer.log
Line 87: Line 89:
'''Step 2.''' Untar the /boot directory from the archive from ''step 1''. For example, in the case of minimal system image with systemd:
'''Step 2.''' Untar the /boot directory from the archive from ''step 1''. For example, in the case of minimal system image with systemd:
<source lang="shell">
<source lang="shell">
$ tar -xf regular-jeos-latest-riscv64.tar ./boot
$ tar -xf regular-jeos-latest-riscv64.tar.xz ./boot
</source>
</source>
The ./boot/vmlinuz will contain symlink to the Linux kernel.
The ./boot/vmlinuz will contain symlink to the Linux kernel.
Line 111: Line 113:
$ mkfs.ext4 /dev/sdX2
$ mkfs.ext4 /dev/sdX2
$ mount /dev/sdX2 /mnt
$ mount /dev/sdX2 /mnt
$ tar -xpvf regular-jeos-latest-riscv64.tar -C /mnt/
$ tar -xpvf regular-jeos-latest-riscv64.tar.xz -C /mnt/
$ umount /dev/sdX2
$ umount /dev/sdX2
</source>
</source>

Revision as of 11:41, 27 June 2019

Regular image builds for SoC with RISC-V (rv64gc) CPU

Русский

Overview

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

To learn more about regular image builds one could refer to this article.

To make a bug report or discuss any suggestions please refer to the "Feedback" section on this page.

To enter the system, after the boot with one of the images listed below, please use the following username/password:
login: root
password: alt

In the case of the developer image (builder) there is an another user:
login: altlinux
password: alt

Attention! It is recommended to change the password as soon as possible after the first log-in to the system.


HiFive Unleashed

Two types of the images for the SiFive's HiFive Unleashed board currently available:


The instructions on how to run these images on HiFive Unleashed in this section.

QEMU

The images for the QEMU listed below:


The instructions on how to run these images on QEMU in 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 x86_64 system: qemu-system-riscv-core.

Step 2. Get the Linux kernel for QEMU and install it:

rpm --install <kernel package>.rpm

After that, the Linux kernel for QEMU compressed with gzip could be found at /usr/share/qemu-riscv64/vmlinuz. Decompress the Linux kernel:

$ gzip -d -c /usr/share/qemu-riscv64/vmlinuz > ~/vmlinux

Step 3. Download one of the images for QEMU listed (above) and just replace <IMAGE> to the path of just downloaded qcow2c image:

$ qemu-system-riscv64 -nographic -machine virt \
                      -kernel ~/vmlinux \
                      -m 2G -smp cpus=4,threads=2,maxcpus=8 \
                      -drive file=<IMAGE>.qcow2c,id=hd0 -device virtio-blk-device,drive=hd0 \
                      -append "earlyprintk root=/dev/vda1 fastboot rootwait console=ttyS0 debug sunrpc.debug" \
                      -netdev user,id=eth0 -device virtio-net-device,netdev=eth0

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. 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 and manual.

Automatic install on ALT Sisyphus

Step 2. Install the alt-rootfs-installer.

Step 3. Run the alt-rootfs-installer. This script will automatically install the system on microSD card. For example, to install regular-builder-alpha20190329-riscv64.tar.xz image on /dev/sdX with log output to /home/user/alt-rootfs-installer.log:

$ alt-rootfs-installer --rootfs=/home/user/images/regular-builder-alpha20190329-riscv64.tar.xz \
                       --media=/dev/sdX \
                       --target=HiFive-Unleashed-bbl --log /home/user/alt-rootfs-installer.log


After this procedure the /dev/sdX disk will contain two partitions. The first partition will contain bbl bootloader with Linux kernel, which is statically linked with bbl. The second partition will contain root file system.

Now, microSD card is ready to use with HiFive Unleashed.

Manual install

Step 2. Untar the /boot directory from the archive from step 1. For example, in the case of minimal system image with systemd:

$ tar -xf regular-jeos-latest-riscv64.tar.xz ./boot

The ./boot/vmlinuz will contain symlink to the Linux kernel.

Step 3. Create the GPT table with two partitions on the microSD card:

  • The first partition must contain specific GUID 2E54B353-1271-4842-806F-E436D6AF6985
  • The second partition is a typical Linux Filesystem GUID 0FC63DAF-8483-4772-8E79-3D69D8477DE4

The example command for /dev/sdX:

$ sgdisk -g --clear \
        --new=1:2048:67583 --change-name=1:bootloader --typecode=1:2E54B353-1271-4842-806F-E436D6AF6985 \
        --new=2:264192:    --change-name=2:root       --typecode=2:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \
        "/dev/sdX"

Step 4. Write the bbl+Linux kernel to the first partition of microSD:

$ dd if=boot/vmlinuz of=/dev/sdX1 bs=4M status=progress

Step 5. Create filesystem on second partition of microSD. Mount it and untar the archive with rootfs:

$ mkfs.ext4 /dev/sdX2
$ mount /dev/sdX2 /mnt
$ tar -xpvf regular-jeos-latest-riscv64.tar.xz -C /mnt/
$ umount /dev/sdX2

Now, microSD is ready to use with HiFive Unleashed.

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.

Set riscv64 as a platform (drop-down list at the right). In the field "Assign to" set arei@altlinux.org.
• IRC channel #altlinux-riscv at freenode.
• Mailing list: riscv-devel@lists.altlinux.org