{"id":13643391,"url":"https://github.com/radxa/rockchip-bsp","last_synced_at":"2026-01-22T10:38:03.932Z","repository":{"id":47918881,"uuid":"157851803","full_name":"radxa/rockchip-bsp","owner":"radxa","description":"Linux BSP for ROCK Pi","archived":false,"fork":false,"pushed_at":"2022-11-07T09:41:22.000Z","size":75,"stargazers_count":91,"open_issues_count":16,"forks_count":44,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-21T01:44:42.552Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rockpi.org","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/radxa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-16T10:28:40.000Z","updated_at":"2025-04-05T04:49:20.000Z","dependencies_parsed_at":"2022-08-12T14:10:34.279Z","dependency_job_id":null,"html_url":"https://github.com/radxa/rockchip-bsp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/radxa/rockchip-bsp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxa%2Frockchip-bsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxa%2Frockchip-bsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxa%2Frockchip-bsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxa%2Frockchip-bsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radxa","download_url":"https://codeload.github.com/radxa/rockchip-bsp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radxa%2Frockchip-bsp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28661874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-02T01:01:46.793Z","updated_at":"2026-01-22T10:38:03.913Z","avatar_url":"https://github.com/radxa.png","language":"Dockerfile","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"readme":"# Rockchip Debian SDK\n\nBelow is the instructions of how to build image for ROCK Pi 4 on a HOST PC.\n\n## Get the source code\n\nNote that here the non-root user is jack and we are at the home folder.\n\n    $ cd ~\n    $ pwd\n    /home/jack\n\nWhen you have a different name, like rose, you can replace jack with rose in the next parts of this guide.\n\nCommand prepended by $ means the command may be executed by an unprivileged user.  And command prepended by # means the command may be executed by an privileged user. But the symbol, $ or #, is not part of the command.\n\nYou need Git to get multiple git repositories to build the image.\n\nInstall Git if you don't have it.\n\n    $ sudo apt-get update \u0026\u0026 sudo apt-get upgrade\n    $ sudo apt-get install git\n\nClone the source code\n\n    $ git clone -b master https://github.com/radxa/rockchip-bsp.git\n    $ cd rockchip-bsp\n    $ git submodule init\n    $ git submodule update\n\nYou will get \n\n    build  kernel  README.md  rkbin  rootfs  u-boot\n\nDirectories usage introductions:\n\n* build:\n    * Some script files and configuration files for building u-boot, kernel and rootfs.\n\n* kernel:\n    * kernel source code, current version is 4.4\n\n* rkbin:\n    * Prebuilt Rockchip binaries, include first stage loader and ATF(Arm Trustzone Firmware).\n\n* rootfs:\n    * Bootstrap a Debian based rootfs, support architechture armhf and arm64, support Debian Jessie, Stretch and Buster.\n\n* u-boot:\n    * u-boot as the second stage bootloader\n\n* docker:\n    * Init a ubuntu 16.04 build environment for easier building u-boot, kernel, rootfs and system.\n\n## Update the source code\n\nThe rockchip-bsp will be updated all the time, so you can update the source to get more fearures before building the system image.\n\n    $ cd ~/rockchip-bsp\n    $ git checkout master\n    $ git fetch origin\n    $ git rebase origin/master\n    $ git submodule update\n\n## Build images\n\nTwo methods of building images will be shown in the next parts. One uses Docker (Part one) and the other doesn't (Part two). Just select one part and start to build your wanted images.\n\n### Part one\n\n#### Install Docker\n\n    $ sudo apt-get update\n    $ sudo apt-get install binfmt-support qemu-user-static\n    $ sudo apt-get install \\\n        apt-transport-https \\\n        ca-certificates \\\n        curl \\\n        software-properties-common\n    $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -\n    $ sudo apt-key fingerprint 0EBFCD88\n\n    pub   4096R/0EBFCD88 2017-02-22\n          Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88\n    uid                  Docker Release (CE deb) \u003cdocker@docker.com\u003e\n    sub   4096R/F273FCD8 2017-02-22\n\n    $ sudo add-apt-repository \\\n       \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \\\n       $(lsb_release -cs) \\\n       stable\"\n\n    $ sudo apt-get update\n    $ sudo apt-get install docker-ce\n    $ apt-cache madison docker-ce\n\n    docker-ce | 18.09.0~ce-0~ubuntu | https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages\n\n    $ sudo apt-get install docker-ce=\u003cVERSION\u003e\n\nGo to the docker folder.\n\n    $ cd ~/rockchip-bsp/docker\n\nBuild a Docker image, called rockchip-radxa:1.\n\n    $ sudo docker build -t rockchip-radxa:1 -f ./Dockerfile .\n\nNow the Docker image, rockchip-radxa:1, is ready. You just need to build Docker image once. Everytime you want to build images, just run a Docker container.\n\n#### Run a Docker container\n\n    $ docker run --privileged -it -v /home/jack/rockchip-bsp:/root rockchip-radxa:1 /bin/bash\n\nNow the Docker container should be running.\n\nHere Docker bind mounts /home/jack/rockchip-bsp in the host to /root in the Docker container. cd /root and ls will show:\n\n    # cd /root\n    # ls\n    build  kernel  README.md  rkbin  rootfs  u-boot\n\n#### Build u-boot\n\n    # cd /root\n    # ./build/mk-uboot.sh rockpi4b     #For ROCK Pi 4 Mode B\n\nThe generated images will be copied to out/u-boot folder\n\n    # ls out/u-boot/\n    idbloader.img  rk3399_loader_v1.12.112.bin  trust.img  uboot.img\n\n#### Build kernel\n\n    # ./build/mk-kernel.sh rockpi4b    #For ROCK Pi 4 Mode B\n\nYou will get the kernel image and dtb file\n\n    # ls out/kernel/\n    Image  rockpi-4b-linux.dtb\n\n#### Make rootfs image\n\nTo build 32bit rootfs:\n\n    # export ARCH=armhf\n\nTo build 64bit rootfs:\n\n    # export ARCH=arm64\n\nBuilding a base debian system by ubuntu-build-service from linaro.\n\n    # cd rootfs\n    # dpkg -i ubuntu-build-service/packages/*        # ignore the broken dependencies, we will fix it next step\n    # apt-get install -f\n    # RELEASE=buster TARGET=desktop ARCH=${ARCH} ./mk-base-debian.sh\n\nThis will bootstrap a Debian buster image, you will get a rootfs tarball named `linaro-buster-alip-xxxx.tar.gz`.\n\nBuilding the rk-debain rootfs with debug:\n\n    # VERSION=debug ARCH=${ARCH} ./mk-rootfs-buster.sh  \u0026\u0026 ./mk-image.sh\n\nThis will install Rockchip specified packages and hooks on the standard Debian rootfs and generate an ext4 format rootfs image at `rootfs/linaro-rootfs.img` .\n\n#### Combine everything into one image\n\nGenerate system image with two partitions.\n\n    # build/mk-image.sh -c rk3399 -t system -r rootfs/linaro-rootfs.img\n\nGenerate ROCK Pi 4 system image with five partitions.\n\n    # build/mk-image.sh -c rk3399 -b rockpi4 -t system -r rootfs/linaro-rootfs.img\n\nThis will combine u-boot, kernel and rootfs into one image and generate GPT partition table. Output is\n\n    out/system.img\n\n#### Exit Docker\n\nAfter getting all the wanted images, exit Docker;\n\n    # exit\n\nIn the host, all generated images are in the ~/rockchip-bsp/out directory.\n\n### Part two\n\nWhen you don't want to use Docker to build images, you can try this way.\n\nNote that if you just used Docker to build the images, then you can't wait to try the new method, there may be operational permissions issues.\n\n#### Install toolchain from Linaro\n\n    $ wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz\n    $ sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/\n    $ export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-\n    $ export PATH=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:$PATH\n\nCheck if Linaro toolchain is the default choice:\n\n    $ which aarch64-linux-gnu-gcc\n    $ /usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc\n\n#### Install other build build tools\n\n    $ sudo apt-get install gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools bc python dosfstools\n\n#### Build u-boot/\n\n    $ cd ~/rockchip-bsp\n    $ ./build/mk-uboot.sh rockpi4b     #For ROCK Pi 4 Mode B\n\nThe generated images will be copied to out/u-boot folder\n\n    $ ls out/u-boot/\n    idbloader.img  rk3399_loader_v1.12.112.bin  trust.img  uboot.img\n\n#### Build kernel\n\n    $ ./build/mk-kernel.sh rockpi4b    #For ROCK Pi 4 Mode B\n\nYou will get the kernel image and dtb file\n\n    $ ls out/kernel/\n    Image  rockpi-4b-linux.dtb\n\n#### Make rootfs image\n\nTo build 32bit rootfs:\n\n    $ export ARCH=armhf\n\nTo build 64bit rootfs:\n\n    $ export ARCH=arm64\n\nBuilding a base debian system by ubuntu-build-service from linaro.\n\n    $ cd rootfs\n    $ sudo apt-get install binfmt-support qemu-user-static gdisk\n    $ sudo dpkg -i ubuntu-build-service/packages/*        # ignore the broken dependencies, we will fix it next step\n    $ sudo apt-get install -f\n    $ RELEASE=buster TARGET=desktop ARCH=${ARCH} ./mk-base-debian.sh\n\nThis will bootstrap a Debian buster image, you will get a rootfs tarball named `linaro-buster-alip-xxxx.tar.gz`.\n\nBuilding the rk-debain rootfs with debug:\n\n    $ VERSION=debug ARCH=${ARCH} ./mk-rootfs-buster.sh  \u0026\u0026 ./mk-image.sh\n\nThis will install Rockchip specified packages and hooks on the standard Debian rootfs and generate an ext4 format rootfs image at `rootfs/linaro-rootfs.img` .\n\n#### Combine everything into one image\n\nGenerate system image with two partitions.\n\n    $ build/mk-image.sh -c rk3399 -t system -r rootfs/linaro-rootfs.img\n\nGenerate ROCK Pi 4 system image with five partitions.\n\n    $ build/mk-image.sh -c rk3399 -b rockpi4 -t system -r rootfs/linaro-rootfs.img\n\nThis will combine u-boot, kernel and rootfs into one image and generate GPT partition table. Output is \n\n    out/system.img\n\n## Flash the image\n\nFor normal users, follow instructions [installation](http://wiki.radxa.com/Rockpi4/install). You will need the generated '''out/system.img''' only.\n\nFor developers, flash from USB OTG port, follow instructions [usb-installation](http://wiki.radxa.com/Rockpi4/dev/usb-install). You will need the flash helper '''rk3399_loader_xxx.bin''' and generated '''out/system.img''' files.\n\n## Troubleshooting\n\nGo to [ROCK Pi 4 FAQs](http://wiki.radxa.com/Rockpi4/FAQs)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradxa%2Frockchip-bsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradxa%2Frockchip-bsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradxa%2Frockchip-bsp/lists"}