From b94ca5f680e0340589868290a3aae93c9a41506b Mon Sep 17 00:00:00 2001 From: Jacob Pease Date: Wed, 26 Feb 2025 17:03:46 -0600 Subject: [PATCH] Fixed flash-sd.sh script. Added flag for direct sdcard io in order to avoid problems with cacheing. Also fixed filesystem writing to write to all of the inodes, avoiding bugs when mounting the card on the FPGA. --- linux/sdcard/flash-sd.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linux/sdcard/flash-sd.sh b/linux/sdcard/flash-sd.sh index 31e6ee45f..b1080739e 100755 --- a/linux/sdcard/flash-sd.sh +++ b/linux/sdcard/flash-sd.sh @@ -184,7 +184,7 @@ if [[ $REPLY =~ ^[Yy]$ ]] ; then sleep 3 echo -e "$NAME Copying binaries into their partitions." - DD_FLAGS="bs=4k iflag=fullblock oflag=direct conv=fsync status=progress" + DD_FLAGS="bs=4k iflag=direct,fullblock oflag=direct conv=fsync status=progress" echo -e "$NAME Copying device tree" sudo dd if=$DEVICE_TREE of="$SDCARD""$PART_PREFIX"1 $DD_FLAGS @@ -195,10 +195,11 @@ if [[ $REPLY =~ ^[Yy]$ ]] ; then echo -e "$NAME Copying Kernel" sudo dd if=$LINUX_KERNEL of="$SDCARD""$PART_PREFIX"3 $DD_FLAGS - sudo mkfs.ext4 "$SDCARD""$PART_PREFIX"4 + sudo mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 "$SDCARD""$PART_PREFIX"4 + sudo fsck -fv "$SDCARD""$PART_PREFIX"4 sudo mkdir /mnt/$MNT_DIR - sudo mount -v "$SDCARD""$PART_PREFIX"4 /mnt/$MNT_DIR + sudo mount -o init_itable=0 -v "$SDCARD""$PART_PREFIX"4 /mnt/$MNT_DIR sudo umount -v /mnt/$MNT_DIR