Skip to content

Use resize2fs to shrink system.img #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions halium-install
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ SYSIMG=$2

check_prereq()
{
if [ ! $(which make_ext4fs) ] || [ ! -x $(which simg2img) ] || \
[ ! -x $(which adb) ]; then
if [ ! -x $(which simg2img) ] || [ ! -x $(which adb) ]; then
echo "please install the android-tools-fsutils and android-tools-adb packages" && exit 1
fi
}
Expand All @@ -41,10 +40,8 @@ do_shell()
convert_android_img()
{
if file $SYSIMG | grep -v ": Linux rev 1.0 ext4" >/dev/null; then
simg2img $SYSIMG $WORKDIR/system.img.raw
mkdir $TMPMOUNT
mount -t ext4 -o loop $WORKDIR/system.img.raw $TMPMOUNT
make_ext4fs -l 160M $WORKDIR/system.img $TMPMOUNT
simg2img $SYSIMG $WORKDIR/system.img
resize2fs -M $WORKDIR/system.img
SYSIMAGE=$WORKDIR/system.img
else
SYSIMAGE=$SYSIMG
Expand Down Expand Up @@ -75,7 +72,6 @@ cleanup()
{
echo
echo "cleaning up"
mount | grep -q $TMPMOUNT 2>/dev/null && umount $TMPMOUNT
cleanup_device
rm -rf $WORKDIR
echo
Expand Down Expand Up @@ -168,7 +164,6 @@ fi
check_mounts

WORKDIR=$(mktemp -d /tmp/halium-install.XXXXX)
TMPMOUNT="$WORKDIR/tmpmount"

echo "transfering rootfs tarball ... "
adb push $TARPATH /recovery/
Expand Down