{"id":15051038,"url":"https://github.com/inindev/visionfive2","last_synced_at":"2025-04-10T02:20:32.124Z","repository":{"id":200677415,"uuid":"706060388","full_name":"inindev/visionfive2","owner":"inindev","description":"stock debian riscv64 linux for the starfive visionfive v2","archived":false,"fork":false,"pushed_at":"2024-10-11T16:23:50.000Z","size":1336,"stargazers_count":10,"open_issues_count":3,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-24T03:53:02.063Z","etag":null,"topics":["debian","debian-linux","device-tree","linux","risc-v","riscv64","starfive","u-boot","visionfive","visionfive-v2"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inindev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-17T08:23:37.000Z","updated_at":"2025-01-20T14:04:14.000Z","dependencies_parsed_at":"2025-02-16T10:32:38.550Z","dependency_job_id":"b2338c45-4f5c-4e8a-b9e1-51423fdcffdf","html_url":"https://github.com/inindev/visionfive2","commit_stats":null,"previous_names":["inindev/visionfive2"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fvisionfive2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fvisionfive2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fvisionfive2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fvisionfive2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inindev","download_url":"https://codeload.github.com/inindev/visionfive2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143027,"owners_count":21054694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["debian","debian-linux","device-tree","linux","risc-v","riscv64","starfive","u-boot","visionfive","visionfive-v2"],"created_at":"2024-09-24T21:30:37.488Z","updated_at":"2025-04-10T02:20:32.098Z","avatar_url":"https://github.com/inindev.png","language":"Shell","readme":"# visionfive2\n#### *Debian riscv64 Linux for the StarFive VisionFive 2*\n\nThis Debian riscv64 Linux image is built directly from official packages using the Debian [debootstrap](https://wiki.debian.org/Debootstrap) utility, see: https://github.com/inindev/visionfive2/blob/main/debian/make_debian_img.sh#L132\n\nMost patches are directly available from the Debian repos using the built-in apt package manager, see: https://github.com/inindev/visionfive2/blob/main/debian/make_debian_img.sh#L354-L361\n\nNote: The kernel in this bundle is from kernel.org and will not get updates from debian.\n\n\u003cbr/\u003e\n\n---\n### debian trixie setup\n\n\u003cbr/\u003e\n\n**1. download image**\n```\nwget https://github.com/inindev/visionfive2/releases/download/v13-6.6.5/visionfive2_trixie-v13-6.6.5.img.xz\n```\n\n\u003cbr/\u003e\n\n**2. determine the location of the target micro sd card**\n\n * before plugging-in device\n```\nls -l /dev/sd*\nls: cannot access '/dev/sd*': No such file or directory\n```\n\n * after plugging-in device\n```\nls -l /dev/sd*\nbrw-rw---- 1 root disk 8, 0 Apr 10 15:56 /dev/sda\n```\n* note: for mac, the device is ```/dev/rdiskX```\n\n\u003cbr/\u003e\n\n**3. in the case above, substitute 'a' for 'X' in the command below (for /dev/sda)**\n```\nsudo su\nxzcat visionfive2_trixie-v13-6.6.5.img.xz \u003e /dev/sdX\nsync\n```\n\n#### when the micro sd has finished imaging, eject and use it to boot the visionfive2 to finish setup\n#### Note the [boot switch configuration setting](https://github.com/inindev/visionfive2/blob/main/misc/vf2_mmc.jpg) needed to select mmc boot.\n\n\u003cbr/\u003e\n\n**4. login account**\n```\nlogin id: debian\npassword: debian\n```\n\n\u003cbr/\u003e\n\n**5. take updates**\n```\nsudo apt update\nsudo apt upgrade\n```\n\n\u003cbr/\u003e\n\n**6. create account \u0026 login as new user**\n```\nsudo adduser youruserid\necho '\u003cyouruserid\u003e ALL=(ALL) NOPASSWD: ALL' | sudo tee /etc/sudoers.d/\u003cyouruserid\u003e\nsudo chmod 440 /etc/sudoers.d/\u003cyouruserid\u003e\n```\n\n\u003cbr/\u003e\n\n**7. lockout and/or delete debian account**\n```\nsudo passwd -l debain\nsudo chsh -s /usr/sbin/nologin debian\n```\n\n```\nsudo deluser --remove-home debian\nsudo rm /etc/sudoers.d/debian\n```\n\n\u003cbr/\u003e\n\n**8. change hostname (optional)**\n```\nsudo nano /etc/hostname\nsudo nano /etc/hosts\n```\n\n\u003cbr/\u003e\n\n---\n### installing on m.2 nvme media\n\n\u003cbr/\u003e\n\n**1. boot from removable mmc**\n\n[Follow the instructions](https://github.com/inindev/visionfive2#debian-trixie-setup) for creating bootable mmc media.\n\n**2. download and copy the image file on to the nvme media**\n```\nwget https://github.com/inindev/visionfive2/releases/download/v13-6.6.5/visionfive2_trixie-v13-6.6.5.img.xz\nsudo su\nxzcat visionfive2_trixie-v13-6.6.5.img.xz \u003e /dev/nvme0n1\nsync\n```\n\n**3. the u-boot partitions are not used on nvme media and can be removed**\n```\nsfdisk --delete /dev/nvme0n1 1\nsfdisk --delete /dev/nvme0n1 2\nsfdisk -r /dev/nvme0n1\n```\n\n**4. remove mmc media and reboot**\n\n\u003cbr/\u003e\n\n---\n### booting from spi nor flash\n\n\u003cbr/\u003e\n\n**1. boot from removable mmc**\n\n[Follow the instructions](https://github.com/inindev/visionfive2#debian-trixie-setup) for creating bootable mmc media.\n\nNote: Configure the [boot switch setting](https://github.com/inindev/visionfive2/blob/main/misc/vf2_mmc.jpg) needed to select mmc boot.\n\n\u003cbr/\u003e\n\n**2. install mtd-utils**\n\nonce linux is booted from the removable mmc, install mtd-utils\n```\nsudo apt update\nsudo apt -y install mtd-utils\n```\n\n\u003cbr/\u003e\n\n**3. erase spi flash**\n```\nsudo flash_erase /dev/mtd0 0 0\nsudo flash_erase /dev/mtd1 0 0\nsudo flash_erase /dev/mtd2 0 0\nsudo flash_erase /dev/mtd3 0 0\n```\n\n\u003cbr/\u003e\n\n**4. write u-boot to spi flash**\n```\nwget https://github.com/inindev/visionfive2/releases/download/v13-6.6.5/u-boot-spl.bin.normal.out\nwget https://github.com/inindev/visionfive2/releases/download/v13-6.6.5/u-boot.itb\nsudo flashcp -v u-boot-spl.bin.normal.out /dev/mtd0\nsudo flashcp -v u-boot.itb /dev/mtd2\n```\n\n\u003cbr/\u003e\n\nOnce the spi flash has been written, the boot sequence should prefer removable mmc media if present, then boot m.2 nvme ssd.\n\nNote: Configure the [boot switch setting](https://github.com/inindev/visionfive2/blob/main/misc/vf2_spi.jpg) needed to select spi boot.\n\n\u003cbr/\u003e\n\n---\n\n### building debian trixie riscv64 for the visionfive2 from scratch\n\n\u003cbr/\u003e\n\nThe build script builds native riscv64 binaries, and thus needs to be run from an riscv64 device such as visionfive2 running \na 64 bit risc-v linux.\n\n\u003cbr/\u003e\n\n**1. clone the repo**\n```\ngit clone https://github.com/inindev/visionfive2.git\ncd visionfive2\n```\n\n\u003cbr/\u003e\n\n**2. run the debian build script**\n```\ncd debian\nsudo sh make_debian_img.sh\n```\n* note: edit the build script to change various options: ```nano make_debian_img.sh```\n\n\u003cbr/\u003e\n\n**3. the output if the build completes successfully**\n```\nmmc_2g.img.xz\n```\n\n\u003cbr/\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finindev%2Fvisionfive2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finindev%2Fvisionfive2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finindev%2Fvisionfive2/lists"}