You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Pratham Patel 3255ef543b README: add TODO for internals 4 weeks ago
setup-scripts split network setup in different scripts 4 weeks ago
.gitignore reflect changes in chroot and output dirs 1 month ago
00-deps.sh code cleanup 4 weeks ago
01-mk-chroot.sh add network-setup.sh 4 weeks ago
README.md README: add TODO for internals 4 weeks ago
chroot-setup.sh add locate pkg 4 weeks ago
mk-img.sh I wasn't already compressing images, make sure that is reflected in README and modify the mk-img.sh script too 4 weeks ago

README.md

README

username: root
password: debian

Don't worry, you will be forced to change the password at first login 😉

TODO: For image

  • reduce image size from 16G to 4G (look here)
  • install linux-headers-$(uname -r) after the first login of root as a wireguard dependency (fixed)
  • setup enp1s0 as WAN ans enp2s0 as LAN (10.0.0.0/8) on first boot
  • possibly move to debian testing/stable
  • test it against actual hardware
  • Run sensors-detect on first boot (if supported by the board)

TODO: For internals (networking)

  • Setup QoS (an easy way for the user to set this up)
  • Port forwarding
  • DMZ

there's probably more, but these shoul do; for now


IF YOU ARE USING IPv6, PLEASE ENABLE THE FOLLOWING SERVICES:

sudo systemctl enable --now shorewall6.service

Building the image

Make sure that you have necessary dependencies installed

sudo ./00-deps.sh

Build the image

Reduce the image size

My default is to build a 16G (sparse) image so I have enough headroom. But you may trim it down to 4G with the following command:

sed -i 's/size=16G/size=4G/g' mk-img.sh

If you are on macOS, I have a few questions...

  1. Why are you using this script on a Mac? I can't even guarantee it running on Ubuntu :/
  2. Did you read 1?

Either way, use the gsed command on Mac. Install it using the following command:

brew install gnu-sed

Build it.

Now create the image:

sudo ./01-mk-chroot.sh

There will be 3 files created and placed in the out/ directory.

  • riscyroutes-VERSION-DATE.img
  • SHA512SUMS

Booting the image in QEMU

I build the image in a Debian VM, so I can not attest for the build working on any other Linux distribution. But the image that gets created does in-fact boot on a different Linux distribution. This may not be a surprise for x86 people. It works on Pop!_OS :)

To boot the image on an x86 machine, you must have the following dependencies:

sudo apt-get install u-boot-qemu opensbi qemu-system-misc
#!/usr/bin/env bash

qemu-system-riscv64 \
        -machine virt -m 8G -smp cpus=8 \
        -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
        -kernel /usr/lib/u-boot/qemu-riscv64_smode/uboot.elf \
        -netdev user,ipv4=on,ipv6=off,id=net0,restrict=off,net=192.168.100.0/24 \
        -device virtio-net-device,netdev=net0 \
        -netdev user,ipv4=on,ipv6=off,id=net1,restrict=off,net=192.168.200.0/24 \
        -device virtio-net-device,netdev=net1 \
        -device virtio-blk-device,drive=hd0 -drive file=riscyroutes-VERSION-DATE.img,format=raw,id=hd0

Post-install

Keeping this here because I don't know if the raspi power supply (15w) will work with VisionFive V2 (30w max).

sudo sensors-detect

Monitor voltage under load using the sensors command.