diff --git a/docs/common/dev/_custom_logo.mdx b/docs/common/dev/_custom_logo.mdx new file mode 100644 index 000000000..92fc00489 --- /dev/null +++ b/docs/common/dev/_custom_logo.mdx @@ -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) +``` + + + + + +可直接替换 logo 图片 + + + + + +- 参考 U-boot 开发, 编译 rk2410 的 U-boot + +``` +./bsp u-boot rk2410 -r 99 +``` + +- 将 {props.product} 的 U-boot 拷贝到板子上 + +
+  scp -r u-boot-rk2410_2017.09-1_arm64.deb radxa@192.168.xx.xx:~/
+
+ +- 在 {props.product} 上使用 rsetup 更新 U-boot + +- 重启系统,确认 U-boot 更新到了最新的 rk2410 + +
+
+ +### 准备 Logo 图片 + +- 将 logo 图片转换为 bmp 格式 + + - 启动 logo 分为两个阶段,第一阶段是 U-boot 阶段,第二阶段是 kernel 阶段。两个阶段的 logo 图片分别为 logo.bmp 和 logo_kernel.bmp。 + + - 若只有一张图片,则 logo 显示时间会比较短。 + + - 两张图片可以是同一张,也可以是不同的。 + +:::warning + +图片总像素数不能超过 200000。 + +::: + +- 将以上两张 bmp 图片保存到 config 分区 + +```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,直至桌面出现。 diff --git a/docs/rock3/rock3a/low-level-dev/custom-logo.md b/docs/rock3/rock3a/low-level-dev/custom-logo.md new file mode 100644 index 000000000..03a5fa45e --- /dev/null +++ b/docs/rock3/rock3a/low-level-dev/custom-logo.md @@ -0,0 +1,10 @@ +--- +sidebar_class_name: hidden +sidebar_position: 8 +--- + +import LOGO from '../../../common/dev/\_custom_logo.mdx'; + +# 定制开机 Logo + + diff --git a/docs/rock3/rock3b/low-level-dev/custom-logo.md b/docs/rock3/rock3b/low-level-dev/custom-logo.md new file mode 100644 index 000000000..557d08e9a --- /dev/null +++ b/docs/rock3/rock3b/low-level-dev/custom-logo.md @@ -0,0 +1,10 @@ +--- +sidebar_class_name: hidden +sidebar_position: 8 +--- + +import LOGO from '../../../common/dev/\_custom_logo.mdx'; + +# 定制开机 Logo + + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_custom_logo.mdx b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_custom_logo.mdx new file mode 100644 index 000000000..cc327fc24 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/common/dev/_custom_logo.mdx @@ -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) +``` + + + + + +- Refer to U-boot development to compile rknext's U-boot. + +``` +./bsp u-boot rknext -r 99 +``` + +- Copy the U-boot of {props.product} to the board + +
+  scp -r .root/.root/usr/lib/u-boot/{props.product_dir}/ radxa@192.168.xx.xx:~/
+
+ +- Execute the following command on {props.product} to replace the latest U-boot + +
+  cd {props.product_dir}
+  sudo bash setup.sh update_bootloader /dev/mmcblk0
+
+ +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. + +
+
+ +### 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 + +
+ + convert.py + +```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 ") + else: + main(sys.argv[1], sys.argv[2]) + +``` + +
+ +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. diff --git a/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3a/low-level-dev/custom-logo.md b/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3a/low-level-dev/custom-logo.md new file mode 100644 index 000000000..c4feca3e4 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3a/low-level-dev/custom-logo.md @@ -0,0 +1,10 @@ +--- +sidebar_class_name: hidden +sidebar_position: 8 +--- + +import LOGO from '../../../common/dev/\_custom_logo.mdx'; + +# Customized Boot Logo + + diff --git a/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3b/low-level-dev/custom-logo.md b/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3b/low-level-dev/custom-logo.md new file mode 100644 index 000000000..5408612d1 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3b/low-level-dev/custom-logo.md @@ -0,0 +1,10 @@ +--- +sidebar_class_name: hidden +sidebar_position: 8 +--- + +import LOGO from '../../../common/dev/\_custom_logo.mdx'; + +# Customized Boot Logo + +