Commit 543b29f8 authored by Strit's avatar Strit

[buildarmimg][buildarmoem] make img sizes relative to the size of the rootfs,...

[buildarmimg][buildarmoem] make img sizes relative to the size of the rootfs, instead of a fixed size
parent 8dd04c33
......@@ -435,14 +435,13 @@ create_img() {
ARCH='aarch64'
fi
if [[ "$EDITION" = "minimal" ]]; then
_SIZE=2000
else
_SIZE=5000
fi
#get size of blank image
SIZE=$(sudo du -s --block-size=MB $ROOTFS_IMG/rootfs_$ARCH | awk '{print $1}' | sed -e 's/MB//g')
EXTRA_SIZE=200
REAL_SIZE=`echo "$(($SIZE+$EXTRA_SIZE))"`
#making blank .img to be used
sudo dd if=/dev/zero of=$IMGDIR/$IMGNAME.img bs=1M count=$_SIZE 1> /dev/null 2>&1
sudo dd if=/dev/zero of=$IMGDIR/$IMGNAME.img bs=1M count=$REAL_SIZE 1> /dev/null 2>&1
#probing loop into the kernel
sudo modprobe loop 1> /dev/null 2>&1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment