{"id":20765693,"url":"https://github.com/inindev/nanopi-r4s","last_synced_at":"2025-05-11T08:34:01.548Z","repository":{"id":41451001,"uuid":"376674733","full_name":"inindev/nanopi-r4s","owner":"inindev","description":"debian arm64 linux for the nanopi r4s","archived":false,"fork":false,"pushed_at":"2023-06-04T20:30:46.000Z","size":117,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-06-04T21:21:37.301Z","etag":null,"topics":["arm","arm64","debian","device-tree","linux","nanopi","nanopi-r4s","r4s","r4s-firmware","rk3399","u-boot"],"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}},"created_at":"2021-06-14T01:28:04.000Z","updated_at":"2023-04-02T18:13:50.000Z","dependencies_parsed_at":"2023-01-18T13:16:03.710Z","dependency_job_id":null,"html_url":"https://github.com/inindev/nanopi-r4s","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r4s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r4s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r4s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r4s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inindev","download_url":"https://codeload.github.com/inindev/nanopi-r4s/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225029199,"owners_count":17409657,"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":["arm","arm64","debian","device-tree","linux","nanopi","nanopi-r4s","r4s","r4s-firmware","rk3399","u-boot"],"created_at":"2024-11-17T11:18:24.412Z","updated_at":"2024-11-17T11:18:25.069Z","avatar_url":"https://github.com/inindev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanopi-r4s\ndebian arm64 linux for the nanopi r4s\n\n---\n#### Notice: Unmaintained Repository\nThis repository is no longer being maintained. An attempt was made to update to debian 12 bookworm (see [bookworm](https://github.com/inindev/nanopi-r4s/tree/bookworm) branch) but the pci lan nic is not loading in linux. This device was always unreliable on reboot and would often need to be power cycled to restart. I recommend looking at the [nanopi r5c or r5s](https://github.com/inindev/nanopi-r5) instead. The [debian bullseye release](https://github.com/inindev/nanopi-r4s/releases/tag/v11.4) here is a functioning load.\n\n---\n### debian bullseye setup\n\n\u003cbr/\u003e\n\n**1. download image:**\n```\nwget https://github.com/inindev/nanopi-r4s/releases/download/v11.4/bullseye.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 Jul  2 16:33 /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 sh -c 'xzcat bullseye.img.xz \u003e /dev/sdX \u0026\u0026 sync'\n```\n\n#### when the micro sd has finished imaging, eject and use it to boot the nanopi r4s to finish setup\n\n\u003cbr/\u003e\n\n**4. login:**\n```\nuser: debian@192.168.1.xxx\npass: 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 debian\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---\n### booting directly to usb from micro sd bootstrap\n\n\u003cbr/\u003e\n\nThe nanopi r4s board always needs to bootstrap from a micro sd card as it contains no embedded flash like a raspberry pi4. \nThe minimum required binary for the micro sd is a special version of uboot which redirects the boot process to an attached \nusb emmc (nand flash) drive.\n\n\u003cbr/\u003e\n\n**1. download images:**\n```\nwget https://github.com/inindev/nanopi-r4s/releases/download/v11.4/usb_rksd_loader.img\nwget https://github.com/inindev/nanopi-r4s/releases/download/v11.4/usb_u-boot.itb\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 Jul  2 16:33 /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```\ncat /dev/zero | sudo tee /dev/sdX\nsudo dd bs=4K seek=8 if=usb_rksd_loader.img of=/dev/sdX conv=notrunc\nsudo dd bs=4K seek=2048 if=usb_u-boot.itb of=/dev/sdX conv=notrunc\nsync\n```\n\n#### when the micro sd has finished imaging, eject and use it to boot the nanopi r4s to usb\n\n\u003cbr/\u003e\n\n\n---\n### building debian bullseye arm64 for the nanopi r4s from scratch\n\n\u003cbr/\u003e\n\nThe build script builds native arm64 binaries and thus needs to be run from an arm64 device such as a raspberry pi4 running \na 64 bit arm linux. The initial build of this project used a debian arm64 raspberry pi4, but now uses a nanopi r4s running \npure debian bullseye arm64.\n\n\u003cbr/\u003e\n\n**1. clone the repo:**\n```\ngit clone https://github.com/inindev/nanopi-r4s.git\ncd nanopi-r4s\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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finindev%2Fnanopi-r4s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finindev%2Fnanopi-r4s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finindev%2Fnanopi-r4s/lists"}