From a370d9865cfb7bb9cdc3359a0b9255b53711aef8 Mon Sep 17 00:00:00 2001 From: JBBgameich Date: Tue, 2 Jan 2018 15:48:31 +0100 Subject: [PATCH] Support flashing the rootfs to the system partition --- functions/core.sh | 13 ++++++++++++- halium-install | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/functions/core.sh b/functions/core.sh index c6a58c9..cf51193 100644 --- a/functions/core.sh +++ b/functions/core.sh @@ -17,6 +17,10 @@ function convert_androidimage() { simg2img $AND_IMAGE system.img } +function rootfs_sparse() { + img2simg rootfs.img rootfs.sparse.img +} + function shrink_images() { sudo e2fsck -fy system.img >/dev/null sudo resize2fs -p -M system.img @@ -28,7 +32,13 @@ function unmount() { function flash() { adb push system.img /data/system.img - adb push rootfs.img /data/rootfs.img + + if [ -f rootfs.sparse.img ]; then + adb reboot bootloader + fastboot flash rootfs.sparse.img + else + adb push rootfs.img /data/rootfs.img + fi } function clean() { @@ -36,5 +46,6 @@ function clean() { sudo rm rootfs -rf sudo rm rootfs.img + if [ -f rootfs.sparse.img ]; then rm rootfs.sparse.img; fi sudo rm system.img } diff --git a/halium-install b/halium-install index 308adb6..f25c3dc 100755 --- a/halium-install +++ b/halium-install @@ -75,6 +75,10 @@ spinner $! echo "I: Shrinking images" shrink_images +echo "I: Making rootfs.img sparse for flashing" +rootfs_sparse &>/dev/null & +spinner $! + echo "I: Pushing rootfs and android image to /data via ADB" flash