From a618a837d4b91b408c231934ca1b82da4b36e627 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Thu, 4 Sep 2025 12:29:57 -0400 Subject: [PATCH] added root check back in, but check that we aren't root changed how mtools accesses images, should functionally be the same. --- scripts/create-disk.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/create-disk.sh b/scripts/create-disk.sh index cfe7f0b..b4b42c6 100755 --- a/scripts/create-disk.sh +++ b/scripts/create-disk.sh @@ -16,6 +16,11 @@ set -euo pipefail # You should have received a copy of the GNU General Public License # along with this program. If not, see . +if [ $(id -u) = 0 ]; then + echo "Script should not be run as root, it could break something! Exiting!" >&2 + exit 1 +fi + # paths to bootcode mbr_file=build/mbr.bin vbr_file=build/vbr.bin @@ -70,6 +75,11 @@ label-id: 0xa0b0c0d0 start=$part_start, size=$((disk_sectors - part_start)), type=c, bootable EOF +mtool_src=/tmp/mtools.conf +cat > $mtool_src <