Difference between revisions of "Template:RockchipMiscCustome"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Configuring kernel command line parameters==
+
==Backup rootfs and create custom SD image  (to burn your application into other boards)==
 +
===Backup rootfs===
 +
Run the following commands on your target board. These commands will back up the entire root partition:
 +
<syntaxhighlight lang="bash">
 +
sudo passwd root
 +
su root
 +
cd /
 +
tar --warning=no-file-changed -cvpzf /rootfs.tar.gz \
 +
    --exclude=/rootfs.tar.gz --exclude=/var/lib/docker/runtimes \
 +
    --exclude=/etc/firstuser --exclude=/etc/friendlyelec-release \
 +
    --exclude=/usr/local/first_boot_flag --one-file-system /
 +
</syntaxhighlight>
 +
Note: if there is a mounted directory on the system, an error message will appear at the end, which can be ignored.
 +
===Making a bootable SD card from a root filesystem===
 +
{{#switch: {{{1}}}
 +
| RK3328 =
 +
Run the following script on your Linux PC host, we'll only mention "ubuntu-noble-core-arm64 os" for brevity, but you can apply the same process for every linux OS.
 +
<syntaxhighlight lang="bash">
 +
su root
 +
git clone https://github.com/friendlyarm/sd-fuse_rk3328 --single-branch -b kernel-6.1.y
 +
cd sd-fuse_rk3328
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/ubuntu-noble-core-arm64-images.tgz
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/emmc-eflasher-images.tgz
 +
scp pi@BOARDIP:/rootfs.tar.gz /rootfs.tar.gz
 +
mkdir rootfs
 +
tar xvzfp rootfs.tar.gz -C rootfs --numeric-owner --same-owner
 +
./build-rootfs-img.sh rootfs ubuntu-noble-core-arm64
 +
./mk-sd-image.sh ubuntu-noble-core-arm64
 +
./mk-emmc-image.sh ubuntu-noble-core-arm64 autostart=yes
 +
</syntaxhighlight>
 +
| RK3399 =
 +
Run the following script on your Linux PC host, we'll only mention "debian-bullseye-desktop-arm64 os" for brevity, but you can apply the same process for every linux OS.
 +
<syntaxhighlight lang="bash">
 +
su root
 +
git clone https://github.com/friendlyarm/sd-fuse_rk3399 --single-branch -b kernel-4.19
 +
cd sd-fuse_rk3399
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/debian-bullseye-desktop-arm64-images.tgz
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/emmc-eflasher-images.tgz
 +
scp pi@BOARDIP:/rootfs.tar.gz /rootfs.tar.gz
 +
mkdir rootfs
 +
tar xvzfp rootfs.tar.gz -C rootfs --numeric-owner --same-owner
 +
./build-rootfs-img.sh rootfs debian-bullseye-desktop-arm64
 +
./mk-sd-image.sh debian-bullseye-desktop-arm64
 +
./mk-emmc-image.sh debian-bullseye-desktop-arm64 autostart=yes
 +
</syntaxhighlight>
 +
| RK3568 =
 +
Run the following script on your Linux PC host, we'll only mention "debian-bullseye-desktop-arm64 os" for brevity, but you can apply the same process for every linux OS.
 +
<syntaxhighlight lang="bash">
 +
su root
 +
git clone https://github.com/friendlyarm/sd-fuse_rk3568 --single-branch -b kernel-6.1.y
 +
cd sd-fuse_rk3568
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/debian-bullseye-desktop-arm64-images.tgz
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/emmc-eflasher-images.tgz
 +
scp pi@BOARDIP:/rootfs.tar.gz /rootfs.tar.gz
 +
mkdir rootfs
 +
tar xvzfp rootfs.tar.gz -C rootfs --numeric-owner --same-owner
 +
./build-rootfs-img.sh rootfs debian-bullseye-desktop-arm64
 +
./mk-sd-image.sh debian-bullseye-desktop-arm64
 +
./mk-emmc-image.sh debian-bullseye-desktop-arm64 autostart=yes
 +
</syntaxhighlight>
 +
| RK3588 =
 +
Run the following script on your Linux PC host, we'll only mention "debian-bullseye-desktop-arm64 os" for brevity, but you can apply the same process for every linux OS.
 +
<syntaxhighlight lang="bash">
 +
su root
 +
git clone https://github.com/friendlyarm/sd-fuse_rk3588 --single-branch -b kernel-6.1.y
 +
cd sd-fuse_rk3588
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/debian-bullseye-desktop-arm64-images.tgz
 +
tar xvzf /path/to/netdrive/03_Partition\ image\ files/emmc-eflasher-images.tgz
 +
scp pi@BOARDIP:/rootfs.tar.gz /rootfs.tar.gz
 +
mkdir rootfs
 +
tar xvzfp rootfs.tar.gz -C rootfs --numeric-owner --same-owner
 +
./build-rootfs-img.sh rootfs debian-bullseye-desktop-arm64
 +
./mk-sd-image.sh debian-bullseye-desktop-arm64
 +
./mk-emmc-image.sh debian-bullseye-desktop-arm64 autostart=yes
 +
</syntaxhighlight>
 +
| #default =
 +
Only support RK3328/RK3399/RK3568/RK3566/RK3588<br />
 +
}}
 +
{{#switch: {{{1}}}
 +
| RK3399 =
 +
==Configuring kernel command line parameters (only support for kernel4.4)==
 
===eMMC Boot===
 
===eMMC Boot===
 
Here are the steps:<br />
 
Here are the steps:<br />
Line 7: Line 87:
 
===SD Boot===
 
===SD Boot===
 
To modify the command line parameters of the SD card, you need to repackage the SD card image file, <br />
 
To modify the command line parameters of the SD card, you need to repackage the SD card image file, <br />
you can use the sd-fuse script we provide to assist packaging, here take rk3568 as an example, <br />
+
you can use the sd-fuse script we provide to assist packaging:
other CPUs also have the corresponding sd-fuse repository, replace the word rk3568 with other cpu models:
+
| #default =
 +
}}
 +
{{#switch: {{{1}}}
 +
| RK3399 =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/friendlyarm/sd-fuse_rk3568.git
+
git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b master --single-branch
cd sd-fuse_rk3568
+
cd sd-fuse_rk3399
wget --no-proxy http://112.124.9.243/dvdfiles/RK3568/images-for-eflasher/debian-buster-desktop-arm64-images.tgz
+
tar xvzf /path/to/netdrive/03_Partition\ image\ files/friendlydesktop-arm64-images.tgz
tar xvzf debian-buster-desktop-arm64-images.tgz
+
tar xvzf /path/to/netdrive/03_Partition\ image\ files/emmc-flasher-images.tgz
vim debian-buster-desktop-arm64/parameter.txt # Edit command-line parameters
+
vim friendlydesktop-arm64/parameter.txt   # Edit command-line parameters
./mk-sd-image.sh debian-buster-desktop-arm64  # Repackage sd image file
+
./mk-sd-image.sh friendlydesktop-arm64    # Repackage sd image file
 +
./mk-emmc-image.sh friendlydesktop-arm64  # Repackage sd-to-emmc image file
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
| #default =
 +
}}

Latest revision as of 08:15, 26 August 2024

1 Backup rootfs and create custom SD image (to burn your application into other boards)

1.1 Backup rootfs

Run the following commands on your target board. These commands will back up the entire root partition:

sudo passwd root
su root
cd /
tar --warning=no-file-changed -cvpzf /rootfs.tar.gz \
    --exclude=/rootfs.tar.gz --exclude=/var/lib/docker/runtimes \
    --exclude=/etc/firstuser --exclude=/etc/friendlyelec-release \
    --exclude=/usr/local/first_boot_flag --one-file-system /

Note: if there is a mounted directory on the system, an error message will appear at the end, which can be ignored.

1.2 Making a bootable SD card from a root filesystem

Only support RK3328/RK3399/RK3568/RK3566/RK3588