Difference between revisions of "Template:OfficialDebianCore"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(3 intermediate revisions by the same user not shown)
Line 41: Line 41:
 
  | NanoPi-R2S
 
  | NanoPi-R2S
 
  | NanoPi-R2C-Plus
 
  | NanoPi-R2C-Plus
 +
| NanoPi-R2S-Plus
 
  | NanoPi-R2C =
 
  | NanoPi-R2C =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
Line 49: Line 50:
 
  | NanoPi-R5S =
 
  | NanoPi-R5S =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b master --single-branch
+
git clone https://github.com/friendlyarm/sd-fuse_rk3568.git -b kernel-6.1.y --single-branch
 
cd sd-fuse_rk3568
 
cd sd-fuse_rk3568
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 55: Line 56:
 
  | NanoPi-R6S =
 
  | NanoPi-R6S =
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b master --single-branch
+
git clone https://github.com/friendlyarm/sd-fuse_rk3588.git -b kernel-6.1.y --single-branch
 
cd sd-fuse_rk3588
 
cd sd-fuse_rk3588
 
</syntaxhighlight>
 
</syntaxhighlight>
Line 68: Line 69:
 
convert files/logo.jpg -type truecolor /tmp/logo.bmp
 
convert files/logo.jpg -type truecolor /tmp/logo.bmp
 
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp
 
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp
sudo LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-bullseye-core-arm64
+
sudo LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-bookworm-core-arm64
sudo ./mk-sd-image.sh debian-bullseye-core-arm64
+
sudo ./mk-sd-image.sh debian-bookworm-core-arm64
sudo ./mk-emmc-image.sh debian-bullseye-core-arm64
+
sudo ./mk-emmc-image.sh debian-bookworm-core-arm64
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 79: Line 80:
 
sudo firstboot && sudo reboot
 
sudo firstboot && sudo reboot
 
</syntaxhighlight>
 
</syntaxhighlight>
===Install Docker===
+
===Install Docker on Debian===
====Create an additional partition for Docker====
+
Please refer to: [[How to Install Docker on Debian]]
Note 1: This operation will erase user data in the system, so please make a backup beforehand.<br>
+
Note 2: The firmware (or boot.img) needs to be updated to version on or after March 14th, 2023<br>
+
Note 3: The device node /dev/mmcblkX needs to be changed to the actual device. For eMMC, the device node is /dev/mmcblk2, and for TF card, the device node is /dev/mmcblk0.
+
<br>
+
* Check the current partition layout
+
<syntaxhighlight lang="bash">
+
sudo apt update
+
sudo apt install parted fdisk
+
export DEV=/dev/mmcblkX
+
sudo parted -s ${DEV} unit MiB print
+
</syntaxhighlight>
+
* Adjust the userdata partition to 8GB
+
Here, 8GB is used as an example. The partition size can be adjusted according to your needs:
+
<syntaxhighlight lang="bash">
+
sudo passwd root  # Create a password for the root user
+
su - root -c 'echo "overlayfs=enable userdata=8096" > /.init_wipedata'
+
sudo reboot
+
</syntaxhighlight>
+
After reboot, confirm that the partition has been adjusted and you can see that the userdata partition is now 8GB:
+
<syntaxhighlight lang="bash">
+
sudo parted -s ${DEV} unit MiB print
+
</syntaxhighlight>
+
* Create a new partition and format it:
+
<syntaxhighlight lang="bash">
+
(echo n; echo ""; echo ""; echo ""; echo w) | sudo fdisk ${DEV}
+
NUM=$(sudo parted ${DEV} print | awk 'NF > 1 {p = $1} END {print p}')  # Get the index of the last partition
+
sudo mkfs.ext4 ${DEV}p${NUM}
+
</syntaxhighlight>
+
* Mount the partition to the Docker data directory:
+
<syntaxhighlight lang="bash">
+
sudo mkdir /var/lib/docker
+
sudo blkid ${DEV}p${NUM}
+
# Configure automatic mounting
+
sudo vi /etc/fstab
+
# Add the following content to the end of the file (where UUID needs to be replaced with the actual one).
+
UUID=2efab5a5-8b74-41d2-8747-4c00fff8514a /var/lib/docker ext4 suid,dev,exec,auto,nouser,async,noatime,nofail 0 0
+
sudo mount /var/lib/docker
+
</syntaxhighlight>
+
====Install Docker Engine====
+
<syntaxhighlight lang="bash">
+
sudo apt install curl ca-certificates uidmap
+
curl -fsSL https://get.docker.com | bash
+
</syntaxhighlight>
+
Let’s verify:
+
<syntaxhighlight lang="bash">
+
sudo docker info
+
</syntaxhighlight>
+
You can see that Docker is using the overlay2 storage driver:
+
<syntaxhighlight lang="bash">
+
$ docker info | grep storage -i
+
Storage Driver: overlay2
+
</syntaxhighlight>
+
====Run Docker as a non-root user====
+
<syntaxhighlight lang="bash">
+
sudo groupadd docker
+
sudo gpasswd -a ${USER} docker
+
sudo systemctl restart docker
+
sudo chmod a+rw /var/run/docker.sock
+
</syntaxhighlight>
+
Let’s verify:
+
<syntaxhighlight lang="bash">
+
docker images
+
</syntaxhighlight>
+
====Testing Docker: Installing Nextcloud with docker====
+
<syntaxhighlight lang="bash">
+
mkdir ~/nextcloud -p
+
docker run -d -p 8888:80  --name nextcloud  -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true  arm64v8/nextcloud
+
</syntaxhighlight>
+
After installation, visit: http://Device-IP-Address:8888 on your computer browser to view the nextcloud web page.
+

Latest revision as of 08:18, 1 July 2024

1 Work with Debian Core

1.1 Account & Password

Regular Account:
    User Name: pi
    Password: pi

Root:
    the root user account is disabled by default, you may configure the root password through the 'sudo passwd root' command.

1.2 View IP address

Since the Debian Bullseye hostname is the hardware model by default, you can use the ping command to get the IP address:ping {{{1}}}
Debian Bullseye uses network-manager to manage the network, and the network ports are configured to automatically obtain IP addresses by DHCP (including devices with multiple network ports).

1.3 Connect to Debian via SSH

Run the following commandssh pi@{{{1}}}
The default password is: pi

1.4 Update Software Packages

$ sudo apt-get update

1.5 Change time zone

1.5.1 Check the current time zone

timedatectl

1.5.2 List all available time zones

timedatectl list-timezones

1.5.3 Set the time zone (e.g. Shanghai)

sudo timedatectl set-timezone Asia/Shanghai

Replace the following two files in the kernel source code directory and recompile the kernel:
kernel/logo.bmp
kernel/logo_kernel.bmp
Or use the script to operate, as shown below:

  • Download scripts:
git clone https://github.com/friendlyarm/sd-fuse_rk3399.git -b kernel-4.19 --single-branch
cd sd-fuse_rk3399
  • Compile kernel and repackage firmware
convert files/logo.jpg -type truecolor /tmp/logo.bmp
convert files/logo.jpg -type truecolor /tmp/logo_kernel.bmp
sudo LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh debian-bookworm-core-arm64
sudo ./mk-sd-image.sh debian-bookworm-core-arm64
sudo ./mk-emmc-image.sh debian-bookworm-core-arm64


1.7 Soft Factory Reset

Execute the following command in a terminal:

sudo firstboot && sudo reboot

1.8 Install Docker on Debian

Please refer to: How to Install Docker on Debian