@@ -117,7 +117,7 @@ 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-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|* -musl);;
120+ rpi-armv6l|rpi-armv7l|rpi-aarch64|GCP|pinebookpro|pinephone|rock64|* -musl);;
121121 * ) die " The $PLATFORM is not supported, exiting..."
122122esac
123123
@@ -172,83 +172,55 @@ if [ "$BOOT_FSTYPE" = "vfat" ]; then
172172 _args=" -I -F16"
173173fi
174174
175+ # These platforms use a partition layout with a small boot
176+ # partition (64M by default) and the rest of the space as the
177+ # root filesystem. This is the generally preferred disk
178+ # layout for new platforms.
175179case " $PLATFORM " in
176- cubieboard2|cubietruck|ci20* |odroid-c2* )
177- # These platforms use a single partition for the entire filesystem.
178- sfdisk " ${FILENAME} " << _EOF
179- label: dos
180- 2048,,L
181- _EOF
182- LOOPDEV=$( losetup --show --find --partscan " $FILENAME " )
183- mkfs.${ROOT_FSTYPE} -O ' ^64bit,^extra_isize,^has_journal' " ${LOOPDEV} p1" > /dev/null 2>&1
184- mount " ${LOOPDEV} p1" " $ROOTFS "
185- ROOT_UUID=$( blkid -o value -s UUID " ${LOOPDEV} p1" )
186- ;;
187- * )
188- # These platforms use a partition layout with a small boot
189- # partition (64M by default) and the rest of the space as the
190- # root filesystem. This is the generally preferred disk
191- # layout for new platforms.
192- case " $PLATFORM " in
193- pinebookpro* |rock64* )
194- # rk33xx devices use GPT and need more space reserved
195- sfdisk " $FILENAME " << _EOF
180+ pinebookpro* |rock64* )
181+ # rk33xx devices use GPT and need more space reserved
182+ sfdisk " $FILENAME " << _EOF
196183label: gpt
197184unit: sectors
198185first-lba: 32768
199186name=BootFS, size=${BOOT_FSSIZE} , type=L, bootable, attrs="LegacyBIOSBootable"
200187name=RootFS, type=L
201188_EOF
202- ;;
203- * )
204- # The rest use MBR and need less space reserved
205- sfdisk " ${FILENAME} " << _EOF
189+ ;;
190+ * )
191+ # The rest use MBR and need less space reserved
192+ sfdisk " ${FILENAME} " << _EOF
206193label: dos
2071942048,${BOOT_FSSIZE} ,b,*
208195,+,L
209196_EOF
210- ;;
211- esac
212- LOOPDEV=$( losetup --show --find --partscan " $FILENAME " )
213- # Normally we need to quote to prevent argument splitting, but
214- # we explicitly want argument splitting here.
215- # shellcheck disable=SC2086
216- mkfs.${BOOT_FSTYPE} $_args " ${LOOPDEV} p1" > /dev/null
217- case " $ROOT_FSTYPE " in
218- # Because the images produced by this script are generally
219- # either on single board computers using flash memory or
220- # in cloud environments that already provide disk
221- # durability, we shut off the journal for ext filesystems.
222- # For flash memory this greatly extends the life of the
223- # memory and for cloud images this lowers the overhead by
224- # a small amount.
225- ext[34]) disable_journal=" -O ^has_journal" ;;
226- esac
227- mkfs.${ROOT_FSTYPE} ${disable_journal: +" $disable_journal " } " ${LOOPDEV} p2" > /dev/null 2>&1
228- mount " ${LOOPDEV} p2" " $ROOTFS "
229- mkdir -p " ${ROOTFS} /boot"
230- mount " ${LOOPDEV} p1" " ${ROOTFS} /boot"
231- BOOT_UUID=$( blkid -o value -s UUID " ${LOOPDEV} p1" )
232- ROOT_UUID=$( blkid -o value -s UUID " ${LOOPDEV} p2" )
233- ROOT_PARTUUID=$( blkid -o value -s PARTUUID " ${LOOPDEV} p2" )
234- ;;
197+ ;;
198+ esac
199+ LOOPDEV=$( losetup --show --find --partscan " $FILENAME " )
200+ # Normally we need to quote to prevent argument splitting, but
201+ # we explicitly want argument splitting here.
202+ # shellcheck disable=SC2086
203+ mkfs.${BOOT_FSTYPE} $_args " ${LOOPDEV} p1" > /dev/null
204+ case " $ROOT_FSTYPE " in
205+ # Because the images produced by this script are generally
206+ # either on single board computers using flash memory or
207+ # in cloud environments that already provide disk
208+ # durability, we shut off the journal for ext filesystems.
209+ # For flash memory this greatly extends the life of the
210+ # memory and for cloud images this lowers the overhead by
211+ # a small amount.
212+ ext[34]) disable_journal=" -O ^has_journal" ;;
235213esac
214+ mkfs.${ROOT_FSTYPE} ${disable_journal: +" $disable_journal " } " ${LOOPDEV} p2" > /dev/null 2>&1
215+ mount " ${LOOPDEV} p2" " $ROOTFS "
216+ mkdir -p " ${ROOTFS} /boot"
217+ mount " ${LOOPDEV} p1" " ${ROOTFS} /boot"
218+ BOOT_UUID=$( blkid -o value -s UUID " ${LOOPDEV} p1" )
219+ ROOT_UUID=$( blkid -o value -s UUID " ${LOOPDEV} p2" )
220+ ROOT_PARTUUID=$( blkid -o value -s PARTUUID " ${LOOPDEV} p2" )
236221
237222# This step unpacks the platformfs tarball made by mkplatformfs.sh.
238223info_msg " Unpacking rootfs tarball ..."
239- if [ " $PLATFORM " = " beaglebone" ]; then
240- # The beaglebone requires some special extra handling. The MLO
241- # program is a special first stage boot loader that brings up
242- # enough of the processor to then load u-boot which loads the rest
243- # of the system. The noauto option also prevents /boot from being
244- # mounted during system startup.
245- fstab_args=" ,noauto"
246- tar xfp " $ROOTFS_TARBALL " -C " $ROOTFS " ./boot/MLO
247- tar xfp " $ROOTFS_TARBALL " -C " $ROOTFS " ./boot/u-boot.img
248- touch " $ROOTFS /boot/uEnv.txt"
249- umount " $ROOTFS /boot"
250- fi
251-
252224# In the general case, its enough to just unpack the ROOTFS_TARBALL
253225# onto the ROOTFS. This will get a system that is ready to boot, save
254226# for the bootloader which is handled later.
@@ -284,24 +256,6 @@ sed -i "${ROOTFS}/etc/ssh/sshd_config" -e 's|^#\(PermitRootLogin\) .*|\1 yes|g'
284256# can be found.
285257info_msg " Configuring image for platform $PLATFORM "
286258case " $PLATFORM " in
287- bananapi* |cubieboard2* |cubietruck* )
288- dd if=" ${ROOTFS} /boot/u-boot-sunxi-with-spl.bin" of=" ${LOOPDEV} " bs=1024 seek=8 > /dev/null 2>&1
289- ;;
290- odroid-c2* )
291- dd if=" ${ROOTFS} /boot/bl1.bin.hardkernel" of=" ${LOOPDEV} " bs=1 count=442 > /dev/null 2>&1
292- dd if=" ${ROOTFS} /boot/bl1.bin.hardkernel" of=" ${LOOPDEV} " bs=512 skip=1 seek=1 > /dev/null 2>&1
293- dd if=" ${ROOTFS} /boot/u-boot.bin" of=" ${LOOPDEV} " bs=512 seek=97 > /dev/null 2>&1
294- ;;
295- odroid-u2* )
296- dd if=" ${ROOTFS} /boot/E4412_S.bl1.HardKernel.bin" of=" ${LOOPDEV} " seek=1 > /dev/null 2>&1
297- dd if=" ${ROOTFS} /boot/bl2.signed.bin" of=" ${LOOPDEV} " seek=31 > /dev/null 2>&1
298- dd if=" ${ROOTFS} /boot/u-boot.bin" of=" ${LOOPDEV} " seek=63 > /dev/null 2>&1
299- dd if=" ${ROOTFS} /boot/E4412_S.tzsw.signed.bin" of=" ${LOOPDEV} " seek=2111 > /dev/null 2>&1
300- ;;
301- ci20* )
302- dd if=" ${ROOTFS} /boot/u-boot-spl.bin" of=" ${LOOPDEV} " obs=512 seek=1 > /dev/null 2>&1
303- dd if=" ${ROOTFS} /boot/u-boot.img" of=" ${LOOPDEV} " obs=1K seek=14 > /dev/null 2>&1
304- ;;
305259rock64* )
306260 rk33xx_flash_uboot " ${ROOTFS} /usr/lib/rock64-uboot" " $LOOPDEV "
307261 # populate the extlinux.conf file
0 commit comments