@@ -117,14 +117,14 @@ PLATFORM="${PLATFORM%-PLATFORMFS*}"
117117
118118# Be absolutely certain the platform is supported before continuing
119119case " $PLATFORM " in
120- bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|GCP|pinebookpro|pinephone|* -musl);;
120+ bananapi|beaglebone|cubieboard2|cubietruck|odroid-c2|odroid-u2|rpi|rpi2|rpi3|rpi4|GCP|pinebookpro|pinephone|rock64| * -musl);;
121121 * ) die " The $PLATFORM is not supported, exiting..."
122122esac
123123
124- # Default for bigger boot partion on pinebookpro since it needs to fit
125- # at least 2 Kernels + initramfs
124+ # Default for bigger boot partion on rk33xx devices since it needs to
125+ # fit at least 2 Kernels + initramfs
126126case " $PLATFORM " in
127- pinebookpro* )
127+ pinebookpro* |rock64 * )
128128 : " ${BOOT_FSSIZE:= 256MiB} "
129129 ;;
130130esac
@@ -172,17 +172,6 @@ if [ "$BOOT_FSTYPE" = "vfat" ]; then
172172 _args=" -I -F16"
173173fi
174174
175- BOOT_START=2048
176- ROOT_START=
177- case " $PLATFORM " in
178- pinebookpro* )
179- BOOT_START=32768
180- # Without this, sfdisk creates root partition starting at
181- # 2048, overlapping u-boot reserved space and boot partition.
182- ROOT_START=$BOOT_START
183- ;;
184- esac
185-
186175case " $PLATFORM " in
187176 cubieboard2|cubietruck|ci20* |odroid-c2* )
188177 # These platforms use a single partition for the entire filesystem.
@@ -200,11 +189,26 @@ _EOF
200189 # partition (64M by default) and the rest of the space as the
201190 # root filesystem. This is the generally preferred disk
202191 # layout for new platforms.
203- sfdisk " ${FILENAME} " << _EOF
192+ case " $PLATFORM " in
193+ pinebookpro* |rock64* )
194+ # rk33xx devices use GPT and need more space reserved
195+ sfdisk " $FILENAME " << _EOF
196+ label: gpt
197+ unit: sectors
198+ first-lba: 32768
199+ name=BootFS, size=${BOOT_FSSIZE} , type=L, bootable
200+ name=RootFS, type=L
201+ _EOF
202+ ;;
203+ * )
204+ # The rest use MBR and need less space reserved
205+ sfdisk " ${FILENAME} " << _EOF
204206label: dos
205- ${BOOT_START} ,${BOOT_FSSIZE} ,b,*
206- ${ROOT_START} ,+,L
207+ 2048 ,${BOOT_FSSIZE} ,b,*
208+ ,+,L
207209_EOF
210+ ;;
211+ esac
208212 LOOPDEV=$( losetup --show --find --partscan " $FILENAME " )
209213 # Normally we need to quote to prevent argument splitting, but
210214 # we explicitly want argument splitting here.
@@ -298,9 +302,24 @@ ci20*)
298302 dd if=" ${ROOTFS} /boot/u-boot-spl.bin" of=" ${LOOPDEV} " obs=512 seek=1 > /dev/null 2>&1
299303 dd if=" ${ROOTFS} /boot/u-boot.img" of=" ${LOOPDEV} " obs=1K seek=14 > /dev/null 2>&1
300304 ;;
305+ rock64* )
306+ rk33xx_flash_uboot " ${ROOTFS} /usr/lib/rock64-uboot" " $LOOPDEV "
307+ # populate the extlinux.conf file
308+ cat > " ${ROOTFS} /etc/default/extlinux" << _EOF
309+ TIMEOUT=10
310+ # Defaults to current kernel cmdline if left empty
311+ CMDLINE="panic=10 coherent_pool=1M console=ttyS2,1500000 root=UUID=${ROOT_UUID} rw"
312+ # set this to use a DEVICETREEDIR line in place of an FDT line
313+ USE_DEVICETREEDIR="yes"
314+ # relative dtb path supplied to FDT line, as long as above is unset
315+ DTBPATH=""
316+ _EOF
317+ mkdir -p " ${ROOTFS} /boot/extlinux"
318+ run_cmd_chroot " ${ROOTFS} " " /etc/kernel.d/post-install/60-extlinux"
319+ cleanup_chroot
320+ ;;
301321pinebookpro* )
302- dd if=" ${ROOTFS} /usr/lib/pinebookpro-uboot/idbloader.img" of=" ${LOOPDEV} " seek=64 conv=notrunc,fsync > /dev/null 2>&1
303- dd if=" ${ROOTFS} /usr/lib/pinebookpro-uboot/u-boot.itb" of=" ${LOOPDEV} " seek=16384 conv=notrunc,fsync > /dev/null 2>&1
322+ rk33xx_flash_uboot " ${ROOTFS} /usr/lib/pinebookpro-uboot" " $LOOPDEV "
304323 run_cmd_chroot " ${ROOTFS} " " xbps-reconfigure -f pinebookpro-kernel"
305324 cleanup_chroot
306325 ;;
0 commit comments