Commit 9b29898b authored by Jonah Brüchert's avatar Jonah Brüchert

Fix and comment dir mode

parent efe61afb
......@@ -32,7 +32,11 @@ function shrink_images() {
}
function inject_androidimage() {
# Move android image into rootfs location (https://github.com/Halium/initramfs-tools-halium/blob/halium/scripts/halium#L259)
sudo mv "$IMAGE_DIR/system.img" "$ROOTFS_DIR/var/lib/lxc/android/"
# Make sure the mount path is correct
sudo sed -i 's,/data/system.img,/var/lib/lxc/android/system.img,g' "$ROOTFS_DIR/lib/systemd/system/system.mount"
}
function unmount() {
......
......@@ -128,29 +128,31 @@ convert_androidimage 2>&1 | $out
echo "I: Running post installation tasks"
post_install $ROOTFS_RELEASE
if [ "$INSTALL_MODE" = "dir" ]; then
echo "I: Injecting android image into rootfs"
inject_androidimage
fi
echo "I: Shrinking images"
shrink_images
if [ "$INSTALL_MODE" = "img" ]; then
case "$INSTALL_MODE" in
"img")
# In dir mode, nothing is being mounted, so unmount would fail
echo "I: Unmounting images"
unmount
fi
echo "I: Shrinking images"
shrink_images
;;
"dir")
echo "I: Injecting android image into rootfs"
inject_androidimage
;;
esac
case "$INSTALL_MODE" in
"img")
echo "I: Pushing rootfs and android image to /data via ADB"
if ! flash_img $ROOTFS_RELEASE; then
if ! flash_img; then
echo "Error: Couldn't copy the files to the device, is it connected?"
fi
;;
"dir")
echo "I: Pushing rootfs and android image to /data via ADB"
if ! flash_dir $ROOTFS_RELEASE; then
if ! flash_dir; then
echo "Error: Couldn't copy the files to the device, is it connected?"
fi
;;
......
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