Switch to truncate to allocate storage for images
Works in low memory situations
This commit is contained in:
parent
6653bb6057
commit
a25ec4a9b0
@ -131,7 +131,7 @@ case "$DD_VERSION" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
info_msg "Creating disk image ($IMGSIZE) ..."
|
info_msg "Creating disk image ($IMGSIZE) ..."
|
||||||
dd if=/dev/zero of=$FILENAME bs=$IMGSIZE count=1 ${DD_SPARSE} >/dev/null 2>&1
|
truncate -s "${IMGSIZE}M" $FILENAME >/dev/null 2>&1
|
||||||
|
|
||||||
ROOTFSDIR=$(mktemp -d)
|
ROOTFSDIR=$(mktemp -d)
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ generate_grub_efi_boot() {
|
|||||||
modprobe -q loop || :
|
modprobe -q loop || :
|
||||||
|
|
||||||
# Create EFI vfat image.
|
# Create EFI vfat image.
|
||||||
dd if=/dev/zero of=$GRUB_DIR/efiboot.img bs=1024 count=16384 >/dev/null 2>&1
|
truncate -s 16M $GRUB_DIR/efiboot.img >/dev/null 2>&1
|
||||||
mkfs.vfat -F12 -S 512 -n "grub_uefi" "$GRUB_DIR/efiboot.img" >/dev/null 2>&1
|
mkfs.vfat -F12 -S 512 -n "grub_uefi" "$GRUB_DIR/efiboot.img" >/dev/null 2>&1
|
||||||
|
|
||||||
GRUB_EFI_TMPDIR="$(mktemp --tmpdir=$HOME -d)"
|
GRUB_EFI_TMPDIR="$(mktemp --tmpdir=$HOME -d)"
|
||||||
@ -249,8 +249,8 @@ generate_squashfs() {
|
|||||||
ROOTFS_FREESIZE="$((ROOTFS_SIZE/6))"
|
ROOTFS_FREESIZE="$((ROOTFS_SIZE/6))"
|
||||||
fi
|
fi
|
||||||
mkdir -p "$BUILDDIR/tmp/LiveOS"
|
mkdir -p "$BUILDDIR/tmp/LiveOS"
|
||||||
dd if=/dev/zero of="$BUILDDIR/tmp/LiveOS/ext3fs.img" \
|
truncate -s "$((ROOTFS_SIZE+ROOTFS_FREESIZE))M" \
|
||||||
bs="$((ROOTFS_SIZE+ROOTFS_FREESIZE))M" count=1 >/dev/null 2>&1
|
$BUILDDIR/tmp/LiveOS/ext3fs.img >/dev/null 2>&1
|
||||||
mkdir -p "$BUILDDIR/tmp-rootfs"
|
mkdir -p "$BUILDDIR/tmp-rootfs"
|
||||||
mkfs.ext3 -F -m1 "$BUILDDIR/tmp/LiveOS/ext3fs.img" >/dev/null 2>&1
|
mkfs.ext3 -F -m1 "$BUILDDIR/tmp/LiveOS/ext3fs.img" >/dev/null 2>&1
|
||||||
mount -o loop "$BUILDDIR/tmp/LiveOS/ext3fs.img" "$BUILDDIR/tmp-rootfs"
|
mount -o loop "$BUILDDIR/tmp/LiveOS/ext3fs.img" "$BUILDDIR/tmp-rootfs"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user