Getting E17 Back with Multiple Monitor Support

Jun 05 2014 Published by under Linux

I have been using e17 for about a year. I haven’t encountered any bugs, and it’s definitely stable enough for daily usage. On upgrading e17 earlier this week to 0.17.6, I found the monitors to be handled separately. I considered this to be a regression in the software. I installed the upstream development version 0.18.7, since it was in the Portage tree to see if it fixed the problems. Other people had the same multiple monitor or dual-monitor problems with e18. I played around with the settings to no avail. Installing 0.17.5 again by editing the 0.17.6 ebuild didn’t help.
I decided to install the old 0.17.5 ebuild which is no longer in the Pportage tree. Upon close examination, EFL (Enlightenment Foundation Libraries) in the recent ebuilds replaced the separate packages used in the 0.17.5.ebuild.
In the 0.17.5.ebuild:

    pam? ( sys-libs/pam )
    || ( >=dev-libs/ecore-1.7.9[X,evas,inotify] >=dev-libs/ecore-1.7.9[xcb,evas,inotify] )
    ukit? ( >=dev-libs/e_dbus-1.7.9[udev] )
    enlightenment_modules_connman? ( >=dev-libs/e_dbus-1.7.9[connman] )
    enlightenment_modules_shot? ( >=dev-libs/ecore-1.7.9[curl] )
    || ( >=media-libs/evas-1.7.9[eet,X,jpeg,png] >=media-libs/evas-1.7.9[eet,xcb,jpeg,png] )
    emotion? ( >=media-libs/emotion-1.7.9 )

In the 0.17.6.ebuild:

    pam? ( sys-libs/pam )
    || ( >=dev-libs/efl-1.8.4[X,eet,jpeg,png] >=dev-libs/efl-1.8.4[xcb,eet,jpeg,png] )
    ukit? ( >=dev-libs/e_dbus-1.7.10[udev] )

I decided I had enough of the split screen methodology. One reason people don’t switch software is because they have to change the ways they interact with them. In my case, interacting with each monitor separately would lead to productivity loss while learning the new methodology and in the future. For example, the taskbar in the newer versions only show windows from one monitor. If I use two taskbars, I would have to keep track of where I put each window. User interfaces should get out of the way as much as possible so that users would not have to perform such unproductive chores.
Time to download the old ebuilds and rollback e17.

cd /usr/portage/x11-wm/enlightenment/
wget -O enlightenment-0.17.5.ebuild
ebuild enlightenment-0.17.5.ebuild digest
cd /usr/portage/x11-wm/enlightenment/
wget -O e_dbus-1.7.9.ebuild
ebuild e_dbus-1.7.9.ebuild digest
emerge -C dev-libs/efl
emerge =x11-wm/enlightenment-0.17.5

The general procedure is to download old ebuilds as necessary and remove packages that block other packages from being emerged. I went on to reinstall terminology, e17’s native terminal.

cd /usr/portage/x11-terms/terminology/
wget -O terminology-0.4.0_alpha1.ebuild
ebuild terminology-0.4.0_alpha1.ebuild digest
emerge -pv =x11-terms/terminology-0.4.0_alpha1 | less
wget -O ../../media-libs/elementary/elementary-1.7.9.ebuild
ebuild ../../media-libs/elementary/elementary-1.7.9.ebuild digest
emerge =media-libs/elementary-1.7.9
emerge -av =x11-terms/terminology-0.4.0_alpha1

Finally, to prevent future upgrades from undoing the work, mask newer versions of e17 and terminology in /etc/portage/package.mask/e17


No responses yet

Gentoo Oracle JDK on ARM

Mar 19 2014 Published by under Linux

Installing a JDK on ARM has several challenges. First, there is no binary icedtea for ARM. Second, building icedtea generates circular build time dependencies.
On my first attempt, I just ran the following commands:

emerge --autounmask-write virtual/jdk
emerge virtual/jdk

However, it soon met an error:

(controller) sabre2 ~ # cat /var/tmp/portage/dev-java/icedtea-bin-
 * Package:    dev-java/icedtea-bin-
 * Repository: gentoo
 * Maintainer:
 * USE:        alsa arm elibc_glibc kernel_linux userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
 * ERROR: dev-java/icedtea-bin- failed (unpack phase):
 *   Nothing passed to the 'unpack' command
 * Call stack:
 *, line   93:  Called src_unpack
 *        environment, line 2546:  Called unpack
 *, line  291:  Called die
 * The specific snippet of code:
 *      [ -z "$*" ] && die "Nothing passed to the 'unpack' command"
 * If you need support, post the output of `emerge --info '=dev-java/icedtea-bin-'`,
 * the complete build log and the output of `emerge -pqv '=dev-java/icedtea-bin-'`.
 * The complete build log is located at '/var/tmp/portage/dev-java/icedtea-bin-'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-java/icedtea-bin-'.
 * Working directory: '/var/tmp/portage/dev-java/icedtea-bin-'
 * S: '/var/tmp/portage/dev-java/icedtea-bin-'

Later, when I checked on gentoo-packages, it didn’t have an arm ebuild. Oracle has hardfloat and softfloat binary JDKs for ARM, so I went on to install them. They can be used to bootstrap an icedtea build.

# emerge -av dev-java/oracle-jdk-bin

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

 * Last emerge --sync was 92d 19h 31m 27s ago.

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] media-fonts/dejavu-2.33  USE="-X -fontforge" 4,767 kB
[ebuild  N     ] media-libs/freetype-2.4.11:2  USE="bindist bzip2 -X -auto-hinter -debug -doc -fontforge (-infinality) -static-libs -utils" 1,510 kB
[ebuild  N     ] virtual/ttf-fonts-1  0 kB
[ebuild  N     ] media-libs/fontconfig-2.10.92:1.0  USE="-doc -static-libs" 1,490 kB
[ebuild  N     ] app-admin/eselect-fontconfig-1.0  0 kB
[ebuild  N F  *] dev-java/oracle-jdk-bin-  USE="fontconfig -X -alsa
-derby -doc -examples -jce -nsplugin -pax_kernel -source" 138,494 kB

Total: 6 packages (6 new), Size of downloads: 146,260 kB
Fetch Restriction: 1 package (1 unsatisfied)

Fetch instructions for dev-java/oracle-jdk-bin-
 * Oracle requires you to download the needed files manually after
 * accepting their license through a javascript capable web browser.
 * Download the following files:
 *   jdk-7u40-linux-arm-vfp-sflt.tar.gz
 *   jdk-7u40-linux-arm-vfp-hflt.tar.gz
 * at ''
 * and move them to '/distfiles'

The following keyword changes are necessary to proceed:
 (see "package.accept_keywords" in the portage(5) man page for more details)
# required by dev-java/oracle-jdk-bin (argument)
=dev-java/oracle-jdk-bin- **

The following license changes are necessary to proceed:
 (see "package.license" in the portage(5) man page for more details)
# required by dev-java/oracle-jdk-bin (argument)
>=dev-java/oracle-jdk-bin- Oracle-BCLA-JavaSE

NOTE: The --autounmask-keep-masks option will prevent emerge
      from creating package.unmask or ** keyword changes.

Use --autounmask-write to write changes to config files (honoring
CONFIG_PROTECT). Carefully examine the list of proposed changes,
paying special attention to mask or keyword changes that may expose
experimental or unstable packages.

You may not have a browser installed on your ARM board, so I suggest just uploading the Oracle tarballs to a server and using wget to download them.
To fix the control panel error when you don’t have a desktop environment installed, you need to remove lines from the ebuild and digest it.

vim /usr/portage/dev-java/oracle-jdk-bin/oracle-jdk-bin-

These lines need to be removed:

    newicon jre/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png \
        sun-jcontrol-${PN}-${SLOT}.png || die
    sed -e "s#Name=.*#Name=Java Control Panel for Oracle JDK ${SLOT}#" \
        -e "s#Exec=.*#Exec=/opt/${P}/jre/bin/jcontrol#" \
        -e "s#Icon=.*#Icon=sun-jcontrol-${PN}-${SLOT}#" \
        -e "s#Application;##" \
        -e "/Encoding/d" \
        jre/lib/desktop/applications/sun_java.desktop \
        > "${T}"/jcontrol-${PN}-${SLOT}.desktop || die
    domenu "${T}"/jcontrol-${PN}-${SLOT}.desktop

Once removed, generate the manifest for it.

ebuild /usr/portage/dev-java/oracle-jdk-bin/oracle-jdk-bin- digest

If you run emerge dev-java/oracle-jdk-bin, it will succeed.

No responses yet

Gentoo on SABRE Lite

Jan 23 2014 Published by under Linux

I recently received several SABRE Lite BD-SL-i.MX6 boards for running ARM benchmarks on DataMill. To install Gentoo on it, you need a USB-to-serial cable converter. It came with a 4GB SD card, which is large enough to get you started.
Overview of the installation:

  • Reset board and format SD card (optional)
  • Compile kernel with btrfs support (optional)
  • Copy boot script and kernel
  • Extract stage3 and portage snapshot
  • Configure the install
  • Backup and clone (optional)

Reset board and format SD card

When I first tried to boot images extracted to the SD card on the board, it always got stuck at the U-Boot prompt. It turned out that there were environment variables left over from previous uses for these boards. Here is the way to reset board variables:

U-Boot > run clearenv
U-Boot > reset

After I managed to boot Linux images on it, I went onto formatting the card for a Gentoo install. I used sfdisk so that formatting can be scripted with a file which I saved as mmc_partitions:

# partition table of /dev/sdd
unit: sectors

/dev/sdd1 : start=     2048, size=   102400, Id=83
/dev/sdd2 : start=   104448, size=  7669760, Id=83
/dev/sdd3 : start=        0, size=        0, Id= 0
/dev/sdd4 : start=        0, size=        0, Id= 0

I formatted the second partition as btrfs so that compression could be used on the small SD card. You may want to format it as ext3 to save time. If you have problems getting it to boot, check to make sure your btrfs-progs are not newer than the btrfs version the kernel is built to support. sys-fs/btrfs-progs-0.20_rc1 worked for the January 2014 kernel source.

# sfdisk -f /dev/sdd < mmc_partitions
# mkfs.btrfs -f /dev/sdd2 && mkfs.ext2 /dev/sdd1

Compile kernel with btrfs support

The git tree for the kernel is available at There are two main branches, one for Android and one for non-Android. Use the most recent one for non-Android.

# wget
# unzip
# cd linux-imx6-boundary-imx_3.0.35_4.0.0
# make ARCH=arm imx6_defconfig
# vim .config

Make the following changes to the kernel config:


Gentoo requires a devtmpfs filesystem to mount at /dev while selecting btrfs also selects LIBCRC32C. The CRC32c CRC algorithm is used by btrfs for checksums.
Now cross compile the kernel

# make -j9 ARCH=arm CROSS_COMPILE=armv7a-unknown-linux-gnueabi- uImage

Copy boot script and kernel

Download 6x_bootscript-20121110 available from a blog post and rename it 6x_bootscript. Get the kernel from one of the i.MX6 builds if you decided to skip building it.

# mount -o compress=zlib /dev/sdd2 /mnt/p1 && mkdir /mnt/p1/boot && mount /dev/sdd1 /mnt/p1/boot
# cp 6x_bootscript /mnt/p1/boot
# cp uImage /mnt/p1/boot

uImage is located in /usr/src/linux/arch/arm/boot if you compiled the kernel.

Extract stage3 and portage snapshot

Download the latest stage3 tarball and extract it

tar xjpf stage3-armv7a*.tar.bz2 -C /mnt/p1

BD-SL-i.MX6 with serial cable
If you get errors trying to run emerge --sync, it is because downloading the portage tree is not optional unlike other guides indicate. Simply download it from your nearest mirror and extract it

# tar xjpf portage-latest.tar.bz2 -C /mnt/p1/usr

Configure the install

If you compiled the kernel with btrfs, edit /mnt/p1/etc/fstab file so that zlib compression is enabled

/dev/mmcblk0p1          /boot           ext2            noatime         0 1
/dev/mmcblk0p2          /               btrfs            noatime,compress=zlib
       0 1

Set kernel boot argument in /mnt/p1/etc/inittab. Change the console= argument to ttymxc1. eg "$bootargs console=ttymxc1,115200 vmalloc=400M consoleblank=0 rootwait"
The rest of the process is the same as for other ARM boards, such as the Trimslice. The guide for it is available at
4 SABRE Lite i.mx6 Development Boards on the benchmark rack

Backup and clone

First make the backup in a folder

cd /backups
tar -cvpzf backup.tar.gz /mnt/p1/

After unmounting the SD card and testing it on the device, put in a new one and clone it with the following commands

sfdisk -f /dev/sdd < mmc_partitions
mkfs.btrfs -f /dev/sdd2 && mkfs.ext2 -FF /dev/sdd1
mount -o compress=zlib /dev/sdd2 /mnt/p1 && mkdir /mnt/p1/boot && mount /dev/sdd1 /mnt/p1/boot
tar xzpf backup.tar.gz -C /mnt/p1
vim /mnt/p1/etc/conf.d/hostname

umount /mnt/p1/boot && umount /mnt/p1

The Funtoo ARM Guide has up to date sections on setting the root password and using swclock. If you decide to use swclock, update the last shutdown time to set the clock with touch /tmp/mnt/p1/lib/rc/cache/shutdowntime after extracting the tarball.

No responses yet

Enabling GCC Graphite and LTO on Gentoo

Jul 08 2013 Published by under Linux

In this article, we will be enabling the GCC options marked with “To use this code transformation, GCC has to be configured with –with-ppl and –with-cloog to enable the Graphite loop transformation infrastructure. “, referred to as graphite. In addition, Link Time Optimization(LTO) refers to the options -flto and -fuse-linker-plugin. -fuse-linker-plugin tells GCC to use an external linker and -flto defers link time optimizations until the final link step so that the optimizer can work across the whole program rather than on individual object files. OpenMP is for parallelization and I save it for another article since I do not have benchmarks to show that it improves performance.
To enable graphite, LTO, and OpenMP it is recommended to first install the latest version of GCC. More recent versions of GCC contain bug fixes for features we are about to enable. The GCC upgrade process is detailed in the guide

After upgrading GCC, we start enabling the newer features. The steps follow the guidelines on the Gentoo wiki roughly. However,  it is unnecessary to rebuild everything after upgrading GCC as explained in the official GCC upgrade guide. libtool allows packages to be built against shared libraries without rebuilding every time the toolchain is upgraded.
Before adding the graphite USE flag, it is essential to build cloog

emerge dev-libs/cloog dev-libs/cloog-ppl

Then add graphite to CFLAGS and enable graphite USE flags

GRAPHITE="-floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block"
CFLAGS="-flto=8 ${GRAPHITE} -ftree-vectorize"
LDFLAGS="${CFLAGS} -fuse-linker-plugin"
# GCC >= 4.8.2 requires the lto flag
USE="graphite lto"

These flags can be appended to the ones you’re already using, although certain flags may conflict with the graphite optimizations. Since graphite flags such as -ftree-loop-distribution is intended to enable further vectorization, I also enabled the -ftree-vectorize flag. The -fuse-linker-plugin is a linker flag while -flto=n turns on the standard link-time optimizer. I set n to 8 for 8 threads while linking. Another factor that could affect performance is -flto-partition, which sets the partitioning algorithm.
To use the linker plugin with LTO, set the linker to Gold:

binutils-config --linker

In addition, before compiling the system it is necessary to build GCC with graphite:

emerge gcc
emerge -e world

Dealing with breakages

Several packages failed to compile with LTO and graphite enabled. These flags can be disabled on a per package basis. First create the files in /etc/portage/env/ called no-lto.conf and no-graphite.conf. In no-graphite.conf, disable your graphite flags:

CFLAGS="${CFLAGS} -fno-loop-interchange -fno-tree-loop-distribution -fno-loop-strip-mine -fno-loop-block"
CXXFLAGS="${CXXFLAGS} -fno-loop-interchange -fno-tree-loop-distribution -fno-loop-strip-mine -fno-loop-block"
LDFLAGS="${LDFLAGS} -fno-loop-interchange -fno-tree-loop-distribution -fno-loop-strip-mine -fno-loop-block"

Similary, disable your LTO flags in no-lto.conf:

CFLAGS="${CFLAGS} -fno-lto -fno-use-linker-plugin"
CXXFLAGS="${CXXFLAGS} -fno-lto -fno-use-linker-plugin"
LDFLAGS="${LDFLAGS} -fno-lto -fno-use-linker-plugin"

Every time a package breaks, add a line to /etc/portage/package.env that either disables graphite or LTO. For example, I made these adjustments:

net-misc/curl no-graphite.conf
media-libs/mesa no-graphite.conf
sys-apps/findutils no-lto.conf
sys-apps/gawk no-lto.conf

After adding a line you can resume the system rebuild with emerge --resume.


Before re-compiling your system, setting moving /var/tmp to RAM speeds things up. The Sabayon wiki has an article on performance, just make sure you reboot after changing /etc/fstab.

After building the current version of PPL, this message is displayed for upgrades:

* After an upgrade of PPL it is important that you rebuild
* dev-libs/cloog-ppl.
* If you use gcc-config to switch to an older compiler version than
* the one PPL was built with, PPL must be rebuilt with that version.
* In both cases failure to do this will get you this error when
* graphite flags are used:
* sorry, unimplemented: Graphite loop optimizations cannot be used

2 responses so far

Phoronix GCC Graphite and LTO Benchmarks

Jul 08 2013 Published by under Linux

GCC Graphite and Link Time Optimization are new features that many Gentoo users do not enable because they have not been proven to improve performance. I recently did a fresh install of Funtoo optimized for Core i7 and a recompile of the system to run Phoronix benchmarks. Before we look at the benchmarks, it is imperative to note that Phoronix is not intended to test the performance of programs compiled with certain sets of GCC flags. The test suite documentation states,

… for the software being tested that may be installed already on the system by the user, the Phoronix Test Suite will ignore those installations. The Phoronix Test Suite installs all tests within its configured environment to improve the reliability of the testing process.

which means the test suite disables system-wide GCC flags for test packages. So out of the tests I ran, only the ones that tested the packages compiled with Graphite and LTO enabled are worth looking at, and these are PyBench and gzip compression. Of the other tests, video and audio encoding as well as the lzma compression are built using the make command, which bypasses the Gentoo build system. If we look at the individual test packages, the lzma package downloads the lzma source

<?xml version="1.0"?>
<!--Phoronix Test Suite v3.0.0a3 (Iveland) [ ]-->

and builds it without using Gentoo’s package manager. That means it doesn’t use the GCC optimization flags.


mkdir $HOME/lzma_

tar -zxvf lzma-4.32.6.tar.gz
cd lzma-4.32.6
./configure --prefix=$HOME/lzma_
make -j $NUM_CPU_JOBS
echo $? > ~/install-exit-status
make install
cd ..
rm -rf lzma-4.32.6

cat > compress-lzma <<EOT
./lzma_/bin/lzma -q -c ./compressfile > /dev/null 2>&1

chmod +x compress-lzma

On the other hand, the gzip package doesn’t require any downloads and uses the system’s gzip


cat > compress-gzip <<EOT
cat compressfile | gzip -c > /dev/null 2>&1

chmod +x compress-gzip

At last, we are ready to understand the results, which do indicate that these new GCC features improve performance.

No responses yet

Upgrading Sabayon and Building Chrome

Apr 26 2013 Published by under Linux

One advantage of using Sabayon is that you can compile programs to be optimized for your CPU architecture. There are many optimization options and I use -march=native -O3 -pipe -fomit-frame-pointer -ftracer -floop-interchange -floop-block -ftree-loop-distribution -freorder-blocks-and-partition. Chrome on Linux is the fastest browser for sites that you visit often, as they are cached. Furthermore, you can boost Chrome performance beyond the benchmarks.
I follow a few simple steps for upgrading Sabayon:

  1. equo update
  2. equo install entropy equo
  3. equo repo mirrorsort sabayon-weekly
  4. equo upgrade
  5. equo conf update

Wolfden has a nice article explaining these steps. To upgrade Chrome, I use the Portage package manager:

  1. emerge –sync
  2. layman -S
  3. equo install sys-devel/gcc-[version]
  4. gcc-config -c
  5. equo install www-client/chromium-[version]
  6. emerge -av –oneshot –nodeps =www-client/chromium-[version]

There were errors coming from different packages when I tried to compile them without steps 3-5, such as configure: error: C compiler cannot create executables and gcc-config: error: could not run/locate ‘g++’. Installing the gcc version listed in gcc-config -c fixed the problem.

No responses yet

Linux vs Windows

Feb 19 2009 Published by under Linux,Windows

In the beginning was the command line. Now days, the windows command line has become more advanced as the power shell and the Linux command line ix just more versatile. As far as Linux being GNU and free goes, GNU doesn’t stand for great software and free doesn’t mean freedom. Who would want to spend their time looking around on the Internet to get suspend or hibernate working when it already works? Who would want to invest time and effort into a system that is not guaranteed to satisfy all your needs?

From a moral point of view, Linux makes logical sense, it appeals to reason. Whatever marketing Windows does, it cannot beat the simple message Linux delivers, that it is free and by osmosis, the user is free, too. That is obviously a false assumption. Yes, Linux offers the chance, given the choice, to modify source code. But the choice is not there in the first place. I’ve actually never modified source code yet, and as for compiling, I end up wasting more time on it than I can save. For example, Dr Scheme compiled in Gentoo simply hangs where it doesn’t. As for great software, I think Enterprise Linux might be better than Windows due to the bug fixes and support. I’d rather be free as in having free time, free in my non-obligation to the community, and free as in not having a bag of thoughts surrounding how I should use my computer. These days, I have too much clutter in my head.
Here’s a quote that I think is an appropriate description of a proper relationship to the computer: “Few things about your PC are as boring as things that just work, invisible in the background. ” To a large extent, Linux fits the boring category because it just works. When it doesn’t a few minutes on Google will solve it. On the other hand, Microsoft takes the other end. It gives gamers the best graphics, the desktop never crashes, and there’s a GUI to control everything. It doesn’t makes the PC anymore fun (to a large extent, trying to have fun on Windows often meant wasting time), but it won’t crash the OS. Compared to Linux, my fun using it comes largely from experimentation and getting hardware to work. The first part often crashes the desktop and the latter often takes hours to get done what only takes 5 minutes with the limited options in Windows. Having limited options in the OS does save me time making decisions and trying this or that as in Linux.

No responses yet