forked from CyanogenMod/android_bootable_recovery
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Ubuntu Touch] Initial release of Ubports recovery
Change-Id: I9c58576663885e504f7a0b8cfbbe98a30811bfa0
- Loading branch information
Showing
14 changed files
with
1,195 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-----BEGIN PGP SIGNATURE----- | ||
Version: GnuPG v1 | ||
|
||
iQEcBAABAgAGBQJVNU16AAoJEBowx9ZYXp6Bkg4IAJ8xmvYzIe22P/7cR5uALUVb | ||
ysOXugvGdXNAn9J867EPnbJ+oAWSJiDgB8i20Wx+c2JKRGQ8XHmDZQL+43ANZzu5 | ||
LMY/7N56LD8UXrB9vmyQhTsyodKeSBF24yJnH3M8upoSrrbuP3VpoGIMa38Udz7b | ||
UDbMkGYJmV8tyoGE377CceNv++vKP49W0j0WK1QakIOHnDbmMSRA0AXve4kUf2LJ | ||
XkVNeUYJ4lpAl0BNSl7J4NOtJFzD+eSjh1yBZTmPzwqvSfkJWft9XnxfP2/r1oy3 | ||
pWkYLHNgdPIR/NPKPtc06MZ+YmQqoTrtVHhO2jFve8MkmhNqNx2sFwcWKZODkUU= | ||
=08bM | ||
-----END PGP SIGNATURE----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#!/sbin/sh | ||
|
||
TARPATH=$(realpath $2) | ||
SYSIMG=$(realpath $3) | ||
|
||
|
||
prepare_ubuntu_system() | ||
{ | ||
mount /data | ||
rm -f /data/system.img | ||
rm -rf /data/ubuntu | ||
for data in system android; do | ||
rm -rf /data/$data-data | ||
done | ||
dd if=/dev/zero of=/data/system.img seek=500K bs=4096 count=0 >/dev/null 2>&1 | ||
mkfs.ext2 -F /data/system.img >/dev/null 2>&1 | ||
mkdir -p /data/ubuntu | ||
mount -o loop /data/system.img /data/ubuntu/ | ||
} | ||
|
||
cleanup() | ||
{ | ||
umount /data/ubuntu/ 2>/dev/null && rm -rf /data/ubuntu 2>/dev/null | ||
rm -r /data/zip | ||
} | ||
|
||
usage() | ||
{ | ||
echo "usage: $(basename $0) <method>\n | ||
methods: zip, pre" | ||
exit 1 | ||
} | ||
|
||
TARBALL=$(basename $TARPATH) | ||
THIS_DIR=$(dirname $0) | ||
|
||
if [ $1 == "zip" ]; then | ||
mkdir /data/zip | ||
unzip $TARPATH -d /data/zip | ||
TARBALL = /data/zip/ubuntu.tar.gz | ||
SYSIMG = /data/zip/system.img | ||
fi | ||
|
||
if [ -z "$TARBALL" ]; then | ||
echo "need valid rootfs tarball path" | ||
usage | ||
fi | ||
|
||
echo -n "preparing system-image on device ... " | ||
prepare_ubuntu_system | ||
echo "[done]" | ||
|
||
echo -n "unpacking rootfs tarball to system-image ... " | ||
echo "$TARPATH" | ||
zcat $TARPATH | tar xf - -C /data/ubuntu | ||
cd /data/ubuntu | ||
mkdir -p /data/ubuntu/android/firmware | ||
mkdir -p /data/ubuntu/android/persist | ||
mkdir -p /data/ubuntu/userdata | ||
[ -e /data/ubuntu/SWAP.swap ] && mv /data/ubuntu/SWAP.swap /data/SWAP.img | ||
for link in cache data factory firmware persist system; do | ||
cd /data/ubuntu && ln -s /android/$link $link | ||
done | ||
cd /data/ubuntu/lib && ln -s /system/lib/modules modules | ||
cd /data/ubuntu && ln -s /android/system/vendor vendor | ||
[ -e /data/ubuntu/etc/mtab ] && rm /data/ubuntu/etc/mtab | ||
cd /data/ubuntu/etc && ln -s /proc/mounts mtab | ||
|
||
echo "[done]" | ||
|
||
echo -n "adding android system image to installation ... " | ||
cd "$(dirname "$0")" | ||
ANDROID_DIR="/data/ubuntu/var/lib/lxc/android/" | ||
cp $SYSIMG $ANDROID_DIR | ||
echo "[done]" | ||
|
||
echo -n "enabling Mir ... " | ||
touch /data/ubuntu/home/phablet/.display-mir | ||
echo "[done]" | ||
|
||
echo -n "cleaning up on device ... " | ||
cleanup | ||
echo "[done]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
LOCAL_PATH := $(call my-dir) | ||
|
||
include $(CLEAR_VARS) | ||
LOCAL_SRC_FILES := system.c popen.c | ||
LOCAL_MODULE := libcrecovery | ||
LOCAL_MODULE_TAGS := optional | ||
include $(BUILD_STATIC_LIBRARY) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef LIBCRECOVERY_COMMON_H | ||
#define LIBCRECOVERY_COMMON_H | ||
|
||
#include <stdio.h> | ||
|
||
int __system(const char *command); | ||
FILE * __popen(const char *program, const char *type); | ||
int __pclose(FILE *iop); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#undef _PATH_BSHELL | ||
#define _PATH_BSHELL "/sbin/sh" |
Oops, something went wrong.