File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ if [ -z "$grub" ]; then
23
23
fi
24
24
echo " using grub-install at ${grub} "
25
25
26
+ disk_usage () {
27
+ du -sm $1 | cut -f1
28
+ }
29
+
30
+ DISK_SIZE=$(( $(disk_usage "$SERENITY_ROOT / Base") + $(disk_usage Root) + 300 ))
31
+
26
32
echo " setting up disk image..."
27
33
dd if=/dev/zero of=grub_disk_image bs=1M count=" ${DISK_SIZE:- 800} " status=none || die " couldn't create disk image"
28
34
chown " $SUDO_UID " :" $SUDO_GID " grub_disk_image || die " couldn't adjust permissions on disk image"
Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ if [ "$(uname -s)" = "Darwin" ]; then
17
17
export PATH=" /usr/local/opt/e2fsprogs/bin:$PATH "
18
18
export PATH=" /usr/local/opt/e2fsprogs/sbin:$PATH "
19
19
fi
20
+
21
+ disk_usage () {
22
+ du -sm $1 | cut -f1
23
+ }
24
+
25
+ DISK_SIZE=$(( $(disk_usage "$SERENITY_ROOT / Base") + $(disk_usage Root) + 100 ))
26
+
20
27
echo " setting up disk image..."
21
28
qemu-img create _disk_image " ${DISK_SIZE:- 600} " m || die " could not create disk image"
22
29
chown " $SUDO_UID " :" $SUDO_GID " _disk_image || die " could not adjust permissions on disk image"
You can’t perform that action at this time.
0 commit comments