diff --git a/docs/common/dev/_custom_logo.mdx b/docs/common/dev/_custom_logo.mdx new file mode 100644 index 000000000..1e1e16af7 --- /dev/null +++ b/docs/common/dev/_custom_logo.mdx @@ -0,0 +1,137 @@ +### 确认 U-boot 是否是 rknext + +由于目前我们只在 rknext 中集成了该功能, 所以需要确认手中板子的 U-boot 是否是 2024 年 10 月份之后的版本, + +可在开机日志中查看 U-Boot 版本 + +如: + +```bash +U-Boot SPL latest-2023.07.02-6-4257d241-g4257d241 (Oct 12 2023 - 07:58:46 +0000) +``` + + + + + +- 参考 U-boot 开发, 编译 rknext 的 U-boot + +``` +./bsp u-boot rknext -r 99 +``` + +- 将 {props.product} 的 U-boot 拷贝到板子上 + +
+  scp -r .root/.root/usr/lib/u-boot/{props.product_dir}/ radxa@192.168.xx.xx:~/
+
+ +- 在 {props.product} 上执行以下命令以替换最新的 U-boot + +
+  cd {props.product_dir}
+  sudo bash setup.sh update_bootloader /dev/mmcblk0
+
+ +:::tip + +/dev/mmcblk0 这里是 eMMC, 如果系统安装在 SD 卡上, 那就是 /dev/mmcblk1 +如果系统安装在 nvme 等设备上,那就需要更新 SPI Flash 上的 U-boot + +::: + +- 重启系统,确认 U-boot 更新到了最新的 rknext + +
+
+ +### 准备一张或者两张图片 + +:::warn + +图片总像素数不能超过 200000。 + +::: + +### 将图片转为 .bmp 格式 + +1. 安装所需要的库 + +```bash +pip install Pillow +``` + +2. 新建一个 convert.py 的文件, 将以下内容保存到 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. 将图片转为 .bmp 格式 + +```bash +python3 convert.py pic1.jpg logo.bmp +python3 convert.py pic1.jpg logo_kernel.bmp +``` + +### 将以上两张 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..c3f615a6b --- /dev/null +++ b/docs/rock3/rock3a/low-level-dev/custom-logo.md @@ -0,0 +1,9 @@ +--- +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..87cb63759 --- /dev/null +++ b/docs/rock3/rock3b/low-level-dev/custom-logo.md @@ -0,0 +1,9 @@ +--- +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..96128b2f0 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3a/low-level-dev/custom-logo.md @@ -0,0 +1,9 @@ +--- +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..63f1f0564 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/rock3/rock3b/low-level-dev/custom-logo.md @@ -0,0 +1,9 @@ +--- +sidebar_position: 8 +--- + +import LOGO from '../../../common/dev/\_custom_logo.mdx'; + +# Customized Boot Logo + +