if you use Orangepi5plus_1.0.6_debian_bullseye_server_linux5.10.110.7z and boot the system up, in /boot, you have boot.scr and boot.cmd. And boot.cmd is as ```# DO NOT EDIT THIS FILE

Please edit /boot/orangepiEnv.txt to set supported parameters

setenv load_addr "0x9000000" setenv overlay_error "false"

default values

setenv rootdev "/dev/mmcblk0p1" setenv verbosity "1" setenv console "both" setenv bootlogo "false" setenv rootfstype "ext4" setenv docker_optimizations "on" setenv earlycon "off"

echo "Boot script loaded from ${devtype} ${devnum}"

if test -e ${devtype} ${devnum} ${prefix}orangepiEnv.txt; then load ${devtype} ${devnum} ${load_addr} ${prefix}orangepiEnv.txt env import -t ${load_addr} ${filesize} fi

if test "${logo}" = "disabled"; then setenv logo "logo.nologo"; fi

if test "${console}" = "display" || test "${console}" = "both"; then setenv consoleargs "console=tty1"; fi if test "${console}" = "serial" || test "${console}" = "both"; then setenv consoleargs "console=ttyS2,1500000 ${consoleargs}"; fi if test "${earlycon}" = "on"; then setenv consoleargs "earlycon ${consoleargs}"; fi if test "${bootlogo}" = "true"; then setenv consoleargs "splash plymouth.ignore-serial-consoles ${consoleargs}" else setenv consoleargs "splash=verbose ${consoleargs}" fi

get PARTUUID of first partition on SD/eMMC the boot script was loaded from

if test "${devtype}" = "mmc"; then part uuid mmc ${devnum}:1 partuuid; fi

setenv bootargs "root=${rootdev} rootwait rootfstype=${rootfstype} ${consoleargs} consoleblank=0 loglevel=${verbosity} ubootpart=${partuuid} usb-storage.quirks=${usbstoragequirks} ${extraargs} ${extraboardargs}"

if test "${docker_optimizations}" = "on"; then setenv bootargs "${bootargs} cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory swapaccount=1"; fi

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image

load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} fdt addr ${fdt_addr_r} fdt resize 65536 for overlay_file in ${overlays}; do if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-${overlay_file}.dtbo; then echo "Applying kernel provided DT overlay ${overlay_prefix}-${overlay_file}.dtbo" fdt apply ${load_addr} || setenv overlay_error "true" fi done for overlay_file in ${user_overlays}; do if load ${devtype} ${devnum} ${load_addr} ${prefix}overlay-user/${overlay_file}.dtbo; then echo "Applying user provided DT overlay ${overlay_file}.dtbo" fdt apply ${load_addr} || setenv overlay_error "true" fi done if test "${overlay_error}" = "true"; then echo "Error applying DT overlays, restoring original DT" load ${devtype} ${devnum} ${fdt_addr_r} ${prefix}dtb/${fdtfile} else if load ${devtype} ${devnum} ${load_addr} ${prefix}dtb/rockchip/overlay/${overlay_prefix}-fixup.scr; then echo "Applying kernel provided DT fixup script (${overlay_prefix}-fixup.scr)" source ${load_addr} fi if test -e ${devtype} ${devnum} ${prefix}fixup.scr; then load ${devtype} ${devnum} ${load_addr} ${prefix}fixup.scr echo "Applying user provided fixup script (fixup.scr)" source ${load_addr} fi fi

if test "${ethernet_phy}" = "rtl8211f"; then fdt set /ethernet@ff540000 tx_delay <0x24> fdt set /ethernet@ff540000 rx_delay <0x18> fi

booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}

Recompile with:

mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr

and orangepiEnv.txt asverbosity=1 bootlogo=false extraargs=cma=128M overlay_prefix=rk3588 fdtfile=rockchip/rk3588-orangepi-5-plus.dtb rootdev=UUID=a3d2a758-6a24-46a9-b03c-5fcb89545bf0 rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u

ChatGPT
To make your system bootable with a new kernel, you need to update the boot.cmd script and potentially the orangepiEnv.txt file. Here are the steps to modify these files:

1. Update boot.cmd:
You will need to modify the boot.cmd script to load the new kernel and initramfs. Here's an example of how you can modify it:

bash
Copy code
# Assuming your new kernel is named Image-new and initramfs is named uInitrd-new
# Modify the following lines in boot.cmd:

load ${devtype} ${devnum} ${ramdisk_addr_r} ${prefix}uInitrd-new
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}Image-new

# ...

booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}
2. Update orangepiEnv.txt:
Update the orangepiEnv.txt file to reflect any changes necessary for the new kernel. For example, if the new kernel requires different parameters or configurations, update the orangepiEnv.txt accordingly.

3. Recompile boot.scr:
After making these changes, you need to recompile the boot.scr file. You can use the mkimage tool for this. The comment at the end of the boot.cmd script provides the command to recompile it:

bash
Copy code
# Recompile with:
# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
Make sure to run this command in the directory where your modified boot.cmd file is located. This will create a new boot.scr file, which is the binary version of the boot script.

4. Copy the new files to the boot partition:
After recompiling boot.scr, copy both the new Image-new (or your new kernel) and uInitrd-new (or your new initramfs) to the boot partition. Also, replace the existing boot.scr with the newly compiled one.

5. Reboot your system:
After these modifications, reboot your system, and it should boot using the new kernel.

Make sure to have a backup of your system or a recovery option in case something goes wrong during this process. Modifying the boot configuration files can potentially render your system unbootable if not done correctly.


So, when you run:

bash
Copy code
mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr
-C none: No compression.
-A arm: Target architecture is ARM.
-T script: Specifies that the input file is a script.
-d /boot/boot.cmd: Specifies the input file (your U-Boot script).
/boot/boot.scr: Specifies the output file, which will be the U-Boot script image.
This command takes the U-Boot script (/boot/boot.cmd), processes it, and creates a binary image (/boot/boot.scr) that U-Boot can execute during the boot process.

---
```# cat orangepiEnv.txt
verbosity=1
bootlogo=false
extraargs=cma=128M
overlay_prefix=rk3588
fdtfile=rockchip/rk3588-orangepi-5-plus.dtb
rootdev=UUID=a3d2a758-6a24-46a9-b03c-5fcb89545bf0
rootfstype=ext4
usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u
``` If I create a new kernel and resides on the same  `rootdev=UUID=a3d2a758-6a24-46a9-b03c-5fcb89545bf0` then this file does not required any modification?
ChatGPT
If your new kernel resides on the same filesystem specified by rootdev=UUID=a3d2a758-6a24-46a9-b03c-5fcb89545bf0, and you haven't changed any critical boot parameters (like the root filesystem type or other essential kernel parameters), you might not need to modify the orangepiEnv.txt file.

However, it's always a good practice to review and verify the content of orangepiEnv.txt after a kernel update, as certain changes in the kernel or boot process might require adjustments to boot parameters. Here are some factors to consider:

Kernel Parameters: If your new kernel requires specific parameters that are not present in the existing orangepiEnv.txt, you may need to add them. For example, changes related to kernel modules, hardware support, or other kernel-specific configurations might necessitate modifications.

Initramfs: If your new kernel requires a different initramfs or additional parameters for the initramfs, you might need to update the orangepiEnv.txt file accordingly.

Device Tree: If your new kernel requires a different device tree binary (dtb), you should update the fdtfile parameter in orangepiEnv.txt to point to the correct device tree file.

Reviewing and adjusting the configuration in orangepiEnv.txt ensures that your bootloader and kernel have the necessary information to boot successfully. If in doubt, consult the documentation for your new kernel version or any release notes that accompany it to identify any specific requirements or changes.