Use your Samsung Captivate Glide as a Debian "Chatter" Phone.

1,939 posts
Thanks Meter: 4,088
 
Post Reply Email Thread
Debian “Chatter” Phone

Screenshot: http://www.mediafire.com/view/ljgv72...x800_scrot.png

Debian. Not run as a tack on, not emulated, not on top of Android, but standalone. That's my goal. That's what I've been working on. Turning an old Glide into a computer. After some careful thought, I figured some other people might be interested in that too, so I thought I'd post it here. Perhaps we can even work together to get it finished.

Why Debian “Chatter”? Well, all Debian versions are given a name from a toy in the Pixar film Toy Story. Chatter happens to be the toy telephone in Toy Story 3. I put Chatter in quotes because it actually is not an official release. Technically, at least at the moment, I am using Debian Jessie. Since becoming a release of Debian would be nearly impossible to spearhead from the ground level, it would most likely become an offshoot of Debian.

What I have done so far is utilize the internal “sdcard” partition as the root file system for Debian Jessie.

What's working:
- Standard Linux functions (mostly)
- Boot up to the X server (XFCE window manager currently)
- Screen, orientation and display
- Physical keyboard (Only the qwerty part)
- Touch-screen as a touch pad to move the mouse pointer
- Battery indication including if it is charging or not
- Audio with ALSA.
- Volume buttons
- Front soft keys

Flashing instructions if your Captivate Glide already has TWRP.
http://www.mediafire.com/download/z9...coveryTWRP.img
1. Download my TWRP backup, and put under the /TWRP/BACKUPS/<SERIALNUMBER>/ folder.
https://www.mediafire.com/folder/9vi...voc/2015-10-20
2. Restore the image through the Restore function in TWRP.
3. Download my tar.gz file to your computer and extract it.
http://www.mediafire.com/download/71...0151102.tar.gz
Or,
http://www.mediafire.com/download/88...0151106.tar.gz
4. Put your phone into the TWRP recovery, and choose the Mount option and select “sdcard”
5. Place the extracted contents of the dated folder onto the sdcard partition, but not the dated folder itself, just what is in it.
6. Reboot your phone into the ODIN download mode.
7. Download my 2ndboot.img file and i927.pit file.
http://www.mediafire.com/download/mu...t77/2nboot.img
http://www.mediafire.com/download/79...rggpa/i927.pit
8. Using Heimdall-frontend, select the pit file, and flash the LNX partition with the 2ndboot.img file.
9. Reboot and Linux on!

Flashing instructions if your Captivate Glide already has Clockworkmod.
http://www.mediafire.com/download/f6...ecoverycwm.img
1. Download my copy of Bio360Rom.zip and move it to your phones sdcard.
http://www.mediafire.com/download/1u.../Bio360ROM.zip
2. Reboot into recovery mode (Clockworkmod) and install the Bio360Rom.zip
3. Reboot your phone into the ODIN download mode.
4. Download my 2ndboot.img file, my recovery.img file, and i927.pit file.
http://www.mediafire.com/download/mu...t77/2nboot.img
http://www.mediafire.com/download/z9...coveryTWRP.img
http://www.mediafire.com/download/79...rggpa/i927.pit
5. Using Heimdall-frontend, select the pit file, and flash the LNX partition with the 2ndboot.img file.
6. Again using Heimdall-frontend, select the pit file, and flash the SOS partition with the recovery.img file.
7. Put your phone into the TWRP recovery, and choose the Mount option and select “sdcard”
8. Download my tar.gz file to your computer and extract it. Place the extracted contents of the dated folder onto the sdcard partition, but not the dated folder itself, just what is in it.
http://www.mediafire.com/download/71...0151102.tar.gz
Or,
http://www.mediafire.com/download/88...0151106.tar.gz
9. Reboot and Linux on!

Optional instructions:
If you want to, head over to the Debian Jessie download page and download the arm version of the DVD's 1 and/or 2. In the following posts I describe how you can rip these cd's to set up a personal repository, one that you can strictly control all of the packages, which may be useful at this time.

Changelog:
Code:
Changelog - Debian "Chatter" using Canium Kernel

20151106
- Added shutdown.sh and reboot.sh to launcher for *better* handling of shutdown.

20151102
- Mapped soft keys: search - xfce-appfinder
- Mapped soft keys: back - xfce-next workspace
- Mapped soft keys: home - xfce showdesktop
- Mapped soft keys: menu - xfce-showmenu
- Mapped volume up/down to amixer Master +/- 5db.
- Added "event2" to xorg.conf. Volume buttons and power button are recognized and can now be mapped to an action.
- Added "event7" to xorg.conf. front soft keys are recognized and can now be mapped to an action.
- Enabled xfce splash screen (like a boot animation.) Also enabled text update of status during start of xfce.

20151101
- Edited xfce panel and options for display of information.

20151020-2
- Moved entire system off of sdcard and onto mmcblk0p4, the "internal sdcard" of the phone.

20151020
- Due to errors with Pulseaudio, removed pavucontrol/pulseaudio. Installed all Alsa controls.
- Installed LXMusic/xmms2 for mp3 player.
- Mixer and alsa mixer can properly set volume to path SPK_HP (the speaker or headphone) and adjust the volume. However, it will mute after a few moments of inactivity. A work in progress.

20151019 Continuing the current fork of Cranium Kernel.
- Udevd is not working due to lack of devtmpfs support in kernel. Added mdev support for hotplug items by editing init.stage2 with:
    /sbin/busybox echo /sbin/busybox mdev > /proc/sys/kernel/hotplug

20151018
- Backed up entire system, forking to other kernels. This backup will remain with all that is done so far. The fork has a seperate changelog.

20151016
- Enabled usb0 as a network interface in /etc/network/interfaces, can start with ~# ifup usb0.
  -On receiving computer, ensure that you insmod "mii.ko" and "usbnet.ko" if not already built into your kernel. -cannot figure out how to attach to it!
    ^-- I now realize that I would need to recompile my desktop computer kernel to support this endevour. This would distract from the process at hand. Scrapped.
- Added second armhf dvd from Debian Jessie to my local repository, and edited /etc/apt/sources to match.

20151015
- Edited xbattbar.sh script to accurately reflect if the phone is plugged in or not. - Put into 20151014 folder.

20151014
- Needed battery indicator. Added xbattbar as it is the only battery indicator with user scriptable inputs.
- Wrote script for xbattbar to work, now accurately reflects battery capacity.
- Put xbattbar in .xsession and removed xclock from .xsession

20151013
- Added XFCE4 and set as default for root in /root/.xsession file with xclock on startup for fun.

20151010
- Added local repository under folder /repo/all
- Used dpkg-scan to create Packages.gz
- Added local repository to /etc/apt/sources.list

20151008
- Added Keyboard to xorg.conf, some keys work, some do not.

20151005
- Added touchscreen to xorg.conf as "corepointer", works to move mouse.

20150924
- Created new initramfs.cpio.gz
- Created new_boot.img
- Copied another init script and init.stage2 script onto sdcard and edited for my purposes.
- Originally booted to Linux, then started Android, and Android was what you saw.
- Edited init and init.stage2 script so that it now boots Linux, and you see Linux. Android is running in chroot env. but cannot start fully due to /dev/graphics/fb0 is in use.

20150921
- Started with debootstrap base image of Debian Jessie
- Added openssh, vnc, lxde, jwm, and some other programs through emulator.
- Broke down Biorom kernel and initramfs. Using Cranium Kernel.
As for me, I plan to keep working on this project, if you are interested in working on this project as well, please feel free to work on it! You can work independently or with me on this if you would like. You are welcome to post here, or to contact me through XDA's message service. Please see the next posts on what still needs to be done (which is a lot).

The current passwords are:
root = root
trondroid = trondroid
me = me

Enjoy!
The Following 7 Users Say Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
26th October 2015, 05:05 PM |#2  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
Thanks to these people for their time and knowledge!
As with any project, it starts somewhere, and I want to thank the following individuals for their prior work that I used as the basis of this project. These individuals may not know that their tools were used here, but I would like to thank them for posting their knowledge and or files or programs for people like me to be able to read and use:

XDA developer bubor – Seriously, this person has a lot of great material on this site. I borrowed their TWRP recovery.img.
XDA developer mdubb2341 - I used this person's Bio360Rom as the chrooted Android environment, due to it's small size and resource requirements (e.g. no zRam).
Mikael Q Kuisma - http://whiteboard.ping.se/Android/Debian – This guy helped tremendously with the breakdown of the boot.img and hijacking init to do what I want instead. He explains how to start Linux then Android, and use your Android phone with Linux underneath.
Eryk Wdowiak - http://www.wdowiak.me/anX11phone/ - This gentleman had some great material on starting Linux after starting Android and running Linux on top of Android.
Ivan Davidov - http://minimal.linux-bg.org/ - The tutorials on setting up minimalistic Linux environments and boot script examples were priceless.
The Following 2 Users Say Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
26th October 2015, 05:07 PM |#3  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
To do list
Phone specific things to do: (Wow this is a big list!)

GPS – I have put FoxtrotGPS and gpsd in the image. I know that /dev/ttyHS0 is the GPS output, but it appears that the GPS is of course off, because it has not been started yet. I either need to echo the appropriate digits into the /sys files, or tell the chrooted Android to turn it on. I also found that it relies on gpsd, and uses standard output to it, which is a huge plus for a Linux phone.

Phone calls/text messaging/radio control – I have not even started on that. My goal was to run a chrooted Android environment and “tell it” from Debian to make a phone call or send and receive messages.

Bluetooth – The module for the bluetooth is already loaded, and I have put the bluez and other bluetooth tools on the phone, I just cannot figure out how to connect to it. It may be powered off also.

Wifi – The modules for this are in the /android/lib/modules directory, but once I insmod them, it does not appear as a connection. I believe that I need to do some sort of mknod to create a node or socket to connect to it, or have the chrooted Android turn it on.

Camera – I have not even looked at this yet.

Accelerometer/compass - I have not even looked at this yet.

Slide switch – I am hoping to use xranr and event input to rotate the screen and change the resolution if you slide out the keyboard.

Code:
Available devices:
/dev/input/event0:      STMPE_keypad – The physical keyboard.
/dev/input/event1:      mpu-accel
/dev/input/event2:      sec_key – Physical keys – Volume +/- and power.
/dev/input/event3:      sec_touchscreen – The touchscreen input.
/dev/input/event4:      proximity_sensor – Sensor that turns off the screen when your face is against it.
/dev/input/event5:      light_sensor – Ambient light sensor to control screen brightness and keyboard lights.
/dev/input/event6:      HALL – Opening the slide out keyboard.
/dev/input/event7:      sec_touchkey – front face soft keys - home, back, search, menu.
/dev/input/event8:      compass_sensor
Linux specific things to do: (Wow, this is also a big list!)

lspci – lspci does not work, which hampers the ability to figure out control of some of the devices. This is a problem (I think) with the kernel / arm hardware and the way the arm ARCH is set up. It uses AMBA.

lsusb - Fixed!
- I also got an OTG cable and can plug stuff in and see it show up with lsusb!

Audio – Pulse audio fails, so I replaced it with alsa. While alsa does work, it has the uniqe problem of turning off the path to device when there is no sound playing. Currently, if you want to listen to music, you open a music player, start the music, open the alsa volume mixer, set the path to SPK_HP, and adjust the volume as desired. Once the song or play list is done, pressing play again will yield no sound until you go to the volume mixer and choose SPK_HP again.

Init – Systemd is the standard init for Debian Jessie, but it causes too many problems on the phone. It either needs to be redone, or replaced. Currently, I am using the rc.local script to start some selected services, as a userspace init, so to speak.

Dbus – dbus can be started after you enter the X window environment, e.g. after the chrooted Android is done starting. I don't know that it is working properly.

Graphics – Currently Debian is just drawing straight to the frame buffer, it would be nice to get the nVidia drivers working for 3d acceleration.

Chrooted Android specific problems: (Not as big of a list.)

ADB – Fixed, ADB now works to connect to the chrooted Android from your computer using ADB as usual.

AM – The activity manager cannot start because we have stolen /dev/graphics/fb0 for the Debian x-server, so you cannot access the AM. If the AM can get up and running, then it would be possible to script orders to it, such as make phone calls, start wifi, etc.

SurfaceFlinger - SF is waiting for the /dev/graphics/fb0 to become available. It would be beneficial to have it "start" without it, perhaps to a virtual frame buffer, which requires a new kernel, or user-space tools like xvfb.

If you have any ideas or thoughts on how to do these things, or if you would like to tackle one of these projects, please let me know! I'd be happy to post your work and let everyone know that you came up with the solution!
The Following 4 Users Say Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
26th October 2015, 05:13 PM |#4  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
Optional Instructions
Optional instructions:
If you want to, head over to the Debian Jessie download page and download the arm version of the DVD's 1 and/or 2. In this post I describe how you can rip these cd's to set up a personal repository, one that you can strictly control all of the packages, which may be useful at this time.

Here are the links for the DVD's:

http://cdimage.debian.org/debian-cd/...rmhf-DVD-1.iso
http://cdimage.debian.org/debian-cd/...rmhf-DVD-1.iso

Then, on your computer:

Code:
~$ cd {to your download directory}
~$ mkdir disk1
~$ mkdir disk2
~$ sudo mount ./debian-8.2.0-armhf-DVD-1.iso ./disk1
~$ sudo mount ./debian-update-8.2.0-armhf-DVD-1.iso ./disk2
~$ mkdir repo1
~$ mkdir repo2
~$ cd disk1
~$ find . -name *deb -exec mv '{}' ../repo1/ \;
~$ cd ..
~$ cd disk2
~$ find . -name *deb -exec mv '{}' ../repo2/ \;
~$ cd ..
~$ sudo umount ./disk1
~$ sudo umount ./disk2
~$ rmdir ./disk1
~$ rmdir ./disk2
~$ cd repo1
~$ sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
~$ cd ..
~$ cd repo2
~$ sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
~$ cd ..
Now you can copy those files to your external sdcard, mount it and add these custom repositories to your /etc/apt/sources.list.

Enjoy!
The Following 4 Users Say Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
30th October 2015, 09:50 PM |#5  
steadfasterX's Avatar
Recognized Developer
Thanks Meter: 14,865
 
Donate to Me
More
Really great to see that! Please continue working on this I like the idea maybe I participate instead of trying to port ubuntu touch...

In the meanwhile keep up your work and thanks for sharing!

-----
Sent from my SGH-I927 using XDA Android mobile app
The Following User Says Thank You to steadfasterX For This Useful Post: [ View ]
31st October 2015, 03:54 AM |#6  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
Thanks!
Quote:
Originally Posted by xdajog

Really great to see that! Please continue working on this I like the idea maybe I participate instead of trying to port ubuntu touch...

In the meanwhile keep up your work and thanks for sharing!

-----
Sent from my SGH-I927 using XDA Android mobile app

Thanks xdajog!
I also tried to port Ubuntu Touch, but the recovery drive is too big for the standard size. I broke down the recovery image and tried to shrink it, I could make it smaller, but I could not get it small enough. Then I attempted to change the pit and re-partition, but ended up having to recover the phone. That is when I started working on this project.
I appreciate the encouragement, and I will be posting more soon! I hope
The Following User Says Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
4th November 2015, 12:01 AM |#7  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
20151102 update.
Just a quick post on the updates. The first post has been updated with new links to the new files, and the change log gives the basics. Here is a little more detail:

Essentially I was able to add support for the /dev/input/event7 (soft keys) and /dev/input/event2 (the physical buttons).

Now the front soft keys work:
Menu - essentially the right click menu of whatever the mouse pointer is on.
Home - clears the desktop, pressing this again will reveal all of your windows again.
Back - I used this as the switch between desktops.
Search - This now brings up the xfce app finder.

The volume keys now are bound with "amixer set Master 5dB+" or "amixer set Master 5dB-" to adjust the volume.
The Following User Says Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
7th November 2015, 03:36 AM |#8  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
20151106 update.
Just a few things added in this update:

Created new shutdown.sh and reboot.sh scripts and linked them to a launcher menu on the panel. It was needed to make sure the system is properly shut down, including the chrooted android system.
Also purged and re-installed lsusb, and now it works. After plugging anything into the OTG cable, they will show up on lsusb and things like a mouse are added as /dev/input/event8.

Several failed attempts, but much was learned about the GPS, particularly the use of gpsd. I can now link gpsd to the GPS, however I still need to turn power for the GPS on. However, the Activity Manager for Android is not up and running because Surface Flinger fails to start due to /dev/graphics/fb0 or fb1 being in use by the X server for Debian.
The Following User Says Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
9th November 2015, 10:47 PM |#9  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
20151109 update.
One of the principle problems with the phone setup was the lack of udev support, which is very important in Debian Jessie.
The problem with udev was the lack of "devtmpfs" file system support in the kernels for the Samsung i927.
So after *many* painful attempts, I was able to load a computer with Ubuntu 12.04, download all of the source code, and compile a custom kernel for the i927. This kernel includes devtmpfs and a few other Linux related things.

The output of uname -a:
Code:
Linux localhost 3.1.10 #2 SMP PREEMPT Mon Nov 9 11:25:41 AKST 2015 armv7l GNU/Linux
And after remaking a boot image, I flashed it to the phone, and to my surprise, this time it worked! Perhaps tomorrow I can update the top post with the new boot image.

It caught me by surprise also because it re-arranged the order of /dev/input/event#'s moving the touchscreen to 1, where before it was 2, but that was easily overcome by editing /etc/X11/xorg.conf.

I do not know that my new kernel is "better" overall, but it is more "useful" as it includes the devtmpfs support needed to continue with this project.
The Following User Says Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
27th November 2015, 08:18 PM |#10  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
New Kernel.
Still having trouble fine tuning the kernel to be just right, which is why I have not updated the top post with this information yet, but for those interested, here it is.

The new kernel:
http://www.mediafire.com/download/or...110ALUboot.img

Flash the boot.img with Odin to the LNX partition.

Edit the xorg.conf file /etc/X11/xorg.conf with the following. The reason for this is that the new kernel has a different order of "events" for device inputs.

Code:
Section "ServerLayout"
	Identifier "Layout0"
	Screen "Screen0"
	InputDevice "touchscreen" "CorePointer"
	InputDevice "keyboard"
	InputDevice "mediakeys"
	InputDevice "frontkeys"
EndSection

Section "Monitor"
	Identifier "Monitor0"
	ModelName "Monitor Model"
	DisplaySize 800 480
EndSection
	
Section "InputDevice"
	Identifier "touchscreen"
	Driver "evdrv"
	Option "Device" "/dev/input/event2"
	Driver "multitouch"
EndSection

Section "InputDevice"
	Identifier "keyboard"
	Driver "evdev"
	Option "Device" "/dev/input/event0"
	Option "CoreKeyboard"
	Option "XkbRules" "xorg"
	Option "XkbModel" "pc105"
	Option "XkbLayout" "us"
EndSection

Section "InputDevice"
	Identifier "keyboard"
	Driver "evdev"
	Option "Device" "/dev/input/event8"
	Option "XkbRules" "xorg"
	Option "XkbModel" "pc105"
	Option "XkbLayout" "us"
EndSection

Section "InputDevice"
	Identifier "mediakeys"
	Driver "evdev"
	Option "Device" "/dev/input/event3"
EndSection

Section "InputDevice"
	Identifier "frontkeys"
	Driver "evdev"
	Option "Device" "/dev/input/event7"
EndSection

Section "Device"
	Identifier "Card0"
	Driver "fbdev"
	Option "fbdev" "/dev/graphics/fb0"
	Option "Rotate" "left"
	Option "VertRefresh" "60" 
EndSection

Section "Screen"
	Identifier "Screen0"
	Device "Card0"
	DefaultDepth 16
	SubSection "Display"
		Depth 16
	EndSubSection
EndSection
Otherwise, your touchscreen will not function.
The Following 2 Users Say Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
20th January 2016, 10:33 PM |#11  
AlaskaLinuxUser's Avatar
OP Senior Member
Flag Fairbanks
Thanks Meter: 4,088
 
Donate to Me
More
Phone is broken.
Unfortunately, my spare Captivate Glide finally bit the dust.

Regardless of what rom/software I put on it, it cannot sustain itself for more than a minute or so before it simply stops working. The screen turns grainy, gets lines through it, and then it reboots itself. Perhaps if I get another phone or motherboard I can continue working on this further.
The Following User Says Thank You to AlaskaLinuxUser For This Useful Post: [ View ] Gift AlaskaLinuxUser Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes