yashsingh1/xdaforums huggingface dataset:
[Hero, G2 Touch Android Development] FunkAndSoda:
hey there, i know i ask for much but could somebody please explain to me how to get debian working on the hero? i tried the installer.sh from modaco but it doesn't work.

i have to admit that im new to linux but im very interested in it (and willing to learn ;-)) since i have my hero.

some noob questions:

will debian install as second operating system on my device or will it just run like in a virtual machine?

will it harm my running modaco 2.0 system? ;-)
[Hero, G2 Touch Android Development] chetermaat:
Some of us need explenation

Wil the hero still have it's phone functionality ?

Wil Debian run in a sort of virtual machine ?

Wil Modaco V 2 be unharmed ?

What is the reason to run Debian on your Hero ?

Thx C
[Hero, G2 Touch Android Development] FunkAndSoda:
I think its mostly because of you can! ;-)
[Hero, G2 Touch Android Development] grincore:
Yes

Yes and No, a Chroot enviroment acts like a virtual machine but it is runnins natively on your phone, not in an emulated machine. However the Debian system is restricted to running "inside" the chroot (should not be able to modify the undrelying system)

Yes

Like the above poster said "Because you can" and hopely in the future we can add more funcionality to our Androids through debien (like the ability of running airckack, and kismet wich cannot be run right now because we don't have proper wifi drivers: http://bobcopeland.com/android_wifi.html )
[Hero, G2 Touch Android Development] chetermaat:
Nice

Ok I'll try to. Always nice to have a Full OS in my pocket :-)
[Hero, G2 Touch Android Development] felikz:
so my phone has original htc rom, but is rooted (with remount permission).. i need also that tool, which provides cp and all the other commands, alright?
[Hero, G2 Touch Android Development] felikz:
now installed busybox and ran install.sh

but if i start bootdeb, this is the console output:

bootdeb
modprobe: permission denied
clear: permission denied
Android Filesytem remounted as read/write
mknod: permission denied
clear: permission denied

a888a
d888888b
8P YP Y88
8|o||o|88
8. .88
8 ._. Y8.
d/ 8b.
.dP . Y8b.
d8: ::88b.
d8 Y88b
:8P :888
8a. : _a88P
._/ Yaa_ : .| 88P|
\ YP | 8P \.
/ \._____.d| .|
--..__)888888P ._.|

Usage: mount [-r] [-w] [-o options] [-t type] device directory
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
Custom Linux Pseudo Bootstrapper V2.1 - by Mark Walker
WEB: http://www.androidfanatic.com
EML: admin@androidfanatic.com

Starting init process
INIT: Debian booting.....
Running Linux Kernel
sysctl: permission denied
AutoMounter started
Type EXIT to end session
Make sure you do a proper EXIT for a clean kill of Debian!

chroot: permission denied

Shutting down Debian........
fuser: permission denied
fuser: permission denied
Processes killed......
Loopback device shutdown - success
Debian down
Coded by Mark Walker
http://www.androidfanatic.com
admin.androidfanatic.com

Rebooting device to ensure clean takedown.........

actuelly it seems that chroot is missing, but where to get it from?? and obviously also sysctl cannot be run..
[Hero, G2 Touch Android Development] oblika:
Did you run the bootdeb as root (did you 'su' before)?

And what firmware are you running?
[Hero, G2 Touch Android Development] felikz:
FW is 1.5 and yes i run it as root.. the same problem comes if i do it via adb shell (of course).. any idea?

so there are mainly two listed errors:

sysctl: not found

chroot: not found
[Hero, G2 Touch Android Development] J-Zeus:
Excuse a very ignorant question - but what is Debian, and what is it good for?

cheers:)
[Hero, G2 Touch Android Development] oblika:
Hmmm... strange...

I would advise you to install the MoDaCo custom ROM 2.0 (faster if nothing else) - i'm currently using this one and I have successfully booted debian using modified bootdeb script (the one provided - /system/bin/bootdeb - doesn't work):

# Based on Saurik's remount.sh - modified by Mark Walker of http://www.androidfanatic.com
# Email admin@androidfanatic.com

#modprobe ext2
#busybox insmod 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=/system/bin
export mnt=/data/local/mnt

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root

mknod /dev/loop0 b 7 0

clear
echo " "
echo " a888a "
echo " d888888b "
echo " 8P YP Y88 "
echo " 8|o||o|88 "
echo " 8. .88 "
echo " 8 ._. Y8. "
echo " d/ 8b. "
echo " .dP . Y8b. "
echo " d8: ::88b. "
echo " d8 Y88b "
echo " :8P :888 "
echo " 8a. : _a88P "
echo " ._/ Yaa_ : .| 88P| "
echo " \ YP | 8P \. "
echo " / \._____.d| .| "
echo " --..__)888888P ._.|"
echo " "
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 Pseudo Bootstrapper V2.1 - by Mark Walker"
echo "WEB: http://www.androidfanatic.com"
echo "EML: admin@androidfanatic.com"
echo " "
sleep 1
echo "Starting init process"
sleep 1
echo "INIT: Debian booting....."
sleep 1
echo "Running Linux Kernel"
sysctl -w net.ipv4.ip_forward=1
sleep 1
echo "AutoMounter started"
sleep 1
echo "Type EXIT to end session"
echo "Make sure you do a proper EXIT for a clean kill of Debian!"
echo " "
echo "Remember to run /scripts/onetime.sh after your FIRST 'boot'."
echo " "

chroot $mnt /bin/bash

#After exit command is executed clear it all up
echo " "

echo "Shutting down Debian........"

sleep 1

fuser -k /data/local/mnt

#busybox umount -f /data/local/mnt/dev/pts /data/local/mnt/proc /data/local/mnt/sys

#busybox umount /data/local/mnt

fuser -k /dev/block/loop0
#losetup -d /dev/block/loop2

echo "Processes killed......"

echo "Loopback device shutdown - success"
echo "Debian down"
echo "Coded by Mark Walker"
echo "http://www.androidfanatic.com"
echo "admin.androidfanatic.com"
echo " "
echo "Rebooting device to ensure clean takedown........."
sleep 2
reboot

Just make a 'bootdeb' file on your pc and then adb push this file to /system/bin/bootdeb and then in adb shell do a chmod a+x /system/bin/bootdeb

That's how I got it working..

PS:

@modaco:

Please try this bootdeb and if it works replace yours in your custom rom.
[Hero, G2 Touch Android Development] oblika:
http://www.debian.org/

What is Debian?

Debian is a free operating system (OS) for your computer. An operating system is the set of basic programs and utilities that make your computer run. Debian uses the Linux kernel (the core of an operating system), but most of the basic OS tools come from the GNU project; hence the name GNU/Linux.
[Hero, G2 Touch Android Development] J-Zeus:
Cheers - why is t important too Hero / Android?
[Hero, G2 Touch Android Development] felikz:
okay i ran your script, but it wastn possible again (because, when in your script sysctl is called, again the error comes: "sysctl: not found" - same for chroot).. is it possible to geht sysctl and chroot from somewhere??

EDIT:

i also tried it with the modaco rom on my phone.. in this case the sysctl error is solved, but the chroot error is:

chroot: can't execute 'bin/bash': No such file or directory
[Hero, G2 Touch Android Development] NikosA:
Hi!

First of all thanks to the devs for their excellent work.

I've flashed modacos latest rom version 2. I would like to try running debian. When I try to load the ext2 module it fails. I've looked for it on all folders (for example under /system/lib/modules) but it's nowhere. How can we expect it to be loaded if it's missing? Or is it hidden somewhere?

Thanks, Nikos
[Hero, G2 Touch Android Development] enlightener:
you don't have to load ext2 module, it's built into the kernel
[Hero, G2 Touch Android Development] felikz:
refering to my last post:

so i checked it up, my phone does not have a file in /system/bin named bash..

whats wrong with that? do you have this file (or directory)? (/system/bin/bash)

edit:

when i start bootdeb from my phone's terminal i get the following:

chroot: can't change root directory to /data/local/mnt: Operation not permitted
[Hero, G2 Touch Android Development] NikosA:
I see. Initially the command "modprobe ext2" was not commented out in the installer script and thus, while I was executing each command manually to learn/know what I am doing, I was getting an error message.

So, I just should try without modprob-ing then (?).

OK, thanks.
[Hero, G2 Touch Android Development] NikosA:
Great! This works for me as well. It's crazy... running debian on this small handheld.

Thanks a lot, Nikos.
[Hero, G2 Touch Android Development] NikosA:
One note only: when exiting from debian (by executing "exit" of course) I get after the very last line of the script a "not permited!" message although it exits... (=reboots?)?

Not sure what is going on.
[Hero, G2 Touch Android Development] felikz:
which installation instructions did you follow?
[Hero, G2 Touch Android Development] NikosA:
-I've put the respective files (debian.img and the rest) the way it is stated in post #11 of this thread (http://xdaforums.com/showpost.php?p=4421176&postcount=11).

-I changed the "installer.sh" a bit (just changed the bit about giving root permissions _from_ "chmod 4777 *" to "chroot 4777 ???" where ??? I mean each of the following separately: fsrw, bootdeb, unionfs, installer.sh, mountonly).

(hopefully the above is not wrong -- I don't like the idea of giving root permissions to all progs).

- Then I used oblika's bootdeb script to replace the "default"

- Then I executed as superuser (=su):

-sh installer.sh

-bootdeb

-within from debian then execute the /scripts/onetime.sh script

It works :-)
[Hero, G2 Touch Android Development] paulobrien:
Here's the bootdeb script from the forthcoming MCR 2.1.

Enjoy!

Everything else you need is preinstalled in MCR 2.0 (except the debian.img on SD of course!)

P

# Based on Saurik's remount.sh
# Modified by Mark Walker of http://www.androidfanatic.com
# Email admin@androidfanatic.com
# Modified for MCR by Paul O'Brien of http://www.MoDaCo.com
# Email paul@modaco.com

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
echo " "
echo "Android Filesytem remounted as read/write"

export kit=/sdcard/debian
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/loop0 b 7 0

echo " "
echo " a888a "
echo " d888888b "
echo " 8P YP Y88 "
echo " 8|o||o|88 "
echo " 8. .88 "
echo " 8 ._. Y8. "
echo " d/ 8b. "
echo " .dP . Y8b. "
echo " d8: ::88b. "
echo " d8 Y88b "
echo " :8P :888 "
echo " 8a. : _a88P "
echo " ._/ Yaa_ : .| 88P| "
echo " \ YP | 8P \. "
echo " / \._____.d| .| "
echo " --..__)888888P ._.|"
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

sleep 1

echo " "
echo "Starting Debian"
echo " "
sysctl -w net.ipv4.ip_forward=1
sleep 1

echo " "
echo "Make sure you do a proper EXIT (by typing 'EXIT') and remember to run /scripts/onetime.sh after your FIRST 'boot'."
echo " "

chroot $mnt /bin/bash

echo " "
echo "Shutting down Debian........"

sleep 1
fuser -k /data/local/mnt
umount -f /data/local/mnt/dev/pts /data/local/mnt/proc /data/local/mnt/sys
umount /data/local/mnt
fuser -k /dev/block/loop2

rm /dev/loop0

echo " "
echo "Shutdown complete"
echo " "
echo "Coded by Mark Walker - http://www.androidfanatic.com"
echo " "
echo "Modified for MCR by Paul O'Brien - http://www.MoDaCo.com"
echo " "
echo "To ensure clean takedown, you should consider rebooting your device (just type 'reboot'!)"
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
echo " "
echo "Android Filesytem remounted as read/only"
echo " "
echo "Finished!"
[Hero, G2 Touch Android Development] oblika:
It's because you ran the bootdeb on the phone and the phone's shell doesn't allow the reboot command. Why I don't know, but it just doesn't (even if root).

If you run the bootdeb via adb it should reboot your phone once exit was issued.
[Hero, G2 Touch Android Development] NikosA:
GD then. One thing I don't understand is how come the boot-up and shut-down commands are in the same script?

Today I launched the "bootdeb" script and it boots-up and runs-down debian (as the commands tell the system to do so) :-p

(

What has been changed since yesterday is that I resized debian.img from 750MB to 3.5GB

)
[Hero, G2 Touch Android Development] NikosA:
Hmmm... seems that the resizing process [1] or, more likely, copying the 3.5GB file from the computer to the sdcard gave a file of 0 bytes! Something went wrong.

[1] http://www.androidfanatic.com/cms/community-forums.html?func=view&catid=9&id=1610
[Hero, G2 Touch Android Development] cuentawarra:
anyone paired a bluetooth keyboard to the hero for easy tipping?
[Hero, G2 Touch Android Development] NikosA:
That was the next idea of mine as well :-). I still have several problems though after resizing the debian.img. Seems like I've messed up permissions. Once I sort this out and have some time I'll try it out (since I have access to a wireless keyboard).
[Hero, G2 Touch Android Development] felikz:
so lets assume this:

1. wipe phone

2. install modaco 2.0 rom

3. put debian.img to /sdcard/debian/debian.img

4. put bootdeb to /sdcard/debian/bootdeb

5. make bootdeb executable

6. run bootdeb

is this what you have done or at least which should work? or is something missing here?
[Hero, G2 Touch Android Development] NikosA:
felikz,

- follow instructions (in the respective thread) closely to get modaco custom rom version 2

- get debian_v21.zip, unzip and copy over to sdcard. As to where you should put the debian.img and the rest of the utilities, I am not sure that you _have_ to put them under the directories as described in post #11 (must have to do with permissions again). The important thing is to run the script "installer.sh" as a superuser, that is,

a. launch a terminal

b. become superuser by executing "su"

c. execute the script with "sh ./installer.sh"

*** Note that I use(d) oblika's script ***

The script will copy the utilities over to the directory /system/bin and set permissions. After that as a superuser you can execute them anytime from anywhere.

- execute "bootdeb"

That should be it.

Well, I have troubles within debian... so maybe I am giving you wrong directions :-p

a. I get (whenever I install a new app) the following (always at "Processing triggers for man-db"):

fopen: permission denied

b. I did an "apt-get update && apt-get upgrade" and the upgrade process gets stuck in rsyslogd and specifically at "Starting enhanced syslog: rsyslogd"

...it waits till I break it with Ctrl+C (=JogBall + c ).
[Hero, G2 Touch Android Development] NikosA:
OK, just FYI:

(a) the "fopen: permission denied" problem can be solved by changing man's ownership to man:

chown -R man:root /var/cache/man

(found this on the web... http://dreamlinuxforums.org/index.php?PHPSESSID=f2cc8aca3c49e36f18473dcbbf416d7a&topic=4908.15)

(b) don't know why and how but another attempt to "apt-get upgrade" fixed it

Regards, Nikos
[Hero, G2 Touch Android Development] felikz:
****in ****, it just does not work! ive tried it now in exactly the way you explained here (wiped the phone, flashed modaco 2.0 and so on..) but i always get some error.. a little question, did you get ouput when you started installer.sh script? i see in the script, that it should print some lines of text.. but when i executed installer.sh i didnt get that..
[Hero, G2 Touch Android Development] NikosA:
Yeah, I know... it's bothering when it just does not work. But please, no need for bad language :-p

I did not get any output when I execute(d) the installer.sh. I managed to fix almost all errors within debian but there is still something: when launching bootdeb some of the "mount" commands report a failure. Don't have the time now to copy-paste the exact messages.

Question to devs: is it required/good or not necessary/bad to give superuser permissions to all progs under /system/bin? Maybe this is the source of (my) errors?

Regards, Nikos
[Hero, G2 Touch Android Development] Metal_Hurlant:
installer.sh considered harmful

A word of caution to people running shell scripts without checking what it is that they do:

installer.sh contains the following code:

cd /system/bin/
chmod 4777 *

This will make every executable in the /system/bin directly readable and writable by absolutely anyone, and make them all run as super-user processes.

In human-readable terms: Anything you install on your phone can do anything it wants now. No more sandbox. This is a security hole.

Interestingly, that step is also completely unnecessary to get debian working on your android phone.

installer.sh should put its executables under /data/local/bin and leave /system/bin alone. optionally, it could put a sticky bit on bootdeb, although I'm not convinced it's much better than simply telling users to run "su" before running "bootdeb".

Additionally, most of the code in "bootdeb" is fluff, and a proper script doing the same thing should be a few lines long and a few seconds faster.

It should also most certainly not try (and fail) to savagely kill every debian-related processes, and it should not end with a "reboot".

As a small example, these are my scripts, known to work under cyanogen 4.0.4:

"debian" will bring you into the debian chroot, or run a command within it:

# userid check and su wrapping logic goes here. later.

export kit=/sdcard/debian
export bin=/system/bin
export mnt=/data/local/mnt

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root

# sloppy check. should -e a few more things at least
if [ -e /dev/loop2 ]
then
echo debian image already setup.
else
mknod /dev/loop2 b 7 0
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
fi

chroot $mnt /bin/bash $@

"undebian" will unmount the debian image, provided you have no debian process still running:

export mnt=/data/local/mnt
umount $mnt/proc
umount $mnt/sys
umount $mnt/dev/pts
umount $mnt
losetup -d /dev/loop2
rm /dev/loop2

echo "If this didn't work, you still have some debian processes running around."
echo "Kill and retry."

Note that debian processes on android seem deaf to signal 1,3,10 and 15 (SIGHUP, SIGQUIT, SIGUSR1 and SIGTERM). That makes it difficult to gracefully kill them.

Until a fix is found for this, kill -9 is the only way to clean things up there.
[Hero, G2 Touch Android Development] grincore:
Agree with the above poster. Modaco, i think this is an important update for your next release. In the meantime can someone post the default permissions that we should have in /system/bin (form an unmodified ROM)?

Can I chmod everything to 0755?
[Hero, G2 Touch Android Development] paulobrien:
bootdeb is in and ready to rock in 2.1 already, WITHOUT everything being chmodded.

P
[Hero, G2 Touch Android Development] grincore:
Glad to hear that, thanks for the hard work. Will try 2.1 tonight.
[Hero, G2 Touch Android Development] NikosA:
+1

What are the default permissions? Just to be sure we are safe!
[Hero, G2 Touch Android Development] Metal_Hurlant:
Unfortunately, I don't know.

I stupidly ran installer.sh myself before realizing the folly of my ways.

FWIW, I did chmod 755 /system/bin/*, and everything seemed to work.. until I tried to su.

So right now, I'm at 0755 for /system/bin/* , except /system/bin/su that positively needs 4755 since it's in the privilege escalation business.

Nothing else exploded so far. Still, the right way of fixing this would be to look at a fresh ROM install.
[Hero, G2 Touch Android Development] NikosA:
Maybe I am a bit lucky since I did not use the installer.sh but customized it to copy and change permissions for the "utilities". I don't know how safe it is to perform rom flashing frequently (or is it ok... like copying a file?) this is why I want to avoid it.

Regards, Nikos
[Hero, G2 Touch Android Development] grincore:
Checked Modaco 1.1 install file

/system/bin 0755

Netcfg and ping 2755

Su, a2sd 4755
[Windows Mobile Apps and Games] shamus:
Hi probably not many will take advantage of this app, but it is definitely adding some functionality to WM which normally this system is lacking. Mods please conciser that this topic is not about networking using this program but translating the program (hacking exe file) so in my opinion it should be in this section.

What is it for? PPPoE is an application to connect to wifi network with Point-to-Point Protocol over Ethernet authentication. http://en.wikipedia.org/wiki/Pppoe

There is no other application like that for Windows Mobile, at least I could not find it :) The only one that exists is made by NTT DOCOMO in Japan and is in Japanese :D

http://flets.com/spot/pdasetup_download.html

Since I'm not a programmer and I simply cannot create application like that I decided to try to translate it to English with help from online Japanese to English translator and BeeGee_Tokyo who helped me by translating parts where online translation failed THANK YOU!

How to start:

Install PPPoE.cab file on your device, it will create folder inside program files, name of the folder is in Japanese and if you are using wwe version you will see squares, you can safely rename this folder to PPPoE or whatever you want, the same with original exe file (you can delete it if you want). Please put my modified exe inside this folder (it is in PPPoE.zip file). I'm testing this program on my Topaz with WM6.1 TESS 2.2.1 but program might be device and system specific so it might not work on your device at all. You can also change .lnk file inside \windows\start menu\programs to correspond exe file name change.

Things left to do:

- translate last missing bits if possible,

- find a way to create a cab file with embedded translated exe, till now MSCEinf and WinCECabManager are unable to help me with that anyone can help?

- test the program in real life environment PPPoE authentication over wifi (I don't have access to such network at the moment) and on what devices it works.

UPDATE - Probably final translation, corrected some minor mistakes, still I can't find a way to translate one error page and about page but program is fully functional now, have fun.
[Windows Mobile Apps and Games] BeeGee_Tokyo:
Translation

I am sure this is not perfect, but it should be good enough to understand the program.

Most of the translation is done by Google :p I just corrected grammar a little bit and translated Katakana words, where Google usually fails.
[Windows Mobile Apps and Games] shamus:
Thank you BeeGee I corrected most of the problem I had with online translation thanks to you so program is ready, I will apply some minor changes and upload final version soon.
[Windows Mobile Apps and Games] ilMessia:
It doesn't work on my i780 even if i rename it like the japanese one (wich works):(
[Windows Mobile Apps and Games] shamus:
I think it is some kind of problem with certificates or security policies or signing of the program, I'll investigate this and will let you know.
[Windows Mobile Apps and Games] cray-1:
certificate error

Hi!

I need this program because my adsl "router" (of Telecom Italia) have locked configuration..

I have htc touch pro with original Rom 5.05.408.1 ITA and when I launch your translated program, Windows return a certificate error! :(

mmmh I have question for you..

Can you create a PDF with screenShot in English and japanese for each window, so we can use the japanese version? :p

thank you very much!

bye!
[Windows Mobile Apps and Games] ilMessia:
Any news? At least, can you post screenshot of yours so we can use the japanese one?
[Windows Mobile Apps and Games] baucha:
Stuck at PPPoE AC discovery search

Well, I tried this program and ran it successfully. I entered all the necessary info n also changed the MAC as required using mtty. But when i connect it says connecting and gets stuck at PPPoE AC discovery search. I can connect with my notebook without any problem over wifi.

Anyone has any idea about it? anyone successful?