My lightweight Debian Desktop - Linux

People generally have a hard time accepting change, understanding new things. It's too bad. THing is, people want things to operate by the parameters they have set instead of accepting what a thing is. Take Linux - people come from elsewhere, sit at a linux box, and lose their minds. Tha's the wrong atitude, of course it's a failure. You don't make toast with a radio.
Linux is a vast collection of stuff. There are many ways to set it up, configure it, many apps that do the one thing. It's a big deal and it's probably too much awesome for most. If your attitude going in is open, and you have no dogma or prejudice, before yuo know it you'll wonder why you suffered anything else for so long.
All that said - I run Debian since forever and I run a lightweight config. I don't use a 'desktop environment' like KDE or Gnome (say g-nome one time standing next to me....fuk'n...) because I don't need or want all that it includes. You might and that's cool. THis ain't for you, though. I'm not gonna hold your hand, but, this is easy to follow, it's basically right in front of you.
If you'd like to enjoy a similar desktop as I do then browse through one time and then get yourself ready. It doesn't take long at all and it's damned easy.
We'll use the net-installer iso because that's all we need and we have an internet connection. If you're not on a pipe, you can't do things this way. We will use the 64 bit net-install iso that includes non-free firmware so your wireless will work during installation. Here. To burn this to a usb stick on windows - go find an app for that. On Linux, use dd:
sudo dd if=firmware-11.2.0-amd64-netinst.iso of=/dev/sdc status="progress"
You can see from the command that my usb stick is /dev/sdc - this is the 'device' it is. It's important to get this right, dd don't care and will wipe whatever drive you put here. Make sure your usb stick is /dev/sdc or /dev/sdb. sudo fdisk -l will tell you, gparted will tell you. Whatever it is...After it's on the stick, reboot to it.
Debian install ain't pretty, but, it's fast and easy. You're gonna hit enter a lot. Chose a hostname, but, don't worry about a domain name in the next screen. If you have one, use it, if you don't, just leave it empty and go next.
Create a root user, this ain't ubuntu. Create your user next...
Partitioning is up to you, you can let debian do its thing with the default - guided (bye bye existing data), or, you can arrow down to manual, which is the right choice - I always use 4 primaries:
{
"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"
}
all formatted ext4 (use as). I use a swap for hibernation, you don't really need it if you have over 4gb ram. Make one, anyway. Make swap at least 2ce your ram. My /root (sda3) partition is so large because I used to run a web server. You can make /root much smaller, say 50gb and put the rest into /home.
If you have data in your /home partition already - what are you doing here - then you can choose to keep it during partitioning. The installer will default to keep, so you're good. You have to tell it to erase the partition, for example in your /boot. You can use other drives or not during the installation, too. You may have a /dev/sdb drive in your box, maybe it's a dump. When you are partitioning you can enter on it and choose to use it or not - use as: ext4, or whatever. Just choose custom for the mount point and type in a name. /stuff... Make sure to make your /boot partition 'bootable' when you are partitioning. You will see it as a choice when you partition.
Your next real decision in the installer is choosing what to install. The installer defaults to: desktop environment, gnome, and at the bottom, standard system utilities. For our purposes, uncheck (arrow key and spacebar) everything except the bottom one, go next...The installer will install some basic tools and whatnot, maybe a hundred or so files. That's it, go next...keep going through the install, mostly hitting enter. Participate in popularity contest or not - hint: Debian doesn't care about you like facebook does, you're not selling your soul if you participate. It defaults to no, though, choose what you want and next...
Install that grub boot loader on your /dev/sda drive. You'll see drive choices when it asks you. Enter on your choice. In a second you will reboot into the vast blackness of a barebones debian install. Wicked.
It's installed and you can grow from here. On the one laptop I have pi-hole installed on - I did nothing else after this barebones install other than install pi-hole. It put dependencies on for me, lighttpd for example and supporting php. That laptop stays on foever and I ssh in if I need to. It's an appliance. For you, you want a desktop, you want programs and whatnot so you can do stuff.
Upon booting you'll land at a login prompt. Log in as root the one time. run: apt install aptitude xorg scrot lxrandr lxappearance openbox feh gpicview unclutter numlockx thunar xinit lxpanel sudo xfce4-terminal, hit enter. When it's finished, run this: visudo, enter. Scroll down to beneath the root user entry and type:
YOURUSERNAME ALL=(ALL:ALL) NOPASSWD:ALL, then, ctrl+x, y, enter.
You've just made yourself admin on the box without having to input a password ever again. Handy. log out from root, type: exit, hit enter.
As it stands now, you can log into a pretty gui desktop right now, so, let's do it. Remember, there's not much installed and we didn't config anything yet. You just have xorg for your display, openbox for window management a panel, a file manager, init, a terminal, and I like aptitude (package management) because I made .bash_aliases entries for it ages ago.
Log in as you. Your prompt might change color, don't worry if it doesn't. You're still logged into just that empty blackness because we didn't start anything yet. Let's do that. Do this first: nano .xinitrc, enter. In that file add this line: exec openbox-session, then save and close (ctrl+x, y, enter). Now, start the pretty by typing: startx, and hit enter.
Bam. You're in more emptiness. This is openbox and you know you're in something because if you right-click (right-click on all of the things) you will see a small menu. Now, this ain't KDE, remember, this is a fleet-footed light desktop and openbox is a window manager, because, that's all you need - the luxury we get we create, this is custom. I don't install too much because I'm just a commoner now, no web development, no audio/video stuff (well, a little) I don't need writing, research , project support anymore, or, anything, really. You might, though, and debian has it all - add your fancy stuff later, let's get openbox and the desktop useable and fancy first.
In linux, everything is a file. Everything, even your devices. That's so cool. OPenbox uses 3 files for configuration, to let you do stuff. rc.xml controls your fancy keyboard combos, menu.xml created and maintains your desktop menu, and autostart.sh does what it says. You can learn and try things as you go, but, for now, we want to edit autostart.sh. Do it: nano .config/openbox/autostart.sh, enter. I have only a few entries which are:
sh ~/.fehbg &
redshift &
lxpolkit &
numlockx &
lxpanel &
compton -bcC &
thunar --daemon &
xscreensaver -no-splash &
#------------------------------------------////
# Delayed Startup Handiness:
#------------------------------------------////
(sleep 2s && unclutter) &
(sleep 3s && volumeicon) &
(sleep 3s && diodon) &
See that first entry - feh? That's a script to tell feh what to present as my desktop background image. Here's the script:
#!/bin/sh
feh --no-fehbg --bg-fill '~/nick/nick-nazzaro-jungle-green.png'
The autostart entry is running the script from my home directory (~/). So, make the file for the script in your home directory (nano .FILENAME, enter). You can see from the autostart entry that my script is saved as .fehbg. Call it whatever you want, just make the file and after you save it, you'll need to make it executable so it will run, do, do this: chmod +x .fehbg, enter. DOn't forget to change the directory feh serves up the image from. You don't have an image in ~/nick... I also use a handy thunar action for the desktop background where I can right-click on any image and set it as the background and the feh script will update to the new choice. Handy.
You'll notice my autostart file has entries we didn't install yet. I'll tell you: redshift reduces the blue when it's dark, numlockx chooses it for you so when you log in you can use your number keys, lxpanel gives me a panel with a tray, compton makes things prettier, thunar is the file manager that you don't have to autolaunch as a daemon at all if you don't want to, xscreensaver does what it says. The entries with sleep are delayed for x seconds: unclutter makes the mouse disappear after 10 seconds - handy, volumeicon gives me mixer access in the panel, and diodon replaces clipit as a clipboard manager. Add whatever program or script that you want to autostart with your desktop.
I have a bunch of entries in the rc.xml file becasue hitting a key-combo is handy. For example I hit win+b to open firefox, win+t for the terminal, and so on. Here is the syntax:
<keybind key="W-b">
<action name="Execute">
<execute>~/Downloads/firefox/firefox</execute>
</action>
</keybind>
I make an entry for screenshots, too, because wtf - I can't be bothered to go clicking for an app when I want one. Most times, the print (screen) button is already employed as a handy full desktop screenshot. But, we are barebones here, no DE that will do that for us. I use scrot because it's magic and awesome. I have entries in rc.xml for key-combos, and I have antries in the menu.xml file as well, should I feel like clicking. IN rc.xml my scrot entries are as follows (yes, I had to make the folder 'scrots' in my ~/. Get used to knowing, and using this: ~/, as /home/YOU/
<!--SCROT-->
<keybind key="W-Print">
<action name="Execute">
<execute>scrot '%Y-%m-%d_$wx$h_%X.jpg' -s -e 'mv $f ~/scrots/ & gpicview ~/scrots/$f'</execute>
</action>
</keybind>
<keybind key="W-Insert">
<action name="Execute">
<execute>scrot '%Y-%m-%d_$wx$h_%X.jpg' -e 'mv $f ~/scrots/'</execute>
</action>
</keybind>
<keybind key="Print">
<action name="Execute">
<execute>scrot '%Y-%m-%d--%s_$wx$h_scrot.jpg' -e 'mv $f ~/scrots/ & gpicview ~/scrots/$f'</execute>
</action>
</keybind>
<!--END SCROT-->
The menu.xml file is just as simple. You can use a tool to make the menu for you, in fact there are a few, but, I don't mess with those. Have a look at one of my sub-menus:
<menu id="stuff" label="Utils" icon="/usr/share/icons/Tango/scalable/apps/system-config-users.svg">
<item label="Audio Settings" icon="/usr/share/icons/Tango/scalable/devices/stock_mic.svg">
<action name="Execute">
<command>pavucontrol</command>
</action>
</item>
<item label="Screensaver" icon="/usr/share/icons/Tango/scalable/apps/gnome-settings-accessibility-technologies.svg">
<action name="Execute">
<execute>
xscreensaver-demo
</execute>
</action>
</item>
<item icon="/usr/share/icons/Tango/scalable/apps/internet-web-browser.svg" label="Bleachbit-root" icon="/usr/share/icons/bleachbit.png">
<action name="Execute">
<execute>
<!-- su-to-root -X -c bleachbit -->
sudo bleachbit
</execute>
</action>
</item>
<item icon="/usr/share/icons/Tango/scalable/apps/utilities-system-monitor.svg" label="GParted" icon="/usr/share/icons/gparted.png">
<action name="Execute">
<execute>
sudo gparted
</execute>
</action>
</item>
<item label="Synaptic" icon="/usr/share/icons/Tango/scalable/apps/preferences-desktop-remote-desktop.svg">
<action name="Execute">
<execute>
sudo synaptic
</execute>
</action>
</item>
<item label="SystemProfiler" icon="/usr/share/icons/Tango/scalable/status/info.svg">
<action name="Execute">
<execute>
sudo hardinfo
</execute>
</action>
</item>
<item label="Timer" icon="/usr/share/icons/Tango/scalable/status/gnome-fs-loading-icon.svg">
<action name="Execute">
<execute>
~/bin/timer.sh
</execute>
</action>
</item>
</menu>
Openbox is pretty easy to set up and it's fast. I have used it for 15 years or so and never missed any fancy desktop environment. It's important to know that I support this lightweight install with ancillary procedures. For example, I employ .bash_aliases to a large degree, as, I am sure most linux users do, or, would, if they knew about it. I also employ a bunch of actions I can run on files and folders in Thunar. It's wicked.
Some entries in my ~/.bash_aliases file, for handiness:
alias 53='sudo lsof -i :53' (what's running on port 53, I have this one on the pi-hole box)
alias clients='sudo nmap -sn 192.168.1.0/24' (clients on my lan)
alias guts='sudo inxi -Fx -c24' (system hardware whatnot)
alias dim='redshift -O 4200K -r -P' (to take care of my eyes if I didn't set redshift up for auto)
alias nap='sudo /usr/sbin/pm-suspend' (to suspend my box when I leave for work, you can use systemctl)
alias again='sudo shutdown -r now' (reboot right now)
alias off='sudo shutdown -h now' (shutdown right now)
--package management --
alias sources='sudo nano /etc/apt/sources.list'
alias show='aptitude show'
alias list='dpkg -L'
alias cpf='sudo aptitude clean && sudo aptitude purge ~c && sudo aptitude -f install'
alias remove='sudo aptitude purge'
alias install='sudo aptitude --without-recommends install'
alias apps='sudo synaptic'
alias search='aptitude search'
alias update='sudo aptitude update'
alias upgrade='sudo aptitude full-upgrade'
alias orphans='sudo deborphan'
alias foster='sudo debfoster'
alias devs="aptitude -F '%p' search '~i -dev$'"
alias devsizes="aptitude -F '%I %p' search '~i -dev$'"
alias hold='sudo aptitude hold'
alias unhold='sudo aptitude unhold'
ssh to my pi box:
alias pi='ssh -p 22061 [email protected]' - I use a key, so, it's - BAM!
shut off the screen saver so I can watch a flick:
alias killx='killall -15 xscreensaver'
quick password:
alias pwgen='pwgen -ys 24 1'
when I'm in a terminal I might want to edit one of the openbox files:
alias auto='geany ~/.config/openbox/autostart.sh &'
alias menu='geany ~/.config/openbox/menu.xml &'
alias rc='geany ~/.config/openbox/rc.xml &'
I have lots more, some entries run an app, a script, do a thing. aliases are so handy.
Here are a couple entries from my thunar custom actions file (uac.xml I think in .config/thunar)
name: resize 640
command: ~/.config/scripts/resize 640 %N (that is a script)
appearance conditions (*) : image file,
Have ffmpeg installed. The script is:
Code:
#!/bin/bash
mkdir -p ./Resized/$1
for file
do
if [ ! -e "$file" ]
then
continue
fi
name=$( echo $file | cut -f1 -d.)
convert -geometry $1x$1 -quality 100 $file ./Resized/$1/${name}_$1.jpg
done
I use another one for resize, too, that's wicked. You can choose any size you want, check it out:
in thunar custom actions -
name: resize-options
command: ~/.config/scripts/resz %N
appearance conditions (*): images
Here's the resz script:
Code:
#!/bin/bash
# resize_img.sh -- An Imagemagick Resize Script
# Author: canci <[email protected]>
# License: GPL. See http://www.gnu.org/licenses/gpl.html
# Dependencies: Bash (duh!), Imagemagick, zenity
# 1. IFS and other delcarations
# Saving the old one
SAVEIFS=$IFS
# Declaring the new one
IFS=$(echo -en "\n\b")
# Files
FILES=`ls -1 [email protected]`
# Directory name in case files are not being overwritten
NEW_DIR=RESIZED__`date +%d-%b-%Y_%T`
# Integer file count for the progress bar
n=1
# 2. Get desired resolution; Exit if cancel button pressed, otherwise move on
RES=`zenity --title="Please enter a resoultion" --entry --text="Image Resizer -- Please enter a resoultion (e.g. 800x600)"`
if [ $? == 1 ]; then
exit
else
# 2.1. Should the resize disregard the current aspect ratio and resize strictly to the given resolution?
#
Q1=`zenity --title="Disregard aspect ratio?" --question --text="Disregard aspect ratio? If Yes, the images will be resized to the exact resolution you provided, which might skew images if the aspect ratio differs. If No, the aspect ratio will be preserved and only the width will be resized accurately."`
if [ $? == 0 ]; then
# 2.1.1. Should the file be overridden or should a new one be created? mogrify or convert will be used accordingly.
#
Q2=`zenity --title="Overwrite file?" --question --text="Overwrite file? If No, the resized images will be put inside a new directory called RESIZED with the date of creation appended to it."`
if [ $? == 0 ]; then
for f in $FILES
do
mogrify -resize `echo $RES`! $f
echo $n
echo "# Processing file: $f"
let "n = n+1"
done | (zenity --progress --title "Resizing..." --percentage=0 --auto-close --auto-kill)
zenity --info --text="Done!"
else
mkdir $NEW_DIR
for f in $FILES
do
convert -resize `echo $RES`! $f $NEW_DIR/$f
echo $n
echo "# Processing file: $f"
let "n = n+1"
done | (zenity --progress --title "Resizing..." --percentage=0 --auto-close --auto-kill)
zenity --info --text="Done!"
fi
# WHAT ELSE? HUH?
else
# 2.1.2. Same as in 2.1.1., but for aspect ratio resize.
#
Q3=`zenity --title="Overwrite file?" --question --text="Overwrite file? If No, the resized images will be put inside a new directory called RESIZED with the date of creation appended to it."`
if [ $? == 0 ]; then
for f in $FILES
do
mogrify -resize $RES $f
echo $n
echo "# Processing file: $f"
let "n = n+1"
done | (zenity --progress --title "Resizing..." --percentage=0 --auto-close --auto-kill)
zenity --info --text="Done!"
else
mkdir $NEW_DIR
for f in $FILES
do
convert -resize $RES $f $NEW_DIR/$f
echo $n
echo "# Processing file: $f"
let "n = n+1"
done | (zenity --progress --title "Resizing..." --percentage=0 --auto-close --auto-kill)
zenity --info --text="Done!"
fi
# Ending 2.1.
fi
# Ending 2
fi
# 3. Restore IFS (for possible future use)
#
IFS=$SAVEIFS
# EOF
exit 0
If you need a handy image resize script, that one is awesome. Put it into a file and make a custom action out of it in thunar, see how awesome it is.
There are so many more from encrypting stuff to flattening folders to mounting an iso..look them up and get some, so handy. Here's that handy right-click desktop wallpaper custom action for thunar:
command: feh --bg-fill %f
appearance conditions: image
You can see where I take advantage of built-in functionality of the system and some apps I choose in order to run and thrive in a lightweight desktop. Of course, I have a bunch of other programs installed: claws-mail, gimp, filezilla - tons of stuf. Actually not, I have 1326 packages installed. People that run with a DE will typically have 2500 packages installed. Debian has 60,000 packages from you to choose from, all config'd for the version release at the time, everything in the bullseye repos will work on your bullseye install.
My desktop is setup for the efficiency, or lack thereof, in which I function - in which I work, move. I like to use the keyboard, I like to use a terminal, I like having shortcuts and some auto stuff. I don't like introducing 19 programs to my machine to get a thing done, I don't jump on the next big app that needs 900 files installed to get it to work. I use what works and if I have to, I adapt myself to it.

The first sentence "People generally have a hard time accepting change, understanding new things. It's too bad. " Made me start laughing so hard my wife had to pause the tv. It's so true. I wanted to thank you for this amazing guide and read haha. I don't roll linux yet but I read the whole guide because your humor is a treat and have bookmarked this for when I do. Have a good day!

Rock ON, man! When/if you do take a poke at linux, I hope this write-up can be helpful. It's definitely not for eveybody, though, not the way I run stuff.
My keyboard sweats from the possibilities.

Related

How to install ubuntu on the Droid 4

How to install ubuntu on the Droid 4
Note to mods: this thread is a branch off of this thread
Huge thanks to zacthespack for creating the ubuntu installer app and original boot script and to zeroktal for modifying the script to work on the D4 and helping me get it working on my device.
I decided to take my experience in setting this up and put it into a how-to so that others could enjoy the experience of having ubuntu on the Droid 4. If zackthespac or zeroktal have any problems with me making and putting this guide up, please let me know and I will remove it.
Knowledge Required:
working knowledge of command line
working knowledge of vi
OR the ability to learn how to use both
Tools Required:
A rooted Motorola Droid 4
BusyBox (Android Market)
Terminal Emulator (Android Market)
Android VNC Viewer (Android Market)
Ubuntu Installer App (Android Market)
zeroktal's ubuntud4.zip file (attached to this post and mediafire)
Vi Cheat Sheet (lagmonster.org)
Step by Step:
Install BusyBox, Terminal, and Android VNC Viewer
Install and run Ubunutu Installer App
Follow the on-screen instructions and click next
Download either the Small or Large image to your phone, (use zeroktal's ubuntud4.zip file instead of the boot script provided in the guide) after the image downloads (will take a while because the file is HUGE) click next
For this screen, the instructions differ from the app.
1. With your D4 plugged into your PC in USB Mass Storage, create a directory (folder) called ubuntu in the EXTERNAL sdcard's root*
2. Extract the image you downloaded to that directory
3. Download and extract the attached .sh (ununtud4.zip) to that directory
4. Disconnect your phone from your PC
5. Open terminal and run the following commands:
su [ENTER]
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext [ENTER]
cd /mnt/sdcard-ext/ubuntu [ENTER]
sh ubuntud4.sh [ENTER]
960x540 [ENTER]**​If you get an error message: ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then") see troubleshooting section below.​killall -TERM Xtightvnc [ENTER]
vncserver :1 -geometry 960x540 [ENTER]**​6. Open androidVNC app and enter the following settings:
Nickname: Anything you want
Password: ubuntu
Address: localhost
Port: 5901
Color Format: 24-bit color (4 bpp)
7. Hit connect
8. Hit your menu soft button and then set input mode to touchpad
9. You have ubuntu on your Droid 4!
To "shut down" ubuntu:
press the menu button, select disconnect in VNC
In terminal type this command 3 times (terminal will close itself when you are done):
exit [ENTER]
To "start up" ubuntu again:
Follow steps 5-8 above
Troubleshooting:
If you get the error message: ubuntud4.sh: 45: syntax error: end of file unexpected (expecting "then") you are about to have fun with vi at the command line.
Do the following from inside terminal:
su [ENTER]
cd /mnt/sdcard-ext/ubuntu [ENTER]
vi ubuntud4.sh [ENTER]​If you see ^M or ^ at the end of any line (remember to scroll all the way to the right to see the end of long lines) remove it. once you do that, everything should work just fine. (See the Vi Cheat Sheet above for help with Vi)
Note: Vol Up + E is [ESC] by default in this terminal emulator
Notes:
* It does not have to be on the external SD, but if you put it on the internal SD you will have to modify things as needed-- if you dont know what needs to be changed, just put it on the external SD.
** Screen size can be whatever you want it to be, but 960x540 is the size of the D4 screen.
*** This is a fairly involved process... especially when it comes to editing the .sh file in vi things can get very frustrating and hard, but just take your time and you will get it. As always, doing anything with root access on your phone, especially on the command line has risks. I am not responsible if anything goes wrong with your phone... proceed at your own risk!
greekchampion04 said:
Notes:
* It does not have to be on the external SD, but if you put it on the internal SD you will have to modify things as needed-- if you dont know what needs to be changed, just put it on the external SD.
** Screen size can be whatever you want it to be, but 960x540 is the size of the D4 screen.
*** This is a fairly involved process... especially when it comes to editing the .sh file in vi things can get very frustrating and hard, but just take your time and you will get it. As always, doing anything with root access on your phone, especially on the command line has risks. I am not responsible if anything goes wrong with your phone... proceed at your own risk!
Click to expand...
Click to collapse
I actually got it up and running on my internal sdcard partition. Pretty much just have to modify the Mount remount command, and a few lines in the script.
Here's the original command
Code:
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext
And the modified one
Code:
mount -o remount,rw,exec,suid /dev/block/vold/179:57 /mnt/sdcard
Only things you have to change are the device location(179:57) and mount location(drop the -ext after sdcard)
Now, after that you also have to modify the script a bit. Just go through it, and anywhere that you see sdcard-ext, drop the -ext off the end.
thanks for putting that up for everybody! like i said, if you know what you are doing its not a hard swap to make.
Is anyone else getting just a gray screen when they remote in? What could be causing this?
i had that same problem at first... did you use zeroktal's ubuntud4.zip file? or did you use the ubuntu.sh file included in the app?
I used the sh file included. I did however fix the problem, when mounting at the start i confused vold with void. I did not get the file system mounted properly. This method does work!! however I am currently trying to get bash on my droid to replace sh as the shell. I've checked the forums but have not found anything yet about someone installing bash on the droid 4. With no way for nandroids I feel i should wait before I kill sh.
Sent from my DROID4 using XDA App
If you mod your init.sh in your root directory to the following, your vnc will work on startup without issue. It will also shutdown vnc on exit.
#!/bin/bash
#############################################
# Asks User to screen size and saves as REZ #
#############################################
#echo "Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:"
#read REZ
##############################################
# Pick which desktop environment to use, this#
# is done by having a xstartup file for each #
# desktop, then renaming the one you want to #
# use to 'xstartup' before boot #
##############################################
echo "Please select which Desktop environment you want to use, type the number to select it then press [ENTER]"
echo "1 - LXDE"
echo "2 - Gnome"
echo "Make your Selection:"
read DESKTOP
if [ $DESKTOP == 1 ]
then
mv /root/.vnc/lxstartup /root/.vnc/xstartup
fi
if [ $DESKTOP == 2 ]
then
mv /root/.vnc/gxstartup /root/.vnc/xstartup
fi
###########################################
# Tidy up previous LXDE and DBUS sessions #
###########################################
rm /tmp/.X* > /dev/null 2>&1
rm /tmp/.X11-unix/X* > /dev/null 2>&1
rm /root/.vnc/localhost* > /dev/null 2>&1
rm /var/run/dbus/pid > /dev/null 2>&1
############################################################
# enable workaround for upstart dependent installs #
# in chroot'd environment. this allows certain packages #
# that use upstart start/stop to not fail on install. #
# this means they will have to be launched manually though #
############################################################
dpkg-divert --local --rename --add /sbin/initctl > /dev/null 2>&1
ln -s /bin/true /sbin/initctl > /dev/null 2>&1
###############################################
# start vnc server with given resolution and #
# DBUS server, (and optionally an SSH server) #
###############################################
dbus-daemon --system --fork > /dev/null 2>&1
/etc/init.d/ssh start
vncserver :1 -geometry 960x540
echo
echo "If you see the message 'New 'X' Desktop is localhost:1' then you are ready to VNC into your ubuntu OS.."
echo
echo "If VNC'ing from a different machine on the same network as the android device use the 1st address below:"
##########################################
# Output IP address of android device #
##########################################
ifconfig | grep "inet addr"
echo
echo "If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)"
echo
echo "To shut down the VNC server and exit the ubuntu environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!"
echo
###############################################################
# Spawn and interactive shell - this effectively halts script #
# execution until the spawning shell is exited (i.e. you want #
# to shut down vncserver and exit the ubuntu environment) #
###############################################################
/bin/bash -i
#########################################
# Disable upstart workaround and #
# kill VNC server (and optionally SSH) #
# Rename used xstartup to its first file#
#########################################
killall -TERM Xtightvnc
/etc/init.d/ssh stop
Also save the follow lines between ### as remount.sh on your system partition. Then chmod 755 /system/remount.sh. Now you can just run run from a terminal /system/remount.sh and voila it remounts correctly and starts ubuntu(with the above fixes). Im still working on the unmounts.
####### for the internal sd card
mount -o remount,rw,exec,suid /dev/block/vold/179:57 /mnt/sdcard
/mnt/sdcard/ubuntu/ubuntu.sh
######
OR
####### for the external sd card
mount -o remount,rw,exec,suid /dev/block/vold/179:1 /mnt/sdcard-ext
/mnt/sdcard-ext/ubuntu/ubuntu.sh
#######
great stuff!
feel free
Feel free and take, modify, repost or edit anything I touch.
QUESTION:
After I delete all the ^M and ^ what do i do next? I try to hit the command ":x" to exit and save changes but it just creates another line. Also when I press VOL UP + E to escape nothing happens.
PhanTuhC said:
QUESTION:
After I delete all the ^M and ^ what do i do next? I try to hit the command ":x" to exit and save changes but it just creates another line. Also when I press VOL UP + E to escape nothing happens.
Click to expand...
Click to collapse
In vi, the command to save and exit is :wq (probably short for write and quit).
remember, read up on the vi quick-reference guide: http://www.lagmonster.org/docs/vi.html
OK I fixed it but now its not letting me connect with androidVNC. All the settings entered is correct but when I try to connect it says:
"VNC connection failed!" localhost/127.0.0.1:5901 - Connection refused"
ok, i've gone thru this a few times (slowly and deliberately) and must be missing something...the directions seem pretty straightforward! here's what i know...
busy/terminal/vnc are all installed
small 2.5gb image is unzipped in /sdcard-ext/ubuntu directory
the attached .sh file from page 1 is in the same directory
i removed all ^M using vi
but when I try sh ubuntud4.sh i get an error...
"mkdir failed for /data/local/mnt/ubun, No such file or directory"
(plus a few other errors)
should the directory be "ubun" or "ubuntu"? am I typing something incorrectly?
copy and paste new script
Copy and paste the new scripts I posted. They will fix your problem. Remember to use the remount script from /system/ the rest will work perfectly if you are root. I'll check back later on your progress.
Ok, well I started from scratch (deleted both .img and .sh files) and it's still not working.
I have all the apps installed (and yes rooted, SU works just fine)
I used Ubuntu Installer app to download the image zip (tried both the large and small img)
I downloaded the .sh file from the first post
The /sdcard-ext/ubuntu/ folder now has two files: "ubuntu.img" and "ubuntud4.sh"
All ^M characters have been removed from .sh file
Still no joy...
Ideas? What am I missing?
In terminal, I can set SU permissions and the mount/cd commands work just fine...it's the last sh command that spits out a bunch of errors about not being able to create/find the directories.
I'm going to format the sdcard and try again...any help is appreciated.
Update: Even after re-formatting the SD and following the steps exactly, no luck!
Did you remember to remount the sdcard with exec and suid permissions?
Andbuntu will work much better than this method. It works on every single phone with modification to the "environmental variables".
http://code.google.com/p/andbuntu/
Follow the directions in the script to make the process much easier than the first post.
instructions:
generate an image with rootstock on an ubuntu computer.
put it on /sdcard/ubuntu/ubuntu.img
run the script on your phone with "sh /path/to/script"
Here is the script. http://andbuntu.googlecode.com/svn/trunk/uboot
Also, run "firstRun" to make things like terminals work properly.
Adamoutler: That didnt work for me. The permissions were incorrect on the mounted partitions.
Sent from my DROID4 using XDA App

[webtop] Using cellular network without jumping through hoops

Upfronts: I'm using NottachTrix 1.3.1 with the 2.3.6 Webtop. I'm also a programmer and a network administrator, so I might be a little more comfortable poking around in things that might break my phone than other users. Don't do anything you aren't comfortable with! I'm just reporting my findings. Your phone, your comfort level, your business!
I wanted to get my new lapdock to use the cellular network without jumping through any "enable/disable mobile hotspot" hoops. I finally got all the webtop2sd stuff running, including a working lxterminal and synaptic. I was running synaptic as root from a bash shell ("sudo bash" to give me a root shell, other commands as needed). I noticed that synaptic worked without wifi but firefox didn't. I could also ping various websites with no trouble under the root shell, but the adas user could not. adas COULD ping IP addresses, though, so it seemed like there was a firewall in place that was blocking adas from resolving domain names.
As it turns out, there is a firewall in place that is blocking the adas user from resolving domain names.
Webtop seems to be using iptables to restrict access to the default login user. I typed "iptables -L" to view all the iptables-based firewalling that was going on. Sure enough, three entries existed to block network traffic for the user "adas". After an "iptables -S" to get the commands that were used to turn on the filtering, I was able to reverse the process. (Hint: -A adds a rule, -D deletes one)
From here, I could do a lot of things -- create a script to disable iptables on demand, block the commands from running in the first place, dance a happy little jig... I won't embarrass myself by revealing which I actually did, but hopefully there's enough in this post that will help others resolve their problems in a similar manner!
(By the way, every time the phone is docked, it re-blocks network access, apparently using a file called "syslog-restart".)
If you could fix this would be great, I have the same rom and everything and I use my LapDock in my business and it is always a pain to make it connect and most of the times it fails to connect for me.
Cheers
The following presumes a working lxterminal and synaptic (or apt-get). If you haven't run the webtopscripts to fix the broken dependencies, now's a good time to poke that bear*.
(Type the stuff that's in bold -- comments are in italics)
In lxterminal:
sudo apt-get install nano (Command-line text editor)
iptables -S (generates a list of rules that iptables is currently using)
copy any lines in the "-P OUTPUT ACCEPT" section that start with "-A"
create a new file in nano by typing nano fwdisable.sh
at the top of the new document, type #!/bin/bash and press Enter
paste the copied lines into the resulting screen
insert iptables at the start of each line and change "-A" to "-D" (A for add, D for delete)
once the file looks the way you think it should, exit the program with CTRL-X, saving the file when it asks
at the command prompt, type chmod 755 fwdisable.sh
run your new shell script with sudo ./fwdisable.sh
open up a web browser and enjoy!
* Please don't poke any bears. While they may look fluffy, they react poorly to being poked. There's probably a good metaphor about messing around in the internals of your phone in there somewhere, but for the life of me I just can't find it!
Did you guys can edit a ROM that has it all in a matter of WebTop, I can not make it work on my Atrix in any way.
I do not have the device only the HDMI cable.
Trying to save fwdisable.sh nano give me following error
"Error writing fwdisable.sh Read-only file system"
Please advise
pederb said:
Trying to save fwdisable.sh nano give me following error
"Error writing fwdisable.sh Read-only file system"
Please advise
Click to expand...
Click to collapse
Sounds like you're not root or su
Sent from my MB860 using Tapatalk 2
Ok the drive was write protected, but now I get
" ./fwdisable.sh: line 2: -D: command not found"
" ./fwdisable.sh: line 3: -D: command not found"
I was not able to get it to work with Nano so I used gedit instead but should not make a difference, right?
Any idea?
maybe someone can create a flashable fix so that its easy for some of us noobs lol
studean said:
The following presumes a working lxterminal and synaptic (or apt-get). If you haven't run the webtopscripts to fix the broken dependencies, now's a good time to poke that bear*.
(Type the stuff that's in bold -- comments are in italics)
In lxterminal:
sudo apt-get install nano (Command-line text editor)
iptables -S (generates a list of rules that iptables is currently using)
copy any lines in the "-P OUTPUT ACCEPT" section that start with "-A"
create a new file in nano by typing nano fwdisable.sh
at the top of the new document, type #!/bin/bash and press Enter
paste the copied lines into the resulting screen
insert iptables at the start of each line and change "-A" to "-D" (A for add, D for delete)
once the file looks the way you think it should, exit the program with CTRL-X, saving the file when it asks
at the command prompt, type chmod 755 fwdisable.sh
run your new shell script with sudo ./fwdisable.sh
open up a web browser and enjoy!
* Please don't poke any bears. While they may look fluffy, they react poorly to being poked. There's probably a good metaphor about messing around in the internals of your phone in there somewhere, but for the life of me I just can't find it!
Click to expand...
Click to collapse
Follow this guide guys, it is ridiculously easy, no flashing needed.
I also added a button to the AWN dock with the command:
sudo ./fwdisable.sh
Which will give you one click disabling of the firewall. It will restart the firewall each time you dock/undock it appears, so just dock it, click the firewall disable button and you are good to go.
Norcalz71 said:
Follow this guide guys, it is ridiculously easy, no flashing needed.
I also added a button to the AWN dock with the command:
sudo ./fwdisable.sh
Which will give you one click disabling of the firewall. It will restart the firewall each time you dock/undock it appears, so just dock it, click the firewall disable button and you are good to go.
Click to expand...
Click to collapse
Well I'm still getting my error no matter how many time I try it again
man i cant even get webtop2sd to work. as soon as i run it on my phone it force closes. i havent even got it to open longer then super user request yet.
fingers crossed on a cwm flashable lol.
Thanks for this. I was wondering why apt-get update would work but adas couldn't ping out properly over 3g.
Also, thank you for the walk through in editing iptables there. Interesting that they chose to use that over something more proprietary, or well hidden.
I had this problem at first, too -- I think it was busybox-related. There's a busybox updater or two in the Market (I mean, "Play Store") that will bring you up to speed and let you install webtop2sd.
Sorry it's been so long since my last post! It appears that you didn't insert an "iptables " before the "-D". Check to make sure that each line after the "#!/bin/bash" starts with "iptables -D" instead of just "-D" and see if that takes care of the problem. (Also make sure you execute the script with a "sudo" -- iptables won't work properly as a regular user...)
studean said:
Sorry it's been so long since my last post! It appears that you didn't insert an "iptables " before the "-D". Check to make sure that each line after the "#!/bin/bash" starts with "iptables -D" instead of just "-D" and see if that takes care of the problem. (Also make sure you execute the script with a "sudo" -- iptables won't work properly as a regular user...)
Click to expand...
Click to collapse
should it be,
iptables -D
or
-D iptables
[email protected]:/$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
-A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 8086 -m owner ! --uid-owner adas -j REJECT --reject-with icmp-port-unreachable
-A OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 8085 -m owner ! --uid-owner adas -j REJECT --reject-with icmp-port-unreachable
This is how it looks before editing
It should be "iptables -D". Based on the output from your "iptables -S" command, the file should look like this:
Code:
#/bin/bash
iptables -D OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 8086 -m owner ! --uid-owner adas -j REJECT --reject-with icmp-port-unreachable
iptables -D OUTPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 8085 -m owner ! --uid-owner adas -j REJECT --reject-with icmp-port-unreachable
I also had a third line (that escapes me at the moment -- I'm on a different machine) that further blocked access, but apparently there is a bit of variation in the configuration... At any rate, create the file using whatever text editor you feel most comfortable using, then "chmod 755" the file to make it executable. If you call it "fwdisable.sh", then you should type "chmod 755 fwdisable.sh" in lxterminal and run the file with "sudo ./fwdisable.sh" to disable the firewall.
Good luck! If you want to know more about the workings of this stuff, google "bash scripting guide" and (for a general overview) read the wikipedia page for "iptables". It will help you understand what's up with all these seemingly weird commands...
That worked, but now I get these error messages?
[email protected]:/$ sudo ./fwdisable.sh
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
[email protected]:/$
Click to expand...
Click to collapse
Please advice
Cheers
You should be okay with those error messages. I'm not entirely sure WHY it's looking for that file, but it's "normal" output. If you'll remember, it's the same output you got in the "iptables -S" command... Something about accessing iptables causes the system to look for that file. (I just haven't been bothered enough over it to check yet...)
To verify, run "sudo iptables -S" again to see if there is anything left. You should just see three lines:
Code:
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
Anything more than that and you might need to edit your script as you did before. If the output from "iptables -S" looks like the above, though, fire up firefox and give it a whirl!
studean said:
You should be okay with those error messages. I'm not entirely sure WHY it's looking for that file, but it's "normal" output. If you'll remember, it's the same output you got in the "iptables -S" command... Something about accessing iptables causes the system to look for that file. (I just haven't been bothered enough over it to check yet...)
To verify, run "sudo iptables -S" again to see if there is anything left. You should just see three lines:
Code:
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
Anything more than that and you might need to edit your script as you did before. If the output from "iptables -S" looks like the above, though, fire up firefox and give it a whirl!
Click to expand...
Click to collapse
[email protected]:/$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
FATAL: Could not load /lib/modules/2.6.32.56-MB860-faux123-GB-024/modules.dep: No such file or directory
-A OUTPUT -o ppp0 -m owner --uid-owner adas -j REJECT --reject-with icmp-port-unreachable
[email protected]:/$
Excellent! This means you're almost there! As before, copy/paste that line into your shell script, change the "-A" to "iptables -D" and that SHOULD be the end of it.
No, really. This time for sure. Just re-run the script when you're done (ignoring the "fatal" stuff) and you'll be browsing in no time!

[chroot] Ubuntu or BT5 chroot script

What is a note without the use of a Desktop Environment?
I love the Resolution of this screen 1280x800 (same size as my laptop) why not put it to good use and get Ubuntu running on this thing.
Root is Required with Busybox
Your device needs to be rooted
you can follow this guide http://forum.xda-developers.com/showthread.php?t=1837907
What did I do?
Not much, credit goes mostly to mSullivan and edounn (from I717). I just modified the script and the ubuntu.img file to work for T-Mobile Galaxy Note devices and uploaded the modified IMG to my own web server.
Instructions
Download the Ubuntu.zip Img from here (1.6gb)
extract ubuntu.zip to /sdcard/ubuntu
you should see
ubuntu.sh
mountonly
unionfs
fsrw
ubuntu.img
now from the terminal type
Code:
su
to gain access to root
then type
Code:
sh /sdcard/ubuntu/ubuntu.sh
to start the script
a few questions should pop up about screen resolution and desktop environment
I used
Code:
1280x800
2 - gnome
for my selections
Download Android VNC program and use these as the credentials
Nickname: Ubuntu (or anything you want)
Password: ubuntu (lower case)
IP: 127.0.0.1
Port: 5900
Color: 24bit
Links and what not
this is the original ubuntu.img I modified
http://ubuntuone.com/1Ew1232e3D51PCjYOkkQU7
for backtrack 5 (i have not tested bt5 yet on the note)
you can go directly to the backtrack 5 website and download using
http://www.backtrack-linux.org/downloads/
these options.
Choose: BT5
ARCH: ARM
IMAGE: IMG
I believe it's about 1gb download and 5gb uncompressed and might need to resize the IMG file to use on our fat32 storage. Follow mSullivan post to see how to resize the IMG. (If and when I get BT5 on our devices i will post another howto).
If you already have your own IMG file and don't want to download 1.6gb from my web server. here is the code
Code:
##########################################
#Ubuntu boot script V1 for Tmo Note #
#Built by Donald Hui (x3maniac) #
#Thanks to everyone at XDA! #
##########################################
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];then echo "This script requires root! Type: su"; exit; fi
mount -o remount,rw /dev/block/mmcblk0p24 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export USER=root
mkdir $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
losetup /dev/block/loop255 $kit/ubuntu.img
mount -t ext2 /dev/block/loop255 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox mount -o bind /sdcard $mnt/sdcard
busybox mount -o bind /sdcard/external_sd $mnt/external_sd
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 " "
busybox chroot $mnt /root/init.sh
echo "Shutting down Ubuntu ARM"
umount $mnt/sdcard
umount $mnt/external_sd
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop255
screenshot Dual Core =)
{
"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"
}
[reserved]
this space is reserved. i'm working on making ubuntu more functional and will be posting the how-to's here as i go
Changing root password for ssh login
remember to change the root password. type
Code:
sudo passwd root
Speeding up VNC
this helps but i can't be too sure. i tried streaming video but still a bit choppy.
using nano to edit the init.sh script in the root folder
Code:
nano /root/init.sh
look for the line that says
Code:
vncserver :0 -geometry $REZ
and add -deferupdate 10 to the end like this
Code:
vncserver :0 -geometry $REZ -deferupdate 10
(Explanation)
-deferupdate time
Time in milliseconds, to defer screen updates (default 40).
Deferring updates helps to coalesce many small desktop changes
into a few larger updates thus saving network bandwidth.
lowering this should help with updates since network bandwidth isn't a problem. I tried lowering this to 0 or 5 but it seems it makes the screen try to refresh faster then it can draw causing weird choppiness when on youtube.
compressing local vnc connection with ssh
this command below compresses the traffic from port 5900(vnc) to port 5901. should help speed up vnc
Code:
ssh -C -L 5901:127.0.0.1:5900 -N -f -l root localhost
I'm not sure if in this case this helps or not. Reason: what this does is compress the information going from one place to another, which requires more CPU. besides on a local environment i don't think it helps but i gave it a try anyway.
(Explanation)
-L 5901:localhost:5900 : Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side. Here you are using port 5900 on the localhost to be forward to localhost on the 5901 port.
-N : Do not execute a remote command i.e. just forward ports.
-f : Requests ssh to go to background just before command execution. Requests ssh to go to background just before command execution. Once password supplied it will go to background and you can use prompt for type commands on local system.
-l root : root is the user to log in as on the remote machine (localhost).
localhost (127.0.0.1): Remote system with VNC server
Running Ubuntu on the Note is pretty awesome.
A few things I noticed:
- For some reason the d key in gnome was set as a shortcut to minimize all windows. (I tried to typed sudo but realizing now you are already root because the shell prompt has a # symbol - old Ubuntu habbits)
- apt-get doesn't work "out of the box" you need to add /sbin to your path something like:
Code:
PATH=$PATH:/sbin
Throw that in your ~/.bash_profile
This is because it's trying to run a program in /sbin but since it's not in your path it crashes.
Also I noticed that many VNC clients don't work well with an external mouse. Jump Desktop seems to work very good with an external mouse (non-free).
Also - since I have a 32GB class 10 SD card I put this on there instead of the main memory. If you want to do this you have to edit this line in the script:
Code:
export kit=/sdcard/ubuntu
to
Code:
export kit=/sdcard/external_sd/ubuntu
nadams said:
Running Ubuntu on the Note is pretty awesome.
A few things I noticed:
- For some reason the d key in gnome was set as a shortcut to minimize all windows. (I tried to typed sudo but realizing now you are already root because the shell prompt has a # symbol - old Ubuntu habbits)
- apt-get doesn't work "out of the box" you need to add /sbin to your path something like:
Code:
PATH=$PATH:/sbin
Throw that in your ~/.bash_profile
This is because it's trying to run a program in /sbin but since it's not in your path it crashes.
Also I noticed that many VNC clients don't work well with an external mouse. Jump Desktop seems to work very good with an external mouse (non-free).
Also - since I have a 32GB class 10 SD card I put this on there instead of the main memory. If you want to do this you have to edit this line in the script:
Code:
export kit=/sdcard/ubuntu
to
Code:
export kit=/sdcard/external_sd/ubuntu
Click to expand...
Click to collapse
thank you for your input to get ubuntu working on internal sd card and path.
as for the "D" key. i remember having to change a shortcut using dconf-tools.
unfortunately i bricked my note by flashing something to the wrong partition. (seriously typo) and havn't been doing anything more with this ubuntu.img. but i will continue to host the file for anyone who needs.
x3maniac said:
thank you for your input to get ubuntu working on internal sd card and path.
as for the "D" key. i remember having to change a shortcut using dconf-tools.
unfortunately i bricked my note by flashing something to the wrong partition. (seriously typo) and havn't been doing anything more with this ubuntu.img. but i will continue to host the file for anyone who needs.
Click to expand...
Click to collapse
Do you think you could post some instructions on how to resize the img disk? I looked in the linked thread and he talks about how to set it up but I don't see anything about resizing it. One of the reasons why I am asking is because there doesn't seem to be enough room for a release upgrade:
Code:
The upgrade has aborted. The upgrade needs a total of 869M free space
on disk '/'. Please free at least an additional 69.2M of disk space
on '/'. Empty your trash and remove temporary packages of former
I tried to run fdisk -l on ubuntu.img just to check out the partition table and I get this error:
Code:
Disk ubuntu.img doesn't contain a valid partition table
Edit: doh - I should of realized that a raw image file wouldn't have a partition table. So to resize:
Code:
dd if=/dev/zero bs=1M count=7168 >> data.img
yes | e2fsck -f data.img
resize2fs data.img
yes | e2fsck -f data.img
Though if you are paranoid you can leave off the yes.
Please note - there are tutorials out there that talk about using cp - this is a bad approach not only because you have to copy the files (this is slow) but some of them don't use the parameter to copy the attributes!
However, this presents a problem of why these Linux images are usually only 3.5GB. Fat32 can only have a file up to 4GB. So if you resize - you will need to format your SD card to ext3. Though exFAT should work - I don't know if Android supports that. I suppose that we could separate the image into different mount points - but eventually I think you will hit the 4GB limit.
Edit 2:
This is more frustrating than it needs to be. So I attempted to format the SD card as ext3/4 - Android refused to automatically mount it (even though it mounts system partitions with ext4). So I'm pretty sure in the Android subsystem it has a
Code:
mount -t vfat /dev/mmcblk1p1 /mnt/sdcard/external_sd
. In any case I tried several applications from the app store to add compatibility - with little success. I managed to get NTFS auto mounted at boot - but Android refuses to read the apps from an NTFS sd card (which I have a feeling would be the same with ext4 if I could get it mounted).
So at this point I am trying 2 partitions: most of the SD card is FAT32, and the second chunk will be ext2 for Ubuntu.
Edit 3:
2 partitions are working great. Just altered the script to mount the partition instead of mounting the file. To be honest I think it's a little faster on a separate partition.
Edit 4:
After upgrading System Monitor no longer sees two cores. I am looking into it.

[TUTORIAL] Build CyanogenMod 11 on a VPS or Dedicated Server

Introduction
CyanogenMod 11 is a custom firmware used on android phones and tablets. But, you already know that, chances are you've used it. Building ROMs may seem scary and confusing at first because of the code and terminals, but in reality, it's not that difficult. In this thread, we're going to be discussing how to build CyanogenMod on a VPS or dedicated server. I say a server and not a desktop machine because this is going to be geared towards keeping things simple. When you have only one shell to work with, it's usually easier.
Vocabulary
A couple words you may be unfamiliar with will be described here.
- shell: where you type in the commands on your VPS/dedicated server
- VPS: Virtual Private Server, a type of server that is virtualized from physical hardware
- Dedicated Server/dedi: a dedi is a physical server, it can be an old computer, or (recommended) a server from a server host/data center like Incero or Colocrossing
- Linux: the operating system in which we will build android
- SSH: Secure SHell, the world-standard protocol used to control Linux servers
- bash: the shell we're going to use
Linux Commands
In order to control our server, we won't be using a GUI (Graphical User Interface) where you can click things to make things happen, we will be using SSH. SSH sessions are just a prompt where you type in commands. This is where people get scared but calm the f*ck down. It's not as scary as movies make it seem. Here's a rundown of some basic commands we'll be using.
- cd: change directory, change the folder we are working in, equivalent of changing folders in windows explorer
- mkdir: make directory, makes folders
- cp: copy, it copies files
- mv: move, it moves files
- rm: remove, it deletes files
- ls: list files, it's like dir for windows
- curl: downloads files from URLs
- adduser: adds users, linux has users just like windows
- apt-get: package manager, it's used to install things. In Windows, you usually install things from .exe or .msi files. In Linux, you generally use a package manager. This will be explained more later.
- nano: our text editor of choice for this tutorial. I chose nano because it's very simple and easy to use for a beginner.
Basic Intro to Linux
A few things that I'm going to discuss about Linux are directory structure as well as file structure. In Windows, we have our C: drive, which is where pretty much everything stays. In Linux, we have /, it's the same thing, except it's represented as a slash. If I wanted to edit C:\cookies\morecookies.txt in Linux, the same file path would be /cookies/morecookies.txt. A couple other things about Linux are that the file system is case sensitive, meaning I can have two files named Android and android in the same directory and they won't conflict, whereas in Windows it would. Linux also uses / (forward-slash) instead of \ (backslash) in the directory structures.
Now, our shell is interactive, meaning it's not just a box we type things into, we can use it in different ways. One of the things you should know about bash is ~ (the tilda). ~ in Linux refers to our home directory. Every user has their own home directory (by default at least). Standard users' homes are stored in /home. If my username is tanmay, my home directory would be /home/tanmay/. If I'm logged in as tanmay, ~/android refers to a file at /home/tanmay/android. If I'm logged in as bob, ~/android refers to /home/bob/android. If you don't understand all this completely, I don't expect you to, don't worry. This was just to give you a brief introduction to Linux.
Buying a VPS
I'm guessing most of you already know how to do this, so I'll put it in a spoiler for those who don't need it loading loads of images.
For this tutorial, we're going to use a DigitalOcean VPS, you can sign up here: https://www.digitalocean.com/?refcode=2050223a4edc
After you sign up for DigitalOcean, head to the billing tab and enter in credit card info or put some money in through PayPal to get yourself some credits. Once done, click the big green Create button. The hostname can be anything you want, I usually just make it "android" or "build". Now, you have a choice here, you can spend less and wait longer for builds, or spend more and wait less. I recommend one of these:
{
"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"
}
Any lower and the build will likely just fail, and any higher is just unnecessary. 16GB is plenty, and 8GB will work just fine. You can go with 4GB if you really can't afford it, but I don't recommend it.
In Select Image, choose Ubuntu 12.04.4 x64 and click Create Droplet. Wait for it to spin up, and check your email. You'll have an email like this:
We'll use these details later.
Getting into our server with SSH
In order to SSH into our server, we need a client. The most common client for Windows is PuTTY. PuTTY is free and open source, it can be downloaded here: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe (direct link). Open it and you should see this:
Under IP, type in your server's IP. If you used DigitalOcean, it should be in your email. Click Open and when it says login as:, enter "root" without quotes, and then when it asks for password, use the one supplied in the email.
If you're on Mac or Linux, you can open a terminal and type in:
Code:
ssh [email protected] # replace server.ip with the IP of your server, if you used DigitalOcean, it's in the email
Use the password supplied in the email.
Installing The Necessary Packages
Once we're in, we need to update the server's current packages to the latest ones, we can do so with the following commands.
Code:
apt-get update # update the package sources list
apt-get -y upgrade # upgrade all the current packages
Now that that's done, we can install the libraries and packages we need.
Code:
apt-get -y install git gnupg flex bison gperf \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
apt-get -y install build-essential schedtool screen python-software-properties
Android relies on many libraries and compilers, so we can't build it without them.
Oracle Java is closed source, so we have to do some other things to install it.
Code:
add-apt-repository -y ppa:webupd8team/java # add third party source to the package manager's list
apt-get update # refreshes the sources list to include the one we just added
apt-get -y install oracle-java6-installer
While installing oracle-java6-installer, you will be prompted to accept the Oracle Sun Java license agreement whatever, use your arrow keys to select accept then click enter.
Adding Swap
Even with 8GB of RAM, you'll probably run out of memory, so we use swap. Swap is hard drive space that acts as if it's memory for things that aren't important to the host at the current time. We'll need this, because android takes a LOT of RAM to compile.
Code:
fallocate -l 8G /swapfile # create an empty file that's 8GB in size called /swapfile
mkswap /swapfile # format the file to be swap
swapon /swapfile # turn the swapfile on
Adding a User
Now that we have all the required packages to build, let's add a user to build under.
Code:
adduser tanmay # replace tanmay with your username of choice, must be lower case
Enter the password when it prompts for one, then do
Code:
login tanmay # replace tanmay with the username above and enter the password
You should see something like this:
Note: Disregard the system restart message, it's not necessary for our purposes.
You may have noticed that the prompt changed from "[email protected]:~#" to "[email protected]:~$". This shows we're in our new account.
Setting up repo and Downloading the CyanogenMod 11 Source
repo is the tool supplied by Google used to manage the android source code. Since it's used by AOSP, pretty much every ROM uses repo to manage their source. To install repo, we need to make a folder called bin (binary), where we'll store it. This is mainly for organization purposes. After that, we'll download repo to that folder.
Code:
mkdir ~/bin # create a folder called bin in our home directory
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo # download repo and store it in ~/bin/repo
chmod +x ~/bin/repo # mark the file as executable, so we can run it
export PATH=$PATH:~/bin # explained below
The last line may seem scary, but all it does is take the current PATH variable and add ~/bin to it. If you do
Code:
echo $PATH
you get
Code:
[email protected]:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/tanmay/bin
You can see /home/tanmay/bin at the end of it. This allows us to use the repo command anywhere in the filesystem, not only in the ~/bin directory.
Now let's make a folder for our source code.
Code:
mkdir cm-11.0 # make a folder called cm-11.0
cd cm-11 # move into the directory we just made
You should see your shell prompt change like so:
Code:
[email protected]:~/cm-11.0$
This shows us what directory we are in for reference. Now, let's initialize repo in this folder with the CyanogenMod 11 repo.
Code:
git config --global user.name "Your Name" # Necessary for repo to init
git config --global user.email [email protected] # same as above
repo init -u https://github.com/CyanogenMod/android.git -b cm-11.0
When you get prompted if you want color or not, type "y" then press enter.
Now we need to actually download the source.
Code:
repo sync
This takes... a long time. Sit back and relax. If you're using a server, it'll probably take around 10-15 minutes, if you're on a home line, expect a few hours as the source is around 8GB large.
Getting Proprietary Blobs
Since every phone has different hardware, each one requires different drivers. The Nexus 4 (or mako) has it's own, along with every other phone. We need to download these so that CyanogenMod can compile properly. We can incorporate these into our local build using the local_manifests folder.
Code:
cd ~/cm-11.0/.repo # cd into our repo folder
mkdir local_manifests # make a folder called local_manifests
nano local_manifests/roomservice.xml
On the last line, you'll see an editor (nano) open up, this is editing ~/cm-11.0/.repo/local_manifests/roomservice.xml. The name roomservice.xml is just a formality, it can be anything you want. Anyways, inside the file, paste in the following:
Code:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<manifest>
<project name="TheMuppets/proprietary_vendor_lge" remote="github" revision="cm-11.0" />
</manifest>
Once you enter that in, press CTRL + X, Y, then enter. This will save and exit the file.
Next run
Code:
cd ~/cm-11.0/ # bring us back to the parent directory of the source
repo sync # sync again to download the new project we added
Don't worry, this sync won't take hours like the last one, this shouldn't take more than a minute or two.
Getting Prebuilts and Building!
We're getting to the actual build! What we have to do now is get the prebuilt apps that CyanogenMod comes with. We can do this with the following command.
Code:
~/cm-11.0/vendor/cm/get-prebuilts
Once those download, run the following.
Code:
export USE_CCACHE=1 # ccache is compiler cache, it makes future builds MUCH faster, this is not necessary if you're only going to build once
source build/envsetup.sh # load the commands supplied by CyanogenMod used to build
lunch cm_mako-userdebug # generate the Makefile, the instructions for the compiler on how to build the ROM
ARE YOU READY?! THIS IS IT.
Code:
mka bacon # yes, bacon
Aaaaaaaaaaaaand wait. Wait a lot. This is going to take a LONG time.
Downloading the ROM
To download your ROM, download WinSCP from here: http://winscp.net/eng/download.php
Once installed (or just downloaded), open it and enter in the same credentials that you used in PuTTY except use the username and password we added ("tanmay" in my case) instead of root. Click login, and click Okay for messages that you get prompted for. Once you're in, open the cm-11.0 folder, then out/product/target/mako/. Inside that folder, you should see a zip called cm-mako-something.zip. Drag this file onto your desktop or a folder of your choice and then flash it.
CONGRATULATIONS YOU BUILT CYANOGENMOD 11 FOR THE NEXUS 4
Wasn't so bad, was it?
I hope this guide has helped you, if it has, please press the Thanks button below.
Thanks for reading!
awesome guide bt can u help me regarding mtk ........how can i add device tree and vendor manually
Nice tutorial. Just want to add that if your going with DigitalOcean you have the choice of deploying an instance that has Docker preinstalled on Ubuntu. In that case following this tutorial is much simpler and easier.
http://forum.xda-developers.com/showthread.php?t=2650345
Thanks !
[email protected] said:
awesome guide bt can u help me regarding mtk ........how can i add device tree and vendor manually
Click to expand...
Click to collapse
Hi bro @[email protected]! Check it may be useful:
https://github.com/axet/android_device_mt6592
https://github.com/axet/android_vendor_mt6592
Regards.
hyperion70.

[MODULE] - Magisk GNU Screen

GNU Screen for Android
Here is a module to add the screen command to android shell system wide system-lessly. I sourced the necessary binaries and libs from Termux and adapted to run outside of Termux's sandboxed environment using a wrapper script. From testing it works great on my OG pixel running pie with SElinux enabled.
Useage:
Code:
.┌[09:18 AM] [u0_a224] [/]
└─ $ screen -h
Use: /sbin/.magisk/img/com.geofferey.screen/bin/screen [-opts] [cmd [args]] or: /sbin/.magisk/img/com.geofferey.screen/bin/screen -r [host.tty] Options: -a Force all capabilities into each window's termcap. -A -[r|R] Adapt all windows to the new display width & height. -c file Read configuration file instead of '.screenrc'. -d (-r) Detach the elsewhere running screen (and reattach here). -dmS name Start as daemon: Screen session in detached mode. -D (-r) Detach and logout remote (and reattach here). -D -RR Do whatever is needed to get a screen session. -e xy Change command characters. -f Flow control on, -fn = off, -fa = auto. -h lines Set the size of the scrollback history buffer. -i Interrupt output sooner when flow control is on. -ls [match] or -list Do nothing, just list our SockDir [on possible matches]. -L Turn on output logging.
-Logfile file Set logfile name.
-m ignore $STY variable, do create a new screen session.
-O Choose optimal output rather than exact vt100 emulation.
-p window Preselect the named window if it exists.
-q Quiet startup. Exits with non-zero return code if unsuccessful.
-Q Commands will send the response to the stdout of the querying process.
-r [session] Reattach to a detached screen process.
-R Reattach if possible, otherwise start a new session.
-s shell Shell to execute rather than $SHELL.
-S sockname Name this session <pid>.sockname instead of <pid>.<tty>.<host>.
-t title Set title. (window's name).
-T term Use term as $TERM for windows, rather than "screen".
-U Tell screen to use UTF-8 encoding.
-v Print "Screen version 4.06.02 (GNU) 23-Oct-17".
-wipe [match] Do nothing, just clean up SockDir [on possible matches].
-x Attach to a not detached screen. (Multi display mode).
-X Execute <cmd> as a screen command in the specified session.
┌[09:18 AM] [u0_a224] [/]
└─ $
CHANGELOG:
v1a - Initial Release
v1.1a - Updates to wrapper script & switch to arm bins/libs
v1.2a - Updates to config.sh & screen-setup.sh
v1.2b - Fully system-less, no more mount binding because it's brutal & un-necessary.
*RESERVED*
reserved

Categories

Resources