From 5dcd36d0dad7e6943eef8fa1d9854922a89c55f0 Mon Sep 17 00:00:00 2001 From: Mike Staszel Date: Sat, 10 Jul 2010 05:43:32 -0700 Subject: [PATCH] First look at Plugbox for HTC Android phones --- androidphones/plugbox/bootplugbox | 34 +++++++++++++++++++++ androidphones/plugbox/fsrw | 4 +++ androidphones/plugbox/mountonly | 47 +++++++++++++++++++++++++++++ androidphones/plugbox/plugbox.sh | 50 +++++++++++++++++++++++++++++++ androidphones/plugbox/unionfs | 20 +++++++++++++ community/mt-daapd/PKGBUILD | 34 +++++++++++++++++++++ community/mt-daapd/mt-daapd | 33 ++++++++++++++++++++ 7 files changed, 222 insertions(+) create mode 100755 androidphones/plugbox/bootplugbox create mode 100755 androidphones/plugbox/fsrw create mode 100755 androidphones/plugbox/mountonly create mode 100755 androidphones/plugbox/plugbox.sh create mode 100755 androidphones/plugbox/unionfs create mode 100755 community/mt-daapd/PKGBUILD create mode 100755 community/mt-daapd/mt-daapd diff --git a/androidphones/plugbox/bootplugbox b/androidphones/plugbox/bootplugbox new file mode 100755 index 000000000..f99f907c0 --- /dev/null +++ b/androidphones/plugbox/bootplugbox @@ -0,0 +1,34 @@ +echo "Preparing Plugbox Linux..." +#modprobe ext2 +mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system +export kit=/sdcard/plugbox +export bin=/system/bin +export mnt=/data/local/mnt +export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH +export TERM=linux +export HOME=/root +mknod /dev/loop2 b 7 0 +mount -o loop,noatime -t ext2 $kit/plugbox.img $mnt +mount -t devpts devpts $mnt/dev/pts +mount -t proc proc $mnt/proc +mount -t sysfs sysfs $mnt/sys +sysctl -w net.ipv4.ip_forward=1 +echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4" +echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf +echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf +echo "Setting localhost on /etc/hosts " +echo "127.0.0.1 localhost" > $mnt/etc/hosts +echo "" +echo "Brought to you by NexusOneHacks.net and PlugApps." +echo " " +chroot $mnt /bin/bash + +#After exit command is executed clear it all up +echo "" + +echo "Cleaning up..." +umount $mnt/dev/pts +umount $mnt/proc +umount $mnt/sys +umount $mnt +#losetup -d /dev/loop2 diff --git a/androidphones/plugbox/fsrw b/androidphones/plugbox/fsrw new file mode 100755 index 000000000..8a2d1eed7 --- /dev/null +++ b/androidphones/plugbox/fsrw @@ -0,0 +1,4 @@ +mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system +echo "Filesytem remounted as read/write" + + diff --git a/androidphones/plugbox/mountonly b/androidphones/plugbox/mountonly new file mode 100755 index 000000000..b82d3c1b2 --- /dev/null +++ b/androidphones/plugbox/mountonly @@ -0,0 +1,47 @@ + +# Based on Saurik's remount.sh - modified by Mark Walker of http://www.androidfanatic.com +# Email admin@androidfanatic.com + +modprobe ext2 + +clear + +mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system +echo "Android Filesytem remounted as read/write" + +export kit=/sdcard/debian +export bin=/data/local/bin +export mnt=/data/local/mnt + +export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH +export TERM=linux +export HOME=/root + +busybox insmod ext2 + +clear +echo " " + +mount -o loop,noatime $kit/debian.img $mnt + +mount -t devpts devpts $mnt/dev/pts +mount -t proc proc $mnt/proc +mount -t sysfs sysfs $mnt/sys + +echo "Custom Linux IMG Mounter V1.0 - by Mark Walker" +echo "WEB: http://www.androidfanatic.com" +echo "EML: admin@androidfanatic.com" +echo " " +sleep 1 + +echo "AutoMounter started" +sleep 1 +echo "REBOOT PHONE TO PROPERLY DISMOUNT" + +echo " " + + +# chroot $mnt /bin/bash + + + diff --git a/androidphones/plugbox/plugbox.sh b/androidphones/plugbox/plugbox.sh new file mode 100755 index 000000000..0104f4e88 --- /dev/null +++ b/androidphones/plugbox/plugbox.sh @@ -0,0 +1,50 @@ +# This script is taken from NexusOneHacks.net and modified for +# Plugbox Linux + +mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system +modprobe ext2 + +clear + +rm -f /data/local/bin/fsrw +rm -f /data/local/bin/bootplugbox +rm -f /data/local/bin/unionfs +rm -f /data/local/bin/installer.sh +rm -f /data/local/bin/mountonly + +mkdir /data/local/mnt + +clear +rm /system/bin/fsrw +rm /system/bin/bootplugbox +rm /system/bin/unionfs +rm -/system/bin/mountonly + +cp -f fsrw /system/bin +cp -f bootplugbox /system/bin +cp -f unionfs /system/bin +cp -f mountonly /system/bin + + +cd /sdcard/plugbox + +chmod 4777 * + +cd /system/bin/ + +chmod 4777 * + +cd / + +clear + +echo " " +echo "Plugbox Chroot Bootloader v0.1" +echo "Plugbox Bootloader is now installed!" +echo "This process does NOT damage Android!" +echo " " +echo "Original Installer by Charan Singh" +echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net" +echo "Modified for Plugbox Linux by PlugApps.com" +echo " " +echo "To enter Plugbox Linux console just type 'bootplugbox'" diff --git a/androidphones/plugbox/unionfs b/androidphones/plugbox/unionfs new file mode 100755 index 000000000..5223c2e9c --- /dev/null +++ b/androidphones/plugbox/unionfs @@ -0,0 +1,20 @@ +busybox insmod unionfs +mount -t unionfs -o dirs=$mnt/etc=rw:/etc=ro unionfs /etc + +mount -o remount,rw / +ln -s $mnt/lib / + +for x in \ + bin boot home media mnt \ + opt selinux srv usr var +do +ln -s $mnt/$x / +done + +rmdir /root +ln -s $mnt/root / +mount -o remount,ro / + +mount -t unionfs -o dirs=$mnt/sbin=rw:/sbin=ro unionfs /sbin +mount -t unionfs -o dirs=$mnt/dev=rw:/dev=rw unionfs /dev +mount -t devpts devpts /dev/pts diff --git a/community/mt-daapd/PKGBUILD b/community/mt-daapd/PKGBUILD new file mode 100755 index 000000000..745374cfa --- /dev/null +++ b/community/mt-daapd/PKGBUILD @@ -0,0 +1,34 @@ +# Maintainer: Mike Staszel +# Contributor: Jon Kristian Nilsen + +# Plugbox Linux changes: +# - Added "LDFLAGS="" + +pkgname=mt-daapd +pkgver=0.2.4.2 +pkgrel=4 +pkgdesc="A multi-threaded DAAP server compatible with iTunes music sharing" +url="http://www.mt-daapd.org/" +license=("LGPL") +arch=('arm') +backup=(etc/mt-daapd/mt-daapd.conf) +depends=('libid3tag' 'gdbm' 'avahi') +source=(http://dl.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz \ + mt-daapd) +md5sums=('67bef9fb14d487693b0dfb792c3f1b05' + '26cf6ff799ef06d262a8648d6890a250') +LDFLAGS="" + +build() { + cd "$startdir/src/$pkgname-$pkgver" + + sed -i 's|DEFAULT_CONFIGFILE "/etc/mt-daapd.conf"|DEFAULT_CONFIGFILE "/etc/mt-daapd/mt-daapd.conf"|' src/main.c + + ./configure --prefix=/usr --sysconfdir=/etc/mt-daapd --enable-avahi --enable-mdns + make || return 1 + make DESTDIR="$startdir/pkg" install || return 1 + + install -D -m644 $srcdir/$pkgname-$pkgver/contrib/mt-daapd.playlist $pkgdir/etc/mt-daapd/sample.playlist && \ + install -D -m644 $srcdir/$pkgname-$pkgver/contrib/mt-daapd.conf $pkgdir/etc/mt-daapd/mt-daapd.conf && \ + install -D -m755 $srcdir/mt-daapd $pkgdir/etc/rc.d/mt-daapd +} diff --git a/community/mt-daapd/mt-daapd b/community/mt-daapd/mt-daapd new file mode 100755 index 000000000..6cf73b9ee --- /dev/null +++ b/community/mt-daapd/mt-daapd @@ -0,0 +1,33 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +start() { + stat_busy "Starting DAAP server" + /usr/sbin/mt-daapd + stat_done +} + +stop() { + stat_busy "Shutting down DAAP server" + killall -INT mt-daapd + stat_done +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + ;; +esac +exit 0