Jun. 9th, 2023

hoshiruri: (ruri - slackware-tan)
(Requires root.)

This was tested with the 2010 Motorola Droid Pro flashed with CyanogenMod 7. This may apply to modern phones, but I highly recommend an easier solution like Termux (non-root) or Linux Deploy (root).

- On the PC -
 
1. Create the chroot filesystem; an alternative would be to mount your microSD card and format it as ext3. I chose 3GB as a size because my microSD card is 4GB.
`truncate --size=3G jessie.img`
`mkfs.ext3 jessie.img`
Mount the filesystem to an empty directory.
`sudo mount jessie.img <mountpoint>`
 
2. Create a minimal root filesystem for the chroot. Make sure you have "debootstrap" installed on your Linux system for this step. Jessie was chosen because it is the last supported version for my Droid Pro's CyanogenMod 7 kernel.
`sudo debootstrap --arch=armel --variant=minbase --foreign jessie <mountpoint> http://archive.debian.org/debian/`
If that doesn't work due to certificate errors, append "--no-check-gpg" to the command:
`sudo debootstrap --no-check-gpg --arch=armel --variant=minbase --foreign jessie <mountpoint> http://archive.debian.org/debian/`
After creating the root filesystem, you are free to unmount the image:
`sudo umount <mountpoint>`
Note: Jessie is the last version that supports this ROM's kernel (Linux 2.6.32.9), and armhf would give a "Segmentation fault" error. Feel free to experiment with earlier versions.
 
3. Push the image to the phone.
`adb push jessie.img /mnt/sdcard` (push the image to the phone's microSD card; this might take a while depending on its size)
 
- On the phone, via adb or terminal -
 
4. Create a directory to mount the image:
```
cd /mnt/sdcard
mkdir mount
```
 
Mount it, bind, then chroot.
```
mount -o loop -t ext3 jessie.img mount
mount -o bind /dev/ /mnt/sdcard/mount/dev
mount -o bind /dev/pts /mnt/sdcard/mount/dev/pts
mount -o bind /proc /mnt/sdcard/mount/proc
mount -o bind /sys /mnt/sdcard/mount/sys
cd mount
chroot . /bin/bash
```
 
5. Now that you're in the chroot (if all things went well), you'll need to do these three steps each time you enter the chroot. If you don't want to do them every time, you can add them to the root ~/.bashrc:
```
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$PATH
export HOME=/root
export TERM=linux
```
 
Complete the debootstrap:
`debootstrap/debootstrap --second-stage`
 
and finally set your time zone (so it's displayed correctly):
`cp /usr/share/zoneinfo/<your_timezone> /etc/localtime`
 
The system should now be a completely functional base Debian system.
 
6. Post-installation steps that led me to the image:
```
apt update
apt install sudo nano xorg icewm tightvncserver
adduser yuki # create a new user
usermod -aG sudo yuki # add sudo privileges for the new user
 
addgroup --gid 3003 sockets # create a sockets group...
usermod -G sockets -a yuki # ...to add internet support for the user. Needed for VNC
```
You can replace icewm with whatever window manager or desktop environment you want if it's included in the repository. I choose IceWM because it's fast and customizable.
 
7. Start a VNC server:
```
su - yuki
vncserver :0 -geometry 480x320 -nevershared
```
and then connect to it (via "localhost:5900" or "127.0.0.1:5900") using a VNC client. The only ones I've found compatible for Android 2.3 are AndroidVNC  and RealVNC Viewer 1.2.12.
 
To close the server, you can use `vncserver -kill :0`.
 
To configure the server, you can edit ~/.vnc/xstartup.
 
The rest of these are beyond the scope of this guide, but I include them anyway:
 
8. Configuring IceWM:
```
mkdir -p ~/.icewm
cp /usr/share/icewm/* ~/.icewm
nano ~/.icewm/preferences
```
 
My go-to IceWM settings are:
```
DesktopBackgroundImage="/home/yuki/Pictures/Backgrounds/<insert_wallpaper_here>"
DesktopBackgroundScaled=1
TaskBarAtTop=1
```

Profile

Ruri

August 2023

S M T W T F S
  1234 5
6789101112
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 23rd, 2026 03:23 pm
Powered by Dreamwidth Studios