summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gta04.mk9
-rwxr-xr-xreplicant_gta04_install.sh217
-rw-r--r--system.prop1
-rw-r--r--ueventd.gta04.rc12
4 files changed, 239 insertions, 0 deletions
diff --git a/gta04.mk b/gta04.mk
index c8668c8..b1bf823 100644
--- a/gta04.mk
+++ b/gta04.mk
@@ -16,9 +16,14 @@
PRODUCT_COPY_FILES := \
device/goldelico/gta04/init.gta04.rc:root/init.gta04.rc \
device/goldelico/gta04/vold.fstab:system/etc/vold.fstab \
+ device/goldelico/gta04/ueventd.gta04.rc:root/ueventd.gta04.rc \
device/goldelico/gta04/twl4030_pwrbutton.kl:system/usr/keylayout/twl4030_pwrbutton.kl \
device/goldelico/gta04/gpio-keys.kl:system/usr/keylayout/gpio-keys.kl
+# Install script
+PRODUCT_COPY_FILES := \
+ device/goldelico/gta04/replicant_gta04_install.sh:replicant_gta04_install.sh
+
# Audio
PRODUCT_PACKAGES += \
libaudio \
@@ -27,6 +32,10 @@ PRODUCT_PACKAGES += \
PRODUCT_COPY_FILES += \
device/goldelico/gta04/tinyalsa-audio.xml:system/etc/tinyalsa-audio.xml
+# RIL
+PRODUCT_PACKAGES += \
+ libhayes-ril
+
# APNS
PRODUCT_COPY_FILES += \
vendor/replicant/prebuilt/common/etc/apns-conf.xml:system/etc/apns-conf.xml
diff --git a/replicant_gta04_install.sh b/replicant_gta04_install.sh
new file mode 100755
index 0000000..804d4a4
--- /dev/null
+++ b/replicant_gta04_install.sh
@@ -0,0 +1,217 @@
+#!/bin/sh
+
+# Replicant GTA04 Install script
+#
+# Copyright (C) 2012 Paul Kocialkowski, GPLv2
+#
+# Based on mkcard.sh v0.5
+# Copyright (C) 2009 Graeme Gregory <dp@xora.org.uk>, GPLv2
+# Parts of the procudure base on the work of Denys Dmytriyenko
+# http://wiki.omap.com/index.php/MMC_Boot_Format
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Env vars
+
+export LC_ALL=C
+
+# Global vars
+
+DRIVE=""
+DRIVE_NAME=""
+DRIVE_SIZE=""
+DRIVE_CYLINDERS=""
+DRIVE_PART=""
+
+SYSTEM_AR=""
+MOUNT_BASE="/media"
+
+# Functions
+
+display_banner() {
+ echo "Replicant GTA04 installer"
+ echo ""
+}
+
+display_help() {
+ echo "Usage: $0 [DRIVE] [SYSTEM]"
+ echo ""
+ echo "Notes: "
+ echo "- The [DRIVE] argument can be omitted"
+ echo "- The [SYSTEM] argument must be a tar archive"
+}
+
+drive_select_list()
+{
+ drives_dir="/dev/disk/by-id/"
+ count=0
+
+ list=$( ls "$drives_dir" )
+
+ for drive in $list
+ do
+ drive_nopart=$( echo "$drive" | sed "s/-part[0-9]*$//g" )
+ if [ "$drive" = "$drive_nopart" ]
+ then
+ ls $drives_dir/$drive-part* 2> /dev/null > /dev/null
+
+ if [ $? -eq 0 ]
+ then
+ count=$(( $count + 1 ))
+ name=$( echo "$drive" | sed "s/^[^-]*-\(.*\)$/\1/g" )
+
+ case "$1" in
+ "show")
+ echo "$count - $name"
+ ;;
+ "store")
+ if [ $count -eq $2 ]
+ then
+ DRIVE=$( readlink -f "$drives_dir/$drive" )
+ DRIVE_NAME="$name"
+ fi
+ ;;
+ esac
+ fi
+ fi
+ done
+}
+
+drive_select()
+{
+ echo "Available devices:"
+ drive_select_list "show"
+
+ echo -n "Choice: "
+ read choice
+
+ drive_select_list "store" $choice
+ echo ""
+}
+
+drive_write_confirm() {
+ if [ "$DRIVE" = "" ]
+ then
+ echo "Wrong drive block"
+ exit 1
+ fi
+
+ echo "This is going to erase the following drive:"
+
+ if [ "$DRIVE_NAME" != "" ]
+ then
+ echo "- $DRIVE_NAME ($DRIVE)"
+ else
+ echo "- $DRIVE"
+ fi
+
+ echo ""
+ echo -n "Are you sure? "
+ read confirm
+
+ if [ "$confirm" = "y" ] || [ "$confirm" = "Y" ]
+ then
+ echo ""
+ return
+ else
+ exit 0
+ fi
+}
+
+drive_umount() {
+ umount $DRIVE* 2> /dev/null
+}
+
+drive_empty() {
+ dd if=/dev/zero of="$DRIVE" bs=1024 count=1024
+}
+
+drive_infos_get() {
+ DRIVE_SIZE=$( fdisk -l "$DRIVE" | grep Disk | grep bytes | awk '{print $5}' )
+ DRIVE_CYLINDERS=$( echo "$DRIVE_SIZE/255/63/512" | bc )
+}
+
+drive_partitions_set() {
+ system_size=$( echo "(250 * 1024 * 1024) / ($DRIVE_SIZE/$DRIVE_CYLINDERS)" | bc )
+ data_size=$( echo "(250 * 1024 * 1024) / ($DRIVE_SIZE/$DRIVE_CYLINDERS)" | bc )
+ cache_size=$( echo "(100 * 1024 * 1024) / ($DRIVE_SIZE/$DRIVE_CYLINDERS)" | bc )
+
+ {
+ echo ",$system_size,83"
+ echo ",$data_size,83"
+ echo ",$cache_size,83"
+ echo ",,0c"
+ } | sfdisk -D -H 255 -S 63 -C "$DRIVE_CYLINDERS" "$DRIVE"
+
+ mkfs.ext2 -L "system" "${DRIVE}1"
+ mkfs.ext2 -L "data" "${DRIVE}2"
+ mkfs.ext2 -L "cache" "${DRIVE}3"
+ mkfs.vfat -F 32 -n "storage" "${DRIVE}4"
+}
+
+system_write() {
+ echo "Writing system files"
+
+ mkdir -p "$MOUNT_BASE/system"
+ mount "${DRIVE}1" "$MOUNT_BASE/system"
+ tar -p -xf $SYSTEM_AR -C "$MOUNT_BASE/system" "system"
+
+ dir=$( pwd )
+ echo "Syncing files"
+ cd "$MOUNT_BASE/system"
+ sync
+ cd "$dir"
+
+ umount "$MOUNT_BASE/system"
+ rmdir "$MOUNT_BASE/system"
+}
+
+display_end() {
+ echo ""
+ echo "Your drive is now ready to be used!"
+}
+
+drive_eject() {
+ eject "$DRIVE"
+}
+
+# Script start
+
+if [ $# -eq 0 ]
+then
+ display_help
+ exit 1
+fi
+
+if [ $# -eq 1 ]
+then
+ SYSTEM_AR=$1
+fi
+
+if [ $# -eq 2 ]
+then
+ DRIVE=$1
+ SYSTEM_AR=$2
+fi
+
+display_banner
+
+if [ "$DRIVE" = "" ]
+then
+ drive_select
+fi
+
+drive_write_confirm
+drive_umount
+drive_empty
+drive_infos_get
+drive_partitions_set
+system_write
+display_end
+drive_eject
diff --git a/system.prop b/system.prop
index 4db8469..ebbb195 100644
--- a/system.prop
+++ b/system.prop
@@ -3,3 +3,4 @@
#
ro.sf.lcd_density=210
+rild.libpath=/system/lib/libhayes-ril.so
diff --git a/ueventd.gta04.rc b/ueventd.gta04.rc
new file mode 100644
index 0000000..fb46edc
--- /dev/null
+++ b/ueventd.gta04.rc
@@ -0,0 +1,12 @@
+# Modem
+
+/dev/ttyHS0 0660 radio radio
+/dev/ttyHS1 0660 radio radio
+/dev/ttyHS2 0660 radio radio
+/dev/ttyHS3 0660 radio radio
+/dev/ttyHS4 0660 radio radio
+/dev/ttyHS5 0660 radio radio
+/dev/ttyHS6 0660 radio radio
+/dev/ttyHS7 0660 radio radio
+/dev/ttyHS8 0660 radio radio
+/dev/ttyHS9 0660 radio radio