-
Notifications
You must be signed in to change notification settings - Fork 69
Custom logo #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Custom logo #496
Changes from all commits
79070d8
b4ed847
8951203
efe1c29
2f31690
fd2d248
efcf289
e970041
13224ea
eefa306
d7e063a
a3ace4f
7c9d835
49eef9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
### 确认 U-boot 是否是 rk2410 | ||
|
||
由于目前我们只在 rk2410 中集成了该功能, 所以需要确认手中板子的 U-boot 是否是 2024 年 10 月份之后的版本, | ||
|
||
可在开机日志中查看 U-Boot 版本 | ||
|
||
如: | ||
|
||
```bash | ||
U-Boot rk2410-2017.09-1-g1a7692f4-dirty #runner (Jan 26 2025 - 10:37:18 +0000) | ||
``` | ||
|
||
<Tabs queryString="version"> | ||
|
||
<TabItem value="U-boot 是 rk2410 的"> | ||
|
||
可直接替换 logo 图片 | ||
|
||
</TabItem> | ||
|
||
<TabItem value="U-boot 不是 rk2410 的"> | ||
|
||
- 参考 <a href={props.uboot_develop}> U-boot 开发</a>, 编译 rk2410 的 U-boot | ||
|
||
``` | ||
./bsp u-boot rk2410 -r 99 | ||
``` | ||
|
||
- 将 {props.product} 的 U-boot 拷贝到板子上 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 直接装生成的deb包 |
||
|
||
<pre style={{ margin: 0 }}> | ||
scp -r u-boot-rk2410_2017.09-1_arm64.deb radxa@192.168.xx.xx:~/ | ||
</pre> | ||
|
||
- 在 {props.product} 上使用 <a href={props.rsetup_path} alt="update u-boot by rsetup" > rsetup</a> 更新 U-boot | ||
|
||
- 重启系统,确认 U-boot 更新到了最新的 rk2410 | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### 准备 Logo 图片 | ||
|
||
- 将 logo 图片转换为 bmp 格式 | ||
|
||
- 启动 logo 分为两个阶段,第一阶段是 U-boot 阶段,第二阶段是 kernel 阶段。两个阶段的 logo 图片分别为 logo.bmp 和 logo_kernel.bmp。 | ||
|
||
- 若只有一张图片,则 logo 显示时间会比较短。 | ||
|
||
- 两张图片可以是同一张,也可以是不同的。 | ||
|
||
:::warning | ||
|
||
图片总像素数不能超过 200000。 | ||
|
||
::: | ||
|
||
- 将以上两张 bmp 图片保存到 config 分区 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有直接在编译的时候打包的方法吗 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有,不过目前 rsdk 这部分功能还没有集成,另外,要在 rsdk 中替换图片,也是要转成规定样式的。 |
||
```bash | ||
sudo mount /dev/mmcblk0p1 /mnt/ | ||
sudo cp logo.bmp /mnt/ | ||
sudo cp logo_kernel.bmp /mnt/ | ||
sudo sync /mnt | ||
sudo umount /mnt | ||
``` | ||
|
||
### 重启系统 | ||
|
||
连接 HDMI 后,系统重新启动,HDMI 将显示刚设定的 logo,直至桌面出现。 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
sidebar_class_name: hidden | ||
sidebar_position: 8 | ||
--- | ||
|
||
import LOGO from '../../../common/dev/\_custom_logo.mdx'; | ||
|
||
# 定制开机 Logo | ||
|
||
<LOGO uboot_develop="../u-boot" product="Radxa ROCK 3A" rsetup_path="../radxa-os/rsetup#update-bootloader" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
sidebar_class_name: hidden | ||
sidebar_position: 8 | ||
--- | ||
|
||
import LOGO from '../../../common/dev/\_custom_logo.mdx'; | ||
|
||
# 定制开机 Logo | ||
|
||
<LOGO uboot_develop="../u-boot" product="Radxa ROCK 3B" rsetup_path="../radxa-os/rsetup#update-bootloader" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
### Verify that the U-boot is rknext | ||
|
||
Since we have only integrated this feature in rknext, you need to check if the U-boot on your board is from October 2024 onwards. | ||
|
||
U-boot version can be viewed in the boot log | ||
|
||
For example: | ||
|
||
```bash | ||
U-Boot SPL latest-2023.07.02-6-4257d241-g4257d241 (Oct 12 2023 - 07:58:46 +0000) | ||
``` | ||
|
||
<Tabs queryString="version"> | ||
<TabItem value="U-boot is before October 2024."> | ||
</TabItem> | ||
<TabItem value="U-boot is after October 2024."> | ||
- Refer to <a href={props.uboot_develop}> U-boot development</a> to compile rknext's U-boot. | ||
|
||
``` | ||
./bsp u-boot rknext -r 99 | ||
``` | ||
|
||
- Copy the U-boot of {props.product} to the board | ||
|
||
<pre style={{ margin: 0 }}> | ||
scp -r .root/.root/usr/lib/u-boot/{props.product_dir}/ radxa@192.168.xx.xx:~/ | ||
</pre> | ||
|
||
- Execute the following command on {props.product} to replace the latest U-boot | ||
|
||
<pre style={{ margin: 0 }}> | ||
cd {props.product_dir} | ||
sudo bash setup.sh update_bootloader /dev/mmcblk0 | ||
</pre> | ||
|
||
sh setup.sh update_bootloader /dev/mmcblk0{" "} | ||
|
||
:::tip | ||
|
||
/dev/mmcblk0 is eMMC, or /dev/mmcblk1 if the system is installed on an SD card. | ||
If the system is installed on a device such as nvme, then you need to update the U-boot on the SPI Flash | ||
|
||
::: | ||
|
||
- Reboot the system and make sure the U-boot is updated to the latest rknext. | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
### Prepare one or two images | ||
|
||
:::tip | ||
|
||
Image width \* height must not exceed 200000 | ||
|
||
::: | ||
|
||
### Convert the image to .bmp format | ||
|
||
1. Install the required libraries | ||
|
||
```bash | ||
pip install Pillow | ||
``` | ||
|
||
2. Create a new convert.py file and save the following to convert.py | ||
|
||
<details> | ||
|
||
<summary>convert.py</summary> | ||
|
||
```py | ||
|
||
from PIL import Image | ||
import os | ||
import sys | ||
|
||
class ImageConverter: | ||
def __init__(self, input_path, output_path): | ||
self.input_path = input_path | ||
self.output_path = output_path | ||
self.target_size = 0.5 * 1024 * 1024 # 0.5 MB in bytes (512 KB) | ||
|
||
def convert_to_bmp(self): | ||
with Image.open(self.input_path) as img: | ||
# Convert to RGB since BMP doesn't support transparency | ||
img = img.convert("RGB") | ||
|
||
# Resize the image if the file size exceeds 0.5 MB | ||
img = self.resize_to_fit(img) | ||
|
||
# Save as BMP | ||
img.save(self.output_path, format='BMP') | ||
|
||
def resize_to_fit(self, img): | ||
# Gradually reduce the size of the image until it fits within the target size | ||
while True: | ||
img.save(self.output_path, format='BMP') | ||
if os.path.getsize(self.output_path) <= self.target_size: | ||
break | ||
# Reduce the size by 10% | ||
width, height = img.size | ||
img = img.resize((int(width * 0.9), int(height * 0.9)), Image.ANTIALIAS) | ||
return img | ||
|
||
def main(input_file, output_file): | ||
converter = ImageConverter(input_file, output_file) | ||
converter.convert_to_bmp() | ||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) != 3: | ||
print("Usage: python3 convert_logo.py <input.jpg> <output.bmp>") | ||
else: | ||
main(sys.argv[1], sys.argv[2]) | ||
|
||
``` | ||
|
||
</details> | ||
|
||
3. Converting images to .bmp format | ||
|
||
```bash | ||
python3 convert.py pic1.jpg logo.bmp | ||
python3 convert.py pic1.jpg logo_kernel.bmp | ||
``` | ||
|
||
### Save the above two bmp images to the config partition | ||
|
||
```bash | ||
sudo mount /dev/mmcblk0p1 /mnt/ | ||
sudo cp logo.bmp /mnt/ | ||
sudo cp logo_kernel.bmp /mnt/ | ||
sudo sync /mnt | ||
sudo umount /mnt | ||
``` | ||
|
||
### Reboot System | ||
|
||
After connecting the HDMI, the system will reboot and the HDMI will display the logo you just set until the desktop appears. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
sidebar_class_name: hidden | ||
sidebar_position: 8 | ||
--- | ||
|
||
import LOGO from '../../../common/dev/\_custom_logo.mdx'; | ||
|
||
# Customized Boot Logo | ||
|
||
<LOGO uboot_develop="../u-boot" product="Radxa ROCK 3A" rsetup_path="../radxa-os/rsetup#update-bootloader" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
sidebar_class_name: hidden | ||
sidebar_position: 8 | ||
--- | ||
|
||
import LOGO from '../../../common/dev/\_custom_logo.mdx'; | ||
|
||
# Customized Boot Logo | ||
|
||
<LOGO uboot_develop="../u-boot" product="Radxa ROCK 3B" rsetup_path="../radxa-os/rsetup#update-bootloader" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RadxaYuntian 看看这里怎么做区分?集成的产品和未做集成的产品需要怎么看,以及这个时间节点有没必要写?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个功能发布了么?发布了是不是每个产品还要单独做支持?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要作单独支持吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hdmi也是?