more comments to seperate setups

This commit is contained in:
2024-10-11 12:08:09 -04:00
parent aff631f3db
commit 0aae0616fd

View File

@@ -71,6 +71,10 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
firstpart=$(lsblk -ilp -o NAME $ld | tr '\n' ' ' | awk '{print $3}') firstpart=$(lsblk -ilp -o NAME $ld | tr '\n' ' ' | awk '{print $3}')
mkfs.fat -v -F32 -s 1 -n 'STEVIAFS' $firstpart mkfs.fat -v -F32 -s 1 -n 'STEVIAFS' $firstpart
#
# MBR setup
#
# copy MBR while preserving partition table # copy MBR while preserving partition table
if ! dd if=$mbr_file of=$ld bs=1 count=440; then if ! dd if=$mbr_file of=$ld bs=1 count=440; then
echo "Failed to write MBR to disk. (part 1)" >&2 echo "Failed to write MBR to disk. (part 1)" >&2
@@ -83,6 +87,10 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
exit 1 exit 1
fi fi
#
# VBR Setup & backup VBR
#
# copy VBR to partition 1 while preserving partition information # copy VBR to partition 1 while preserving partition information
# copy jmp short entry; nop # copy jmp short entry; nop
if ! dd if=$vbr_file of=$firstpart bs=1 count=3; then if ! dd if=$vbr_file of=$firstpart bs=1 count=3; then
@@ -106,6 +114,11 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
exit 1 exit 1
fi fi
#
# Stage2 Setup
#
#stage2 to sectors 1-64 #stage2 to sectors 1-64
if ! dd if=$stage2_file of=$ld bs=$disk_sector_size seek=1; then if ! dd if=$stage2_file of=$ld bs=$disk_sector_size seek=1; then
echo "Failed to write Stage2 to disk." >&2 echo "Failed to write Stage2 to disk." >&2
@@ -132,6 +145,10 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
exit 1 exit 1
fi fi
#
# Final Cleanup
#
# detach loop device # detach loop device
umount $mount_point umount $mount_point
sync sync