Skip to content

Commit 0f81061

Browse files
authored
Merge pull request #1330 from JacobPease/main
Added dsync oflag to sdcard script, avoiding all I/O buffering.
2 parents 8e7583d + c777bea commit 0f81061

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

linux/sdcard/flash-sd.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,16 @@ if [[ $REPLY =~ ^[Yy]$ ]] ; then
184184
sleep 3
185185

186186
echo -e "$NAME Copying binaries into their partitions."
187-
DD_FLAGS="bs=4k iflag=direct,fullblock oflag=direct conv=fsync status=progress"
187+
DD_FLAGS="bs=4k iflag=direct,fullblock oflag=dsync conv=fsync status=progress"
188188

189189
echo -e "$NAME Copying device tree"
190-
sudo dd if=$DEVICE_TREE of="$SDCARD""$PART_PREFIX"1 $DD_FLAGS
190+
sudo dd if=$DEVICE_TREE of="$SDCARD""$PART_PREFIX"1 $DD_FLAGS && sync
191191

192192
echo -e "$NAME Copying OpenSBI"
193-
sudo dd if=$FW_JUMP of="$SDCARD""$PART_PREFIX"2 $DD_FLAGS
193+
sudo dd if=$FW_JUMP of="$SDCARD""$PART_PREFIX"2 $DD_FLAGS && sync
194194

195195
echo -e "$NAME Copying Kernel"
196-
sudo dd if=$LINUX_KERNEL of="$SDCARD""$PART_PREFIX"3 $DD_FLAGS
196+
sudo dd if=$LINUX_KERNEL of="$SDCARD""$PART_PREFIX"3 $DD_FLAGS && sync
197197

198198
sudo mkfs.ext4 -E lazy_itable_init=0,lazy_journal_init=0 "$SDCARD""$PART_PREFIX"4
199199
sudo fsck -fv "$SDCARD""$PART_PREFIX"4

0 commit comments

Comments
 (0)