Related
Hey everyone!!
Since if got new phone (Moto Milestone), i was wondering is it possible to install linux (gentoo, debian) on my old G1?
So, not in chroot, but as only OS on device! i dont need GUI, just shell. I was thinking that /, boot, etc, bin and maybe some more would be in device rom, and rest on sdcard!!
3g modem is not important to work, but wifi and gps are must!!
can this be done? i want to find some use of my old, but faithfull, G1!!
P.S. mods, if I posted this in wrong topic, I appologize!
thx for any hints. i have 6+ years on linux experience, mostly with gentoo, so recompiling and configuring isn't big problem!!
Sent from my Milestone
amossam said:
Hey everyone!!
thx for any hints. i have 6+ years on linux experience, mostly with gentoo, so recompiling and configuring isn't big problem!!
Click to expand...
Click to collapse
so do it then
not sure why you think its difficult
Firerat said:
so do it then
not sure why you think its difficult
Click to expand...
Click to collapse
well, i think it wouldn't be easy, and I'm asking is it possible!
with all due respect, i don't think that yours tone is in place.
so just for your info, i appreciate your work werry much!
i don't know too much about booting process of G1, but i know that SPL transfers boot process to kernel, so i assume that there is no boot flag! and i cannot find any detailed explanation of booting process that is detailed and easy to understand...
so, instead of using that tone, i would be gratefull if you have any link to share!!
Sent from my Milestone
amossam said:
well, i think it wouldn't be easy, and I'm asking is it possible!
with all due respect, i don't think that yours tone is in place.
so just for your info, i appreciate your work werry much!
i don't know too much about booting process of G1, but i know that SPL transfers boot process to kernel, so i assume that there is no boot flag! and i cannot find any detailed explanation of booting process that is detailed and easy to understand...
so, instead of using that tone, i would be gratefull if you have any link to share!!
Sent from my Milestone
Click to expand...
Click to collapse
i have 6+ years on linux experience, mostly with gentoo, so recompiling and configuring isn't big problem!!
Click to expand...
Click to collapse
here is a very usefull link
http://www.google.com
it is great for doing internet searches
don't clam to be some linux guru if you are not
http://www.unixweblog.com/2010/03/htc-dreamg1-dual-boot-native-debian/
and here is how I found it
I googled
native linux on g1
you will see links to xda
its been done, and done and done
there is absolutely nothing wrong with the firerat's tone. I actually thanked him for that post... it was classic firerat!
I think if you learned how to use the search function.. you will see it haz been done. google is your best friend!! hey, bing works as well. ask jeeves may not... but such is the element of being a man of linus -- most linux people dont go into a police station and ask for the number to dial 911 and where they can dial this number to get some police help.
jesus.......i just did a search... it goes all the way back to the days of jesus h freke. 1998.
just frigging search. how can you operate a phone and not be able to operate a basic google search..
hold one second... my 4 year old dog who has half his chromosomes just did it...wow.... here it is.. http://forum.xda-developers.com/showthread.php?t=444419&page=40
plz dont thank me either. if you must thank someone, thank firerat... but i dont know if he wants your thanx.
have fun chrootin! and its good to see people care enough about their dream to not toss it in the recycle bin at tmobile. those things are powerful.
Firerat said:
here is a very usefull link
http://www.google.com
it is great for doing internet searches
don't clam to be some linux guru if you are not
http://www.unixweblog.com/2010/03/htc-dreamg1-dual-boot-native-debian/
and here is how I found it
I googled
native linux on g1
you will see links to xda
its been done, and done and done
Click to expand...
Click to collapse
its like watching fire be invented all over again!
i humbly applogise that i asked one question. i did some research but i couldn't get the right keywords...
btw, i didn't said that i'm linux guru, only that i have experience...
nwm, i'll move on on my own...
can please mod lock this or delete, obviously this is another stupid duplicate post...
Sent from my Milestone
amossam said:
i humbly applogise that i asked one question. i did some research but i couldn't get the right keywords...
btw, i didn't said that i'm linux guru, only that i have experience...
nwm, i'll move on on my own...
can please mod lock this or delete, obviously this is another stupid duplicate post...
Sent from my Milestone
Click to expand...
Click to collapse
install linux on g1
http://www.htc-dream-g1.net/en/Linux/Debian/Native
currently the 4th hit
Firerat said:
install linux on g1
http://www.htc-dream-g1.net/en/Linux/Debian/Native
currently the 4th hit
Click to expand...
Click to collapse
how simple can you get? lol
{Mod edit}
Here's how to do this:
HTC Dream Native Debian Linux - bibanon/android-development-codex WikiThis guide was mostly organized by Novaspirit, refined on the Debian Wiki, and based on notes from XDA-Developers.
Here, we've fixed some glaring errors and updated it for Debian squeeze.
This guide will create a dual-boot Linux and Android system. The phone will boot normally into Android; just hold home+power when turning on to enter Debian Linux.
Working / Not WorkingWorking
Phone can boot!
SDCard reader/writer
Keyboard
LEDs
Touchscreen
Vibrator
USB Ethernet
Xorg with OpenMoko Kernel
Phone Call : I am able to answer an incomming call from console!
Unlock SIM Card and register on Network
Working with bugs
Trackball - No event on click with ball - must click and move ball slightly
TouchScreen (MonoTouch) - I can use it in console FBDEV, but with Xorg, the calibration doesn’t work - calibration is very difficult but doable
ALSA - Sound is low, when phone works, sound is very low, and alsamixer, for select OutPut has device bugs.
Xorg with my Kernel - The phone crashes (freeze) when you leave Xorg found this only happens sometimes not all
Not working
WiFi card is detected, but crashes when doing “ifconfig wlan0 up”.
Not tested
GPS
Accelerometers/Compas
Other USB Gadgets, like Storage
Bluetooth
Internet throug GSM/3G APN
Power management
Accelerated GL
Camera
TouchScreen (MultiTouch)
HOWTOYou will need:
A laptop with Debian-based Linux (Ubuntu, Debian, Linux Mint, etc.)
Just run it off a live CD
An HTC Dream/G1 or MyTouch 3G
8GB or larger SDCard
4GB for Linux, 4GB for Android
An Android 1.6 or higher Custom ROM that supports EXT2/3
only a few older Android versions lack it.
USB Debugging Enabled
HardSPL and Engineering SPL
gives you fastboot support
ADB and Fastboot
The easiest way to install them is to use Minimal ADB.
Partitioning the SDCard
It's possible to use Android itself to partition it, but that's another guide...
Click to expand...
Click to collapse
obtain gparted using:
sudo apt-get install gparted
select your sdcard and select it on the top right menu
You will need three partitions:
fat32 (android)
ext3 (android apps and stuff if you got app2sd)
ext3 (debian)
For example, an 8GB SDCard would be partitioned like this:
2 GB FAT32 for Android
2 GB EXT3 for app2sd
4 GB EXT3 for my real Debian
After creating the partitions, make sure to record the names, found in gparted's top-right corner (ex. /dev/sdb1, /dev/sdc6).
The G1 will see those partitions with names: /dev/mmcblk0p3 or whatnot. Just add the last number of the /dev/sdb1 name, replacing that 3.
Keep your SDCard plugged in.
Generate the Debian Root Filesystem with debootstrapWe will use debootstrap to install all the necessary system packages to an image, which you will flash onto the G1.
mkdir debdroid
sudo /usr/sbin/debootstrap --foreign --arch armel squeeze debdroid/ http://http.debian.net/debian
Copy debootstrap to the SDCardWe now need to copy the system image to the G1. Change /dev/sdb3 to the EXT3 partition for Debian on your SDCard (The names were previously obtained from GParted).
mount /dev/sdb3 /mnt/memory # change correct device
sudo cp -pfr debdroid/* /mnt/memory/
umount /mnt/memory
debootstrap Second StageNow reboot into your G1, and connect it to the computer to begin the second phase of installation. Make sure USB Debugging is enabled, and your phone is recognized by ADB.
Mount the debian EXT3 partition:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Now your debian partition should be mounted to file system at /data/mnt
Next, we will chroot into the debian partition to start the second stage of installation. This will take about 25 minutes, so be patient and keep your phone charged.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /debootstrap/debootstrap --second-stage
umount /data/mnt
rmdir /data/mnt
Set the SSH service to start on bootWe will need an SSH service running on the G1 for internet tethering from the PC. We have to install Galoula's SSH modules, and edit configuration files to start SSH on boot.
Insert the sdcard back into your Linux PC and run these commands:
(replace /dev/sdb2 with the name of your debian EXT3 partition)
(the package links will have to be updated for squeeze)
mount /dev/sdb2 /mnt
cd /mnt/tmp
wget http://www.galoula.net/fr/Tutoriels...ALOULA-001/Modules-2.6.32_GALOULA-001.tar.bz2
tar -jxvf Modules-2.6.32_GALOULA-001.tar.bz2 -C ..
echo g_ether >> ../etc/modules
echo "auto lo" >> ../etc/network/interfaces
echo "iface lo inet loopback" >> ../etc/network/interfaces
echo "auto usb0" >> ../etc/network/interfaces
echo "iface usb0 inet static" >> ../etc/network/interfaces
echo " address 192.168.0.202" >> ../etc/network/interfaces
echo " netmask 255.255.255.192" >> ../etc/network/interfaces
echo " network 192.168.100.0" >> ../etc/network/interfaces
echo " gateway 192.168.0.200" >> ../etc/network/interfaces
echo "none /sys sysfs rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "none /proc proc rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "udev /dev tmpfs rw,size=10240k,mode=755 0 0" >> ../etc/fstab
echo "devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0" >> ../etc/fstab
echo "HTC-Dream" > ../etc/hostname
echo "127.0.0.1 localhost HTC-Dream" > ../etc/hosts
cat /etc/resolv.conf > ../etc/resolv.conf
mkdir ../dev/pts
sync
cd
umount /mnt
Later on, we will also install the SSH packages on the phone itself.
Now insert the sdcard back into the G1, and plug the G1 into the computer.
Chroot Setup
Note: Don't worry; we are still installing Native Debian Linux. We are only temporarily using a chroot for greater convenience when pumping in commands.
Click to expand...
Click to collapse
Make sure your Android G1 has a WiFi internet connection and USB Debugging enabled.
Set your phone to Stay Awake, so the phone will not suddenly cut off your wifi connection. Settings->Application->Development->Stay Awake
Disable WiFi sleep, which will cause download issues. Settings->Wifi->Menu Button->Advanced->Wifi Sleep Policy->Never sleep when plugged in
Enter the chrootFirst, mount the Debian partition on the G1 from your PC, using these commands:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Then, enter the chroot:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /bin/bash
Set up Squeeze Package RepositoriesThis will install the necessary Debian repositories and some basic packages to the G1.
Type the commands below to add squeeze package repositories:
echo "deb http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install bzip2 build-essential
Install SSHFinally, we can install the openssh packages. An SSH server allows you to access a USB connected phone from your computer, so you can pump in terminal commands using copy and paste.
Type this command in the same chroot at your computer:
apt-get install openssh-server openssh-client libkrb53 openssh-blacklist libedit2 udev libvolume-id0 libkeyutils1
/etc/init.d/ssh stop
Note: During installation, the G1 might restart unexpectedly. Simply enter the chroot again (see previous section).
Click to expand...
Click to collapse
Create a Root user password and exit the ChrootWe will want to create a root user password.
passwd
Type in the password you want to use (make sure that you only use numbers and letters! special characters cannot be easily entered).
As a security measure, text will not appear onscreen, so just keep typing and press enter when you've put it in.
Exit the ChrootWe're all done, so you can exit the chroot.
sync
exit # exits the chroot
umount /mnt
rmdir /data/mnt
exit # exits `adb shell`
Boot LinuxPut the sdcard back into your G1, Plug in your G1 to the PC, and type this command to enter fastboot mode:
adb reboot bootloader
Type this command on your Linux PC to download and boot the kernel.
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
fastboot -c "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" boot ./zImage
Your phone will now boot into Debian.
Type in the Username and PasswordAs a security feature, nothing will be displayed while you type your password.
username: root
password: <the password that you created>
Tether your G1's internet connection to the PCWe have to forward your PC's internet connection to your G1. Type these commands in the computer:
ifconfig usb0 192.168.0.200/26
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
(not tested) Alternatively, use these commands: (recommended by Jorge Peñalba)
ifconfig usb0 192.168.0.200/26\
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 1 \> /proc/sys/net/ipv4/ip\_forward\
ssh 192.168.0.202 -l root\
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 0 \> /proc/sys/net/ipv4/ip\_forward
SSH into the G1Use this command to SSH into the G1's command line, so you can send commands to it from your computer. Log into your phone with the same username and password you set before.
ssh 192.168.0.202
Enable Dual Boot (optional)We will create a custom kernel for the phone to dual-boot between Android and Linux. This way, you will be able to hold power+home to boot Linux.
Use your computer to SSH into the G1 and run these commands:
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/mkboot.tar.bz2
tar -jxvf mkboot.tar.bz2
cd mkboot
make && make install
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/android-imagetools.tar.bz2
tar -jxvf android-imagetools.tar.bz2
cd android-imagetools
make && make install
cd /tmp
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" \
--kernel zImage --ramdisk ./Newramdisk.cpio.gz -o Recovery-boot.img
cat /dev/zero > /dev/mtd1
mkdir /dev/mtd
cd /dev/ && for i in `ls -w1 mtd?`;do ln -s /dev/$i /dev/mtd/$i; done && cd - || cd -
flash_image recovery Recovery-boot.img
Normal boot will get you into Android
Holding home and power will boot into debian
Galoula's NetinstallHow to Install Ubuntu with Ubuntu-Install.img ?
Download Ubuntu-Install.img on your Linux-PC.
Turn off your HTC G1.
Turn On HTC G1 in FastBosst mode : Power on with hold the camera button, if it's OK, you can see 3 Android on Skateboards.
In this screen press Back.
Connect USB cable betweek PC and G1.
On your Linux PC type this command : "fastboot boot Ubuntu-Install.img" without quotes.
If the G1 don't start, press the back button on G1.
The G1 start the Ubuntu Installer.
Warning ! My image is set for a French G1 keymap.
The special keys are :
Up : End
Down : Back
Left : Home
Right : Call
Escape : menu (on keyboard)
Tab : Right alt with Q.
Control : Search Button
For get networking works : This kernel use USB-NET.
To configure IT :On the Linux PC :
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sysctl -w net.ipv4.ip_forward=1
On the G1 :When the installer tell you for Networking Configuration, chose usb0
You can cancel the DHCP discover.
Type this settings :
IP Address : 192.168.0.202
NetMask : 255.255.255.0
GateWay : 192.168.0.200
DNS : Your DNS
The setup tell you because it can't download "kernel modules", chose continue, my kernel can read the SDCARD for the installation, but it can't read internal partition for more secure.
The setup can tell you a warning because the kernel can't be installed, please continue (and ignore it) because, Ubuntu-Rescue.img contain the appropriate kernel.
Actualy, the file is : boot-recovery.img
Now, you can setup your Ubuntu !
Galoula's Netinstall images
Page Index for this GitHub Wiki
Source: Github
ppp- said:
Here's how to do this:
HTC Dream Native Debian Linux - bibanon/android-development-codex WikiThis guide was mostly organized by Novaspirit, refined on the Debian Wiki, and based on notes from XDA-Developers.
Here, we've fixed some glaring errors and updated it for Debian squeeze.
This guide will create a dual-boot Linux and Android system. The phone will boot normally into Android; just hold home+power when turning on to enter Debian Linux.
Working / Not WorkingWorking
Phone can boot!
SDCard reader/writer
Keyboard
LEDs
Touchscreen
Vibrator
USB Ethernet
Xorg with OpenMoko Kernel
Phone Call : I am able to answer an incomming call from console!
Unlock SIM Card and register on Network
Working with bugs
Trackball - No event on click with ball - must click and move ball slightly
TouchScreen (MonoTouch) - I can use it in console FBDEV, but with Xorg, the calibration doesn’t work - calibration is very difficult but doable
ALSA - Sound is low, when phone works, sound is very low, and alsamixer, for select OutPut has device bugs.
Xorg with my Kernel - The phone crashes (freeze) when you leave Xorg found this only happens sometimes not all
Not working
WiFi card is detected, but crashes when doing “ifconfig wlan0 up”.
Not tested
GPS
Accelerometers/Compas
Other USB Gadgets, like Storage
Bluetooth
Internet throug GSM/3G APN
Power management
Accelerated GL
Camera
TouchScreen (MultiTouch)
HOWTOYou will need:
A laptop with Debian-based Linux (Ubuntu, Debian, Linux Mint, etc.)
Just run it off a live CD
An HTC Dream/G1 or MyTouch 3G
8GB or larger SDCard
4GB for Linux, 4GB for Android
An Android 1.6 or higher Custom ROM that supports EXT2/3
only a few older Android versions lack it.
USB Debugging Enabled
HardSPL and Engineering SPL
gives you fastboot support
ADB and Fastboot
The easiest way to install them is to use Minimal ADB.
Partitioning the SDCard
obtain gparted using:
sudo apt-get install gparted
select your sdcard and select it on the top right menu
You will need three partitions:
fat32 (android)
ext3 (android apps and stuff if you got app2sd)
ext3 (debian)
For example, an 8GB SDCard would be partitioned like this:
2 GB FAT32 for Android
2 GB EXT3 for app2sd
4 GB EXT3 for my real Debian
After creating the partitions, make sure to record the names, found in gparted's top-right corner (ex. /dev/sdb1, /dev/sdc6).
The G1 will see those partitions with names: /dev/mmcblk0p3 or whatnot. Just add the last number of the /dev/sdb1 name, replacing that 3.
Keep your SDCard plugged in.
Generate the Debian Root Filesystem with debootstrapWe will use debootstrap to install all the necessary system packages to an image, which you will flash onto the G1.
mkdir debdroid
sudo /usr/sbin/debootstrap --foreign --arch armel squeeze debdroid/ http://http.debian.net/debian
Copy debootstrap to the SDCardWe now need to copy the system image to the G1. Change /dev/sdb3 to the EXT3 partition for Debian on your SDCard (The names were previously obtained from GParted).
mount /dev/sdb3 /mnt/memory # change correct device
sudo cp -pfr debdroid/* /mnt/memory/
umount /mnt/memory
debootstrap Second StageNow reboot into your G1, and connect it to the computer to begin the second phase of installation. Make sure USB Debugging is enabled, and your phone is recognized by ADB.
Mount the debian EXT3 partition:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Now your debian partition should be mounted to file system at /data/mnt
Next, we will chroot into the debian partition to start the second stage of installation. This will take about 25 minutes, so be patient and keep your phone charged.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /debootstrap/debootstrap --second-stage
umount /data/mnt
rmdir /data/mnt
Set the SSH service to start on bootWe will need an SSH service running on the G1 for internet tethering from the PC. We have to install Galoula's SSH modules, and edit configuration files to start SSH on boot.
Insert the sdcard back into your Linux PC and run these commands:
(replace /dev/sdb2 with the name of your debian EXT3 partition)
(the package links will have to be updated for squeeze)
mount /dev/sdb2 /mnt
cd /mnt/tmp
wget http://www.galoula.net/fr/Tutoriels...ALOULA-001/Modules-2.6.32_GALOULA-001.tar.bz2
tar -jxvf Modules-2.6.32_GALOULA-001.tar.bz2 -C ..
echo g_ether >> ../etc/modules
echo "auto lo" >> ../etc/network/interfaces
echo "iface lo inet loopback" >> ../etc/network/interfaces
echo "auto usb0" >> ../etc/network/interfaces
echo "iface usb0 inet static" >> ../etc/network/interfaces
echo " address 192.168.0.202" >> ../etc/network/interfaces
echo " netmask 255.255.255.192" >> ../etc/network/interfaces
echo " network 192.168.100.0" >> ../etc/network/interfaces
echo " gateway 192.168.0.200" >> ../etc/network/interfaces
echo "none /sys sysfs rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "none /proc proc rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "udev /dev tmpfs rw,size=10240k,mode=755 0 0" >> ../etc/fstab
echo "devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0" >> ../etc/fstab
echo "HTC-Dream" > ../etc/hostname
echo "127.0.0.1 localhost HTC-Dream" > ../etc/hosts
cat /etc/resolv.conf > ../etc/resolv.conf
mkdir ../dev/pts
sync
cd
umount /mnt
Later on, we will also install the SSH packages on the phone itself.
Now insert the sdcard back into the G1, and plug the G1 into the computer.
Chroot Setup
Make sure your Android G1 has a WiFi internet connection and USB Debugging enabled.
Set your phone to Stay Awake, so the phone will not suddenly cut off your wifi connection. Settings->Application->Development->Stay Awake
Disable WiFi sleep, which will cause download issues. Settings->Wifi->Menu Button->Advanced->Wifi Sleep Policy->Never sleep when plugged in
Enter the chrootFirst, mount the Debian partition on the G1 from your PC, using these commands:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Then, enter the chroot:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /bin/bash
Set up Squeeze Package RepositoriesThis will install the necessary Debian repositories and some basic packages to the G1.
Type the commands below to add squeeze package repositories:
echo "deb http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install bzip2 build-essential
Install SSHFinally, we can install the openssh packages. An SSH server allows you to access a USB connected phone from your computer, so you can pump in terminal commands using copy and paste.
Type this command in the same chroot at your computer:
apt-get install openssh-server openssh-client libkrb53 openssh-blacklist libedit2 udev libvolume-id0 libkeyutils1
/etc/init.d/ssh stop
Create a Root user password and exit the ChrootWe will want to create a root user password.
passwd
Type in the password you want to use (make sure that you only use numbers and letters! special characters cannot be easily entered).
As a security measure, text will not appear onscreen, so just keep typing and press enter when you've put it in.
Exit the ChrootWe're all done, so you can exit the chroot.
sync
exit # exits the chroot
umount /mnt
rmdir /data/mnt
exit # exits `adb shell`
Boot LinuxPut the sdcard back into your G1, Plug in your G1 to the PC, and type this command to enter fastboot mode:
adb reboot bootloader
Type this command on your Linux PC to download and boot the kernel.
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
fastboot -c "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" boot ./zImage
Your phone will now boot into Debian.
Type in the Username and PasswordAs a security feature, nothing will be displayed while you type your password.
username: root
password: <the password that you created>
Tether your G1's internet connection to the PCWe have to forward your PC's internet connection to your G1. Type these commands in the computer:
ifconfig usb0 192.168.0.200/26
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
(not tested) Alternatively, use these commands: (recommended by Jorge Peñalba)
ifconfig usb0 192.168.0.200/26\
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 1 \> /proc/sys/net/ipv4/ip\_forward\
ssh 192.168.0.202 -l root\
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 0 \> /proc/sys/net/ipv4/ip\_forward
SSH into the G1Use this command to SSH into the G1's command line, so you can send commands to it from your computer. Log into your phone with the same username and password you set before.
ssh 192.168.0.202
Enable Dual Boot (optional)We will create a custom kernel for the phone to dual-boot between Android and Linux. This way, you will be able to hold power+home to boot Linux.
Use your computer to SSH into the G1 and run these commands:
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/mkboot.tar.bz2
tar -jxvf mkboot.tar.bz2
cd mkboot
make && make install
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/android-imagetools.tar.bz2
tar -jxvf android-imagetools.tar.bz2
cd android-imagetools
make && make install
cd /tmp
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" \
--kernel zImage --ramdisk ./Newramdisk.cpio.gz -o Recovery-boot.img
cat /dev/zero > /dev/mtd1
mkdir /dev/mtd
cd /dev/ && for i in `ls -w1 mtd?`;do ln -s /dev/$i /dev/mtd/$i; done && cd - || cd -
flash_image recovery Recovery-boot.img
Normal boot will get you into Android
Holding home and power will boot into debian
Galoula's NetinstallHow to Install Ubuntu with Ubuntu-Install.img ?
Download Ubuntu-Install.img on your Linux-PC.
Turn off your HTC G1.
Turn On HTC G1 in FastBosst mode : Power on with hold the camera button, if it's OK, you can see 3 Android on Skateboards.
In this screen press Back.
Connect USB cable betweek PC and G1.
On your Linux PC type this command : "fastboot boot Ubuntu-Install.img" without quotes.
If the G1 don't start, press the back button on G1.
The G1 start the Ubuntu Installer.
Warning ! My image is set for a French G1 keymap.
The special keys are :
Up : End
Down : Back
Left : Home
Right : Call
Escape : menu (on keyboard)
Tab : Right alt with Q.
Control : Search Button
For get networking works : This kernel use USB-NET.
To configure IT :On the Linux PC :
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sysctl -w net.ipv4.ip_forward=1
On the G1 :When the installer tell you for Networking Configuration, chose usb0
You can cancel the DHCP discover.
Type this settings :
IP Address : 192.168.0.202
NetMask : 255.255.255.0
GateWay : 192.168.0.200
DNS : Your DNS
The setup tell you because it can't download "kernel modules", chose continue, my kernel can read the SDCARD for the installation, but it can't read internal partition for more secure.
The setup can tell you a warning because the kernel can't be installed, please continue (and ignore it) because, Ubuntu-Rescue.img contain the appropriate kernel.
Actualy, the file is : boot-recovery.img
Now, you can setup your Ubuntu !
Galoula's Netinstall images
Page Index for this GitHub Wiki
Source: Github
Click to expand...
Click to collapse
Wow. That's a ton of info! I'll try.
ppp- said:
{Mod edit}
Here's how to do this:
Click to expand...
Click to collapse
@ppp- I've edited your post above and removed the part that was simply intended to offend another user. Be aware that XDA is not like the common social media, and we're enforcing the XDA Forum Rules that have been established, and to which you agreed to adhere when you registered on this private platform a few days ago. Please review the forum rules with special emphasis on rule no. 2 regarding member conduct. Thanks for your cooperation.
Regards
Oswald Boelcke
Senior Moderator
ppp- said:
{Mod edit}
Here's how to do this:
HTC Dream Native Debian Linux - bibanon/android-development-codex WikiThis guide was mostly organized by Novaspirit, refined on the Debian Wiki, and based on notes from XDA-Developers.
Here, we've fixed some glaring errors and updated it for Debian squeeze.
This guide will create a dual-boot Linux and Android system. The phone will boot normally into Android; just hold home+power when turning on to enter Debian Linux.
Working / Not WorkingWorking
Phone can boot!
SDCard reader/writer
Keyboard
LEDs
Touchscreen
Vibrator
USB Ethernet
Xorg with OpenMoko Kernel
Phone Call : I am able to answer an incomming call from console!
Unlock SIM Card and register on Network
Working with bugs
Trackball - No event on click with ball - must click and move ball slightly
TouchScreen (MonoTouch) - I can use it in console FBDEV, but with Xorg, the calibration doesn’t work - calibration is very difficult but doable
ALSA - Sound is low, when phone works, sound is very low, and alsamixer, for select OutPut has device bugs.
Xorg with my Kernel - The phone crashes (freeze) when you leave Xorg found this only happens sometimes not all
Not working
WiFi card is detected, but crashes when doing “ifconfig wlan0 up”.
Not tested
GPS
Accelerometers/Compas
Other USB Gadgets, like Storage
Bluetooth
Internet throug GSM/3G APN
Power management
Accelerated GL
Camera
TouchScreen (MultiTouch)
HOWTOYou will need:
A laptop with Debian-based Linux (Ubuntu, Debian, Linux Mint, etc.)
Just run it off a live CD
An HTC Dream/G1 or MyTouch 3G
8GB or larger SDCard
4GB for Linux, 4GB for Android
An Android 1.6 or higher Custom ROM that supports EXT2/3
only a few older Android versions lack it.
USB Debugging Enabled
HardSPL and Engineering SPL
gives you fastboot support
ADB and Fastboot
The easiest way to install them is to use Minimal ADB.
Partitioning the SDCard
obtain gparted using:
sudo apt-get install gparted
select your sdcard and select it on the top right menu
You will need three partitions:
fat32 (android)
ext3 (android apps and stuff if you got app2sd)
ext3 (debian)
For example, an 8GB SDCard would be partitioned like this:
2 GB FAT32 for Android
2 GB EXT3 for app2sd
4 GB EXT3 for my real Debian
After creating the partitions, make sure to record the names, found in gparted's top-right corner (ex. /dev/sdb1, /dev/sdc6).
The G1 will see those partitions with names: /dev/mmcblk0p3 or whatnot. Just add the last number of the /dev/sdb1 name, replacing that 3.
Keep your SDCard plugged in.
Generate the Debian Root Filesystem with debootstrapWe will use debootstrap to install all the necessary system packages to an image, which you will flash onto the G1.
mkdir debdroid
sudo /usr/sbin/debootstrap --foreign --arch armel squeeze debdroid/ http://http.debian.net/debian
Copy debootstrap to the SDCardWe now need to copy the system image to the G1. Change /dev/sdb3 to the EXT3 partition for Debian on your SDCard (The names were previously obtained from GParted).
mount /dev/sdb3 /mnt/memory # change correct device
sudo cp -pfr debdroid/* /mnt/memory/
umount /mnt/memory
debootstrap Second StageNow reboot into your G1, and connect it to the computer to begin the second phase of installation. Make sure USB Debugging is enabled, and your phone is recognized by ADB.
Mount the debian EXT3 partition:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Now your debian partition should be mounted to file system at /data/mnt
Next, we will chroot into the debian partition to start the second stage of installation. This will take about 25 minutes, so be patient and keep your phone charged.
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /debootstrap/debootstrap --second-stage
umount /data/mnt
rmdir /data/mnt
Set the SSH service to start on bootWe will need an SSH service running on the G1 for internet tethering from the PC. We have to install Galoula's SSH modules, and edit configuration files to start SSH on boot.
Insert the sdcard back into your Linux PC and run these commands:
(replace /dev/sdb2 with the name of your debian EXT3 partition)
(the package links will have to be updated for squeeze)
mount /dev/sdb2 /mnt
cd /mnt/tmp
wget http://www.galoula.net/fr/Tutoriels...ALOULA-001/Modules-2.6.32_GALOULA-001.tar.bz2
tar -jxvf Modules-2.6.32_GALOULA-001.tar.bz2 -C ..
echo g_ether >> ../etc/modules
echo "auto lo" >> ../etc/network/interfaces
echo "iface lo inet loopback" >> ../etc/network/interfaces
echo "auto usb0" >> ../etc/network/interfaces
echo "iface usb0 inet static" >> ../etc/network/interfaces
echo " address 192.168.0.202" >> ../etc/network/interfaces
echo " netmask 255.255.255.192" >> ../etc/network/interfaces
echo " network 192.168.100.0" >> ../etc/network/interfaces
echo " gateway 192.168.0.200" >> ../etc/network/interfaces
echo "none /sys sysfs rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "none /proc proc rw,nosuid,nodev,noexec 0 0" >> ../etc/fstab
echo "udev /dev tmpfs rw,size=10240k,mode=755 0 0" >> ../etc/fstab
echo "devpts /dev/pts devpts rw,nosuid,noexec,gid=5,mode=620 0 0" >> ../etc/fstab
echo "HTC-Dream" > ../etc/hostname
echo "127.0.0.1 localhost HTC-Dream" > ../etc/hosts
cat /etc/resolv.conf > ../etc/resolv.conf
mkdir ../dev/pts
sync
cd
umount /mnt
Later on, we will also install the SSH packages on the phone itself.
Now insert the sdcard back into the G1, and plug the G1 into the computer.
Chroot Setup
Make sure your Android G1 has a WiFi internet connection and USB Debugging enabled.
Set your phone to Stay Awake, so the phone will not suddenly cut off your wifi connection. Settings->Application->Development->Stay Awake
Disable WiFi sleep, which will cause download issues. Settings->Wifi->Menu Button->Advanced->Wifi Sleep Policy->Never sleep when plugged in
Enter the chrootFirst, mount the Debian partition on the G1 from your PC, using these commands:
adb shell
mkdir /data/mnt
mount -t ext3 /dev/block/mmcblk0p3 /data/mnt
Then, enter the chroot:
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
export USER=root
chroot /data/mnt /bin/bash
Set up Squeeze Package RepositoriesThis will install the necessary Debian repositories and some basic packages to the G1.
Type the commands below to add squeeze package repositories:
echo "deb http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian/ squeeze main non-free contrib" >> /etc/apt/sources.list
echo "deb http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://security.debian.org/ squeeze/updates main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
echo "deb-src http://ftp.debian.org/debian squeeze-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get install bzip2 build-essential
Install SSHFinally, we can install the openssh packages. An SSH server allows you to access a USB connected phone from your computer, so you can pump in terminal commands using copy and paste.
Type this command in the same chroot at your computer:
apt-get install openssh-server openssh-client libkrb53 openssh-blacklist libedit2 udev libvolume-id0 libkeyutils1
/etc/init.d/ssh stop
Create a Root user password and exit the ChrootWe will want to create a root user password.
passwd
Type in the password you want to use (make sure that you only use numbers and letters! special characters cannot be easily entered).
As a security measure, text will not appear onscreen, so just keep typing and press enter when you've put it in.
Exit the ChrootWe're all done, so you can exit the chroot.
sync
exit # exits the chroot
umount /mnt
rmdir /data/mnt
exit # exits `adb shell`
Boot LinuxPut the sdcard back into your G1, Plug in your G1 to the PC, and type this command to enter fastboot mode:
adb reboot bootloader
Type this command on your Linux PC to download and boot the kernel.
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
fastboot -c "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" boot ./zImage
Your phone will now boot into Debian.
Type in the Username and PasswordAs a security feature, nothing will be displayed while you type your password.
username: root
password: <the password that you created>
Tether your G1's internet connection to the PCWe have to forward your PC's internet connection to your G1. Type these commands in the computer:
ifconfig usb0 192.168.0.200/26
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE
(not tested) Alternatively, use these commands: (recommended by Jorge Peñalba)
ifconfig usb0 192.168.0.200/26\
iptables -A POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 1 \> /proc/sys/net/ipv4/ip\_forward\
ssh 192.168.0.202 -l root\
iptables -D POSTROUTING -t nat -s 192.168.0.0/24 -j MASQUERADE\
echo 0 \> /proc/sys/net/ipv4/ip\_forward
SSH into the G1Use this command to SSH into the G1's command line, so you can send commands to it from your computer. Log into your phone with the same username and password you set before.
ssh 192.168.0.202
Enable Dual Boot (optional)We will create a custom kernel for the phone to dual-boot between Android and Linux. This way, you will be able to hold power+home to boot Linux.
Use your computer to SSH into the G1 and run these commands:
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/mkboot.tar.bz2
tar -jxvf mkboot.tar.bz2
cd mkboot
make && make install
cd /usr/src
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Outils/android-imagetools.tar.bz2
tar -jxvf android-imagetools.tar.bz2
cd android-imagetools
make && make install
cd /tmp
wget http://www.galoula.net/fr/Tutoriels/HTC-DREAM-G1/FTP/Native_Debian/2.6.32_GALOULA-001/zImage
wget http://wiki.openmoko.org/images/f/f6/Newramdisk.cpio.gz
mkbootimg --cmdline "console=tty0 no_console_suspend=1 root=/dev/mmcblk0p3 rootdelay=2 fbcon=rotate:1" \
--kernel zImage --ramdisk ./Newramdisk.cpio.gz -o Recovery-boot.img
cat /dev/zero > /dev/mtd1
mkdir /dev/mtd
cd /dev/ && for i in `ls -w1 mtd?`;do ln -s /dev/$i /dev/mtd/$i; done && cd - || cd -
flash_image recovery Recovery-boot.img
Normal boot will get you into Android
Holding home and power will boot into debian
Galoula's NetinstallHow to Install Ubuntu with Ubuntu-Install.img ?
Download Ubuntu-Install.img on your Linux-PC.
Turn off your HTC G1.
Turn On HTC G1 in FastBosst mode : Power on with hold the camera button, if it's OK, you can see 3 Android on Skateboards.
In this screen press Back.
Connect USB cable betweek PC and G1.
On your Linux PC type this command : "fastboot boot Ubuntu-Install.img" without quotes.
If the G1 don't start, press the back button on G1.
The G1 start the Ubuntu Installer.
Warning ! My image is set for a French G1 keymap.
The special keys are :
Up : End
Down : Back
Left : Home
Right : Call
Escape : menu (on keyboard)
Tab : Right alt with Q.
Control : Search Button
For get networking works : This kernel use USB-NET.
To configure IT :On the Linux PC :
sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0 up
iptables -A POSTROUTING -t nat -j MASQUERADE -s 192.168.0.0/24
sysctl -w net.ipv4.ip_forward=1
On the G1 :When the installer tell you for Networking Configuration, chose usb0
You can cancel the DHCP discover.
Type this settings :
IP Address : 192.168.0.202
NetMask : 255.255.255.0
GateWay : 192.168.0.200
DNS : Your DNS
The setup tell you because it can't download "kernel modules", chose continue, my kernel can read the SDCARD for the installation, but it can't read internal partition for more secure.
The setup can tell you a warning because the kernel can't be installed, please continue (and ignore it) because, Ubuntu-Rescue.img contain the appropriate kernel.
Actualy, the file is : boot-recovery.img
Now, you can setup your Ubuntu !
Galoula's Netinstall images
Page Index for this GitHub Wiki
Source: Github
Click to expand...
Click to collapse
Could you provide the ROM, HardSPL, and EngeneeringSPL?
Hi
i ve got a problem with the whole stuff.
it runs smoothly, but the filesystem is read-only.
it's a img file and script. it makes a chrooted system.
the problem could be the script. may the point where the partitions mounted.
or anywhere. i dont know.
i guess the problem:
#
busybox mknod /dev/block/loop255 b 7 255 > /dev/null 2>&1
busybox losetup /dev/block/loop255 ./ubuntu.img > /dev/null 2>&1
busybox mount /dev/block/loop255 /data/local/mnt > /dev/null 2>&1
#
the last line.
or
#
busybox mount -t proc proc /data/local/mnt/proc > /dev/null 2>&1
busybox mount -t devpts devpts /data/local/mnt/dev/pts > /dev/null 2>&1
busybox mount -t sysfs sysfs /data/local/mnt/sys > /dev/null 2>&1
busybox chroot /data/local/mnt /root/init.sh > /dev/null 2>&1
#
if its not enough to find out
i ll attach the file, but im writing from phone right now
Please help i cant wait xd
i neeed a writable system.
There are threads on this site and elsewhere showing the steps to boot ubuntu on android phones. Our Ideos X6 comes with a powerful hardware so i believe we can run ubuntu on it. But it seems that the kernel must support loop devices. Can anyone make a custom kernel supporting loop devices.
Or has anyone successful in running Ubuntu on Ideos X6.
Our kernel have support for loop device. Take this little instruction how install ubuntu oneiric, also the same process for debian just write distribution name and correct url in debootstrap.
1. this stage you must complete on your linux pc.
Code:
#debootstrap part on PC
sudo apt-get install debootstrap
sudo dd if=/dev/zero of=ubuntu.img seek=838860800 bs=1 count=1
sudo mke2fs -F ubuntu.img
sudo mkdir ubuntu
sudo mount -o loop ubuntu.img ubuntu/
sudo debootstrap --arch armel --foreign oneiric ubuntu http:/ports.ubuntu.com/ubuntu-ports/
sudo umount ubuntu
sudo rm -r ubuntu
2. push this ubuntu.img to sdcard on your phone.
Code:
adb push ubuntu.img /sdcard/ubuntu.img
3. create this script as ubuntu.sh on your sdcard too
Code:
echo "Setting some stuff up.."
export bin=/system/bin
export img=/mnt/sdcard/ubuntu.img
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
mkdir $mnt
echo "Mounting the Linux Image"
busybox losetup /dev/block/loop7 $img
mount -t ext2 -o noatime,nodiratime /dev/block/loop7 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
echo "Setting Up Networking"
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Mounting sdcard in /mnt"
mkdir $mnt/mnt/sdcard
busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard
echo "Entering CHROOT "
echo " "
busybox chroot $mnt /bin/bash
echo " "
echo "Shutting down CHROOT"
umount $mnt/mnt/emmc
umount $mnt/mnt/sdcard
busybox sysctl -w net.ipv4.ip_forward=0
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
busybox losetup -d /dev/block/loop7
4. So now we connect to device, run superuser permission, and chroot to ubuntu
Code:
sudo adb shell
su
sh /sdcard/ubuntu.sh
5.run continue deboostrap
Code:
/debootstrap/debootsrap --second-stage
6. setup apt
Code:
echo 'deb http:/ports.ubuntu.com/ubuntu-ports/ oneiric main' >/etc/apt/sources.list
apt-get clean
apt-get update
7. add root password
Code:
passwd root
8. exit from ubuntu shell with 'exit' and run it again sh /sdcard/ubuntu.sh from terminal emulator on your device or via adb shell.
So, now ubuntu install successfully on your phone and you may install openssh and vnc server.
P.S. http:/ correct it with two //, I can't push correct link to forum. its denied post urls.
Error
I followed your steps exactly as given and changed / to // in http i am getting the following output when i ran ubuntu.sh. kindly help
# sh ubuntu.sh
Setting some stuff up..
mkdir failed for /data/local/ubuntu, File exists
Mounting the Linux Image
losetup: /dev/block/loop7
mount: Device or resource busy
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
Setting Up Networking
net.ipv4.ip_forward = 1
ubuntu.sh: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
ubuntu.sh: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
ubuntu.sh: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
Mounting sdcard in /mnt
mkdir failed for /data/local/ubuntu/mnt/sdcard, No such file or directory
mount: mounting /mnt/sdcard/ on /data/local/ubuntu/mnt/sdcard failed: No such file or directory
Entering CHROOT
chroot: can't execute '/bin/bash': No such file or directory
Shutting down CHROOT
failed.
failed.
net.ipv4.ip_forward = 0
failed.
failed.
failed.
failed.
losetup: /dev/block/loop7: Device or resource busy
Possbile what loop7 device already busy on your phone.
ry this command to see it
Code:
busybox losetup
And try manual steps which in script to see which step is failed.
When I type
Code:
#busybox losetup
nothing happens
when i type
Code:
#busybox losetup /dev/block/loop7 /mnt/sdcard/ubuntu.img
losetup: /dev/block/loop7
Code:
#mount -t ext2 -o noatime,nodiratime /dev/block/loop7 /data/local/ubuntu
mount: Device or resource busy
the second line is the outputfrom the command.
Do you phone have block devices in /dev/block/ ?
just checked using root explorer. there are many loop# files in /dev/block folder
You may try with UC kernel, or try with ext3 file system. I suppose what your kernel without support ext2.
i tried with UC v5. It supports ext2,ext3 and ext4. Still getting same error.
Should i convert my android filesystem to ext2,3,0r 4. If yes how to do it?
No, you don't need do converting. Problem with loop device or mount, try to see busybox losetup after mount image to block device, it's must show what image mounted to block device. If it's ok, try different option for mount.
I don't have anymore ideas why it doesn't work.
This scenario successful work on my phone.
Can you tell me what ROM you are using
Sent from my CSL-MI410 using XDA App
Last rom from wellcom (2.3-V318E)
now it works. Installed ubuntu. But i am now unable to install any package. when i try to install tightvncserver i get error message
E: Unable to locate package tightvncserver
actally i am not able to install any package
i have checked the /etc/apt/sourcels.list and it contains the required entry and i also did
apt-get clean
apt-get update
and it updates without any error
You need add another repositories to /etc/sources.list such as universe, multiverse, restricted with the same path.
Recently I became interested in dual booting my Atrix, mainly for the fun of it, and because I like the convenience of quickly reverting to a different ROM without having to restore it from backup. I would also like to evaluate the performance of my system with sdcard in the loop among other things.
From my web research, it appears that multiple attempts at dual booting the Atrix have been made without much success. I have heard of SafeStrap, but I'm the kind of person who wants to know what’s happening inside the black box. So I decided to try my hand by flashing CM9 to internal memory and CM7 to my Patriot 16GB Class 4 micro-SD card. I did all of this on Ubuntu 11.10 using GParted, Android SDK and several Perl and Bourne shell scripts that I either customized or created.
I probably could have done this on Windows (which for example has Atrix USB drivers whereas Ubuntu does not) and perhaps be able to use available space on my 10GB emmc to host additional ROMs. But in spite of the lack of drivers, I felt more comfortable having a full-up, dedicated *nix-based OS on hand to support the experiment.
I decided to to push a stable ROM to sdcard (in this case, CM7.2 RC1), one that runs well without any patches --- because a stock recovery tool wouldn't recognize it.
The experiment was successful as I now enjoy my 3GB CM7 build running from SD card with stable browser, keyboard and camera. And I can still use Joker's Kitchen Sink to explore some of the many possible ROM configurations without touching the CM7 build.
YouTube video (3:38) showing reboots from one ROM to the other: http://www.youtube.com/watch?v=31TPyAguQ60
Preliminaries (Ubuntu)
GParted and Perl installed
Android SDK for Linux (i386) installed http://developer.android.com/sdk/index.html
I download testsign.zip from http://forum.xda-developers.com/showthread.php?t=551711 , copy to Ubuntu <android-sdk-linux/tools> directory and extract zip there. This creates a testsign subfolder with testsign.jar file inside.
Atrix Filesystem Analysis
I boot my phone to CWM 5.0.2.0, open an Ubuntu terminal, get root (sudo -s), run adb shell and invoke the “edify” and “df” commands to view the current filesystem:
~ # edify
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /boot emmc /dev/block/mmcblk0p11 (null)
2 /cache ext3 /dev/block/mmcblk0p15 (null)
3 /data ext3 /dev/block/mmcblk0p16 (null)
4 /sdcard vfat /dev/block/mmcblk1p1 (null)
5 /emmc vfat /dev/block/mmcblk0p18 (null)
6 /system ext3 /dev/block/mmcblk0p12 (null)
7 /recovery emmc /dev/block/mmcblk0p10 (null)
8 /osh ext3 /dev/block/mmcblk0p13 (null)
9 /preinstall ext3 /dev/block/mmcblk0p17 (null)
~ # df -a
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 417804 32 417772 0% /dev
devpts 0 0 0 0% /dev/pts
proc 0 0 0 0% /proc
sysfs 0 0 0 0% /sys
/dev/block/mmcblk0p15 645056 69020 543268 11% /cache
/dev/block/mmcblk0p16 2064208 129052 1830300 7% /data
/dev/block/mmcblk0p12 322516 238496 84020 74% /system
SD Card Partitioning
Next I get root on Ubuntu, connect SD card to PC, ensure SD card adapter switch is set to read/write, run GParted and shrink the vfat (fat32) partition to allow room for /system, /cache and /data in that order. Then I create these partitions as ext4 with sizes reasonably consistent with the existing filesystem on emmc.
Note: GParted did not see my internal (emmc) card, and it prefixed the sdcard partitions as “/dev/mmcblk0” instead of “/dev/mmcblk1”.
Now I exit GParted, pull sdcard from PC and reinsert into phone. Then I boot to CWM, connect phone to PC, enter adb shell and verify the new sdcard partition map using the onboard “parted” tool:
~ # parted /dev/block/mmcblk1
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: SD SU16G (sd/mmc)
Disk /dev/block/mmcblk1: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 10.7GB 10.7GB primary fat32 lba
2 10.7GB 11.1GB 346MB primary ext4
3 11.1GB 11.8GB 692MB primary ext4
4 11.8GB 14.0GB 2217MB primary ext4
quit
~#
Clone CM7 to SD Card
Presently I have CM7.2 RC1 installed in emmc, and I want to clone this ROM to sdcard. But I first ensure that my phone is adequately charged, especially if I will be in CWM for a long time. My experience is that CWM can drain the battery, even when phone is connected to a powered USB hub.
I boot to CWM 5.0.2.0, open Ubuntu terminal on PC, get root (sudo -s), run adb shell and mount the new CM7 sdcard partitions.
Then I clone ROM to sdcard. (I did this over ADB, though in retrospect I probably could have done it more quickly with terminal emulator.)
~ # dd if=/dev/block/mmcblk0p12 of=/dev/block/mmcblk1p2
655360+0 records in
655360+0 records out
335544320 bytes (320.0MB) copied, 140.786369 seconds, 2.3MB/s
~ # dd if=/dev/block/mmcblk0p15 of=/dev/block/mmcblk1p3
1310720+0 records in
1310720+0 records out
671088640 bytes (640.0MB) copied, 282.791984 seconds, 2.3MB/s
~ # dd if=/dev/block/mmcblk0p16 of=/dev/block/mmcblk1p4
4194304+0 records in
4194304+0 records out
2147483648 bytes (2.0GB) copied, 898.662170 seconds, 2.3MB/s
Since the data partition is fairly large, I ending up using the “cat” command, which cut the transfer time to about 6 minutes….
~ # cat /dev/block/mmcblk0p16 > /dev/block/mmcblk1p4
Flash CM9 to Internal Memory
Now I push Joker CM9 beta 0.6.0 zip to sdcard and install via CWM...
[email protected]:~/Desktop# adb push beta-0.6.0-cm-9.0.0-RC0-olympus-UNOFFICIAL-signed.zip /sdcard/Download
1286 KB/s (125162795 bytes in 95.013s)
[email protected]:~/Desktop#
Modify CM7 Ramdisk, Re-pack ROM Zip and Re-sign
Now I modify ramdisk in the CM7 boot.img to mount the sdcard /system, /cache and /data partitions at boot time. To help streamline the mod, I wrote custom Perl scripts based on the ones linked here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
My Perl script “unpack-romzip.pl” actually starts with a baseline ROM, extracts boot.img and then p****s out kernel and ramdisk directory from boot.img. Here is the script in action...
[email protected]:~/Desktop# ./unpack-romzip.pl update-cm-7.2.0-RC1-olympus+gapps.zip
Extract boot.img from update-cm-7.2.0-RC1-olympus+gapps.zip
Archive: update-cm-7.2.0-RC1-olympus+gapps.zip
inflating: boot.img
Rename boot.img to update-cm-7.2.0-RC1-olympus+gapps.img
kernel written to update-cm-7.2.0-RC1-olympus+gapps.img-kernel
ramdisk written to update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk.cpio.gz
Extract ramdisk zip to directory: update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk
513 blocks
Delete intermediate file: update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk.cpio.gz
Results...
-rw-r--r-- 1 root root 2574336 2012-05-03 19:12 update-cm-7.2.0-RC1-olympus+gapps.img-kernel
drwxr-xr-x 8 root root 4096 2012-05-03 19:12 update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk
In this experiment, the only ramdisk file I will modify is init.olympus.rc: I do so by commenting out the /system, /cache and /data mount commands for the emmc partitions and creating equivalent mount commands for the sdcard partitions...
# mount ext4 /dev/block/mmcblk0p12 /system noatime nodiratime wait ro barrier=1
# mount ext4 /dev/block/mmcblk0p16 /data nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
# mount ext4 /dev/block/mmcblk0p15 /cache nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk1p2 /system noatime nodiratime wait ro barrier=1
mount ext4 /dev/block/mmcblk1p4 /data nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk1p3 /cache nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
Now I back out of ramdisk and run my other Perl script: repack-romzip.pl, which combines ramdisk and kernel to obtain a new boot image and then generates a repacked ROM zip. Here is the script in action...
[email protected]:~/Desktop# ./repack-romzip.pl update-cm-7.2.0-RC1-olympus+gapps.zip
Repack Android boot image from kernel file and ramdisk directory and roll into new ROM zip
Run cpio and gzip on ramdisk directory
514 blocks
Make boot image from kernel file and ramdisk cpio zip
Updated boot.img...
-rw-r--r-- 1 root root 2725888 2012-05-03 19:20 update-cm-7.2.0-RC1-olympus+gapps-repack.img
Copy update-cm-7.2.0-RC1-olympus+gapps.zip to update-cm-7.2.0-RC1-olympus+gapps-repack.zip
Add updated boot.img to update-cm-7.2.0-RC1-olympus+gapps-repack.zip
updating: boot.img
zip warning: Local Entry CRC does not match CD: boot.img
(deflated 0%)
I am almost ready to re-sign my CM7 ROM zip. But I first need to modify its updater-script to mount /system to /dev/block/mmcblk1p2 (sdcard) instead of /dev/block/mmcblk0p12 (emmc). So I edit the updater-script and change:
format("ext4", "EMMC", "/dev/block/mmcblk0p12");
mount("ext4", "EMMC", "/dev/block/mmcblk0p12", "/system");
to
format("ext4", "EMMC", "/dev/block/mmcblk1p2");
mount("ext4", "EMMC", "/dev/block/mmcblk1p2", "/system");
Now I invoke the java command below to re-sign the CM7 zip:
[email protected]:~/Desktop# java -classpath ~/android-sdk-linux/tools/testsign/testsign.jar testsign update-cm-7.2.0-RC1-olympus+gapps-repack.zip update-cm-7.2.0-RC1-olympus+gapps-repack-signed.zip
[email protected]:~/Desktop# ls -ld *.zip
-rw-rw-r-- 1 robert robert 125162795 2012-05-03 18:05 beta-0.6.0-cm-9.0.0-RC0-olympus-UNOFFICIAL-signed.zip
-rw-r--r-- 1 root root 105000424 2012-05-03 19:23 update-cm-7.2.0-RC1-olympus+gapps-repack-signed.zip
-rw-r--r-- 1 root root 104987732 2012-05-03 19:20 update-cm-7.2.0-RC1-olympus+gapps-repack.zip
-rw------- 1 robert robert 104999357 2012-05-01 20:10 update-cm-7.2.0-RC1-olympus+gapps.zip
Then I transfer the re-signed zip to sdcard/Download, reboot to CWM and install.
Test Results
I do some preliminary testing by attempting to boot CM9 from Joker's CM9 1.0GHz v4 boot image file:
[email protected]:~/Desktop# fastboot boot cm9-1.0-atrixv4-boot.img
downloading 'boot.img'...
OKAY [ 0.204s]
booting...
OKAY [ 0.002s]
finished. total time: 0.206s
Success. Now I try CM7...
[email protected]:~/Desktop# fastboot boot update-cm-7.2.0-RC1-olympus+gapps-repack.img
downloading 'boot.img'...
OKAY [ 0.182s]
booting...
OKAY [ 0.002s]
finished. total time: 0.185s
And to my delight, CM7 boots
Finally I install Script Manager and push my custom boot-rom.sh to sdcard/Boot. This script offers four options: Current ROM (default), CM9, CM7 or CWM recovery. Rebooting to the other ROM is just a few keystrokes away, though I must configure Script Manager to run boot-rom.sh as superuser (press SU button on configuration screen).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Elapsed times…
Execution of boot-rom.sh on CM7 to CM9 welcome screen: 44 sec.
Execution of boot-rom.sh on CM9 to CM7 welcome screen: 45 sec.
Conclusions and Thoughts
My Atrix dual boot capability offers an efficient means to circumvent instabilities in CM9 by providing a stable CM7 ROM to run from my sdcard. Of course there are limitations here in that a stock recovery won't recognize my CM7 build. But I'm fine with that since I probably won't patch.
I think it would be kind of interesting to push identical ROMs on emmc and sdcard and compare performance. I heard from a fellow engineer that Class 16 cards are now available.
It would also be interesting to explore refinements like multiple-boot from emmc and various forms of automation.
This is a work in progress and I appreciate your constructive feedback.
YouTube video (3:38) showing reboots from one ROM to the other: http://www.youtube.com/watch?v=31TPyAguQ60
Credits
jokersax11 @ xda, ghost_og @ xda,
Photon Dev Team, Atrix Dev Team
Koush
Other credits embedded in this post
Holy. ****.
Sent from my MB860 using XDA
Wow thanks for the info. I wanted to give this a try but I had a question. If I partition my sdcard to the specs you provided, can I flash your resigned cm7 zip and it would flash it to my sdcard. If that is possible, could you post the modified cm7?
Wow....waiting is coming.......
Something you could look into is moving the apps to SD and let each rom build its own dalvik cache. Then you can keep your apps between both builds
Sent from my MB855 using XDA
I think you better get into developing roms, because it sounds like you have an amazing amount of knowledge with this technology. Something I can only hope to achieve, lol.
I think you should make a full length 45 min youtube clip to explain everything, but I know that's not gonna happen, so see how much you can cram into 5 minutes! lol
Nice job man, outstanding progression!
Blur ROM with WebTop and CM9
Is it possible to switch between Blur based ROM with WebTop and CM9?
#!/system/bin/sh
mount -o remount,rw /dev/block/mmcblk0p1 /system//挂载/system为可写
busybox md5sum -cs /system/boot/md5 && CHANGE=0 || CHANGE=1//判断boot.img是否更新
echo $CHANGE
if [ "$CHANGE" = "1" ]
then
cat /dev/block/mmcblk0p5 > /data/boot1.img
busybox md5sum /system/build.prop > /system/boot/md5
echo "Creat new boot done!"
fi
if [ -e /data/boot2.img ]//判断另外的系统是否更新boot.img
then
busybox mv /data/boot2.img /system/boot/boot2.img
echo "Backup new boot done!"
fi
cat /system/boot/boot2.img > /dev/block/mmcblk0p5
fdisk /dev/block/mmcblk0 < /system/bin/fdisk1.sh
///////////////////同fixuid
mkdir /data/lib
chmod 0777 /data/lib
cat /data/system/packages.xml | grep 'package name="'| awk -F"\"" '{print $2}' > /data/packages.list
awk -F" " '{print "rm /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm $fname-2/lib" >>/data/cx.sh
done
awk -F" " '{print "mkdir /data/lib/"$1}' /data/packages.list >> /data/cx.sh
awk -F" " '{print "mv /data/data/"$1"/lib/ /data/lib/"$1"/"}' /data/packages.list >> /data/cx.sh
busybox chown -R 1000.1000 /data/lib
awk -F" " '{print "rm -R /data/data/"$1"/lib"}' /data/packages.list >> /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm -R $fname-2/lib" >>/data/cx.sh
done
chmod 0777 /data/cx.sh
/data/cx.sh
////////////////////////////////////////////////////移动第二系统数据为主数据
cat /system/bin/noshare|while read fname
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
cat /data/noshare|while read fname//移动不需要共享的数据
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
echo "Move data done!"
/////////////////////////同fixuid
awk -F" " '{print "ln -s /data/lib/"$1" /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /data/system/packages.xml | grep 'package name=\"'| awk -F"\"" '{print $2" "$18}' | awk -F" " '{print "busybox chown -R "$2"."$2" /data/data/"$1}' >> /data/cx.sh
chmod 0777 /data/cx.sh
/data/cx.sh
echo "Move UID done!"
reboot
kingme__hu said:
#!/system/bin/sh
mount -o remount,rw /dev/block/mmcblk0p1 /system//挂载/system为可写
busybox md5sum -cs /system/boot/md5 && CHANGE=0 || CHANGE=1//判断boot.img是否更新
echo $CHANGE
if [ "$CHANGE" = "1" ]
then
cat /dev/block/mmcblk0p5 > /data/boot1.img
busybox md5sum /system/build.prop > /system/boot/md5
echo "Creat new boot done!"
fi
if [ -e /data/boot2.img ]//判断另外的系统是否更新boot.img
then
busybox mv /data/boot2.img /system/boot/boot2.img
echo "Backup new boot done!"
fi
cat /system/boot/boot2.img > /dev/block/mmcblk0p5
fdisk /dev/block/mmcblk0 < /system/bin/fdisk1.sh
///////////////////同fixuid
mkdir /data/lib
chmod 0777 /data/lib
cat /data/system/packages.xml | grep 'package name="'| awk -F"\"" '{print $2}' > /data/packages.list
awk -F" " '{print "rm /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm $fname-2/lib" >>/data/cx.sh
done
awk -F" " '{print "mkdir /data/lib/"$1}' /data/packages.list >> /data/cx.sh
awk -F" " '{print "mv /data/data/"$1"/lib/ /data/lib/"$1"/"}' /data/packages.list >> /data/cx.sh
busybox chown -R 1000.1000 /data/lib
awk -F" " '{print "rm -R /data/data/"$1"/lib"}' /data/packages.list >> /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm -R $fname-2/lib" >>/data/cx.sh
done
chmod 0777 /data/cx.sh
/data/cx.sh
////////////////////////////////////////////////////移动第二系统数据为主数据
cat /system/bin/noshare|while read fname
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
cat /data/noshare|while read fname//移动不需要共享的数据
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
echo "Move data done!"
/////////////////////////同fixuid
awk -F" " '{print "ln -s /data/lib/"$1" /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /data/system/packages.xml | grep 'package name=\"'| awk -F"\"" '{print $2" "$18}' | awk -F" " '{print "busybox chown -R "$2"."$2" /data/data/"$1}' >> /data/cx.sh
chmod 0777 /data/cx.sh
/data/cx.sh
echo "Move UID done!"
reboot
Click to expand...
Click to collapse
What's this? I don't... I... can't comprehend...
Anyone able to make an auto script to help beginners and confused people like me? I can't follow through half of the OP's instructions.... not used to using SDK and terminal/ADB.
Woooow!! This is epic dude! I could have a Blur rom on my sd and a custom rom on my internal, to keep webtop functionality when i want! A Windows guide would be prettt awesome!
Sent from my MB860 using XDA
Amazing!
This is amazing!! Thanks a lot for your work!
This could make things MUCH easier for me when testing both CM9 and CM7 Neutrino.
I hope this project matures by the time my exams finish, like as Jokersax11 said, the ability to save dalvik cache would be awesome.
Massive thumbs up from me here
This really is some fantastic development! I am beyond impressed. You my friend should join the league of developer jedi's.
Fantastic work!
Now, if this could only somehow be transformed into a zip...LOL
J-Roc said:
This really is some fantastic development! I am beyond impressed. You my friend should join the league of developer jedi's.
Fantastic work!
Now, if this could only somehow be transformed into a zip...LOL
Click to expand...
Click to collapse
+1 for the ZIP and making this easier to use for the Ordinary good people like Some of Us
Amazing work ! Keep up
Thanks to your guide I've made it to cloning to sdcard all with windows. Will post back with tutorial if I can finish the job. Thank you for your amazing work!
Maybe you can work together with BootManager dev to support Atrix...
Dude, you're awesome. I think this is the final little push I needed to get me computer set up to dual boot Ubuntu and windows definitely going to be worth it now. Thanks for the work
KH_Lionheart said:
Dude, you're awesome. I think this is the final little push I needed to get me computer set up to dual boot Ubuntu and windows definitely going to be worth it now. Thanks for the work
Click to expand...
Click to collapse
You are quite welcome!
YouTube video (3:38) demonstrating reboot from one ROM to the other: http://www.youtube.com/watch?v=31TPyAguQ60
Sweet!
Seeing as how you had this on the back burner, I am SO glad you got those kernel building issues squashed. Awesome job man!
J-Roc said:
This really is some fantastic development! I am beyond impressed. You my friend should join the league of developer jedi's.
Fantastic work!
Now, if this could only somehow be transformed into a zip...LOL
Click to expand...
Click to collapse
tasadar said:
+1 for the ZIP and making this easier to use for the Ordinary good people like Some of Us
Amazing work ! Keep up
Click to expand...
Click to collapse
Here's the problem: I needed GApps on CM7 to provide the tools needed to support my experiment. However, Google has requested that copyrighted material be removed from CM7. So while I was able to streamline the integration of GApps with CM7, I could not provide the ROM, only the procedure. See http://forum.xda-developers.com/showthread.php?p=25588129#post25588129.
IDK, maybe Google will soften up a bit...?
How to install chrooted Debian 7.8 on a Chromecast (Debcast?)
English are not my native language but I will try answer any questions
Step 1 – 5 was made on a Debian 7.8 computer (raspbian)
Step 6 – 12 was made in Chromecast shell
1. Install debootstrap
Code:
su
apt-get install debootstrap
2. Download mini-installation for armhf with debootstrap, this will take a while.
Code:
debootstrap --arch=armhf --variant=minbase --foreign wheezy debian http://http.debian.net/debian
3. Tar the downloaded
Code:
tar -cvf debian.tar debian/
4. Send debian.tar to CC,data dir is writable
Code:
cat debian.tar | ssh [email protected][chromecast-ip] 'cat > /data/debian.tar'
5. ssh to chromecast
Code:
ssh [email protected](chromecast-ip)
6. Untar
Code:
cd /data
tar -xvf debian.tar
7. Create a start file for Chroot
Code:
vi /data/chroot.sh
#!/bin/sh
# Fix all PATH for Debian
export ROOT=/data/debian
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export HOME=/root
# remount /data. Got an error first time I loged into chroot. remount is a fix for this
# not sure if we need to do this every reboot
echo "Remounting /data"
mount -o remount,defaults /data
# Mount dev for Debian if needed
mountpoint $ROOT/dev –q
if [ ! $? -eq 0 ] ; then
echo "Mounting dev"
mount -o bind /dev $ROOT/dev
fi
# Mount pts for Debian if needed
# It's a fix for direct ssh login to chroot
mountpoint $ROOT/dev/pts –q
if [ ! $? -eq 0 ]; then
echo "Mounting ptst"
chroot $ROOT /bin/mount -t devpts -o OPTIONS devpts /dev/pts
fi
# Mount proc for Debian if needed
mountpoint $ROOT/proc –q
if [ ! $? -eq 0 ]; then
echo "Mounting proc"
mount -o bind /proc $ROOT/proc
fi
# Mount proc for Debian if needed
mountpoint $ROOT/sys –q
if [ ! $? -eq 0 ]; then
echo "Mounting sys"
mount -o bind /sys $ROOT/sys
fi
# start chroot
chroot $ROOT /bin/bash -l
8. run chroot.sh and continue with the installation, this will take a while
Code:
chmod +x chroot.sh
./chroot.sh
debootstrap/debootstrap --second-stage
9. We now got a working minimal chroot jail, almost no programs are installed, before we can install anything we need to update sources.list and add some repositories. Use http://debgen.simplylinux.ch/ to create a sources.list. I use debian mirrors for Sweden.
Code:
echo ”deb http://ftp.se.debian.org/debian stable main” > /etc/apt/sources.list
echo ”deb http://security.debian.org/ wheezy/updates main” >> /etc/apt/sources.list
apt-get update
10. Install vim and ssh
Code:
apt-get install vim ssh
11. change port from 22 to 2222 and restart ssh
Code:
vi /etc/ssh/sshd_config
/etc/init.d/ssh restart
12. Set a password
Code:
passwd
OPTIONAL
1. Install desctop and vnc server, this will take a while and our installation will rise with 400-450M (mine using about 800M total), we only got 1.1G total to play with so be carefull which program you install. A fix to this would be to create a Yaffs2 image for loop mount and then store it on a USB drive.
Code:
apt-get install xfce4 tightvncserver
2. Create a loginpassword to vnc, and choose if you need a guest login
Code:
tightvncserver
3. Start vnc server, 800x600 res.
Code:
vncserver :0 -geometry 800x600 -depth 24
4. Log into chromecast, I used a standalone RealVNC in windows and [chromecast-ip]:0 to login
5. More info at http://elinux.org/RPi_VNC_Server
INFO
- To exit root jail, just type exit
- If you started sshd in root jail you can connect to it with ssh on port 2222.
- No need to start chroot to load a program in chroot, you can start it from outside
Code:
chroot with chroot /data/debian /etc/init.d/ssh start
- you can also kill program from outside, run ps to find out ID and use kill [id]
- Chromecast does support loop mount, but not very many filesystems
o To mount a supported filesystem use
Code:
mount myImage.img /mnt/myImage –o loop=/dev/block/loop0
o does not support ext, ext2, ext3 or ext4
o Does support yaffs2, vfat…
o supported filetypes can be found in cat /proc/filesystems
o yaffs2utils can be compiled in debian (on CC), this program can make same filesystem type as /data, and this file can be loop mounted
o Install git, gcc and make. Then git clone https://github.com/justsoso8/yaffs2utils
Errors:
- stdin is not a tty. Run inside chroot jail:
Code:
/bin/mount -t devpts -o OPTIONS devpts /dev/pts
or outside chroot run
Code:
chroot /data/debian /bin/mount -t devpts -o OPTIONS devpts /dev/pts
. Then try to connect to port 2222 again.
- do this: mount -t proc proc /proc.
Run (outside chroot)
Code:
mount -t proc /proc /data/debian/proc
- Chroot and vi can be found in busybox (busybox chroot, busybox vi) you can create a symlink to it.
Code:
mkdir /data/bin & cd /data/bin
ln /bin/busybox –s vi
ln /bin/busybox –s chroot
export PATH=/data/bin:$PATH
o If you need Busybox it can be downloaded from: http://www.busybox.net/downloads/binaries/latest/busybox-armv7l
TODO:
- Autostart chroot on boot
- Does anyone know how to view shell via HDMI?
- Can keyboards and mouse be connected via a USB hub so we can use CC as a minimal computer?
LINKS:
http://www.hjackson.org/blog/archives/2008/10/18/ssh-stdin-is-not-a-tty
https://wiki.debian.org/ChrootOnAndroid
http://www.cyberciti.biz/faq/how-do-i-compress-a-whole-linux-or-unix-directory/
http://elinux.org/RPi_VNC_Server
http://debgen.simplylinux.ch/
https://bitbucket.org/inkubux/cubox-i/wiki/Plex Wheezy
https://help.ubuntu.com/community/BasicChroot
https://github.com/justsoso8/yaffs2utils
http://www.busybox.net/downloads/binaries/latest/busybox-armv7l
Screenshot:
g
Click for large
How are you using a mouse and keyboard, powered otg
Sent from my iPad using Tapatalk
it's a minimum installation of Debian, but I guess you can install xfce and use X-forwarding with sshd. They got it working on a transcend wifi sd-card so it can be made, not sure how fast it will run.
http://dmitry.gr/index.php?r=05.Projects&proj=15. Transcend WiFiSD
Cool
Ok, I tried X-forwarding, it's not a GUI, it's more like you run a program from a host, and "stream" it to some other computer using a client program and ssh.
Also installed xcfe-desctop and tightvncserver. No problem connecting to chromecast and run programs in vnc.
Is it possible to post a little 'how to' and some screenshots?
sure, give me a few days =)
Pietplezier said:
Is it possible to post a little 'how to' and some screenshots?
Click to expand...
Click to collapse
First post is updated with new information
Mape0661 said:
sure, give me a few days =)
Click to expand...
Click to collapse
Screenshots looks wicked!
Pietplezier said:
Screenshots looks wicked!
Click to expand...
Click to collapse
Thanks! It worked better then I thought it would, it's working like a small computer.
I have tryed to view shell over HDMI, would be fun, but I haven't got it to work yet, only crashed the chromecast.