Wednesday, May 16, 2012

My own Linux distro project Xw0rX 0.1

Big geek wonabe is in myself. I figure that out long time ago trying to make my room a freaking sort of Watch Tower like I assume League of Justice have. I guess knowing what League of Justice is qualifies me as a geek already. But all that away, the reason I'm saying that I'm a geek wonabe, or already am is now I'm planing to make my own Linux Distribution. Well thats big bite for me of course. Of course I'm not gona do it. I just saw somewhere a tools for making your own distro with apps you want. And there it is, I want my distro to be on my flash drive with all my apps witch I need. So you kinda see it now, its actually intro for my app list :))

First, lets start with distro that I'm going to use. Since I'm not gona need Out-of-the-box distro I'm not going to use Linux Mint or similar systems witch have "everything".
I'm gona need a lightweight distro at least based on Debian, and I hope I'm going to have a chance to make one based on Ubuntu of course, cause with those apt-get or aptitude install manager is included and thats the one I got used to. So Ubuntu is the one.

Now the interface. I know that CLI would be the easies way to use all what I need, but I figure it out, for my tasks, I can't survive without GUI. So just CLI won't do it for me.
So about that GUI, I'm still gona need a lightweight one. That kicks out KDE right away from the list, leaves environments that I know to work with like Gnome derivatives, XFACE, LXDE, those *Box environments, and least wanted witch I still have no experience with, like Enlightenment and most interesting to me the tiling window managers like Awesome, Xmonad and many others.
This kinda leaves me in big dilemma, I actually have no idea witch environment to use for my distro. I'm thinking over Gnome, OpenBox and Awesome. I know everything with Gnome 2.x, I can configure almost everything on OpenBox, and have so little experience with Awesome, but going from Awesome to Gnome the performance requirements are rising, not that it matters a lot but, who knows on witch computers I'm gona use my distro. So I'll stay open minded here for now.

So lets start with app list and what every app is for:

sudo - gives me administrative privileges
apt-get - Software install manager
Thunar - File Manager (Browser)
x-terminal-emulator - name seas it all
dvtm - CLI terminal spliting
nano - CLI text editor
leafpad - GUI text editor
gmrun or dmenu - run dialog
geany - programing GUI
epic5 - CLI IRC client
mplayer - media player
audacious - audio player
ffmpeg - enables playing, converting and scripting media files
sox - CLI tool for creating spectrograms from wav files
bluetooth-agent - bluetooth
hcitool - bluethoot tool (for making bluetooth scripts)
grep - mostly for piping text of other tools
dbview - DBF viewer
nmap - universal network tool
aircrack-ng - network hacking set of tools
wireshark - network monitoring tool
bmon - CLI network monitoring tool
clamAV - free antivirus (in case I might need it somewhere)
postler or geary - Email client
firefox - web browser
'tor' or similar - private web browsing
ssh - secure shell
Wicd - Network manager (I might prefer Gnome Network Manager in Gnome)
Calculator - do you really need an explanation :)
file-roller (rar, 7zip, gz...) - compress/uncompress files
gThumb - Image viewer/editor
evince - Document viewer (PDF)
simplescan - Scanning app
transmission - torrent client
rtorrent - cli torrent client
pidgin - multi-platform instant messenger
gparted  - partitioning tool
giver - sharing tool for network between linux systems only
samba4 - sharing tool for windows network
abiword - Text processing tool (like MS Word)
conky - customizable system info tool

Not sure that all this apps are compatible with OpenBox, especially with Awesome, so Gnome would be the one but it might not be the most lightweight, so OpenBox is probably the best solution. So there are few apps for OpenBox that would make it easier to use and customize:

obmenu - menu editing tool
obconf - configuring tool for openbox
openbox-themes - no need to translate :)
nitrogen - wallpaper manager
tint2 - panel

Even if openbox is lightweight and fast, it takes a lot of time to be configured and customized for final release of my distro so that it could be fully usable. But since I'm planing this distro only for personal tasks, I shouldn't care about user friendly environment cause for me, OpenBox is userfriendlly enough.

Now to have some kickoff for this project of mine:

http://maketecheasier.com/build-your-own-ubuntu-based-distro-with-novo-builder/2010/07/02

http://www.tuxradar.com/content/build-your-own-linux-distribution-easy-way

Since I'm looking up to Crunchbang as distro that mine is going to be closest to by functionality and looks, I'm probably going to need this post to get along.

http://crunchbanglinux.org/wiki/adding_crunchbang_features_in_another_distro

From this, you (who every is reading this blog, if any) see that I'm not planing to do all this from LFS (linux from scratch) but with simple GUI that would make all this easy and possible without much of coding from my side. Witch is rational thinking cause my programing skills ain't on some proud level.

So here are some new links that could help me with making my project realization so much easier.



Tutorial here:
http://www.ubuntugeek.com/creating-custom-ubuntu-live-cd-with-remastersys.html
http://klikit.pbworks.com/Remastersys+tutorial+by+dedoimedo
Downloadable here:
http://remastersys.sourceforge.net/remastersystool.html

Since I'm going to need some security/testing/penetrating tools, this commands would remind me of programs I'll need here and there:
http://www.cyberciti.biz/tips/linux-iptables-examples.html

As I'm getting better and better with xterm (or Linux terminal) I'm thinking more about using a tiling window manager for my distro... Awesome and Xmonad are best known as tiling WMs. So if I get more familiar with Xmonad till I start building my distro, here is a link from HGT for using it:
http://www.howtogeek.com/114728/how-to-use-xmonad-a-tiling-window-manager-for-linux/
Find this two:
http://www.haskell.org/haskellwiki/Xmonad/Using_xmonad_in_Gnome

So I actually learned enough about XMonad to start using it.
So here are apps for it that I'd need for starters so I could use it properly:
nm-applet - a panel network manager applet
trayer - panel for xmonad
terminator - I think its best terminal emulator for xmonad by my opinion


I've installed crunchbang on my laptop and xmonad within.
I'm working 95% efficiently with that combination so that could be my final solution for distro+wm.
I'm going to remove all other wms cause with crunchbang  KDE and Gnome are included so there would be options of combining them with openbox, witch sucks for me to be honest and is totally redundant.
For now on, I'm going to be on standby, cause there is a lot of work around, so working on my distro is now secondary task.
I'll work with this crunchbang on my laptop, make it stable and when I'm 100% sure that it works perfectly for me with xmonad, I'll creat distro of it.



Ok so here is crunchbang with xmonad working, with xmobar, terminals, and nitrogen which controls that background, I still don't know how to setup startup applications but all in time...



Now, after enough experience with this XMonad, I realized it can't work on every platform the right way, so that means getting back to some "normal" window manager, that actually for me means that *box window managers are also not going to be included in my wish list right now.


I'm thinking now about Gnome, XFCE or LXDE. Since all those can be find in most Ubuntu distributions, first thought was Lubuntu or Xbuntu.
Lubuntu 10.04.4 would be the great choice now, it's light, uses kernel version 2.*, so its lightweight and user friends at the same time as much as possible.
But before getting it to USB, it would be a good idea to  update it and then disable the updates. So now, here we go with Lubuntu 10.04.4

So here is what I run the first time after installing lubuntu on my laptop:


############################
sudo apt-get update && sudo apt-get upgrade
############################

then after that being done i removed programs I don't need:

#######################################
sudo apt-get remove mtpaint sylpheed osmo aqualung gnome-mplayer
##########################################
which will remove 14 MB, not much but I like to keep things clean.
that being said:

###############################
sudo apt-get autoremove && sudo apt-get autoclean
###############################

Now lets go back to list of programs I do need and install them:

############
sudo apt-get install geany epic5 mplayer audacious ffmpeg grep dbview nmap aircrack-ng wireshark bmon clamav openssh-client openssh-server gthumb rtorrent gparted giver samba4 conky
############

I've skiped few from my list cause there are already similar or better options involved, or simply I realized I don't need them that much.

Ok. So here is the next problem. Lubuntu is quite different from Ubuntu in some parts of functionality, so Novo-builder isn't working in it like it should, or its that the Novo-builder is working only on Ubuntu and not any other derivatives.

So here we are, again, beck to the Ubuntu.
I'm still gonna use 10.04.4 LTS version, since latter versions are quite high on system requirements, and I'm planing to make this distro lightweight one.

Since this time the subject is basic Ubuntu 10.04.4 LTS list of new apps and the ones that  should be removed would be different from the ones I used in Lubuntu.
So here it goes:

Removing:
################
sudo apt-get remove gedit tomboy aisleriot gbrainy gnome-games-common f-spot openoffice.org-* empathy gwibber evolution pitivi rhythmbox
################
I would probably also include removing Nautilus since I want Thunar to be default file manager.

Installing new:
##########
sudo apt-get install thunar thunar-archive-plugin leafpad dmenu geany epic5 mplayer ffmpeg audacious grep dbview nmap aircrack-ng wireshark bmon clamav openssh-client openssh-server rar unrar gthumb evince rtorrent pidgin gparted giver samba4 abiword conky
##########

Ok so here is how this distro looks like so far:


Looks great to be honest. By the background you already see how am I going to name my distro. Of course. As my tech channel on youtube XW0RKS with some additional markings like OS, Linux, x86 or something similar.

So here is how it looks now... Geek factor 95%


Tron theme and some Drakefire Icon theme made it more hollywood, which works for me.

So now I'm ready to make this thing bit more lighther and then try to put it all in single .iso file.

Well so much about lightweights. Distro weights more then one GB. Couse I'm planing to place this distro on USB drive which has less then 1GB, I'll need to do a lot more to make it lighter then this.
 

I managed to shrink it to bit less then 950MB and now it can fit on my 1GB flash, but thats temporary solution for me. I'll see what I can do to shrink it even more after I make it lightweight and fast as it can get.

So now distro looks great:

 
But when I run it from flash drive it looks ugly as hell:

When .iso was created it didn't picked up xw0rks.jpg file from /usr/share/backgrounds/ so there is only this horrible color as wallpaper, and menus are placed by default, and since I deleted all the themes exept the ones I use when distro looks nice, it uses this basic theme for windows and menues.
So for now distro looks like this every time I boot it from USB, but not much is needed for me to customize it back to my planned original 'tron' theme.

Next step is to remove those things that I probably am not going to need at any time.
Samba, geany, dictionary etc.

So I did, now I'm going to chose Openbox as my final solution for lightweight window manager of my distro.

##################################
sudo apt-get install openbox obconf obmenu tint2 nitrogen
##################################

After that I logoff, login to openbox session and remove nautilus and gnome for good.

#######################
sudo apt-get remove nautilus* gnome*
#######################

This command will remove everything related both to nautilus and gnome.

That worked well, nothing but openbox left on my machine, but that comes with new problems.

Most of the things that work on Ubuntu, works over Gnome, so now network doesn't work nor the sound does, and pictures can't be viewed cause there is no software anymore for that.

In Gnome "eog" (eye of gnome) was the viewer for pictures, now it's gonne but I fix that by installing "feh" the most lightweight possible image viewer there is for linux. It's most lightweight cause it really has no interface, you actually run it from terminal, or when you double click the image it opens with only window border and no interface.

For network, I plugged in ethernet cable (cause this is laptop and I want it to have WLAN) so I could install some software.
I tried "wcid" which is network manager for most linux distros, it worked fine for wired but didn't work for wireless connection, in short, wifi doesn't work with it somehow.



I didn't want to experiment with "wcid" and try to make it work with wifi, I just removed it and install the old good "nm-applet" which works perfectly with wifi, it connected right away.

By my opinion, the most important problem to be solved wouldn't be disabled sound, but the fact that autostart script doesn't work. I put autostart file in ~/.config/openbox/autostart and this is the code for it:

####################################

#Panel
tint2 &

#Network
nm-applet &

#wallpaper
nitrogen --set-centered /home/x/Pictures/xw0rks.png

####################################

It seas it all by it self about what it does, or what it should do every time I start openbox-session, but right now for some reasons, unknown to my brain, it doesn't work.


Now, I find out whats the problem with startup programs. I found on every and each forum that autostart programs are placed in .config/openbox/autostart file, but actually its autostart.sh file, it has to be shell thing, so that solves the problem. I just rename autostart to autostart.sh and everything works just fine.

After all of that, I didn't have much will of customizing my distro, I just decided to make it the first time and publish it.

So here it is finally, Xw0rX 0.1:
https://docs.google.com/open?id=0B_yXkeb_Ey2TVUpjSnFYV2hDYzA

Right now, I'm gonna take a break from this distro and continue improving it some other time, for now. So long geeks.

================================================================================

Lets bring now some rational thinking with this.
I'm gonna make another list of programs that I need, this time, I'm gonna use as much as CLI based apps as possible instead of GUI ones.


File Manager - ranger
Web Browser - Chromium-browser
rtorrent - torrent client
x-terminal-emulator - xterm
Text editor - nano and/or leafpad
run dialog - gmrun
irc client - epic5 
media player - mplayer
music player - audacious or mp3blaster
media conversion - ffmpeg
data base viewer - dbview
ssh - openssh-client and openssh-server
network manager - wcid (would probably need to figure out how to work with it)
file compression - file-roller, rar, unrar...
image - feh
pdf - evince
hard drive partitioning - gparted
file sharing - giver, samba
total commander alternative - midnightcommander

In case I use openbox:

panel - tint2
configuring wm - obconf
configuring ob menu - obmenu
themes - openbox-themes

In case I use Gnome

remove: nautilus, evolution and more.

Here are the codes for openbox from ubuntu:

##############
sudo apt-get install openbox obmenu obconf openbox-themes tint2 ranger chromium-browser rtorrent nano leafpad gmrun epic5 mplayer audacious ffmpeg dbview openssh-client openssh-server wcid file-roller rar unrar feh evince gparted giver samba4 midnightcommander
#############

Removing:
#############
sudo apt-get remove gnome* nautilus* gedit tomboy aisleriot gbrainy gnome-games-common f-spot openoffice.org-* empathy gwibber evolution pitivi rhythmbox transmission gnome-terminal
#############