§2023-06-15
- debian_bookworm_server_linux5.10.110, after flashde into microSD
$ sudo fdisk /dev/sdb
[sudo] password for alexlai:
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
GPT PMBR size mismatch (8036351 != 62333951) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Command (m for help): p
Disk /dev/sdb: 29.72 GiB, 31914983424 bytes, 62333952 sectors
Disk model: Storage Device
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 738115BE-8654-0442-A5C6-B0B37ECC8C8F
Device Start End Sectors Size Type
/dev/sdb1 61440 2158591 2097152 1G Linux extended boot
/dev/sdb2 2158592 8036318 5877727 2.8G Linux filesystem
- the boot partition
$ sudo mount /dev/sdb1 /mnt
$ ls /mnt
boot.bmp boot.scr dtb Image logo.bmp orangepi_first_run.txt.template uInitrd
boot.cmd config-5.10.110-rockchip-rk3588 dtb-5.10.110-rockchip-rk3588 initrd.img-5.10.110-rockchip-rk3588 orangepiEnv.txt System.map-5.10.110-rockchip-rk3588 vmlinuz-5.10.110-rockchip-rk3588
$ cat /mnt/boot.scr
a�r�X
# 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
- root
alexlai@hc4Jammy:~$ sudo umount /mnt
alexlai@hc4Jammy:~$ sudo mount /dev/sdb2 /mnt
alexlai@hc4Jammy:~$ ls /mnt
bin boot dev etc home lib lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var
alexlai@hc4Jammy:~$ cat /mnt/etc/fstab
UUID=4ba4cf3f-3f6d-4fc0-9200-9e92d6d2f5fb / ext4 defaults,noatime,commit=600,errors=remount-ro 0 1
UUID=EE66-DCBA /boot vfat defaults 0 2
tmpfs /tmp tmpfs defaults,nosuid 0 0
/dev/sdb2: LABEL="opi_root" UUID="4ba4cf3f-3f6d-4fc0-9200-9e92d6d2f5fb" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="rootfs" PARTUUID="18c9ac03-af0d-8e42-956f-4cc26fb82729"
/dev/sdb1: LABEL_FATBOOT="opi_boot" LABEL="opi_boot" UUID="EE66-DCBA" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="bootfs" PARTUUID="d10b7fec-0bcf-af4d-a274-67504d80a2de"
/