Fedora 37 nspawn(chroot on steroids) on VF2

I started out with the Debian-69 image booting from the sdcard but with the root partition on the nvme.

All I did was create another partition on the nvme so I had nvme0n1p1 with the debian root and nvme0n1p2 for the fedora root.

I attached the fedora image to loop0 via

# losetup /dev/loop0 Fedora-Developer-37-20221130.n.0-nvme.raw.img
# partprobe /dev/loop0
# lsblk --fs /dev/loop0
NAME      FSTYPE FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
├─loop0p1 ext4   1.0   _/boot 53e7246e-90c3-42c4-b447-3ebc9fe1fdfc
└─loop0p2 ext4   1.0   _/     d9334329-e2ad-4b72-8f5f-b61406e9d461

The fedora root is loop0p2 and so I did this:

dd if=/dev/loop0p2 of=/dev/nvme0n1p2 bs=1M

To boot I just modified extlinux.conf from the debian boot partition to add a new entry for Fedora:

label l2
        menu label Fedora (NVMe)
        linux /boot/vmlinuz-5.15.0-starfive
        initrd /boot/initrd.img-5.15.0-starfive
        fdtdir /boot/dtbs/
        append  root=/dev/nvme0n1p2 rw console=tty0 console=ttyS0,115200 earlycon rootwait stmmaceth=chain_mode:1 selinux=0

The only difference between this and the debian boot entry is the root=/dev/nvme0n1p2.

Before booting, I mounted the fedora root to /mnt and edited /mnt/etc/fstab to look like this:

/dev/nvme0n1p2  /     ext4    defaults,noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s 0 0
/dev/mmcblk1p2  /boot vfat    defaults,noatime,x-systemd.device-timeout=300s,x-systemd.mount-timeout=300s 0 0

I could have used UUIDs or LABELs but these block devices are stable and easier for me to work with.

At this point the board will boot fine if you choose the new boot entry from the boot menu (or change the default in extlinux.conf) but I suggest you add a user and add them to the wheel group. When this Fedora instance boots the console output will show you what the root and riscv user passwords are but it might be easier to change them while you’re here.

Assuming I’ve remembered all the steps correctly, and you’ve booted Fedora, the next step is to conf the yum repos.

Disable all repos in /etc/yum.repos.d except for fedora-riscv.repo. You need to edit the repo url in that one to be:

baseurl=http://fedora.riscv.rocks/repos-dist/f38/latest/riscv64/

The change is from f37 to f38 in the path. For some reason f37 is empty.

Now you should be able to dnf as expected. Here’s what I get when I run a few dnf group commands:

# dnf group list
Last metadata expiration check: 3:40:13 ago on Sat 18 Feb 2023 07:14:13 AM EST.
Available Environment Groups:
   Fedora Custom Operating System
   Minimal Install
   Fedora Server Edition
   Fedora Workstation
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Deepin Desktop
   Budgie Desktop
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
   i3 desktop
   Sway Desktop
Installed Groups:
   C Development Tools and Libraries
   Development Tools
   RPM Development Tools
Available Groups:
   3D Printing
   Administration Tools
   Audio Production
   Authoring and Publishing
   Budgie
   Budgie Desktop Applications
   Cloud Infrastructure
   Cloud Management Tools
   Compiz
   Container Management
   D Development Tools and Libraries
   Design Suite
   Domain Membership
   Editors
   Educational Software
   Electronic Lab
   Engineering and Scientific
   FreeIPA Server
   Games and Entertainment
   Headless Management
   LibreOffice
   MATE Applications
   Milkymist
   Network Servers
   Neuron Modelling Simulators
   Office/Productivity
   Python Classroom
   Python Science
   Robotics
   Security Lab
   Sound and Video
   Sway Window Manager (supplemental packages)
   System Tools
   Text-based Internet
   Window Managers
# dnf group install "System Tools"
Last metadata expiration check: 3:41:26 ago on Sat 18 Feb 2023 07:14:13 AM EST.
Dependencies resolved.
==================================================================================================================================
 Package                                Architecture       Version                                  Repository               Size
==================================================================================================================================
Installing group/module packages:
 BackupPC                               riscv64            4.4.0-8.fc37                             fedora-riscv            431 k
 NetworkManager-l2tp                    riscv64            1.20.6-1.fc37                            fedora-riscv            183 k
 NetworkManager-libreswan               riscv64            1.2.16-2.fc37                            fedora-riscv            124 k
 NetworkManager-openconnect             riscv64            1.2.8-3.fc37                             fedora-riscv            544 k
 NetworkManager-openvpn                 riscv64            1:1.8.18-2.fc37                          fedora-riscv            271 k
 NetworkManager-vpnc                    riscv64            1:1.2.8-2.fc37                           fedora-riscv            168 k
 bonnie++                               riscv64            2.00a-6.fc37                             fedora-riscv             83 k
 cifs-utils                             riscv64            6.15-2.fc37                              fedora-riscv             94 k
 libreswan                              riscv64            4.9-1.fc37                               fedora-riscv            1.3 M
 nmap                                   riscv64            3:7.93-1.fc37                            fedora-riscv            5.5 M
 openconnect                            riscv64            9.01-3.fc37                              fedora-riscv            870 k
 openldap-clients                       riscv64            2.6.3-1.2.riscv64.fc37                   fedora-riscv            174 k
 openvpn                                riscv64            2.5.8-1.fc37                             fedora-riscv            652 k
 samba-client                           riscv64            2:4.17.2-2.fc37                          fedora-riscv            675 k
 setserial                              riscv64            2.17-55.fc37                             fedora-riscv             26 k
 tigervnc                               riscv64            1.12.0-7.fc37                            fedora-riscv            313 k
 vpnc                                   riscv64            0.5.3-44.svn550.fc37                     fedora-riscv             90 k
 xdelta                                 riscv64            3.1.0-15.fc37                            fedora-riscv             89 k
 zisofs-tools                           riscv64            1.0.8-28.fc37                            fedora-riscv             28 k
Installing dependencies:
 BackupPC-XS                            riscv64            0.62-9.fc37                              fedora-riscv            109 k
 esmtp                                  riscv64            1.2-20.fc37                              fedora-riscv             50 k
 fedora-logos-httpd                     noarch             36.0.0-3.fc37                            fedora-riscv             16 k
 httpd                                  riscv64            2.4.54-5.fc37                            fedora-riscv             45 k
 httpd-core                             riscv64            2.4.54-5.fc37                            fedora-riscv            1.3 M
 httpd-filesystem                       noarch             2.4.54-5.fc37                            fedora-riscv             13 k
 httpd-tools                            riscv64            2.4.54-5.fc37                            fedora-riscv             78 k
 ldns                                   riscv64            1.8.1-7.fc37                             fedora-riscv            164 k
 libdbi                                 riscv64            0.9.0-20.fc37                            fedora-riscv             48 k
 libesmtp                               riscv64            1.0.6-25.fc37                            fedora-riscv             63 k
 libpskc                                riscv64            2.6.7-4.fc37                             fedora-riscv             34 k
 libxcrypt-compat                       riscv64            4.4.30-1.fc37                            fedora-riscv            103 k
 nmap-ncat                              riscv64            3:7.93-1.fc37                            fedora-riscv            221 k
 par2cmdline                            riscv64            0.8.1-7.fc37                             fedora-riscv            122 k
 perl-CGI                               noarch             4.54-4.fc37.rvre0                        fedora-riscv            198 k
 perl-Net-FTP-AutoReconnect             noarch             0.3-37.fc37                              fedora-riscv             14 k
 perl-Net-FTP-RetrHandle                noarch             0.2-36.fc37                              fedora-riscv             18 k
 perl-Time-ParseDate                    noarch             2015.103-22.fc37                         fedora-riscv             39 k
 pkcs11-helper                          riscv64            1.29.0-2.fc37                            fedora-riscv             65 k
 ppp                                    riscv64            2.4.7-21.0.riscv64.fc29                  fedora-riscv            952 k
 rrdtool                                riscv64            1.8.0-4.fc37                             fedora-riscv            551 k
 rsync-bpc                              riscv64            3.1.3.0-5.fc37                           fedora-riscv            303 k
 stoken-libs                            riscv64            0.92-7.fc37                              fedora-riscv             46 k
 tigervnc-icons                         noarch             1.12.0-7.fc37                            fedora-riscv             23 k
 tigervnc-license                       noarch             1.12.0-7.fc37                            fedora-riscv             16 k
 vpnc-script                            noarch             20220509-2.gite52f8e66.fc37              fedora-riscv             18 k
 xl2tpd                                 riscv64            1.3.17-1.fc37                            fedora-riscv             94 k
 xmlsec1                                riscv64            1.2.34-2.fc37                            fedora-riscv            184 k
Installing weak dependencies:
 cifs-utils-info                        riscv64            6.15-2.fc37                              fedora-riscv             20 k
 julietaula-montserrat-fonts            noarch             1:7.222-3.fc37                           fedora-riscv            1.6 M
 mod_http2                              riscv64            2.0.9-1.fc37                             fedora-riscv            141 k
 mod_lua                                riscv64            2.4.54-5.fc37                            fedora-riscv             57 k
Installing Groups:
 System Tools

Transaction Summary
==================================================================================================================================
Install  51 Packages

Total download size: 18 M
Installed size: 64 M
Is this ok [y/N]:

Hope that helps!

2 Likes