Google Android and Linux for KAISER!!

Search This thread

enatefox

Senior Member
Jul 4, 2008
1,846
3
Anybody know how to set up system-wide SOCKS5 proxy support? I got ConnectBot and can get connected to my server at home and want all DNS and regular traffic tunnelled through. I think Opera mini for Android is probably the worst browser next to the built-in one so I can't imagine it supports it. I'd like every widget, etc. through the tunnel. Any ideas? I've seen how to tether to a computer and give the computer a proxy through the phone modem but that's not the same.
 

enatefox

Senior Member
Jul 4, 2008
1,846
3
I would assume that the SSH implementation would be the same but not sure. I guess there's really one way to find out.

I would need a data.img that has texts saved and preferably one with a send error. This isn't exactly rocket science though. How good are you at SQL? I posted this but didn't hear back. At any rate, you just need to map the features needed (are they sending but saying failed? anything else?) and where they are handled by HTC's app. I can't get specific when a dump of the tables shows nothing to look at.
 

roadhead

Senior Member
Dec 23, 2008
86
3
Wifi Works! I was even able to leave my office, have the 3g kick on by itself, and then revert back to Wifi when I was in range.

This is as good as my wife's G1 in that regard (better actually, as she goes from Wifi to EDGE)

Build is very fast moving about, never have to wait for Clock, Calender, Weather widgets to reload on the home screen :)

All in all I must say this project has come a long way from the first time I tried to use it, and found that I couldn't have working data AND a screen that flipped the correct way :)

Thanks a ton to all the developers who have worked so hard on this.

Cheers!
 

ibanezbass

Senior Member
Jan 29, 2009
295
127
Oklahoma City
enatefox, i'm having a major brainfart lol how do u mount the data.img

scratch that i got it..

now what command do i need to run in sqlite3? if i type in .database i can see one called main

nevermind got it dumped. is that what u need? i'll pm it to u if it is.
 
Last edited:

enatefox

Senior Member
Jul 4, 2008
1,846
3
You got anything good? ".tables" will show the tables, then you can "select * from <table_name>;" until you see stuff. Look for something related to error or fail. I'm used to MS SQL and MySQL but I'm sure I can translate some stored procedures I have that let me do full text searches and the like. You can send me the db files if you want so I can look for what to look for but unless you're randomizing the data, I'll have your personal info on it.
 

ibanezbass

Senior Member
Jan 29, 2009
295
127
Oklahoma City
1|1|0|4xxxxxxxx0||xxxxxxxxxxxxxx||1|-1|2|||Hey|0||
2|1|129|1xxxxxxxxx0||xxxxxxxxxxxx|0|0|-1|1|0||Hey|145||+xxxxxxxxxx
3|1|129|1xxxxxxxxx0||xxxxxxxxxxxx|0|0|-1|1|0||Hey|145||+xxxxxxxxxx

first is sent, second are recieved. i sent the first then hit edit and sent it again but thats what it looks like on my phone.

also theres
Code:
... WHERE thread_id = new.thread_id        AND (m_type=132 OR m_type=130 OR m_type=128)        AND msg_box != 3         AND pdu.m_id is NULL) +      (SELECT COUNT(DISTINCT pdu.m_id) FROM pdu LEFT JOIN threads       ON threads._id = thread_id      WHERE thread_id = new.thread_id        AND (m_type=132 OR m_type=130 OR m_type=128)        AND msg_box != 3        AND pdu.m_id is not NULL)   WHERE threads._id = new.thread_id;   UPDATE threads SET read =     CASE (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = threads._id)      WHEN 0 THEN 1      ELSE 0    END  WHERE threads._id = new.thread_id;   UPDATE threads SET unread_count =     (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = threads._id) +     (SELECT COUNT(*)          FROM pdu          WHERE read = 0            AND thread_id = threads._id)  WHERE threads._id = new.thread_id; END;
CREATE TRIGGER pdu_update_thread_read_on_update AFTER  UPDATE OF read  ON pdu   WHEN new.m_type=132    OR new.m_type=130    OR new.m_type=128 BEGIN   UPDATE threads SET read =     CASE (SELECT COUNT(*)          FROM pdu          WHERE read = 0            AND (m_type=132              OR m_type=130)            AND thread_id = threads._id)      WHEN 0 THEN 1      ELSE 0    END  WHERE threads._id = new.thread_id;   UPDATE threads SET unread_count =     (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = threads._id) +     (SELECT COUNT(*)          FROM pdu          WHERE read = 0            AND thread_id = threads._id)  WHERE threads._id = new.thread_id; END;
CREATE TRIGGER sms_update_thread_read_on_update AFTER  UPDATE OF read  ON sms BEGIN   UPDATE threads SET read =     CASE (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = threads._id)      WHEN 0 THEN 1      ELSE 0    END  WHERE threads._id = new.thread_id;   UPDATE threads SET unread_count =     (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = threads._id) +     (SELECT COUNT(*)          FROM pdu          WHERE read = 0            AND thread_id = threads._id)  WHERE threads._id = new.thread_id; END;
CREATE TRIGGER sms_update_thread_on_delete AFTER DELETE ON sms BEGIN   UPDATE threads SET      date = (strftime('%s','now') * 1000)   WHERE threads._id = old.thread_id;   UPDATE threads SET message_count =      (SELECT COUNT(sms._id) FROM sms LEFT JOIN threads       ON threads._id = thread_id      WHERE thread_id = old.thread_id        AND sms.type != 3) +      (SELECT COUNT(pdu._id) FROM pdu LEFT JOIN threads       ON threads._id = thread_id      WHERE thread_id = old.thread_id        AND (m_type=132 OR m_type=130 OR m_type=128)        AND msg_box != 3)   WHERE threads._id = old.thread_id;   UPDATE threads SET unread_count =     (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = old.thread_id) +     (SELECT COUNT(*)          FROM pdu          WHERE read = 0            AND thread_id = old.thread_id)  WHERE threads._id = old.thread_id;   UPDATE threads SET snippet =    (SELECT snippet FROM     (SELECT date * 1000 AS date, sub AS snippet, thread_id FROM pdu        WHERE m_type=132 OR m_type=130 OR m_type=128      UNION SELECT date, body AS snippet, thread_id FROM sms)    WHERE thread_id = OLD.thread_id ORDER BY date DESC LIMIT 1)   WHERE threads._id = OLD.thread_id;   UPDATE threads SET snippet_cs =    (SELECT snippet_cs FROM     (SELECT date * 1000 AS date, sub_cs AS snippet_cs, thread_id FROM pdu        WHERE m_type=132 OR m_type=130 OR m_type=128      UNION SELECT date, 0 AS snippet_cs, thread_id FROM sms)    WHERE thread_id = OLD.thread_id ORDER BY date DESC LIMIT 1)   WHERE threads._id = OLD.thread_id;   UPDATE threads SET priority =    (SELECT priority FROM     (SELECT date * 1000 AS date, pri AS priority, thread_id FROM pdu        WHERE m_type=132 OR m_type=130 OR m_type=128      UNION SELECT date, 0 AS priority, thread_id FROM sms)    WHERE thread_id = OLD.thread_id ORDER BY date DESC LIMIT 1)   WHERE threads._id = OLD.thread_id; END;
CREATE TRIGGER pdu_update_thread_on_delete AFTER DELETE ON pdu BEGIN   UPDATE threads SET      date = (strftime('%s','now') * 1000)  WHERE threads._id = old.thread_id;   UPDATE threads SET message_count =      (SELECT COUNT(sms._id) FROM sms LEFT JOIN threads       ON threads._id = thread_id      WHERE thread_id = old.thread_id        AND sms.type != 3) +      (SELECT COUNT(pdu._id) FROM pdu LEFT JOIN threads       ON threads._id = thread_id      WHERE thread_id = old.thread_id        AND (m_type=132 OR m_type=130 OR m_type=128)        AND msg_box != 3)   WHERE threads._id = old.thread_id;   UPDATE threads SET unread_count =     (SELECT COUNT(*)          FROM sms          WHERE read = 0            AND thread_id = old.thread_id) +     (SELECT COUNT(*)          FROM pdu          WHERE read = 0            AND thread_id = old.thread_id)  WHERE threads._id = old.thread_id;   UPDATE threads SET snippet =    (SELECT snippet FROM     (SELECT date * 1000 AS date, sub AS snippet, thread_id FROM pdu        WHERE m_type=132 OR m_type=130 OR m_type=128      UNION SELECT date, body AS snippet, thread_id FROM sms)    WHERE thread_id = OLD.thread_id ORDER BY date DESC LIMIT 1)   WHERE threads._id = OLD.thread_id;   UPDATE threads SET snippet_cs =    (SELECT snippet_cs FROM     (SELECT date * 1000 AS date, sub_cs AS snippet_cs, thread_id FROM pdu        WHERE m_type=132 OR m_type=130 OR m_type=128      UNION SELECT date, 0 AS snippet_cs, thread_id FROM sms)    WHERE thread_id = OLD.thread_id ORDER BY date DESC LIMIT 1)   WHERE threads._id = OLD.thread_id;   UPDATE threads SET priority =    (SELECT priority FROM     (SELECT date * 1000 AS date, pri AS priority, thread_id FROM pdu        WHERE m_type=132 OR m_type=130 OR m_type=128      UNION SELECT date, 0 AS priority, thread_id FROM sms)    WHERE thread_id = OLD.thread_id ORDER BY date DESC LIMIT 1)   WHERE threads._id = OLD.thread_id; END;
CREATE TRIGGER delete_obsolete_threads_pdu AFTER DELETE ON pdu BEGIN   DELETE FROM threads   WHERE     _id = old.thread_id     AND _id NOT IN     (SELECT thread_id FROM sms      UNION SELECT thread_id from pdu); END;
CREATE TRIGGER delete_obsolete_threads_when_update_pdu AFTER UPDATE OF thread_id ON pdu WHEN old.thread_id != new.thread_id BEGIN   DELETE FROM threads   WHERE     _id = old.thread_id     AND _id NOT IN     (SELECT thread_id FROM sms      UNION SELECT thread_id from pdu); END;
CREATE TRIGGER delete_obsolete_threads_sms AFTER DELETE ON sms BEGIN   DELETE FROM threads   WHERE     _id = old.thread_id     AND _id NOT IN     (SELECT thread_id FROM sms      UNION SELECT thread_id from pdu); END;
CREATE TRIGGER insert_mms_pending_on_insert AFTER INSERT ON pdu WHEN new.m_type=130  OR new.m_type=135 BEGIN   INSERT INTO pending_msgs    (proto_type,     msg_id,     msg_type,     err_type,     err_code,     retry_index,     due_time)   VALUES     (1,      new._id,      new.m_type,0,0,0,0);END;
CREATE TRIGGER insert_mms_pending_on_update AFTER UPDATE ON pdu WHEN new.m_type=128  AND new.msg_box=4  AND old.msg_box!=4 BEGIN   INSERT INTO pending_msgs    (proto_type,     msg_id,     msg_type,     err_type,     err_code,     retry_index,     due_time)   VALUES     (1,      new._id,      new.m_type,0,0,0,0);END;
CREATE TRIGGER delete_mms_pending_on_update AFTER UPDATE ON pdu WHEN old.msg_box=4  AND new.msg_box!=4 BEGIN   DELETE FROM pending_msgs  WHERE msg_id=new._id; END;
CREATE TRIGGER delete_mms_pending_on_delete AFTER DELETE ON pdu BEGIN   DELETE FROM pending_msgs  WHERE msg_id=old._id; END;
CREATE TRIGGER update_threads_error_on_update_mms   AFTER UPDATE OF err_type ON pending_msgs   WHEN (OLD.err_type < 10 AND NEW.err_type >= 10)    OR (OLD.err_type >= 10 AND NEW.err_type < 10) BEGIN  UPDATE threads SET error =     CASE      WHEN NEW.err_type >= 10 THEN error + 1      ELSE error - 1    END   WHERE _id =   (SELECT DISTINCT thread_id    FROM pdu    WHERE _id = NEW.msg_id); END;
CREATE TRIGGER update_threads_error_on_delete_mms   BEFORE DELETE ON pdu  WHEN OLD._id IN (SELECT DISTINCT msg_id                   FROM pending_msgs                   WHERE err_type >= 10) BEGIN   UPDATE threads SET error = error - 1  WHERE _id = OLD.thread_id; END;
CREATE TRIGGER update_threads_error_on_move_mms   BEFORE UPDATE OF msg_box ON pdu   WHEN (OLD.msg_box = 4 AND NEW.msg_box != 4)   AND (OLD._id IN (SELECT DISTINCT msg_id                   FROM pending_msgs                   WHERE err_type >= 10)) BEGIN   UPDATE threads SET error = error - 1  WHERE _id = OLD.thread_id; END;
CREATE TRIGGER update_threads_error_on_update_sms   AFTER UPDATE OF type ON sms  WHEN (OLD.type != 5 AND NEW.type = 5)    OR (OLD.type = 5 AND NEW.type != 5) BEGIN   UPDATE threads SET error =     CASE      WHEN NEW.type = 5 THEN error + 1      ELSE error - 1    END   WHERE _id = NEW.thread_id; END;
CREATE TRIGGER update_threads_error_on_delete_sms   AFTER DELETE ON sms  WHEN (OLD.type = 5) BEGIN   UPDATE threads SET error = error - 1  WHERE _id = OLD.thread_id; END;
CREATE TRIGGER part_cleanup DELETE ON pdu BEGIN   DELETE FROM part  WHERE mid=old._id;END;
CREATE TRIGGER addr_cleanup DELETE ON pdu BEGIN   DELETE FROM addr  WHERE msg_id=old._id;END;
CREATE TRIGGER cleanup_delivery_and_read_report AFTER DELETE ON pdu WHEN old.m_type=128 BEGIN   DELETE FROM pdu  WHERE (m_type=134    OR m_type=136)    AND m_id=old.m_id; END;
 
Last edited:

enatefox

Senior Member
Jul 4, 2008
1,846
3
pending_msgs has this schema:
Code:
err_type INTEGER,err_code INTEGER,retry_index INTEGER NOT NULL DEFAULT 0,due_time INTEGER,last_try INTEGER

CREATE TRIGGER update_threads_error_on_update_mms   AFTER UPDATE OF err_type ON pending_msgs   WHEN (OLD.err_type < 10 AND NEW.err_type >= 10)    OR (OLD.err_type >= 10 AND NEW.err_type < 10) BEGIN  UPDATE threads SET error =     CASE      WHEN NEW.err_type >= 10 THEN error + 1      ELSE error - 1    END   WHERE _id =   (SELECT DISTINCT thread_id    FROM pdu    WHERE _id = NEW.msg_id); END;
pdu holds the thread ID to reference the error and updates the threads table with an error ID. And so it continues as databases go.

You can send me the info, but I'll have private texts so you may want to go through for names and numbers. This is where I would start though. There should exist entries in threads where error is not null and <> 0 for example.

*EDIT, you pretty much should have it in your post above me now. Should find a better way to go over this. Can you create a new data.img, just text a couple of times to yourself or whatever and then after anonymizing it, send it my way? These are separate file-based db's but maybe we can profile it as it is sending via ADB.
 
Last edited:

polyrhythmic

Senior Member
Oct 19, 2007
536
7
Seattle
www.doublerebel.com
Anybody know how to set up system-wide SOCKS5 proxy support? I got ConnectBot and can get connected to my server at home and want all DNS and regular traffic tunnelled through.

ConnectBot supports setting up SSH tunnels, including SOCKS5. Forwarding your browser through them seems to be a bit complicated.

I found this source which recommends a mini-debian install and using Privoxy.

That technique adds a proxy setting directly into the connection database, and I imagine it would work system-wide. Also. the shell commands could be scripted to make the process easier.

Most of the other results I get are related to SOCKS proxies not working.

I too would like to be able to forward traffic through my home network. I'm not as familiar with the Android internals as you are, but I'd be happy to help beta test and debug!
 

enatefox

Senior Member
Jul 4, 2008
1,846
3
Sweet, thanks poly. I have not heard anything back on why I can't and how to load the ext2 module into the kernel. I used to be able to boot Ubuntu on Android but now I've got errors. So.. you've taught me that not only do I fail at chrooting Ubuntu but that I fail at SOCKS as a direct result.
Specifically:
Code:
bash-3.2# modprobe ext2.ko
modprobe: chdir(2.6.25-00864-g0b26332): No such file or directory
bash-3.2# insmod ext2.ko
insmod: cannot insert 'ext2.ko': Cannot allocate memory


ibanezbass, just ones you send yourself don't have an error? I'm looking around the databases to make sure I got the layout down now. Next is I'll send you some scripts that will dump output into a spreadsheet or something with the info then we'll figure out what's next once we're looking at the same thing. Also, this is a good guide at what to do if you need a quick start: http://davanum.wordpress.com/2007/12/11/android-how-to-poke-around-the-sqlite3-databases/
 
Last edited:

dzo

Senior Recognized Developer
Apr 3, 2008
2,487
5,086
Auckland
Sweet, thanks poly. I have not heard anything back on why I can't and how to load the ext2 module into the kernel. I used to be able to boot Ubuntu on Android but now I've got errors. So.. you've taught me that not only do I fail at chrooting Ubuntu but that I fail at SOCKS as a direct result.
Specifically:
Code:
bash-3.2# modprobe ext2.ko
modprobe: chdir(2.6.25-00864-g0b26332): No such file or directory
bash-3.2# insmod ext2.ko
insmod: cannot insert 'ext2.ko': Cannot allocate memory


ibanezbass, just ones you send yourself don't have an error? I'm looking around the databases to make sure I got the layout down now. Next is I'll send you some scripts that will dump output into a spreadsheet or something with the info then we'll figure out what's next once we're looking at the same thing. Also, this is a good guide at what to do if you need a quick start: http://davanum.wordpress.com/2007/12/11/android-how-to-poke-around-the-sqlite3-databases/

ext2 is built into the kernel already which is why it complains. Only G1/Magic users would need that module.
 

enatefox

Senior Member
Jul 4, 2008
1,846
3
Thanks for your help. So, how come I can't chroot Ubuntu then? Booting now, I got your message after copying it to /lib/modules in rootfs..

Code:
bash-3.2# mknod /dev/loop2 b 7 0
bash-3.2# cd /sdcard/debian
bash-3.2# ls
debian.img mnt
bash-3.2# mount -o loop,noatime debian.img mnt
mount: cannot setup loop device: No such file or directory
Code:
bash-3.2# mount
rootfs on / type rootfs (rw)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop2 on / type ext2 (ro,sync,noatime,nodiratime,errors=continue)
tmpfs on /dev type tmpfs (rw,size=100k)
proc on /proc type proc (rw)
sys on /sys type sysfs (rw)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/mmcblk0p1 on /cache type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop0 on /data type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/loop1 on /system type cramfs (ro,noatime,nodiratime)
/dev/block/loop0 on /etc type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/loop0 on /shared_prefs type ext2 (rw,sync,noatime,nodiratime,errors=continue)
/dev/block/mmcblk0p1 on /tmp type vfat (rw,noatime,nodiratime,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1,flush)
/dev/block/loop0 on /smodem type ext2 (rw,sync,noatime,nodiratime,errors=continue)
tmpfs on /dev type tmpfs (rw,mode=755)
devpts on /dev/pts type devpts (rw,mode=600)
tmpfs on /sqlite_stmt_journals type tmpfs (rw,size=4096k)
Alright, stupid mistake in that it's not ext2 support related. But what's with not being able to set up the loop device?
 
Last edited:

vilord

Senior Member
Aug 4, 2007
942
2
Boston
use losetup... take a look at the init file to see how it is done...

The other reason you can't chroot ubuntu is because you're using a file called "debian.img"
That likely only contains debian and not ubuntu ;)
 
Last edited:

enatefox

Senior Member
Jul 4, 2008
1,846
3
Code:
bash-3.2# mknod /dev/loop7 b 7 0
bash-3.2# losetup /dev/loop7 debian.img
losetup /dev/block/loop7 /sdcard/debian/debian.img
mount -t ext2 -o noatime,nodiratime,sync /dev/block/loop7 /sdcard/debian/mnt
And it works. Now:
Code:
bash-3.2# chroot /sdcard/debian/mnt/ /bin/bash
Bus error
My assumption is not having mounted /proc, /sys, etc. so I did this in case:
Code:
mount -t devpts devpts /sdcard/debian/mnt/dev/pts 
mount -t proc proc /sdcard/debian/mnt/proc 
mount -t sysfs sysfs /sdcard/debian/mnt/sys
Still.. and mount is showing that they did mount
 
Last edited:
Terminal Help

I am getting an access denied message when attempting to turn swapfile on in terminal emulator. I remember some having troubles when attempting to use term. Emulator to turn on WiFi (gettin calibration) but I never had any trouble. This is a new build (black hero from zen) as suggested by enatefox. What can I do to troubleshooting this problem and turn swap on?
 

enatefox

Senior Member
Jul 4, 2008
1,846
3
Oh you.. you're not using my mod of Zen's image I guarantee that. You either can mod the system.img so that /bin/su and /xbin/su are chmod 4755 or, if that sounds like crazy-talk, you can just type "/bin/su" instead and it will work.

The easiest method though, is use Zen's uploaded rootfs with compcache and swap (both) from 8-16 and you'll be golden. I personally use 60Mb swap with compcache. I have all 7 screens loaded with widgets and it is quicker than WM6 in my opinion. Enjoy the glory.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Is anyone having problems charging on Kaiser? I'm was using the latest basefiles and system-xrom1.4r3.sqsh so I switched to the Google-Ion-2009-09-12 bundle both from vogue-android on google code with fresh data.img, same problem. Charging will work for the first few hours and then without any changes, it will stop. It will charge for like 30 seconds and stop charging and the battery icon will go back to normal and in "battery status" it shows "not charging". A regular soft reboot will not fix this for some reason. Charges just fine in windows mobile, but to use android I have to reboot and charge in wm6 and when fully charged switch back to android. Anyone experienced this?
    1
    Nice, I got it working on L26 V4 worked 1st time :)

    Still a bit buggy of course but getting there

    is l26 an lg device?

    I will provide a zImage with our latest changes from the linuxtogo git later this day.

    I will also upload a console image for testing purpose later (you can read the AT data from the arm9 in it. Just create a device node using mknod dev/smd0 254 2 and use cat /dev/smd0 to read from it. you will see incoming calls, sms etc.)
    This is one of the current mayor problems: We can read from the AT buffer but not write to it which is essential for any phone operations i.e. writing sms, making phone calls but also for using the gps. The gps deveice in kaiser is controlled also with AT send buffer. So once we hve it working we only need the msm_proc_comm work to make calls on the kaiser! If somebody knows what I'm talking about please have a look in arch/arm/mach-msm/smd-kaiser.c

    Any hints/improvements appreaciated
    1
    Can't make phone call

    Hi every ones!!! :)

    Android boot excellent, have internet connection but I can't make calls.

    Someone can help me.

    Thank you!!!
    1
    I have a question: can I access my phone via USB when my phone is booted into Android and my computer is running Linux? It would makes sense to me, but it doesn't seem to be working.