all: Add buffer and byte flushing

This commit is contained in:
Steev Klimaszewski
2021-09-17 09:46:40 -05:00
parent 0866498fea
commit b93bcc5007
18 changed files with 77 additions and 8 deletions

View File

@@ -182,9 +182,12 @@ echo "UUID=$UUID / $fstype errors=remount-ro 0 1" >> ${wo
echo "Rsyncing rootfs to image file"
rsync -HPavz -q ${work_dir}/ ${basedir}/root/
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Unmount partitions
sync
umount ${rootp}
umount -l ${rootp}
dd if=${work_dir}/usr/lib/u-boot/Bananapi/u-boot-sunxi-with-spl.bin of=${loopdevice} bs=1024 seek=8

View File

@@ -170,9 +170,12 @@ mount ${rootp} "${basedir}"/root
echo "Rsyncing rootfs to image file"
rsync -HPavz -q ${work_dir}/ ${basedir}/root/
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Unmount partitions
sync
umount ${rootp}
umount -l ${rootp}
dd if=${work_dir}/usr/lib/u-boot/Bananapro/u-boot-sunxi-with-spl.bin of=${loopdevice} bs=1024 seek=8

View File

@@ -212,9 +212,12 @@ echo "UUID=$UUID / $fstype errors=remount-ro 0 1" >> ${wo
echo "Rsyncing rootfs into image file"
rsync -HPavz -q ${work_dir}/ ${basedir}/root/
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Unmount partitions
sync
umount ${rootp}
umount -l ${rootp}
kpartx -dv ${loopdevice}
losetup -d ${loopdevice}

View File

@@ -227,7 +227,10 @@ EOF
log "Rsyncing rootfs into image file" green
rsync -HPavz -q "${work_dir}"/ "${basedir}"/root/
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -257,6 +257,10 @@ sync
cd ${current_dir}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -356,6 +356,10 @@ sync
cd ${current_dir}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -370,6 +370,10 @@ sync
cd ${current_dir}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -263,6 +263,10 @@ sync
cd ${current_dir}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -285,6 +285,10 @@ sh sd_fusing.sh ${loopdevice}
cd ${current_dir}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -312,6 +312,10 @@ dd if=${current_dir}/bsp/bootloader/pinebook-pro/trust.img of=${loopdevice} seek
#TARGET="/usr/lib/u-boot/pinebook-pro-rk3399" /usr/bin/u-boot-install-rockchip ${loopdevice}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -268,6 +268,10 @@ sync
cd ${current_dir}
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"

View File

@@ -583,6 +583,10 @@ rsync -HPavz -q --exclude boot ${work_dir}/ ${basedir}/root/
rsync -rtx -q ${work_dir}/boot ${basedir}/root
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Unmount partitions
umount ${bootp}
umount ${rootp}

View File

@@ -75,7 +75,7 @@ install -m755 /bsp/scripts/monstop /usr/bin/
echo "deb http://http.re4son-kernel.com/re4son kali-pi main" > /etc/apt/sources.list.d/re4son.list
wget -qO /etc/apt/trusted.gpg.d/kali_pi-archive-keyring.gpg https://re4son-kernel.com/keys/http/kali_pi-archive-keyring.gpg
eatmydata apt-get update
eatmydata apt-get install -y kalipi-kernel kalipi-bootloader kalipi-re4son-firmware kalipi-kernel-headers kalipi-config kalipi-tft-config firmware-raspberry
eatmydata apt-get install -y kalipi-kernel kalipi-bootloader kalipi-re4son-firmware kalipi-kernel-headers kalipi-config kalipi-tft-config firmware-raspberry pi-bluetooth
# Copy script rpi-resizerootfs
install -m755 /bsp/scripts/rpi-resizerootfs /usr/sbin/
@@ -188,6 +188,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/
rsync -rtx -q "${work_dir}"/boot "${basedir}"/root
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${bootp}"
umount -l "${rootp}"

View File

@@ -521,6 +521,10 @@ rsync -HPavz -q --exclude boot ${work_dir}/ ${basedir}/root/
rsync -rtx -q ${work_dir}/boot ${basedir}/root
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Unmount partitions
umount -l ${bootp}
umount -l ${rootp}

View File

@@ -186,6 +186,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/
rsync -rtx -q "${work_dir}"/boot "${basedir}"/root
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${bootp}"
umount -l "${rootp}"

View File

@@ -186,6 +186,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/
rsync -rtx -q "${work_dir}"/boot "${basedir}"/root
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${bootp}"
umount -l "${rootp}"

View File

@@ -187,6 +187,10 @@ rsync -HPavz -q --exclude boot "${work_dir}"/ "${basedir}"/root/
rsync -rtx -q "${work_dir}"/boot "${basedir}"/root
sync
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${bootp}"
umount -l "${rootp}"

View File

@@ -247,6 +247,11 @@ make ARCH=arm
dd if=u-boot.imx of=${loopdevice} bs=512 seek=2 conv=fsync
cd "${current_dir}"
# Flush buffers and bytes - this is nicked from the Devuan arm-sdk.
blockdev --flushbufs "${loopdevice}"
python -c 'import os; os.fsync(open("'${loopdevice}'", "r+b"))'
# Umount filesystem
umount -l "${rootp}"