Installing GENTOO 2008.0 on a QEMU DISK IMAGE (and KDE4).

Dieses Thema im Forum "Gentoo" wurde erstellt von SueBradely12345, 22.08.2008.

  1. #1 SueBradely12345, 22.08.2008

    SueBradely12345 GESPERRT!

    Dabei seit:
    Installing GENTOO 2008.0 on a QEMU
    DISK IMAGE (and KDE4).

    A couple of years ago, I wrote a script to automatically install Gentoo 2006.0 from the Gentoo LiveCD. Recently, I trimmed the script to install Gentoo 2008.0 on a Qemu (virtual) hard-disk. I used the KVM version of Qemu, but everything should be the same for non-KVM Qemu. This guide was written for those using an AMD64 system, but other systems should be similar. Most of the necessary changes are obvious.

    Download the following:
    livecd-amd64-installer-2008.0-r1.iso (696M)
    portage-20080721.tar.bz2 from (31M)

    Although, I recommend the 2008-07-21 version of portage, because it has been checked and is known to compile KDE 4.0.5, you may wish to use the latest portage version which can be found here:

    portage-latest.tar.bz2 from (31M)

    mkdir /b 
    The directory /b will be seen by Qemu/KVM as the hard-disk /dev/hdb.

    mv portage-20080721.tar.bz2 /b 
    chmod +x 
    /sbin/modprobe kvm-amd 
    qemu-img create -f raw gentoo.img 10G 
    qemu-system-x86_64 -boot d -m 256 -soundhw es1370 -usbdevice tablet \ 
          gentoo.img -cdrom livecd-amd64-installer-2008.0-r1.iso -hdb fat:/b & 
    Although the Gentoo LiveCD recognizes the Qemu Cirrus Logic video card and sets the correct driver in the xorg.conf file, the X-server is unable to start the graphics environment (it turns out that the cirrus drivers have not been compiled). The screen flashes a few times and a window appears asking if you wish to see the X log. Say no, then OK and hit return a couple of times to get to the console. Once at the console, enter the command:

    vi /etc/X11/xorg.conf 
    Search for the string cirrus and replace it with vesa.

    Alternatively, you can also use the following commands to edit the xorg.conf file:

    mv /etc/X11/xorg.conf /etc/X11/xorg.conf-old 
    awk '{print gensub(/cirrus/,"vesa","g")}' /etc/X11/xorg.conf-old > /etc/X11/xorg.conf 
    After editing xorg.conf, start the window manager Xfce4 with:

    Open a terminal window in Xfce4. Then mount the first (and only) partition of /dev/hdb and run the script:

    mkdir /b 
    mount /dev/hdb1 /b 
    (the script assumes /dev/hdb1 is mounted on /b)
    (run the script)

    The script will partition the virtual hard-disk /dev/hda and set up Gentoo 2008.0 on /dev/hda3. Of course, these days you no longer need a swap partition and you never needed a boot partition. However, to keep in step with Gentoo we will have both.

    I would have usually formated /dev/hdb3 with the Reiser3 filesystem, however, this usually extremely reliable filesystem, has been deliberately sabotaged. This sabotage causes massive corruption of files after a short time. By comparison, I have used the Reiser3 filesystem for nearly ten years now and have never had any corruption, at all, on any of my many Reiser3 boxes.

    When the script finishes, you should:

    Shutdown the LiveCD. 
    Then boot up Gentoo 2008.0 from the hard-disk, with:

    qemu-system-x86_64 -m 256 -soundhw es1370 -usb -usbdevice tablet gentoo.img & 
    At this point you have a functional Gentoo system which uses the Xfce4 desktop.

    The sound does not work because (since at least 2005) Gentoo has refused to compile the LiveCD kernel with the ALSA OSS emulation option. This means that the sound does not work for a few (very popular) older cards. The symptom of this problem is that the device /dev/dsp does not get created. This old, well-known problem, is easily fixed by recompiling your kernel with the following options:

    Device Drivers  --->
        Sound  --->
            Advanced Linux Sound Architecture  --->
                <M> Sequencer support
                <M> Sequencer dummy client
                <M> OSS Mixer API
                <M> OSS PCM (digital audio) API
                    [ * ] OSS PCM (digital audio) API - Include plugin system
               [ * ] OSS Sequencer API
               [ * ] Support old ALSA API
    A new kernel will also stop the system loading every pata and sata module it can find.

    The script adds 8139too and snd_ens1370 to /etc/modules.autoload.d/kernel-2.6 which causes the correct ethernet and sound kernel modules to be loaded at boot. To connect to the internet using Qemu's default networking, you need to connect to Qemu's DHCP server, which you do with the command:

    dhcpcd eth0 
    Adding the KDE desktop to your Gentoo system.

    First, you must uninstall the QT 4 libraries on the LiveCD with (you may ask why they are there):

    emerge -C qt:4 
    If you used the script, then this has been done for you.

    If you want KDE4 (version 4.0.5), then hide the package.mask file (only for KDE4) with:

    mv /usr/portage/profiles/{package.mask,hide-package.mask} 
    If you want KDE3 (version 3.5.9), then do not hide the package.mask file.

    Now you should check what happens in a dry run:

    emerge -pv mesa 
    emerge -pv kde-meta 
    KDE 3.5.9 is chosen automatically if you did not hide the package.mask file and KDE 4.0.5 is chosen if you did.

    Then you should download all the source files with:

    emerge -f mesa
    emerge -f kde-meta 
    Now you should compile everything. This took somewhere between 12 & 16 hours on my box. I think that is good, considering that the compilation is being done in a virtual system. For KDE3 the following commands were necessary:

    emerge mesa 
    emerge flex 
    emerge kde-meta 
    For whatever reason, kdepim-meta-3.5.9 and related packages did not compile. Everything else did. If you need kdepim 3.5.9, you should use a version of portage different from portage-20080721.tar.bz2.

    For KDE4 these commands were necessary:

    emerge mesa 
    USE="mdnsresponder-compat" emerge avahi 
    USE="-doc" emerge glib 
    emerge kde-meta 
    Without the proper USE-variable KDE4's compositing is disabled at compile time. The stated reason is that the X-org development headers are missing. However, this is not true. You need USE="xcomposite" and even with this, compositing is not possible for older graphics cards, like the Cirrus Logic. The script now sets some USE-variables, like xcomposite, for you. You should check /etc/make.conf and see if you approve of the choices. Remember that the default USE-variables are listed in:


    and your current configuration can be seen by typing:

    emerge --info 
    Now you need to configure KDE.

    This is done by changing a line in your /home/gentoo/.dmrc file.

    For KDE4, change the line Session=xfce to Session=kde-4.

    You should save the downloaded files so that you can trash your virtual Gentoo system without losing them.

    First, shutdown Gentoo. Then mount the image gentoo.img with:

    mount -o loop,offset=$((1124550*512)) gentoo.img /1 
    1124550 is the number of sectors to the start of the 3rd partition. It comes from:

    fdisk -lu
    Disk /dev/hda: 10.7 GB, 10737418240 bytes
    255 heads, 63 sectors/track, 1305 cylinders, total 20971520 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Disk identifier: 0x934947c5
       Device Boot      Start         End      Blocks   Id  System
    /dev/hda1   *          63      128519       64228+  83  Linux
    /dev/hda2          128520     1124549      498015   82  Linux swap / Solaris
    /dev/hda3         1124550    20964824     9920137+  83  Linux
    Now you can copy files to and from the image. To save the downloaded files:

    mkdir /gentoo 
    cp -r /1/usr/portage/distfiles /gentoo 
    Don't forget to unmount your Gentoo disk image before booting Gentoo 2008.0.

    umount /1 
    So, what did I think of KDE4. Well, the main selling feature of KDE4, compositing, is turned off for older graphics cards like the Cirrus Logic. The system complains that: Required X extensions (XComposite and XDamage) are not available. KDE4 has more polished graphics, but it is missing some of the little features that made KDE3 so useable. The start "menu" is awful and it would be hard to use KDE4, if one was forced to use this grotesque feature. Thankfully, SuSE 11.0 has the old menu as an option. Things like the taskbar icons cannot be moved and some configuration options are poorer. Hopefully, KDE4 will catch up with KDE3 soon. However, at this point, KDE4 is definitely a regression.

    If I get time I will write an article on how to transfer your virtual Gentoo 2008 system to a system using your real hardware.

    For further information I recommend the Gentoo installation manual.
  2. Anzeige

    Schau dir mal diese Kategorie an. Dort findest du bestimmt etwas.
    Registrieren bzw. einloggen, um diese und auch andere Anzeigen zu deaktivieren
  3. #2 SueBradely12345, 23.08.2008

    SueBradely12345 GESPERRT!

    Dabei seit:
    For those who just want to see what the script does, here are the commands:

    Für diejenigen, möchte nur sehen, was das Skript tut, hier sind die Befehle:

    echo -e "n\np\n1\n\n8\nn\np\n2\n\n70\nn\np\n3\n\n\nt\n2\n82\na\n1\np\nw"|fdisk /dev/hda
    (partitions the virtual harddisk)
    mkfs.ext2 /dev/hda1 (formats the boot partition)
    mkswap /dev/hda2 (sets up the swap area)
    mkfs.ext3 /dev/hda3 (formats the Gentoo 2008 partition)
    mkdir /1 (creates a mount point for the 3rd partition)
    mount /dev/hda3 /1 (mounts the 3rd partition)
    cd /mnt/livecd
    tar -cpf - * | tar -C /1 -xpf - (copies the LiveCD)
    rm -f /1/usr/portage/{eclass,profiles} (removes some links)
    tar -xjpf /b/portage*.tar.* -C /1/usr/ (unpacks the copy of portage in /b)
    rm -f /1/etc/gconf /1/var/db (removes more links)
    mv /1/usr/livecd/gconf /1/etc (copies configuration files)
    mv /1/usr/livecd/db /1/var (copies emerge database)
    rm -fr /1/usr/livecd (some house-keeping)
    rm -f /1/home/gentoo/Desktop/* (more house-keeping)
    rm -f /1/etc/runlevels/default/{autoconfig,local} (important)
    awk '{print gensub(/cirrus/,"vesa","g")}' /etc/X11/xorg.conf > /1/etc/X11/xorg.conf
    (corrects the graphics configuration)
    cp /etc/profile.csh /1/etc/profile.csh (copies eselect configuration)
    cp /etc/ /1/etc/ (adds /usr/local/lib to
    echo -e "ACCEPT_KEYWORDS=\"~amd64\"
    FETCHCOMMAND=\"/usr/bin/wget -t 2 -T 30 --passive-ftp \\\${URI} -P \\\${DISTDIR}\"
    USE=\"arts xcomposite htmlhandbook mplayer ffmpeg flac a52 aac cdparanoia cdr dv dvd dvdr
    dvdread gimp imagemagick gif ncurses gcj fortran zlib cups curl curlwrappers doc nls\"
    VIDEO_CARDS=\"cirrus fbdev glint i810 mach64 mga neomagic nv r128 radeon s3virge savage
    sis tdfx trident vesa vga via vmware voodoo\"
    CAMERAS=\"adc65 agfa_cl20 aox barbie canon casio_qv clicksmart310 digigr8 digita dimagev
    dimera3500 directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 kodak_dc120
    kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150 largan lg_gsm
    mars mustek panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859
    pccam300 pccam600 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2 ricoh ricoh_g3
    samsung sierra sipix_blink sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55
    soundvision spca50x sq905 stv0674 stv0680 sx330z template toshiba_pdrm11\"
    " | tee -a /1/etc/make.conf (adds USE-variables, etc, to the make.conf file)
    echo -e "#filesystem mount type options dump fsck-order
    /dev/hda1 /boot ext2 defaults 1 2
    /dev/hda2 swap swap defaults 0 0
    /dev/hda3 / ext3 noatime 0 1
    none /proc proc defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/fd0 /a vfat user,noauto 0 0
    /dev/cdrom /cd iso9660 user,noauto,ro,exec 0 0
    " | tee /1/etc/fstab (creates a new fstab file)
    chroot /1 /bin/bash << EOG (change-roots to the new system)
    mount /dev/hda1 /boot (mounts the boot partition)
    grub-install /dev/hda1 (installs the grub machinary)
    /sbin/grub --batch << EOB (configures the grub machinary)
    root (hd0,0)
    setup (hd0)
    passwd << EOP (sets the root password as the single letter p)
    umount /boot (unmounts the boot partition)
    emerge -C qt:4 (emerge --unmerge qt:4)
    exit (exits the change root environment)
    mount /dev/hda1 /1/boot (mounts the boot partition)
    cp -r /boot/* /1/boot/ (copies the boot machinary)
    echo -e "default 0
    timeout 5
    title GENTOO 2008.0 kernel-genkernel-x86_64-2.6.24-gentoo-r7 /dev/hda3
    kernel (hd0,0)/kernel-genkernel-x86_64-2.6.24-gentoo-r7 root=/dev/ram0 real_root=/dev/hda3 udev ro
    initrd (hd0,0)/initramfs-genkernel-x86_64-2.6.24-gentoo-r7
    " | tee -a /1/boot/grub/menu.lst (adds a boot entry to the menu.lst file)
    echo -e "8139too\nsnd_ens1370" >> /1/etc/modules.autoload.d/kernel-2.6
    (makes sure the ethernet & sound drivers are loaded at boot)
  4. #3 GendoIkari, 23.08.2008

    GendoIkari Routinier

    Dabei seit:
    Dort wo die Sonne aufgeht...
    It may be a good way for gentoo noobs to get a running system. But there is no effect of learning how gentoo is working.

    (war um ist der ganze threat in englisch? will da jemand sein englisch mal testen?)
  5. Andre

    Andre Foren Gott

    Dabei seit:
    No, it seams that this Guy is from New Zealand :)
  6. #5 GendoIkari, 24.08.2008
    Zuletzt bearbeitet: 24.08.2008

    GendoIkari Routinier

    Dabei seit:
    Dort wo die Sonne aufgeht...
    very cool that he is interested in gentoo an these page.
    EDIT (autom. Beitragszusammenführung) :

    For me is this script an good possibility to make an komplit and autark auto install cd/dvd for an PC with out internet. You must only link the files on the cd.
  7. #6 SueBradely12345, 24.08.2008

    SueBradely12345 GESPERRT!

    Dabei seit:
    Your argument is wrong.

    Most people who try to get gentoo running, fail, give up and learn nothing.

    Giving them a platform from which to learn about gentoo, eventually has them learning a lot more.

    Ihr Argument ist falsch.

    Die meisten Menschen versuchen, um gentoo laufen, scheitern, aufgeben und lernen nichts.

    Durch die Bereitstellung einer Plattform, von denen zu lernen über Gentoo, schließlich hat Lernen sie eine Menge mehr.
  8. Anzeige

    Vielleicht findest du HIER Antworten.
    Registrieren bzw. einloggen, um diese und auch andere Anzeigen zu deaktivieren

Installing GENTOO 2008.0 on a QEMU DISK IMAGE (and KDE4).

Die Seite wird geladen...

Installing GENTOO 2008.0 on a QEMU DISK IMAGE (and KDE4). - Ähnliche Themen

  1. sysinstall: Installing X.Org distribution

    sysinstall: Installing X.Org distribution: Hallo, viel weiter bin ich nicht gekommen :( Bin gerade beim Punkt Installing X.Org Distribution. Bei mir läuft es so ab: es wird ein Packet...
  2. black screen before installing

    black screen before installing: Konnte an vielen Stellen von Leuten lesen, die suse 10 installieren konnten, danach beim bootvorgang vor einem schwarzen Bildschirm standen....
  3. Gnome ohne Systemd bei Gentoo und Funtoo

    Gnome ohne Systemd bei Gentoo und Funtoo: Das GitHub-Projekt »GNOME Without Systemd« will für Gentoo und dessen Derivat Funtoo die Möglichkeit bieten, die Desktopumgebung Gnome ohne...
  4. Google bringt WLAN-Router mit Gentoo Linux auf den Markt

    Google bringt WLAN-Router mit Gentoo Linux auf den Markt: Google stellt einen Router vor, der mit Gentoo Linux läuft und dem ac-Standard entspricht. Der »OnHub« genannte Router wurde zusammen mit dem...
  5. gentoo-filemanager neue Dateiendung mit bestimmter SW öffnen lassen

    gentoo-filemanager neue Dateiendung mit bestimmter SW öffnen lassen: Hallo Kennt sich hier jemand mit dem filemanger gentoo aus ? Ich hab ejetzt geschlagene 1Std versucht, ihn zu überreden eine *.odt zu...