O.K. this is definitely a double whammy of why I prefer FreeBSD.

A few days ago I installed KDE on Ubuntu, which added the Kubuntu boot splash. When I installed the *rest* of KDE via synaptic: on the next boot it broke GDM and my Gnome session until I did an apt-get remove followed by an apt-get install of the gdm and ubuntu-desktop packages. This is deffo one of the reasons why the distinction on BSD between /usr and /usr/local is a good thing ™.

This after noon I clicked through one of Gnomes settings bit for languages, and thought perhaps it would have a way to merge my preferences for U.S. and ISO formatting. It asked if I wanted to install a few dozen more language packs for English and German, since I had taken the liberty of adding the German language packs. Also told it to prefer the British English and standard German languages above standard English (rather than ignored); American English being the primary. Being American, you never have to worry until you start spelling in different dialects. That added export LANGUAGE=”en_US:en_GB:de:en” to the end of my .profile; which I moved to an /etc/profile.d script.

‘lo and behold on reboot, the entire Gnome desktop is in German…. and despite that being very different than my limited reading vocabulary, I still can figure out what the frig I’m looking at! Just don’t ask me to pronounce it properly lol.

die portmaster die

Well, after 23 hours uptime, submitting several problem reports over gettext, and a heck of a lot of compiling, it seems that my laptops updating is finally complete… except for a few stubborn packages that I rarely use anyway lol.

The thing that *really* pissed me off, is portmaster. Three times (gettext, gtk20, gstreamer-plugins) I had to manually do make reinstalls in order to get the freaking packages to install correctly. However portmaster saw fit to work it’s magic, it forgot to install essential things, like msgfmt, libgstpbutils-.*, and and the actual gtk-x11 library o/. Which obviously caused other ports depending on them to pop corks during portmasters updating them.

I think I’m going to again ditch the third party updating tools, flip the bird, and go back to using my own custom updater script. All that’s really needed, is implementing the topological sort over dependencies anyway… then it would be automated in essence. And it’s never doubled my work load the way portmaster and portupgrade do!!!

Since I haven’t much to do right now, aside from cursing at portmaster and dealing with libintl problems >_>, I’ve spent a bit of time importing my journal entries from Aug ’09. Now that I look at it, I actually began the move from Live Journal to Blogger back in December, and I’ve still got two months worth of entries to go before all is done :-S.

Currently my laptop is more or less in dispose, courtesy of irksome updates. In updating devel/gettext, it seems several ports were missed on the massive stream of PORTVERSION bumps, or portmaster failed horribly to notice >_>. So far I have 6 problem reports filed: on devel/libelf; lang/gawk; graphics/evince; security/gnutls; ftp/wget; and graphics/librsvg2. Most of them were only defined as using GNU Gettext when built with Native Language Support.

Some how, I can’t help but think this is almost payback against the English speaking world :-o.

+1 for updating my stable system

Wowsa, looks like the new bwn driver actually supports my laptops integrated broadcom wireless, ’tis good. At least I know if my faithful Atheros card dies, I won’t have to buy a replacement lol.

Of course, assuming it actually works if I try to connect it to my WAP, hehe.

Oy gevalt, this port is compiling gcc44 as a build dependency. What is this, karmic retribution for my refusal to upgrade gcc45 today? HAHAHAHA

A little size of fun.

Generally, I’m rather finicky about making assumptions about the sizes of types, and even conversions between signed and unsigned types. Although I occasionally skirt dangerous gronud, such as feeding a function pointer into a object pointer, and expect to be able to cast the void* back to the function pointer (basically implementation defined by C, but required by POSIX), I also tend to make notes of when (fully aware) I do things that are non portable, but not necessarily obvious. At least in the example case I just mentioned, I didn’t know that was dangerous ground until I reviewed code under -pendantic, and scratched my head at the required warning message.

Normally I take things in stride, and just cringe when I see, “Portable” software doing stupid things like using unsigned int where they mean uint32_t, or the (flawed) assumption that a pointer to xyz will be as large as an object of xyz. So I thought I’d just take a look see here, and then wrote a program to display it in bits rather then bytes, since most of the folks I know will better get the picture that way :-o.

Also being a practical man, I kind of like to know what is off the edge of the map, just in case I some day have to jump off o/.

Here is a simple program to solve my curiosity:

 #include 
#include
#include
#include
int
main(void) {

    printf("sizeof(char)t= %u-bitsn", sizeof(char)*CHAR_BIT);
    printf("sizeof(char*)t= %u-bitsn", sizeof(char*)*CHAR_BIT);
    printf("sizeof(wchar_t)t= %u-bitsn", sizeof(wchar_t)*CHAR_BIT);
    printf("sizeof(wchar_t*)t= %u-bitsn", sizeof(wchar_t*)*CHAR_BIT);
    printf("sizeof(short int)t= %u-bitsn", sizeof(short int)*CHAR_BIT);
    printf("sizeof(short int*)t= %u-bitsn", sizeof(short int*)*CHAR_BIT);
    printf("sizeof(int)t= %u-bitsn", sizeof(int)*CHAR_BIT);
    printf("sizeof(int*)t= %u-bitsn", sizeof(int*)*CHAR_BIT);
    printf("sizeof(long)t= %u-bitsn", sizeof(long)*CHAR_BIT);
    printf("sizeof(long*)t= %u-bitsn", sizeof(long*)*CHAR_BIT);
    printf("sizeof(long long)t= %u-bitsn", sizeof(long long)*CHAR_BIT);
    printf("sizeof(long long*)t= %u-bitsn", sizeof(long long*)*CHAR_BIT);
    printf("sizeof(size_t)t= %u-bitsn", sizeof(size_t)*CHAR_BIT);
    printf("sizeof(size_t*)t= %u-bitsn", sizeof(size_t*)*CHAR_BIT);
    printf("sizeof(float)t= %u-bitsn", sizeof(float)*CHAR_BIT);
    printf("sizeof(float*)t= %u-bitsn", sizeof(float*)*CHAR_BIT);
    printf("sizeof(double)t= %u-bitsn", sizeof(double)*CHAR_BIT);
    printf("sizeof(double*)t= %u-bitsn", sizeof(double*)*CHAR_BIT);
    printf("sizeof(long double)t= %u-bitsn", sizeof(long double)*CHAR_BIT);
    printf("sizeof(long double*)t= %u-bitsn", sizeof(long double*)*CHAR_BIT);
    printf("sizeof(ptrdiff_t)t= %u-bitsn", sizeof(ptrdiff_t)*CHAR_BIT);
    printf("sizeof(ptrdiff_t*)t= %u-bitsn", sizeof(ptrdiff_t*)*CHAR_BIT);
    printf("sizeof(intptr_t)t= %u-bitsn", sizeof(intptr_t)*CHAR_BIT);
    printf("sizeof(intptr_t*)t= %u-bitsn", sizeof(intptr_t*)*CHAR_BIT);

    return 0;
}


The C standard defines CHAR_BIT in limits.h, as being the number of bits  for the smallest object that is not a bit field, roughly meaning that CHAR_BIT = number of bits in a byte, for all practical intents and purposes. Like wise, the sizeof operator is defined as returning the size of its operand in bytes, as an implementation defined unsigned integer value having the type size_t, from stddef.h. For the fuckos out there, the standard also says that a char object is large enough to store any character of the basic execution set (A-Z, a-z, 0-9, space, plus the required punctuation and control characters—roughly a character set of 99 symbols that fit within a single byte), and that those characters will have a non negative value while doing it. It also declares that sizeof(char) == 1. From this we can infer that sizeof(x) * CHAR_BIT should be the size of x in bits, and that ‘x’ is basically as good as off the edge of the map, for any x that you can’t make on my grandmothers type writer.

Having the size of each type followed by a pointer to it displayed, is mostly done to emphasis that a pointer to a size, means dick all about the size of the pointer. You’ll notice an interesting connection between pointer size and your hardware however. Gee, that just doesn’t sound right, LOL.

Some examples:

Run on FreeBSD 8.0-STABLE i386:

sizeof(char)    = 8-bits
sizeof(char*)   = 32-bits
sizeof(wchar_t) = 32-bits
sizeof(wchar_t*)        = 32-bits
sizeof(short int)       = 16-bits
sizeof(short int*)      = 32-bits
sizeof(int)     = 32-bits
sizeof(int*)    = 32-bits
sizeof(long)    = 32-bits
sizeof(long*)   = 32-bits
sizeof(long long)       = 64-bits
sizeof(long long*)      = 32-bits
sizeof(size_t)  = 32-bits
sizeof(size_t*) = 32-bits
sizeof(float)   = 32-bits
sizeof(float*)  = 32-bits
sizeof(double)  = 64-bits
sizeof(double*) = 32-bits
sizeof(long double)     = 96-bits
sizeof(long double*)    = 32-bits
sizeof(ptrdiff_t)       = 32-bits
sizeof(ptrdiff_t*)      = 32-bits
sizeof(intptr_t)        = 32-bits
sizeof(intptr_t*)       = 32-bits

and FreeBSD 8.0-RELEASE amd64:

sizeof(char)    = 8-bits
sizeof(char*)   = 64-bits
sizeof(wchar_t) = 32-bits
sizeof(wchar_t*)        = 64-bits
sizeof(short int)       = 16-bits
sizeof(short int*)      = 64-bits
sizeof(int)     = 32-bits
sizeof(int*)    = 64-bits
sizeof(long)    = 64-bits
sizeof(long*)   = 64-bits
sizeof(long long)       = 64-bits
sizeof(long long*)      = 64-bits
sizeof(size_t)  = 64-bits
sizeof(size_t*) = 64-bits
sizeof(float)   = 32-bits
sizeof(float*)  = 64-bits
sizeof(double)  = 64-bits
sizeof(double*) = 64-bits
sizeof(long double)     = 128-bits
sizeof(long double*)    = 64-bits
sizeof(ptrdiff_t)       = 64-bits
sizeof(ptrdiff_t*)      = 64-bits
sizeof(intptr_t)        = 64-bits
sizeof(intptr_t*)       = 64-bits

I also have access to 32-bit versions of Windows NT and OpenBSD running on Pentium 4-grade hardware, but don’t feel like booting the wintel tonight, I’m to comfortable with Dixie hehe. Perhaps I will run the program on other systems and implementations, for the sake of testing, and add it to this entry as a comment.

Haven’t been keeping pace with my Journal for the last couple days, let’s just say I don’t want to talk about the Holidays.

Dixie spent about 2 days solid compiling ports, nearly 240 of mine and well over 800 when dependencies are included. That’s finally finished, so my beloved laptop is again ready for getting stuff done :-D.

Here’s the list I fed through updater.sh:

devel/pkg-config
devel/gmake
devel/autoconf-wrapper
devel/automake-wrapper
lang/perl5.10
devel/p5-ExtUtils-Depends
devel/p5-ExtUtils-PkgConfig
lang/python26
devel/py-setuptools
lang/python31
lang/ruby18
lang/guile
java/javavmwrapper
graphics/png
graphics/ruby-libpng
graphics/jpeg
graphics/tiff
devel/nasm
devel/php5
devel/glib20
devel/glibmm
devel/gamin
devel/gio-fam-backend
devel/p5-Glib2
devel/py-gamin
devel/py-gobject
devel/ruby-glib2
converters/libiconv
converters/ruby-iconv
devel/gettext
devel/p5-Locale-gettext
devel/ruby-gettext
devel/p5-ReadLine-Gnu
devel/p5-ReadLine-Perl
devel/p5-Storable
devel/p5-Term-ReadLine-Zoid
devel/p5-Term_ReadKey
devel/pcre
devel/pcre++
devel/php5-pcre
security/gnupg
secruity/ca_root_nss
security/gnutls
security/py-gnutls
security/nss
security/openssl
security/php5-openssl
security/py-openssl
www/libwww
ftp/curl
ftp/curlpp
www/p5-WWW-Curl
ftp/py-curl
ftp/wget
mail/php5-imap
net/php5-sockets
net/librsync
archivers/p7zip
archivers/unrar
archivers/unzip
archivers/zip
devel/bison
devel/bisoncpp
ports-mgr/portmaster
ports-mgr/portupgrade
ports-mgr/psearch
graphics/dri
graphics/libdrm
x11/xbitmaps
x11-themes/xcursor-themes
x11-fonts/xorg-fonts
x11/xorg-apps
x11/xorg-libraries
x11/xorg-server
x11/xorg-drivers
x11/xorg-docs
x11/xdm
x11/rxvt-unicode
devel/dbus
devel/dbus-glib
misc/hicolor-icon-theme
misc/shared-mime-info
x11-fonts/terminus-font
x11-fonts/webfonts
textproc/expat2
textproc/libxml++26
textproc/libxml2
textproc/libxslt
textproc/p5-XML-LibXML
textproc/p5-XML-Parser
textproc/py-expat
textproc/py-libxml2
textproc/ruby-libxml
devel/libIDL
devel/ORBit2
devel/boost-all
accessiblity/py-papi
audio/freealut
databases/sqlite3
databases/py-sqlite3
databases/ruby-sqlite
databases/p5-DBD-SQLite
databases/p5-DBI
databases/php5-mysql
databases/php5-sqlite
graphics/GraphicsMagick
graphics/ImageMagic
graphics/freeimage
lang/clisp
math/py-numeric
multimedia/libdvdcss
multimedia/libdvdnav
multimedia/libdvdplay
multimedia/libdvdread
textproc/docbook
textproc/docbook-tdg
textproc/docbook-xsl
textproc/doocbook-xsd
textproc/py-docutils
textproc/aspell
multimedia/win32-codecs
emulators/linux_base-f10
x11-toolkits/py-tkinter
devel/libglade2
devel/libglademm24
x11-toolkits/p5-Glade2
devel/ruby-libglade2
devel/libnotify
devel/libnotifymm
graphics/cairo
graphics/cairomm
graphics/p5-Cairo
graphics/py-cairo
graphics/ruby-cairo
graphics/ruby-gdk_pixbuf2
x11-toolkits/pango
x11-toolkits/pangomm
x11-toolkits/ruby-pango
graphics/cegui
accessibility/atk
accessiblity/ruby-atk
x11-toolkits/gtk20
x11-toolkits/gtkmm24
x11-toolkits/p5-Gtk2
x11-toolkits/py-gtk2
x11-toolkits/ruby-gtk2
x11-toolkits/qt33
devel/qt4
x11-toolkits/qscintilla
devel/py-qt4-qscintilla2
devel/qscintilla2
multimedia/mencoder
multimedia/mplayer
www/opera
www/libxul
www/firefox35
www/mplayerplug-in
www/linux-f10-flashplugin10
www/nspluginwrapper
x11-toolkits/vte
archivers/php5-bz2
archivers/php5-zlib
devel/php5-spl
devel/py-xdg
devel/xdg-user-dirs
graphics/driconf
sysutils/fusefs-kmod
sysutils/fusefs-sshfs
audio/cdparanoia
deskutils/notification-daemon
devel/cmake
devel/cscope
devel/ctags
devel/doxygen
devel/bazaar-ng
devel/git
devel/mercurial
devel/subversion
lang/pcc
devel/qtcreator
devel/xdg-utils
devel/desktop-file-utils
editors/abiword
editors/emacs
editors/mg
emulators/wine
graphics/evince
graphics/dia
graphics/geeqie
grahpics/gimp
graphics/hsetroot
graphics/inkscape
mail/hairloom-mailx
math/gnumeric
net-im/pidgin
net-im/pidgin-libnotify
net-im/pidgin-otr
net/rdesktop
net/rsync
shells/bash
shells/ksh93
shells/pdksh
shells/v7sh
shells/zsh
sysutils/bsdstats
sysutils/cdrdao
sysutils/cdrtools
sysutils/dvd+rw-tools
sysutils/e2fsprogs
textproc/antiword
textproc/webcpp
www/arora
x11-wm/fvwm2-devel
x11-wm/transset-df
x11-wm/xcompmgr
x11-wm/xfce4
x11/xrefresh
games/chromium-bsu
games/doom-data
games/doom-freedoom
games/doom-hr
games/openarena
games/prboom
games/supertux
games/wesnoth
games/xgalaga
accessibility/atk-reference
x11/libgnome-reference
x11-toolkits/pango-reference
devel/ORBit2-reference
devel/glib20-reference
devel/glibmm-reference
devel/libglade2-reference
graphics/cairo-reference
textproc/libxml2-reference
textproc/libxslt-reference
x11-toolkits/gtk20-reference
x11-toolkits/vte-reference

FreeBSD 8.0 day 2.0: upgrading ports

Since I have accumulated a lot of stuff since 7.0 was released, I have elected to do a clean slate — nuke it all and rebuild. The perfect chance to get rid of any stale leaves hehe.

# cd /var/db/pkg && pkg_delete -f *

As Mal.exe reminded me, this is equalivulent to pkg_delete -a; I forgot about that hahahaha!!!

while all the ports are being put under the hbomb, I set to work in an already running session of vim (since it depends on plenty of ports with my builds!) and wrote a list.

Every time I update my laptops ports, I use a customised “updater.sh” script, which does exactly what I want. The portmaster and portupgrade systems are only used when needed for an expedient coverage of issues marked /usr/ports/UPDATING. It was just smoother to write my own small script around the ports tree, then live with the qirks in portmaster and portupgrade: mine does just what I want and without the hub bub.

My updater.sh is programmed to parse a file, expecting input lines in the format of category/portname, which tell it what ports need upgrading. In my experience, it works better then portmaster and without that need for constantly asking “Are you still running?” that portupgrade has…

updater.sh is in the middle of fetching ~230 distfiles, and setting any stray build options. So that everything will be ready op for compiling all this junk. At least I can go play SWAT while things compile, but need all the stuff fetched and recursively configured before I can have fun hehe.

Will post the input list later.

The first FreeBSD upgrade to ever piss me off

I built world, two kernels: (my custom) VIPER, and GENERIC. I took about 2 hours using make -j6 on my lowly Sempron.

Fetched updates to the ports tree via portsnap while waiting for the install kernel to finish; I noticed that the boot into single user mode for mergemaster’ing was blazingly fast. Everything went well until the first multi user boot.

The blasted wireless card stopped working. Changing in the ath manual and the release notes info about Atheros support made me expect there might be problems. Plugged in a spare (broken) Ethernet cable and did a search on the FreeBSD forums where a thread mentioned cloning the wireless interface to a generic wlan0…. it worked.

ifconfig wlan0 create wlandev ath0

and volia!

So, just how did this creep up on me, and why wasn’t it in the release notes… (that anyone I know seems to have noticed)???

The manual for rc.conf explains this under network_interface:

If a wlans_ variable is set, an wlan(4) interface
will be created for each item in the list with the wlandev
argument set to interface. Further wlan cloning arguments
may be passed to the ifconfig(8) create command by setting
the create_args_ variable. One or more wlan(4)
devices must be created for each wireless devices as of
FreeBSD 8.0. Debugging flags for wlan(4) devices as set by
wlandebug(8) may be specified with an wlandebug_
variable. The contents of this variable will be passed
directly to wlandebug(8).

which makes the fix in rc.conf, adding wlans_interfacename=”wlan0″ into the mixture:

wlans_ath0="wlan0"      
ifconfig_wlan="self censored :-P"

In order to find some backstory in /usr/src/UPDATING, I had to GREP for it:

20080420:
The 802.11 wireless support was redone to enable multi-bss
operation on devices that are capable. The underlying device
is no longer used directly but instead wlanX devices are
cloned with ifconfig. This requires changes to rc.conf files.
For example, change:
ifconfig_ath0=”WPA DHCP”
to
wlans_ath0=wlan0
ifconfig_wlan0=”WPA DHCP”
see rc.conf(5) for more details. In addition, mergemaster of
/etc/rc.d is highly recommended. Simultaneous update of userland
and kernel wouldn’t hurt either.

As part of the multi-bss changes the wlan_scan_ap and wlan_scan_sta
modules were merged into the base wlan module. All references
to these modules (e.g. in kernel config files) must be removed.

If changing from FreeBSDs natural to wlan for that makes one damn lick of sense what so ever (eth0 lovers aside), I will leave it to someone who knows to comment…. because I don’t know, and I don’t really give a fart.

The release notes in provides two helpful sentences: wlan pseudo devices are now used and check out the ifconfig manual.

Other then wasting an two hours of my time over a change that probably isn’t even the bloody handbook yet, everything went smoothly.