Difference between revisions of "Template:UbuntuNobleDesktop-Common"
(updated by API) |
(updated by API) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
User Name: root<br/> | User Name: root<br/> | ||
Password: fa<br/> | Password: fa<br/> | ||
− | === | + | ===Install Ubuntu software center=== |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
$ sudo apt-get update | $ sudo apt-get update | ||
− | |||
− | |||
− | |||
$ sudo apt-get install snapd | $ sudo apt-get install snapd | ||
$ sudo snap install snap-store | $ sudo snap install snap-store | ||
Line 28: | Line 15: | ||
===Install the kernel-header package=== | ===Install the kernel-header package=== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | sudo dpkg -i /opt/linux-headers-*.deb | + | sudo dpkg -i /opt/archives/linux-headers-*.deb |
</syntaxhighlight> | </syntaxhighlight> | ||
try to compile a kernel module: | try to compile a kernel module: | ||
Line 40: | Line 27: | ||
sudo modprobe 88x2bu | sudo modprobe 88x2bu | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | ===Install the kernel-image package=== | ||
+ | You can visit http://112.124.9.243/archives/ to check if there is a new version of the kernel deb package (compare with the current version in the /opt/archives/ directory). If a new version is available, download it locally and install it using dpkg -i. | ||
+ | |||
===Change time zone=== | ===Change time zone=== | ||
====Check the current time zone==== | ====Check the current time zone==== | ||
Line 93: | Line 84: | ||
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 | ||
− | LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh ubuntu- | + | LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh ubuntu-noble-desktop-arm64 |
− | ./mk-emmc-image.sh ubuntu- | + | ./mk-emmc-image.sh ubuntu-noble-desktop-arm64 |
</syntaxhighlight> | </syntaxhighlight> | ||
===Soft Factory Reset=== | ===Soft Factory Reset=== | ||
Line 144: | Line 135: | ||
mpv --fs https://www.youtube.com/watch?v=lK-nYDmC1Dk | mpv --fs https://www.youtube.com/watch?v=lK-nYDmC1Dk | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | === | + | ===Using USB Camera=== |
− | + | (Note: The following test commands use the Logitech HD Pro Webcam C920.) | |
+ | * List camera devices | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | $ v4l2-ctl --list-devices | |
− | + | </syntaxhighlight> | |
− | + | * Display supported formats | |
− | + | <syntaxhighlight lang="bash"> | |
+ | $ v4l2-ctl -d /dev/video1 --list-formats-ext --all | ||
+ | </syntaxhighlight> | ||
+ | * Preview | ||
+ | <syntaxhighlight lang="bash"> | ||
+ | $ export XDG_RUNTIME_DIR=/run/user/0 | ||
+ | $ gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! videoconvert ! glimagesink | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | * Record video | |
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
− | + | $ gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg,width=1280,height=720,framerate=30/1 ! \ | |
− | + | jpegdec ! videoconvert ! queue ! mpph265enc ! h265parse ! \ | |
− | + | queue ! mux. alsasrc device=hw:CARD=realtekrt5616co ! audio/x-raw,channels=2 \ | |
+ | ! audioconvert ! voaacenc ! queue ! mux. matroskamux name=mux ! filesink location="demo.mkv" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
===Install Docker Engine=== | ===Install Docker Engine=== | ||
====Install Docker Engine==== | ====Install Docker Engine==== | ||
Line 164: | Line 162: | ||
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release | sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | ||
− | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | + | echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \ |
+ | https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt update | sudo apt update | ||
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin | sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin |
Latest revision as of 10:49, 21 January 2025
Contents
[hide]- 1 Account & Password
- 2 Install Ubuntu software center
- 3 Install the kernel-header package
- 4 Install the kernel-image package
- 5 Change time zone
- 6 Change startup LOGO and Wallpaper
- 7 Soft Factory Reset
- 8 Start the program automatically at startup(For example Firefox)
- 9 Disable auto-mounting
- 10 Setup Chinese language and Input method
- 11 Video playback with hardware decoding
- 12 Using USB Camera
- 13 Install Docker Engine
1 Account & Password
Regular Account:
User Name: pi
Password: pi
Root:
User Name: root
Password: fa
2 Install Ubuntu software center
$ sudo apt-get update $ sudo apt-get install snapd $ sudo snap install snap-store
3 Install the kernel-header package
sudo dpkg -i /opt/archives/linux-headers-*.deb
try to compile a kernel module:
sudo apt update sudo apt install git gcc make bc git clone https://github.com/RinCat/RTL88x2BU-Linux-Driver.git cd RTL88x2BU-Linux-Driver make -j$(nproc) sudo make install sudo modprobe 88x2bu
4 Install the kernel-image package
You can visit http://112.124.9.243/archives/ to check if there is a new version of the kernel deb package (compare with the current version in the /opt/archives/ directory). If a new version is available, download it locally and install it using dpkg -i.
5 Change time zone
5.1 Check the current time zone
timedatectl
5.2 List all available time zones
timedatectl list-timezones
5.3 Set the time zone (e.g. Shanghai)
sudo timedatectl set-timezone Asia/Shanghai
6 Change startup LOGO and Wallpaper
6.1 Change startup LOGO
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 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 LOGO=/tmp/logo.bmp KERNEL_LOGO=/tmp/logo_kernel.bmp ./build-kernel.sh ubuntu-noble-desktop-arm64 ./mk-emmc-image.sh ubuntu-noble-desktop-arm64
7 Soft Factory Reset
Execute the following command in a terminal:
sudo firstboot && sudo reboot
8 Start the program automatically at startup(For example Firefox)
Put the desktop file in the ~/.config/autostart/ directory, for example:
mkdir ~/.config/autostart/ cp /usr/share/applications/firefox.desktop ~/.config/autostart/
9 Disable auto-mounting
sudo systemctl mask udisks2 sudo reboot
10 Setup Chinese language and Input method
10.1 Setup Chinese language
Enter the following command and select 'zh_CN.UTF-8':
sudo dpkg-reconfigure locales
Add environment variables to .bashrc:
echo "export LC_ALL=zh_CN.UTF-8" >> ~/.bashrc echo "export LANG=zh_CN.UTF-8" >> ~/.bashrc echo "export LANGUAGE=zh_CN.UTF-8" >> ~/.bashrc
Reboot device:
sudo reboot
11 Video playback with hardware decoding
11.1 GUI
- Locate the video file in the file browser, right click and select "Play with mpv media player"
- Using Kodi player
- Using Chromium web browser, you can play videos on the web with hardware decoding (limited to the video formats supported by the CPU)
11.2 Command line
- Play local video file
export DISPLAY=:0.0 mpv --fs /home/pi/Videos/demo.mp4
- Play web-video
export DISPLAY=:0.0 mpv --fs https://www.youtube.com/watch?v=lK-nYDmC1Dk
12 Using USB Camera
(Note: The following test commands use the Logitech HD Pro Webcam C920.)
- List camera devices
$ v4l2-ctl --list-devices
- Display supported formats
$ v4l2-ctl -d /dev/video1 --list-formats-ext --all
- Preview
$ export XDG_RUNTIME_DIR=/run/user/0 $ gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegdec ! videoconvert ! glimagesink
- Record video
$ gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg,width=1280,height=720,framerate=30/1 ! \ jpegdec ! videoconvert ! queue ! mpph265enc ! h265parse ! \ queue ! mux. alsasrc device=hw:CARD=realtekrt5616co ! audio/x-raw,channels=2 \ ! audioconvert ! voaacenc ! queue ! mux. matroskamux name=mux ! filesink location="demo.mkv"
13 Install Docker Engine
13.1 Install Docker Engine
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \ https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Let’s verify:
sudo docker info
13.2 Run Docker as a non-root user
sudo groupadd docker sudo gpasswd -a ${USER} docker sudo systemctl restart docker sudo chmod a+rw /var/run/docker.sock
Let’s verify:
docker images
13.3 Testing Docker: Installing Nextcloud with docker
mkdir ~/nextcloud -p docker run -d -p 8888:80 --name nextcloud -v ~/nextcloud/:/var/www/html/ --restart=always --privileged=true arm64v8/nextcloud
After installation, visit: http://Device-IP-Address:8888 on your computer browser to view the nextcloud web page.