First look at Plugbox for HTC Android phones

This commit is contained in:
Mike Staszel 2010-07-10 05:43:32 -07:00
parent 9b9334bc2c
commit 5dcd36d0da
7 changed files with 222 additions and 0 deletions

View file

@ -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

4
androidphones/plugbox/fsrw Executable file
View file

@ -0,0 +1,4 @@
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
echo "Filesytem remounted as read/write"

47
androidphones/plugbox/mountonly Executable file
View file

@ -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

View file

@ -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'"

20
androidphones/plugbox/unionfs Executable file
View file

@ -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

34
community/mt-daapd/PKGBUILD Executable file
View file

@ -0,0 +1,34 @@
# Maintainer: Mike Staszel <mikestaszel@plugboxlinux.org>
# Contributor: Jon Kristian Nilsen <jokr.nilsen@gmail.com>
# 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
}

33
community/mt-daapd/mt-daapd Executable file
View file

@ -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