Posts Tagged ‘Gentoo’

NPTL_KERN_VER

In Gentoo, this variable can be used to specify the lowest kernel version we want glibc to support. For example, I am completely certain I will never use a kernel older than 2.6.30 on my Gentoo box, so I may want to add NPTL_KERN_VER="2.6.30" to /etc/make.conf. This way, glibc will assume the kernel supports all features that 2.6.30 supports and remove fallback codes written for old kernels.

The default value for NPTL_KERN_VER has been 2.6.9 for years.

That will not make a real difference, though. By switching from 2.6.9 to 2.6.30, the size of my /lib/libc.so.6 reduced by approximately 20KiB, or 1.3%.

Tags:

Removed some distribution-specific patches

With all due respect to Gentoo developers, I really hate the patches they made for coreutils, especially the one to have uname parse /proc/cpuinfo.

The result is that uname -a displays more info, specifically the mode of the CPU, on Gentoo than other Linux distributions. Generally this is not a bad thing. But I do have concerns:

(1) In my view the utility uname should remain a simple wrapper of the homonym system call. If CPU/vendor info really needs to be returned by uname, it is better to add it to kernel. This is also part of the reason why upstream rejected this patch.

(2) If I am used to finding CPU info from uname, I will likely forget the more orthodox method (cat /proc/cpuinfo). A job interviewer may not be that patient to listen to my explanation about the patch.

Tags: ,

Extract Deb files from command line

Debian and its derivatives use the .deb format to distribute their packages. To extract them, use ar – Yes, the very program we programmers use to make static libraries.

ar x sudo_1.6.9p17-2_i386.deb

Or we can directly extract things from data.tar.gz contained in the .deb file:

ar p sudo_1.6.9p17-2_i386.deb data.tar.gz | tar -xzf -

No longer a user of Debian GNU/Linux, I still have to remember how to extract .deb files. I frequently need to cross-compile a 64-bit version of my program on a 32-bit system, and vice versa; but I don’t want to cross-compile by myself so many libraries on which my program depends. Instead, I find it a good idea to download a right .deb file from the Debian Packages Repository and pick out the .so files.

Tags: , , ,

[Gentoo] Logrotating emerge.log

It seems the reason why emerge.log is not logrotate‘d is that log analyzers (qlop and genlop) expect a full log. I’m not sure about qlop, but since I use only genlop, it seems okay to add it to /etc/logrotate.dgenlop supports reading logs from multiple files and also from compressed files (gzip and bzip2).

Create a logrotate configuration file. /etc/logrotate.d/emergelog:

/var/log/emerge.log {
    compresscmd /bin/bzip2
    uncompresscmd /bin/bunzip2
    compressext .bz2
    rotate 100
    create 660 portage portage
    delaycompress
    daily
    size 2M
}

I configured my logrotate to compress using lzma by default, but genlop recognizes only gz and bz2, so I need to explicitly specify bzip2 (or gzip) here.

A wrapper for genlop is also necessary. /usr/local/bin/genlop:

#!/bin/bash

f=()
for x in /var/log/emerge.log*; do
    f=("${f[@]}" -f "$x")
done
exec /usr/bin/genlop "${f[@]}" "$@"

Tags: , , ,

Gentoo begins to mark gcc-4.3 stable

Already done in amd64. It seems it’s going to happen to all others arches very soon.

I have been waiting for this for more than six months…

GCC 4.3 eliminated some implicit inclusions among headers, and therefore has caused many compilation errors – most notably missing <cstdlib> and <cstring>. (It’s not GCC’s fault; it’s the coders’.)

I switched my default compiler from 4.2.4 to 4.3.2 just a few days ago, so I’m not a real hacker – hackers* always live on the bleeding edge. I reported only two bugs exposed by GCC 4.3 – should have been more had I switched earlier..

* A hacker is different from a cracker! Those who illegally and/or immorally crack computer systems or proprietary software should be called crackers.

Tags: ,

Disk size needed to compile OpenOffice

Gentoo today stabilized openoffice 3.0. I then emerged it in two systems. OpenOffice 3 now supports parallel building, so there should be a speedup compared with 2.4 in an multi-core system.

x86 laptop: debugging is completely disabled. About 5 GiB.

amd64 desktop: CFLAGS=”… -ggdb”; FEATURES=”splitdebug“. More than 11GiB!

Tags: ,