{"id":15051058,"url":"https://github.com/inindev/nanopi-r5","last_synced_at":"2025-04-09T06:11:59.568Z","repository":{"id":148907329,"uuid":"616240153","full_name":"inindev/nanopi-r5","owner":"inindev","description":"stock debian arm64 linux for the nanopi r5c \u0026 r5s","archived":false,"fork":false,"pushed_at":"2025-03-25T11:53:33.000Z","size":237,"stargazers_count":114,"open_issues_count":12,"forks_count":19,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-02T02:13:03.586Z","etag":null,"topics":["arm","arm64","debian","debian-linux","device-tree","linux","nanopi","nanopi-r5c","nanopi-r5s","nvme","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-20T01:31:40.000Z","updated_at":"2025-03-25T11:53:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf0866a0-e07c-4b3d-83cc-8f35c85433d4","html_url":"https://github.com/inindev/nanopi-r5","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inindev%2Fnanopi-r5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inindev","download_url":"https://codeload.github.com/inindev/nanopi-r5/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"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","debian-linux","device-tree","linux","nanopi","nanopi-r5c","nanopi-r5s","nvme","u-boot"],"created_at":"2024-09-24T21:30:43.840Z","updated_at":"2025-04-09T06:11:59.551Z","avatar_url":"https://github.com/inindev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nanopi-r5\n#### *Stock Debian ARM64 Linux for the NanoPi R5C \u0026 R5S*\n\nThis stock Debian ARM64 Linux image is built directly from official packages using the Debian [Debootstrap](https://wiki.debian.org/Debootstrap) utility, see: https://github.com/inindev/nanopi-r5/blob/main/debian/nanopi-r5c/make_debian_img.sh#L126\n\nBeing an unmodified Debian build, patches are directory available from the Debian repos using the stock **apt** package manager, see: https://github.com/inindev/nanopi-r5/blob/main/debian/nanopi-r5c/make_debian_img.sh#L355-L365\n\nIf you want to run true up-stream Debian Linux on your ARM64 device, this is the way to do it.\n\n---\n### debian bookworm setup\n\n\u003cbr/\u003e\n\n**1. download the appropriate image**\n```\n(R5C) wget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/nanopi-r5c_bookworm-1203.img.xz\n(R5S) wget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/nanopi-r5s_bookworm-1203.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 Mar 19 21:08 /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 nanopi-r5s_bookworm-1203.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 r5c or r5s to finish setup\n\n\u003cbr/\u003e\n\n**4. login account**\n```\nuser: debian\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 new admin account**\n```\nsudo adduser \u003cyouruserid\u003e\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 from internal eMMC\n\n\u003cbr/\u003e\n\nImaging the internal eMMC device involves booting from a removable MMC card and imaging the internal eMMC device. When booted, the removable MMC device is seen as ```/dev/mmcblk0``` and the internal eMMC device is seen as ```/dev/mmcblk1```\n\n\u003cbr/\u003e\n\n**1. boot from removable MMC**\n\nUsing the steps in the first section above, create a removable MMC card and boot using it. Note: If the internal eMMC device already has a bootable image on it, it will prefer to boot from that. To force the nanopi5 to boot from the removable MMC card you just made, hold the ```mask``` button down before applying power. Once successfully booted to the removable MMC, you will be able to see this by using the ```df``` command which will show /dev/mmcblk0p1 as the booted partition.\n\n\u003cbr/\u003e\n\n**2. download the appropriate image to the booted MMC card and image the internal eMMC**\n```\n(R5C) wget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/nanopi-r5c_bookworm-1203.img.xz\n(R5S) wget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/nanopi-r5s_bookworm-1203.img.xz\nsudo su\nxzcat nanopi-r5s_bookworm-1203.img.xz \u003e /dev/mmcblk1\n```\n\n\u003cbr/\u003e\n\nOnce imaging completes, shutdown, remove the MMC card and it will then boot using the internal eMMC device.\n\nNote: Once booted, ```sudo apt update``` then ```sudo apt upgrade``` to get the latest updates from the debian repositories.\n\n\u003cbr/\u003e\n\n---\n### booting from internal NVMe _(r5s only)_\n\n\u003cbr/\u003e\n\nImaging the internal NVMe device involves booting from a removable MMC card and imaging the internal NVMe device. When booted, the internal NVMe device is seen as ```/dev/nvme0n1```\n\n\u003cbr/\u003e\n\n**1. boot from removable MMC**\n\nUsing the steps in the first section above, create a removable MMC card and boot using it. Note: If the internal eMMC device already has a bootable image on it, it will prefer to boot from that. To force the nanopi5 to boot from the removable MMC card you just made, hold the ```mask``` button down before applying power. Once successfully booted to the removable MMC, you will be able to see this by using the ```df``` command which will show /dev/mmcblk0p1 as the booted partition.\n\n\u003cbr/\u003e\n\n**2. download the image to the booted MMC card and image the internal NVMe**\n```\nwget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/nanopi-r5s_bookworm-1203.img.xz\nsudo su\nxzcat nanopi-r5s_bookworm-1203.img.xz \u003e /dev/nvme0n1\n```\n\n\u003cbr/\u003e\n\n**3. install u-boot to internal eMMC**\n\nThe last step is to prepare the internal eMMC to host u-boot. The eMMC must not contain a bootable partition or it will be preferred for boot over the internal NVMe. Start by downloading the two u-boot files:\n```\nwget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/idbloader-r5s.img\nwget https://github.com/inindev/nanopi-r5/releases/download/v12.0.3/u-boot-r5s.itb\n```\n\nErase the internal eMMC (the device is actually ```/dev/mmcblk1``` but X is placed where 1 belongs to prevent a copy paste mistake)\n```\nsudo dd if=/dev/zero of=/dev/mmcblkX bs=1M count=1024\n```\n\nThe internal eMMC is now erased, install u-boot (again, change X to 1):\n```\nsudo dd bs=4K seek=8 if=idbloader-r5s.img of=/dev/mmcblkX\nsudo dd bs=4K seek=2048 if=u-boot-r5s.itb of=/dev/mmcblkX\n```\n\n**4. setup is now complete and the system is ready for use**\n\nshutdown the device, remove the external mmc card, and restart the device\n\nNote: Once booted, ```sudo apt update``` then ```sudo apt upgrade``` to get the latest updates from the debian repositories.\n\n\u003cbr/\u003e\n\n---\n### building debian bookworm arm64 for the nanopi r5c / r5s 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 a 64 bit arm linux. The initial build of this project used a debian arm64 odroid m1, but now uses a nanopi r5s running stock debian bookworm arm64.\n\n\u003cbr/\u003e\n\n**1. clone the repo**\n```\ngit clone https://github.com/inindev/nanopi-r5.git\ncd nanopi-r5\n```\n\n\u003cbr/\u003e\n\n**2. run the debian build script**\n```\n(R5C) cd debian/nanopi-r5c\n(R5S) cd debian/nanopi-r5s\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finindev%2Fnanopi-r5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finindev%2Fnanopi-r5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finindev%2Fnanopi-r5/lists"}