Thursday, November 10, 2011

multiboot -fedora 16, archlinux and vista


this guide will show how i do multiboot, with fedora 16, archlinux and vista, while keeping the linux system partitions (/, /home, /var and /tmp) on lvm2 over encrypted partitions (the guide might not be useful if you want to use encrypted partitions over lvm2).

since my previous article about multiboot, multiboot, here i come, fedora 16 was released and i've managed to ruin my fedora 15 grub config. even though i could fix grub, i've decided to take it almost from scratch (i've kept only the vista partition untouched) and document as much as possible.


the current configuration i have is this:
  • /dev/sda1: fedora 16 boot (150MB, ext2, primary)
  • /dev/sda2: windows vista (70GB, ntfs, primary)
  • /dev/sda4: extended (remaining, up to 1T)
    • /dev/sda5: encrypted (150GB, luks, logical)
      • /dev/mapper/vg_007 (lvm2)
        • /dev/vg_007/lv_swap (2GB, swap)
        • /dev/vg_007/lv_f16_root (25GB, ext4)
        • /dev/vg_007/lv_f16_home (5GB, ext4)
        • /dev/vg_007/lv_f16_tmp (2GB, ext4)
        • /dev/vg_007/lv_f16_var (4GB, ext4)
        • /dev/vg_007/lv_arch_root (25GB, ext4)
        • /dev/vg_007/lv_arch_home (5GB, ext4)
        • /dev/vg_007/lv_arch_tmp (2GB, ext4)
        • /dev/vg_007/lv_arch_var (16GB, ext4)
    • (582GB, free)
    • /dev/sda6: arch boot (100MB, ext2, logical)
    • /dev/sda7: encrypted (160GB, luks, logical)
      •  /dev/mapper/007-ST-DATA-LNX (ext4)
    • /dev/sda8: vista data (40GN, vfat, logical)
i've chosen some small home partitions as i keep most of my data on 007-ST-DATA-LNX and i intend to keep only minimum (like configs) in the /home directories, with big data symlinked from 007-ST-DATA-LNX.

based on other articles i've read on arch configuration, i've also decided to start with a big lv_arch_var.

the 007 is not related in any way with the mi6, but with the hard-disk being my seventh one and also a seagate (thus 007 and ST).


note: this was left untouched since my original installation of fedora 15.

in order to avoid any complications, its always good to install your m$ os as soon as possible, as they can be picky about existing partitions and will always overwrite the mbr.

but even before vista, i wanted to make sure that i have some space reserved for a boot partition.

  • boot from a linux live cd
  • create /dev/sda1 at the beginning of the disk
  • reboot
and continue with vista installation:
  • boot from vista cd
  • install vista

now we could waste the next 8-16 hours to update vista or we could continue with installing your linux distros. i advise the later, as it would allow us at some point to make a backup of a clean vista with ntfsclone.

fedora 16

note: this guide should be usable more or less with any other distro

continuing from the previous step, boot now from the fedora 16 cd into the live system.

no previous encrypted and lvm2 configuration

in case you are using a clean disk, you'll have to add the logical volumes that will keep the encrypted partitions, encrypt them, create a volume group and then add the logical volumes to it.

open a terminal and:
  • gain root:
    $ su -
  • create the logical partition /dev/sda5 (use cfdisk or fdisk)
  • encrypt /dev/sda5 and unlock it:
    # cryptsetup -v -c aes-xts-plain -y -s 512 luksFormat /dev/sda5
    # cryptsetup luksOpen /dev/sda5 007-ROOT
  • create the vg_007 volume group:
    # vgcreate vg_007 /dev/mapper/007-ROOT
  • create the logical volumes (you could create the arch volumes at this point, too, but you can do it also when you'll install arch):
    # lvcreate -v -n lv_swap -L 2G vg_007
    # lvcreate -v -n lv_f16_root -L 25G vg_007
    # lvcreate -v -n lv_f16_home -L 5G vg_007
    # lvcreate -v -n lv_f16_tmp -L 2G vg_007
    # lvcreate -v -n lv_f16_var -L 4G vg_007
  • in order for the installer to go smoothly, it is best to deactivate now the lvm2 and lock the encrypted partition (the installer will ask you later for the password):
    # vgchange -a n
    # cryptsetup luksClose 007-ROOT

using existing encrypted and lvm2 configuration

you don't have to do anything in this case. if you want to unlock and inspect the lvm2 partitions, don't forget to deactivate and lock them before installing the os.

common steps

now that we have the disk partitioned for fedora, simply launch the installer. at some point, the installer will ask Which type of installation would you like? and you should select Create Custom Layout.

the installer will ask for the password used to decrypt /dev/sda5 and will present all existing partitions, including the lvm2 ones.

use this mapping:

partitionmount pointformatfile-system

later on, when asked where to install grub, accept the default /dev/sda.

except the initial part when you manually configure the encrypted and lvm2 partitions, there's nothing very different compared with a regular installation.


installing arch is not that complicated either. just insert the arch cd and boot from it. the boot process should leave you at a root prompt.

now, all you have to do is to:
  • unlock /dev/sda5:
    # cryptsetup luksOpen /dev/sda5 007-ROOT
  • activate the lvm2:
    # vgchange -a y
  • if you haven't created the lvm partitions for arch when you created those for fedora, you'll have to create them now:
    # lvcreate -v -n lv_arch_root -L 25G vg_007
    # lvcreate -v -n lv_arch_home -L 5G vg_007
    # lvcreate -v -n lv_arch_tmp -L 2G vg_007
    # lvcreate -v -n lv_arch_var -L 16G vg_007
  • start the install process:
    # /arch/setup
  • when you get to 4. Prepare hard drives:
    • select 3. Manually Configure block devices, filesystems and mountpoints
    • select dev directly by /dev/*
    • use the mapping in the table bellow
    • select Done when finished
  • when you get to 7. Configure System
    • modify /etc/rc.conf to contain:
    • modify /etc/mkinitcpio.conf to contain (keep the order!):
      HOOKS=...keymap encrypt lvm2 filesystems...
  • skip 8. Install Bootloader as we will use the grub from fedora and we don't want to mess with its config
  • exit the installer and reboot the machine (you will boot to fedora).

arch partition mapping:

partitionmount pointformatfile-system

grub tweaking

ok. we are almost done and all we have now to do is make grub2 boot correctly arch.

by default, fedora's grub2 will try to autodetect windows and arch. while windows autodetection works, the one for arch is not, probably because we are using encryption and lvm.

the solution is simple tough:
  • modify /etc/default/grub to save selected os (nice to have) and to disable the os prober (having that would only clutter the menu):
  • identify the uuid of the windows partition:
    # blkid /dev/sda2
    /dev/sda2: UUID="EC8074DA8074ACA8" TYPE="ntfs"
  • create /etc/grub.d/50_WindowsVista for the vista installation (and make it executable):
    exec tail -n +3 $0

    # partition numbering is like in /dev
    # /dev/sda1 -> (hd0,1)
    # /dev/sda2 -> (hd0,2)
    menuentry "Windows Vista Home Premium" {
            insmod part_msdos
            insmod ntfs
            set root='(hd0,msdos2)'
            search --no-floppy --fs-uuid --set=root EC8074DA8074ACA8
            chainloader +1
  • identify the uuid of the arch boot partition:
    # blkid /dev/sda6
    /dev/sda6: LABEL="ARCH_BOOT" UUID="ee393ce1-bff0-4373-ab79-adab37a506cc" TYPE="ext2"
  • create /etc/grub.d/51_ArchLinux for the vista installation (and make it executable):
    exec tail -n +3 $0

    # partition numbering is like in /dev
    # /dev/sda1 -> (hd0,1)
    # /dev/sda2 -> (hd0,2)
    menuentry "ArchLinux" {
            set gfxpayload=keep
            insmod part_msdos
            insmod ext2
            set root='(hd0,msdos6)'
            search --no-floppy --fs-uuid --set=root ee393ce1-bff0-4373-ab79-adab37a506cc
            linux   /vmlinuz-linux root=/dev/mapper/vg_007-lv_arch_root cryptdevice=/dev/sda5:vg_007 ro vga=773
            initrd  /initramfs-linux.img
  • rebuild the /boot/grub2/grub2.cfg:
    # grub2-mkconfig -o /boot/grub2/grub.cfg
  • install the changes:
    # grub2-install /dev/sda
that's it. now we should have a system that can boot fedora 16, arch linux and vista.

other distros could be added to the mix, though maintaining the grub menu might not be as easy as with arch.

if anybody finds this useful or knows a better way, please let me know.

i would also love to know how i can chainload a second grub2 from the main one, as all the info i've found so far was only how to chainload from grub to grub2, but not from grub2 to grub2.

Tuesday, November 08, 2011

certifications on odesk

while looking for contracts, i've came across the oDesk. in their own words:

oDesk is the marketplace for online workteams, with the best business model for both employers and contractors.

one nice feature of oDesk is that you can take a couple of test to asses your knowledge and expertise in various areas. and you can do that for free!

tests have a 40 minutes limit and can be repeated after 30 days, if you haven't made it perfect from the first and think you can do better a second (or third, forth, etc...) time.

once finished, the test will also show you what are your weak areas, so that you can concentrate on improving those in particular.

according to the oDesk, i'm in the top 20 programmers that have taken the python and c++ test from oDesk. it's not bad, but it could be much better :-)

so, while i'm not sure if i will get even one contract via oDesk, at least i know what i should improve and where i've started to get rusty.

oDesk Certified C++ Programmer oDesk Certified Python 2.x Developer

Saturday, November 05, 2011

multiboot, here i come

these past days i've been doing some late autumn cleaning through my pc and laptop and finally settled to use my pc as the main box.
this also gave me an opportunity to do some clean installs and reorganize my disks.

for a long time i've wanted to try other distros. doing that in a virtual machine is kind of ok (with the added benefit that you always have something that works and a web browser at hand to look on the net for answers), but you never get 100% of what the machine can give. it's also the problem that, if you discover that you like more the distro from your VM, than you have to reinstall it again on the hard-drive to use it directly.

after a lot of thinking i've decided to try multibooting.

this is nice, as i always have something that work just a reboot away, but, at least the solution i came with, not without its share of problems. overall, i find it quite acceptable.

for me, these were the main challenges of multiboot:
  • maintain the list of boot-able OS's up-do-date
  • make sure that when installing a new os i don't destroy the booting capability of the existing ones (or i have at least some way to recover that booting capability later)
  • maintain the content of /boot for each linux distro

at the present i have these OS's installed:
in a couple of days fedora 16 is going to be released and i'll put it along the other distros, while keeping fedora 15 for a couple of weeks until fedora 16 stabilizes - no new release is without its share of small problems and i'm sure this will be case, too. having already a multiboot system in place should make this much simpler.

i might also try, at some point, sabayon 7 or ubuntu 11.10.

the hardware for my main box is:
there is no dedicated video card, as the Intel 3000HD from the i5 worked quite ok until now. this allowed me to reduce power consumption, heat and noise to a minimum, and this is always a good thing in my book ;-)

the only driver problem so far was with the network driver from fedora 15 (and archlinux core CD): the driver was a bit finicky and the connection dropped a lot. the best solution was to download the driver sources from realtek support page, compile the driver and install it
bellow is a diagrams with my current partitions. i use one unencrypted lvm2 for linux boot partitions and one encrypted lvm2 for the rest of the linux partions.

in the next couple of days i'll try to post more info on how i've configured the system.

let me know if this is useful to you.

Tuesday, October 18, 2011

backlog - got married

this summer, me and cristina finally got married... not sure if i should put this on my linkedin profile, as job experience, even though it was quite a challenge to do everything in a little over 1 month :-)

After the civil ceremony
16 August 2011
After the wedding, at Popa Tatu Church
25 September 2011

Monday, October 17, 2011

quake report

i've discovered recently a very nice qt4 book: beginning nokia apps development - qt and html5 for symbian and meego.

quake report is loosely based on the things thought in the first half of that book, in the shake app.

like shake, it is a simple app that connects to usgs, downloads the xml with the latest quakes around the world and displays them, as a list or on a map.

so what's different then?

quake report:
  • uses the location service to display the map and the events on the map
  • the map can be zoomed in and out, using the +/- buttons, the mouse wheel (on desktop) or with a pinch gesture
  • the size and color of the event markers shows the size and age of the events
  • details of an event can be shown directly on the map, if desired

the code is on sourceforge and distributed under GPLv3.

quake report compiles and runs successfully on desktop (fedora), symbian and meego harmattan. unfortunately, the code is not compiling on maemo, due to missing map support. as it uses qt widgets, not qml, the apps compiles and runs on meego harmattan, but looks kind of out of place. due to all of these, the only binary that i provide is for symbian^3. you can download it from ovi or install it directly from your symbian phone, through the store application.

Map view.
The size of the marker is proportional with quake's magnitude.
The markers get darker the older the events is.

List View.
The events are order by their age,
with newest at the top.

Details view.

Tuesday, October 04, 2011

the mer project

as expected, i'm not the only one nonplussed by the tizen. some people decided to reboot mer (from maemo reconstructed).

this project sounds more open than tizen: at least they plan to use open governance, not invite-only membership, as in tizen. as such, it should hopefully be less prone to big corps influence, too, so we will not have something similar happening next year, when intel, samsung or the linux foundation decides to launch yet another platform.

qt is here to stay

while hanging around on #mer, somebody pointed me to

so if you were wondering what will happen if nokia changes the license of qt to some close license, rest assured: the last free version will be re-released as BSD or some other free license (i would still prefer, in such a case to actually be LGPL and GPLv3, as it is now).

Thursday, September 29, 2011

killing me softly (aka tizen is announced)

my whole yesterday was ruined by the announcement that meego is dead and a new mobile platform, tizen, is to take it's place.

i'm still trying to grasp the reasons that determined intel to go mad, but, so far, i can't find much.

what we know so far is that the tools of choice for this platform will be html5/javascript. bye-bye 'simple xbmc remote', or, as other put it on irc, anything more than rss readers and fart apps.

apparently there will be some native sdk, but nobody knows yet what UI toolkit will be used, what development platforms will it run on (that is, will it run on gnu/linux?) and how much effort will you have to put into keeping your app up-to-date with the sdk if you choose to do a native app. some people on the #tizen irc channel speculate efl & co will be used, as samsung, intel's partner in this new platform, has a lot of vested expertise and time in these.

nomovok apparently will provide support for qt on tizen and, from their announcement, you would guess they already have a working tizen at their fingertips.

the funny thing is that nobody else knows what tizen will be. not publicly, at least.

my hopes of qt being a first class citizen in tizen are slim.

people on irc (the main source of info at this point) claim that qt is associated with nokia and due to elop's decisions, all ties with qt and nokia had to be cut off.

some even fear that nokia owns qt's copyright and can close its source. what a load of frak! once (l)gpl, always (l)gpl and you can always fork the latest free version, even if they (nokia or digia) decide to change the license. and if that happens, all i can foresee is they will end up with some product like openoffice or xfree86 - everybody else uses libreoffice and

others say that intel doesn't give a frak about the UI used and it simply wants a phone manufacturer on board: nokia used qt, so it was qt for meego, samsung uses efl, so it might be efl for tizen. funny thing is that both nokia and samsung produces arm phones, not intel ones...

so where does this leaves me?

i'll continue with qt until things become clearer. hopefully, i'll be covered for the next 2-3 years on the mobile front, with symbian phones, until elop pulls its plug completely.

and then we have the desktop. with kde using qt and qt being lgpl, i have a lot of confidence that qt will be here for years to come.

Monday, September 26, 2011

simplexbmcremote for maemo in ovi

the circle is now complete: simplexbmcremote for maemo is now also in ovi.

this might come as unexpected, but porting the remote to QML on Maemo5 (N900) was the most complicated of these QML ports (MeeGo Harmattan, Symbian and Maemo5), as the current reference Maemo5 firmware has no QtQuick Components and many things had to be implemented by hand.

at least now all appear to work and i can start investigating something new (like adding Bluetooth support, if i can figure out how to do it (-: ).

Monday, September 19, 2011

simplexbmcremote for symbian^3 in ovi

the symbian^3 version of simple xbmc remote has also been accepted and published on OVI. go and get it or install it directly from your phone!

the meego harmattan version has also been cleaned a bit.

Wednesday, September 07, 2011

simplexbmcremote in ovi

just received a confirmation email that the QML N9/N950 version of the simple xbmc remote is now available via ovi store.

Saturday, May 28, 2011

simplexbmcremote 1.00.0

all planned features implemented, no bug reports in the past couple of weeks: the final 1.00.0 version is here (the only change is the version bump).

Saturday, May 21, 2011

pycomicsviewer on sourceforge

funny thing, but somebody was actually interested in my old pycomicsviewer and even sent some patches.

in order to consolidate my portofolio of open source projects, i've moved it on sourceforge. nothing new yet, just moved the code and updated some links in the docs.

Friday, May 06, 2011

simplexbmcremote 0.11.1

this is a minor release. the changes are:
  • added backspace button [implemented ID: 3296099]
  • made the legend dialog show in portrait

Saturday, April 30, 2011

simplexbmcremote 0.11.0

after a lot of hard work, i declare the simple xbmc remote mostly finished.

release 0.11.0 can be considered a RC, as i've implemented all the features i wanted.

i don't plan new features in the near future and, if there are no major issues reported, i'll rename it into 1.0.0.

changes in 0.11.0:
  • added configuration for fullscreen startup
  • enable the custom screen saver via the main menu
  • added button to restore default settings in the setup dialog

changes in 0.10.0:
  • use the event server api to solve freeze problems in the context menu (port must be changed to 9777)
  • cleaned up the code

Monday, April 25, 2011

simple qt: detect when the current window becomes active

for my simple xbmc remote, i wanted to be notified somehow when the main window loses or gains the focus and the custom screen saver is active, so that i can deactivate it while the app is not in focus.

without this, you could get your screen dimmed or locked by the simple xbmc remote, even though you were actually doing something completely different and the app was somewhere in the background.

my first approach was to create a timer and interrogate periodically the main window if it is still the active one (via QWidget::isActiveWindow). not very elegant.

a nicer approach is to connect to the QApplication::focusChanged signal.

Saturday, April 23, 2011

simplexbmcremote 0.9.1

just after releasing the 0.9.0 i've discovered that the lock timeout value was not saved correctly. so here you have the 0.9.1.

also, i've just discovered that the navigation no longer works in the context menu (as some reported, but never been able to reproduce on my box before).

the 0.9.1 is now in the extras-devel repo and on sourceforge.

Friday, April 22, 2011

simplexbmcremote 0.9.0

this is my small Easter egg gift to all n900 owners - a new release for the simple xbmc remote.

new in this release are:
  • working alternate dim and lock mechanism
  • a new menu entry that opens the homepage in the default browser
  • a new key code sent when pressing the ESC button - hopefully this will make ESC work for more people, without breaking anything

Saturday, April 02, 2011

simplexbmcremote 0.8.4-1

finally managed to upload a new version of simplexbmcremote to extras-devel. the upload failed for 0.8.3 and 0.8.4 due to a missing build dependency. now that's fixed and you should be able to retrieve it via the extras-devel repo.

the code for the 0.8.4 from extras-devel is actually tagged with 0.8.4-1 in the git repo. the 0.8.4 tag was done before trying to upload the first time to extras-devel. i'll try to be more consistent next time and tag the git only after successfully uploading in extras-devel.

Sunday, March 27, 2011

moved single xbmc remote to sourceforge

i have just finished moving the git repository and the web page to sourceforge. please use this new location for code pull, bug reports or discussions:

Friday, March 18, 2011

simplexbmcremote 0.8.2

this is a minor update that adds three more buttons:
  • the esc button (same functionality as pressing ESC on the keyboard)
  • the gui button (similar with pressing TAB on the keyboard)
  • the context menu button (similar with pressing C on the keyboard)

Monday, March 14, 2011

help japan

in case you didn't know already, if you want to help japan in these dire times, you can make a donation via american red cross or via paypall. just to name a few.

Sunday, March 13, 2011

simplexbmcremote 0.8.1

after a lot of struggles to get it packaged and uploaded to the maemo's garage, my simple xmbc remote is finally in the extras-devel.

the remote is not very fancy, but it allows me to do what i need:

  • navigate through my movies collection,
  • select a movie, 
  • start/pause/it,
  • jump forward and backward in the movie,
  • control the audio volume,
  • change the language and subtitle.
to use it effectively, you will have to enable remote control in the xbmc networking. you'll also have to set the correct ip and port in the simple xbmc remote via its setup dialog.

the application does not start the xbmc, so you must have it already started or you'll get an error message.

you can rate it at the code is available in the garage.

Wednesday, February 16, 2011

in helsinki

Ok, so now I'm in Helsinki and will develop automated testing tools for F-Secure.

All looks very promising and, if I'm able to withstand the extreme cold that arrived here just a couple of days before me, I hope I'll enjoy it much more than my last contract in France.

The contract is for 4 months, with 1 month notice. Not too little, not too much, exactly on my taste. Ends when the summer starts, in time for a nice and long delayed holiday ;-)

Pictures will be on Picasa, as always.

Saturday, February 12, 2011

status update

Since December 2010 I'm back in Bucharest. Since January 2011 I'm free of contract.

The French experience left me with mixed feelings, but for the near future I will avoid a new contract in France (or with a French company) unless it pays an indecent amount of money and it is something that really, really, really, really, reeeeally interests me.