Showing posts with label debian testing. Show all posts
Showing posts with label debian testing. Show all posts

19 March 2012

112. Kernel 3.3.x on debian testing

Compiling a kernel on debian is easy. Kernel 3.3 came out today, and here's how to build it for debian testing:
sudo apt-get install kernel-package fakeroot
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.tar.bz2
tar -xvf linux-3.3.tar.bz2 
cd linux-3.3/

cat /boot/config-`uname -r`>.config
make oldconfig

EDIT: 3.3.1 is here: http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.3.1.tar.bz2 -- the build instructions are the same
EDIT 2: This has been tried with 3.3.4 as well. All is fine.
EDIT 3: And it's fine with 3.3.5

You'll also be asked about the new inclusions in the kernel. You can pick the default if you don't know - Yes means to compile into the kernel, m mean to provide as a module and no means don't support. Some drivers are better provided as modules -- see e.g. http://justlinux.com/forum/archive/index.php/t-127876.html
"Some things obviously have to be compiled into the kernel - file system support for your / filesys, stuff like that. Most everything else can be modules, if you desire." and "f you hot-swap different usb peripherals then I would recommend compiling those drivers as modules". Same goes for network drivers.

You can also look up the different options here: http://cateee.net/lkddb/web-lkddb/.
Seems like there's a lot of network and touch/screen drivers. And the fabled android drivers are available now:
Make audit loginuid immutable (AUDIT_LOGINUID_IMMUTABLE) [N/y/?] (NEW) Yes
Memory Resource Controller Kernel Memory accounting (EXPERIMENTAL) (CGROUP_MEM_RES_CTLR_KMEM) [N/y/?] (NEW) No
EFI stub support (EFI_STUB) [N/y/?] (NEW) No
UNIX: socket monitoring interface (UNIX_DIAG) [N/m/y/?] (NEW) m
UDP: socket monitoring interface (INET_UDP_DIAG) [N/m/?] (NEW)  
m
Netfilter NFACCT over NFNETLINK interface (NETFILTER_NETLINK_ACCT) [N/m/y/?] (NEW) m
Supply CT list in procfs (OBSOLETE) (NF_CONNTRACK_PROCFS) [Y/n/?] (NEW) Yes
"nfacct" match support (NETFILTER_XT_MATCH_NFACCT) [N/m/?] (NEW) No
IPVS source hashing table size (the Nth power of 2) (IP_VS_SH_TAB_BITS) [8] (NEW)
"rpfilter" reverse path filter match support (IP_NF_MATCH_RPFILTER) [N/m/?] (NEW) No
"rpfilter" reverse path filter match support (IP6_NF_MATCH_RPFILTER) [N/m/?] (NEW) No
Open vSwitch (OPENVSWITCH) [N/m/y/?] (NEW) No
Network priority cgroup (NETPRIO_CGROUP) [N/m/y/?] (NEW) m
ISA Bus based legacy SJA1000 driver (CAN_SJA1000_ISA) [N/m/?] (NEW) No
Bosch CC770 and Intel AN82527 devices (CAN_CC770) [N/m] (NEW) No
NFC LLCP support (EXPERIMENTAL) (NFC_LLCP) [N/y/?] (NEW) 
No
Block Device Driver for Micron PCIe SSDs (BLK_DEV_PCIESSD_MTIP32XX) [N/m/?] (NEW) 
No
NVM Express block device (BLK_DEV_NVME) [N/m/y/?] (NEW) No
Ethernet team driver support (EXPERIMENTAL) (NET_TEAM) [N/m/y/?] (NEW) Yes
Calxeda 1G/10G XGMAC Ethernet driver (NET_CALXEDA_XGMAC) [N/m/y/?] (NEW) No
Micrel KS8995MA 5-ports 10/100 managed Ethernet switch (MICREL_KS8995MA) [N/m/y] (NEW) No
Atheros ath9k bluetooth coexistence support (ATH9K_BTCOEX_SUPPORT) [Y/n/?] (NEW) Yes
Hardware support that overlaps with the brcmsmac driver (B43_BCMA_EXTRA) [Y/n] (NEW) Yes
Broadcom IEEE802.11n PCIe SoftMAC WLAN driver (BRCMSMAC) [N/m/?] (NEW) 
No
iwlwifi experimental P2P support (IWLWIFI_P2P) [N/y/?] (NEW) 
No
Enable full debugging output in iwlegacy (iwl 3945/4965) drivers (IWLEGACY_DEBUG) [N/y/?] (NEW) 
 No
TCA8418 Keypad Support (KEYBOARD_TCA8418) [N/m/?] (NEW) 
No
AUO in-cell touchscreen using Pixcir ICs (TOUCHSCREEN_AUO_PIXCIR) [N/m/?] (NEW) 
No
EETI eGalax multi-touch panel support (TOUCHSCREEN_EGALAX) [N/m/?] (NEW) 
No
PIXCIR I2C touchscreens (TOUCHSCREEN_PIXCIR) [N/m/?] (NEW) 
No
Sharp GP2AP002A00F I2C Proximity/Opto sensor driver (INPUT_GP2A) [N/m/?] (NEW) 
No
Polled GPIO tilt switch (INPUT_GPIO_TILT_POLLED) [N/m/y/?] (NEW) 
No
SBS Compliant gas gauge (BATTERY_SBS) [N/m/?] (NEW) 
No
National Semiconductor LP8727 charger driver (CHARGER_LP8727) [N/m/?] (NEW) 
No
Battery charger manager for multiple chargers (CHARGER_MANAGER) [N/y/?] (NEW)  No?
VIA Watchdog Timer (VIA_WDT) [N/m/y/?] (NEW) 
No
Support STMicroelectronics STMPE (MFD_STMPE) [N/y/?] (NEW) 
No
Support Dialog Semiconductor DA9052/53 PMIC variants with SPI (MFD_DA9052_SPI) [N/y/?] (NEW) 
No
Enable IR raw decoder for the Sanyo protocol (IR_SANYO_DECODER) [M/n/?] (NEW) 
No
JL2005B/C/D USB V4L2 driver (USB_GSPCA_JL2005BCD) [N/m/?] (NEW) 
m
V4L PCI(e) devices (V4L_PCI_DRIVERS) [Y/n/?] (NEW) Yes
V4L ISA and parallel port devices (V4L_ISA_PARPORT_DRIVERS) [N/y/?] (NEW) 
No
V4L platform devices (V4L_PLATFORM_DRIVERS) [N/y/?] (NEW) 
 No
Intel GMA5/600 KMS Framebuffer (DRM_GMA500) [N/m/?] (NEW) 
No
Roccat Isku keyboard support (HID_ROCCAT_ISKU) [N/m/?] (NEW) 
No
Microsoft Hyper-V mouse driver (HID_HYPERV_MOUSE) [N/m/?] (NEW) 
No
EHCI support for Marvell on-chip controller (USB_EHCI_MV) [N/y/?] (NEW) 
No
Inventra Highspeed Dual Role Controller (TI, ADI, ...) (USB_MUSB_HDRC) [N/m/?] (NEW) 
No
Marvell USB2.0 Device Controller (USB_MV_UDC) [N/m/?] (NEW) 
No
LED Support for TCA6507 I2C chip (LEDS_TCA6507) [N/m/?] (NEW) 
No
LED support for the Bachmann OT200 (LEDS_OT200) [N/m/y/?] (NEW) 
No
InfiniBand SCSI RDMA Protocol target support (INFINIBAND_SRPT) [N/m/?] (NEW) 
No
Support for rtllib wireless devices (RTLLIB) [N/m/?] (NEW)
Android Drivers (ANDROID) [N/y/?] (NEW) 
No
Fujitsu Tablet Extras (FUJITSU_TABLET) [N/m/y/?] (NEW) 
No
Fujitsu-Siemens Amilo rfkill support (AMILO_RFKILL) [N/m/?] (NEW) 
No
AMD IOMMU Version 2 driver (EXPERIMENTAL) (AMD_IOMMU_V2) [N/m/y/?] (NEW) 
No
Btrfs with integrity check tool compiled in (DANGEROUS) (BTRFS_FS_CHECK_INTEGRITY) [N/y/?] (NEW) 
No
NFS server manual fault injection (NFSD_FAULT_INJECTION) [N/y/?] (NEW) No
Kernel memory leak detector (DEBUG_KMEMLEAK) [N/y/?] (NEW) 
No
NMI Selftest (DEBUG_NMI_SELFTEST) [N/y/?] (NEW) No
Serpent cipher algorithm (x86_64/SSE2) (CRYPTO_SERPENT_SSE2_X86_64) [N/m/y/?] (NEW) 

No
Continuing,
make-kpkg clean
fakeroot make-kpkg -j7 --initrd --revision=3.3.0 --append-to-version=amd64 kernel_image kernel_headers  

The build takes a LONG time. Once it's done:

mv ../linux*3.3.0*.deb .
sudo dpkg -i *.deb

Done.

Linux tantalum 3.3.0-amd64 #1 SMP Tue Mar 20 06:29:46 EST 2012 x86_64 GNU/Linux



111. Ecce (nwchem) on Debian, and ROCKS/Centos

If you're using nwchem chances are that you've considered using ECCE to parse the output:
http://ecce.emsl.pnl.gov/

First of all you'll need to register at https://eus.emsl.pnl.gov/Portal/ -- and you can only do that if you're faculty. Postdocs and PhD students need not apply. Other than that, it's free, but you'll have to wait a couple of days to get your registration approved.

As much as I like nwchem owing to the clear syntax, I feel less warmly about ecce. Don't get me wrong -- it's pretty. It's just feels archaic and cobbled together. Even worse is that it's not open source and that its workings feel a bit opaque at times. Still, there's no better program for visually parsing nwchem output at this point. Anyway...

--start here --
Debian:
Download the install_ecce.v6.2.rhel5-gcc3.2.3-m32.csh file to ~/tmp/ecce

There's no md5sum supplied but here's what I got:
2ee70cc817dee9f80b11be5eac6e53e5

If you haven't already
sudo apt-get install csh 

OK, moving on...
cd ~/tmp/ecce
chmod +x  install_ecce.v6.2.rhel5-gcc3.2.3-m32.csh
./install_ecce.v6.2.rhel5-gcc3.2.3-m32.csh


Main ECCE installation menu
===========================
0) Help on main menu options
1) Full install
2) Full upgrade
3) Application software install
4) Application software upgrade
5) Server install
6) Server upgrade

Pick 1 if you're installing on your desktop and there's no server that you know of. 

Once the installation is over you get:
***************************************************************
!! You MUST perform the following steps in order to use ECCE !!
-- Unless only the user 'me' will be running ECCE,
   start the ECCE server as 'me' with:
     /home/me/tmp/ecce/ecce-v6.2/server/ecce-utils/start_ecce_server
-- To register machines to run computational codes, please see
   the installation and compute resource registration manuals
   at http://ecce.pnl.gov/using/installguide.shtml
-- To run ECCE each user must source either the runtime_setup
   (csh/tcsh) or runtime_setup.sh (sh/bash/ksh) script in the
   directory /home/me/tmp/ecce/ecce-v6.2/apps/scripts
   from their shell environment setup script.  For example,
   with csh or tcsh, add the following to ~/.cshrc:
     if (-e /home/me/tmp/ecce/ecce-v6.2/apps/scripts/runtime_setup) then
       source /home/me/tmp/ecce/ecce-v6.2/apps/scripts/runtime_setup
     endif
***************************************************************
Which translates to:
1. sh  /home/me/tmp/ecce/ecce-v6.2/server/ecce-utils/start_ecce_server
2. Sourcing that file makes no sense. Instead, add the following to your ~/.bashrc
export ECCE_HOME=/home/me/tmp/ecce/ecce-v6.2/apps
export PATH=${ECCE_HOME}/scripts:${PATH}

Assuming you've source your ~/.bashrc, start ecce by typing
ecce

...which takes an unreasonably long time (ca 1 min) after which you're greeted by
Press Any Key
Type in a password -- any password -- which will be your password from now on.
You're then taken to
Click on Viewer (assuming you've got something to look at)
Pay attention to the fine print
Have a look at the text box in the bottom right corner..and pay attention. In my particular case I have 6 cores and an mpi aware nwchem 6.0 version compiled. I bet that's better than whatever comes bundled with ecce. Also, the

To change you go to the machine browser (see screen shot #2), click on set up remote access and make sure that everything is working by clicking on e.g. processes:

Then click on the Machine menu (top left), select Register Machine while your machine is selected.
You can now change your options.

Running:
So, before using ecce you always need to
sh  /home/me/tmp/ecce/ecce-v6.2/server/ecce-utils/start_ecce_server
first. The server will run until you stop it or reboot.
Next, start ecce
ecce

Integration with nwchem
Most people would probably set up their nwchem jobs by hand, because it's so simple. All you need to do is to include the statement
ecce_print ecce.out
in the beginning, and you'll get an ecce.out file which you can then IMPORT (not open regularly, but import) into ecce.

Click on Viewer, Import Calculation From Output File, select your ecce out and voilá:
ECCE: homo (benzene)
If you're running debian, you're done now.



ROCKS 5.4.3/Centos 5.6:
This isn't a fix as much as a rant. The problem with ROCKS 5.4.3 is that csh is so broken that it's a struggle just to install ecce. I mean, I do show how to get ecce running in the end, but ROCKS feels like an unfinished piece of work compared to a normal debian install.

--Demonstration only -- don't do --
First back up ssh-key.sh and ssh-key.csh in /etc/profile.d

So...you start by
chmod +x install_ecce.v6.2.rhel5-gcc3.2.3-m32.csh
./install_ecce.v6.2.rhel5-gcc3.2.3-m32.csh
...and nothing's happening.

You then try just typing in
csh

/etc/profile.d/ssh-key.sh: line 211: return: can only `return' from a function or sourced script
It appears that you have not set up your ssh key.
This process will make the files:
     /export/home/me/.ssh/id_rsa.pub
     /export/home/me/.ssh/id_rsa
     /export/home/me/.ssh/authorized_keys
Generating public/private rsa key pair.
/export/home/me/.ssh/id_rsa already exists.
Overwrite (y/n)? 

Turns out there's a bug in ROCKS 5.4.3.  You can fix that by:
rpm -Uvh ftp://www.rocksclusters.org/pub/rocks/updates/5.4.3/x86_64/RPMS/rocks-config-server-5.4.3-1.x86_64.rpm

So far so good.
csh
...and nothing. It just exits. Or so you think. But the problem is bigger than that --  try opening a new terminal in e.g. gnome (gnome-terminal or xterm) -- it exits immediately. No error message or anything.

You can get csh to start by moving /etc/csh.cshrc out of the way, but you're still screwed as to opening a new terminal. The only way to get back a working system is to restore ssh-key.sh and ssh-key.csh.

--- Demonstration over ---

--Start here --
 You could also get around all this by running
csh -f
But then you don't have any env. variables loading and it can lead to problems of its own.

Anyway:
csh -f install_ecce.v6.2.rhel5-gcc3.2.3-m32.csh

The install starts. Just follow the instructions.

After installation, start the server:
csh -f ecce-v6.2/server/ecce-utils/start_ecce_server

Hit enter until you get a workable prompt back...
Edit your ~/.bashrc and add

export ECCE_HOME=/home/me/tmp/ecce/ecce-v6.2/apps
export PATH=${ECCE_HOME}/scripts:${PATH}

Don't bother sourcing your ~/.bashrc. It's easier to just open a new terminal.
Type
ecce
and you should be up and running...sort of. Under ROCKS I had problems importing ecce.out files since I had problems actually connecting to the server. Don't know why, but it came down to not being able to open a remote shell on the host.

NOTE:
this worked fine on one box, but not on another one which I was setting up remotely. On that one I had to edit

ecce/apps/siteconfig/Dataservers
and
ecce/apps/siteconfig/jndi.properties 

In particular, I had to change references to eccetera.emsl.pnl.gov.

18 March 2012

110. Compiling, installing Gnuplot 4.6 on Debian

A new version of gnuplot doesn't happen very often, and this one has an interesting added feature in terms of support for using braces in algorithms.
http://www.gnuplot.info/announce.4.6.0

Building gnuplot 4.6 is similar to building 4.4.4 and is pretty straightforward:

sudo apt-get install libgd2-xpm-dev checkinstall

wget http://sourceforge.net/projects/gnuplot/files/latest/download?source=files
mv download\?source\=files gnuplot-4.6.tar.gz
tar -xvf gnuplot-4.6.tar.gz
cd gnuplot-4.6.0/

./configure --with-linux-vga
make
checkinstall -install=no
 sudo rm /usr/local/share/info/dir -rf
sudo dpkg -i gnuplot_4.6.0-1_amd64.deb

You may get an error if trying to install on a system with a home-compiled version of octave (see below).

The problem with handling small numbers is not present in this version (http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-bug-in-debian.html).


Error:
Selecting previously unselected package gnuplot.
(Reading database ... 258722 files and directories currently installed.)
Unpacking gnuplot (from gnuplot_4.6.0-1_amd64.deb) ...
dpkg: error processing gnuplot_4.6.0-1_amd64.deb (--install):
 trying to overwrite '/usr/local/share/info/dir', which is also in package octave 3.6.1-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 gnuplot_4.6.0-1_amd64.deb
Solution:

 sudo dpkg --force-overwrite -i gnuplot_4.6.0-1_amd64.deb

17 March 2012

109. Building Thunderbird 11 on Debian testing

The build is fairly straightforward and pretty much identical to building 10.0.2 (earlybird): http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-building.html

As always, uninstall existing versions before installing a new one.

--start here --
First install the dependencies:
sudo apt-get install libdbus-glib-1-dev gir1.2-notify-0.7 libnotify-dev yasm checkinstall libzip-dev zip 


Download the sources  and untar:
mkdir ~/tmp
cd ~/tmp

wget ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/11.0/source/thunderbird-11.0.source.tar.bz2
tar -xvf thunder-bird-11.0.source.tar.bz2
cd comm-release/

Start the build
./configure --disable-necko-wifi
make -j3

3 is the number of cores +1. If you have a quadcore CPU substitute 3 with 5. The build takes a while so you will probably want to do a parallel build.

Finally, to install
sudo make install



checkinstall is segfaulting for me.

Error:

/home/me/tmp/comm-release/mozilla/js/src/config/nsinstall -R -m 644 ../mozilla-config.h ../../../config/nsStaticComponents.h  ../../../dist/include
make[5]: /home/me/tmp/comm-release/mozilla/js/src/config/nsinstall: Command not found
make[5]: *** [export] Error 127
make[5]: Leaving directory `/home/me/tmp/comm-release/mozilla/js/src/config'
make[4]: *** [export] Error 2
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/home/me/tmp/comm-release/mozilla/js/src'
make[3]: *** [export_tier_js] Error 2
make[3]: Leaving directory `/home/me/tmp/comm-release/mozilla'
make[2]: *** [tier_js] Error 2
make[2]: Leaving directory `/home/me/tmp/comm-release/mozilla'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/me/tmp/comm-release/mozilla'
Solution:
I got this error because I accidentally untared the new sources into an existing directory with an older version of thunderbird. The solution was to delete the directory and untar the sources again.


08 March 2012

97. Wine 1.4 out now -- very brief build instructions

UPDATE 16 May 2013: See here for Wine 1.5.30: http://verahill.blogspot.com.au/2013/05/416-wine-1530-in-chroot.html

UPDATE (10th Jan 2013): See here for Wine 1.5.21 using the multiarch approach in Debian Testing/Wheezy: http://verahill.blogspot.com.au/2013/01/308-compiling-wine-1521-on-debian.html

Updated list of dependencies for debian stable/squeeze: http://verahill.blogspot.com.au/2012/11/compiling-wine-155-from-source-using.html


The instructions are identical to those for wine1.4 rc4 and 5: http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-compiling-wine.html and wine 1.3.35: http://verahill.blogspot.com.au/2012/01/debian-testingwheezy-64-bit-installing.html

I've tested the build on 8 March 2012.

-- START HERE --
sudo apt-get install bison flex gcc libc6-dev libfontconfig-dev libfreetype6-dev libglu-dev libgsm1-dev libice-dev libjpeg-dev libldap-dev libmpg123-dev libncurses5-dev libopenal-dev libpng-dev libsm-dev libssl-dev libusb-dev libx11-dev libxcomposite-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxml2-dev libxrandr-dev libxrender-dev libxslt-dev libxt-dev libxxf86vm-dev make libcapi20-dev liblcms-dev libsane-dev libhal-dev libdbus-1-dev valgrind prelink libcups2-dev opencl-dev lib32opencl1 oss4-dev gettext lib32v4l-dev lib32ncurses5-dev lib32asound2-dev lib32z-dev ia32-libs-dev
mkdir ~/tmp
cd tmp/
wget http://prdownloads.sourceforge.net/wine/wine-1.4.tar.bz2
tar -xvf wine-1.4.tar.bz2
./configure

configure: gstreamer-0.10 base plugins 32-bit development files not found, gstreamer support disabled
configure: libgsm 32-bit development files not found, gsm 06.10 codec won't be supported.
configure: libtiff 32-bit development files not found, TIFF won't be supported.
configure: WARNING: libjpeg 32-bit development files not found, JPEG won't be supported.
configure: Finished.  Do 'make' to compile Wine.
The warnings about lack of support can safely be ignored if you don't need it. The TIFF error seems a bit random since it appears on some of my systems, but not others. I haven't figured out the responsible package yet.

make
sudo checkinstall --install=no
to build 23Mb deb package without installing it
 OR 
sudo make install
to install without building a package.


Note:
JPEG support is supposedly available if you
1. remove symlinks
sudo rm /usr/lib32/libjpeg.so.62 /usr/lib32/libjpeg.so.62.0.0
2. Then, create new ones
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62
sudo ln -s /usr/lib32/libjpeg.so.8 /usr/lib32/libjpeg.so.62.0.0




Edit:
I didn't know it before, but there's a slightly different, wine-specific, way of building described here http://chrisjrob.com/2012/03/08/wine-1-4-on-debian-wheezy/

To see you wine version do
winecfg
This is from a newer build - 1.5.6



Links to this page:
http://chrisjrob.com/2012/03/08/wine-1-4-on-debian-wheezy
http://forums.linuxmint.com/viewtopic.php?p=535245
http://debian.linux.pl/threads/26515-Instalacja-wine-1-4-w-Debianie-Squeeze

05 March 2012

93. Building and installing samba from source

Here's how to compile and get started with SAMBA, which may come in handy if you need to set up a mixed environment.


Compiling

sudo apt-get install build-essential


wget http://ftp.samba.org/pub/samba/samba-latest.tar.gz
tar -xvf samba-latest.tar.gz 
cd samba-3.6.3/
cd source3
./configure
make
sudo checkinstall

You may want to look through the checkinstall settings:
*****************************************
**** Debian package creation selected ***
*****************************************
This package will be built according to these values:
0 -  Maintainer: [ root@barebone ]
1 -  Summary: [ samba 3.6.3 ]
2 -  Name:    [ samba ]
3 -  Version: [ 3.6.3 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ source3 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ source3 ]
12 - Conflicts: [  ]
13 - Replaces: [  ]
Enter a number to change any of them or press ENTER to continue:
Once the package is installed you need to put symlinks in your /usr/lib to the installed samba libs:
sudo ln -s /usr/local/samba/lib/libtalloc.so.2 /usr/lib/libtalloc.so.2
 sudo ln -s /usr/local/samba/lib/libtdb.so.1 /usr/lib/libtdb.so.1



Finally, create smb.conf in /etc/samba/ and make samba find it using a symlink
sudo mkdir /etc/samba
sudo touch /etc/samba/smb.conf
sudo ln -s /etc/samba/smb.conf /usr/local/samba/lib/smb.conf

Done. Sort of. You need to configure samba using smb.conf...a minimal configuration file can be found at the end of the post.



Errors:
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/verahill/tmp/samba-3.6.3/source3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

Solution:
sudo apt-get install build-essential



error:
-bash: smbclient: command not found
solution:
 put /usr/local/samba/bin in PATH
export $PATH=PATH:/usr/local/samba/bin


error:
/usr/local/samba/bin/smbclient: error while loading shared libraries: libtalloc.so.2: cannot open shared object file: No such file or directory
solution:
sudo ln -s /usr/local/samba/lib/libtalloc.so.2 /usr/lib/libtalloc.so.2


error:
/usr/local/samba/bin/smbclient: error while loading shared libraries: libtdb.so.1: cannot open shared object file: No such file or directory
solution:
 sudo ln -s /usr/local/samba/lib/libtdb.so.1 /usr/lib/libtdb.so.1


Error:
/usr/local/samba/bin/smbclient: error while loading shared libraries: libwbclient.so.0: cannot open shared object file: No such file or directory
Solution:
 sudo ln -s /usr/local/samba/lib/libwbclient.so.0 /usr/lib/libwbclient.so.0


error:
/usr/local/samba/bin/smbclient: Can't load /usr/local/samba/lib/smb.conf - run testparm to debug it
solution:
because I know where debian normally puts the smb.conf --
sudo mkdir /etc/samba
sudo touch /etc/samba/smb.conf
sudo ln -s /etc/samba/smb.conf /usr/local/samba/lib/smb.conf



Configuration:
Following https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html#id2551954

Minimal /etc/samba/smb.conf:
[global]
workgroup = WKG
netbios name = MYNAME
[share1]
path = /tmp
Also, open up the relevant ports in your firewall:
Iptables
sudo iptables -A INPUT -p udp -m udp --dport 137 -j ACCEPT
sudo iptables -A INPUT -p udp -m udp --dport 138 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 139 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 445 -j ACCEPT



03 March 2012

91. Downgrading nvidia drivers from 295.20 to 290.10 on debian testing

How to downgrade your nvidia drivers

WARNING -- you must use the terminal during these steps. If you don't know how to use e.g. cd, ls and nano or vim you will want to be careful:
1. Make sure that you have internet access even without a graphical environment
2. Make sure that you have a basic understanding of how to navigate in the terminal
3. Print out or write down these instructions before startintg

I typically test all my instructions on several different computers as a form of proof-reading. For various reasons I can't do that with this blog post, so read through the instructions first to understand what they do and that typos won't throw you off.

If you've been having the gnome-shell crash bug
http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-nvidia-bug.html
[ 7011.967820] gnome-shell[32742]: segfault at 10 ip 00007fa1b6d98c0f sp 00007fa1914a1638 error 6 in libnvidia-tls.so.295.20[7fa1b6d98000+3000]
or the evolution crash bug
http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-no-real.html
[22129.426444] evolution[20435]: segfault at 10 ip 00007f2a05bf8c0f sp 00007f29e5725508 error 6 in libnvidia-tls.so.295.20[7f2a05bf8000+3000]
which are both caused by nvidia driver 295.20, here's how to gracefully downgrade to the previous version of the nvidia driver: 290.10. Be aware that evolution crashes occasionally under 290.10 too, but not nearly as consistently as under 25.20 -- chances are that evolution is a bit buggy on its own.

This will make use of the dkms package, which is what you should use anyway. We'll pull the old stuff from a snapshot archive.

1. Setting up your computer 
I prefer not to be forced to boot into X when I'm mucking about with graphics drivers, so:

Edit your /etc/default/grub
find your
GRUB_CMDLINE_LINUX_DEFAULT
line and add "text" to it e.g.
change
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset nouveau.modeset=0"
to
GRUB_CMDLINE_LINUX_DEFAULT="text nomodeset nouveau.modeset=0"
Do
sudo update-grub

Now is a good time to do a reboot to see if you have internet in text-only mode. 
sudo shutdown -r now
To start your graphical environment again do 
startx


2. Set up snapshot archive
To your /etc/apt/sources.list add this line:
deb http://snapshot.debian.org/archive/debian/20120120T092809Z/ wheezy main contrib non-free
Also, create a
/etc/apt/apt.conf.d/60ignore_repo_date_check
file with the following in it:
Acquire
{
Check-Valid-Until "false";
}
Run
sudo apt-get update
Don't install anything yet.

3. Get the nvidia binary driver
Go to e.g. ~/tmp and
wget http://us.download.nvidia.com/XFree86/Linux-x86_64/290.10/NVIDIA-Linux-x86_64-290.10.run
chmod +x NVIDIA-Linux-x86_64-290.10.run

Don't forget where you put it.

4. Remove your existing drivers and packages:
First reboot:
sudo shutdown -r now
You'll now boot into a text-only environment, so you had better printed this out first.

Then
sudo apt-get autoremove nvidia-*
The following packages will be REMOVED:
  diffstat glx-alternative-mesa glx-alternative-nvidia glx-diversions libcublas4 libcuda1 libcudart4 libcufft4
  libcurand4 libcusparse4 libgl1-nvidia-alternatives libgl1-nvidia-glx libglx-nvidia-alternatives libnpp4
  libthrust-dev libvdpau-dev nvidia-alternative nvidia-glx nvidia-installer-cleanup nvidia-kernel-common
  nvidia-kernel-dkms nvidia-support nvidia-vdpau-driver opencl-headers quilt xserver-xorg-video-nvidia
0 upgraded, 0 newly installed, 26 to remove and 3 not upgraded.
After this operation, 435 MB disk space will be freed.
Do you want to continue [Y/n]?Y
[..]
Reboot for good luck:
sudo shutdown -r now

If you do
locate nvidia.ko
chances are you'll find
/lib/modules/3.2.9/updates/dkms/nvidia.ko
where 3.2.9 is the current kernel version.

Do
sudo updatedb
locate nvidia.ko
to make sure that the nvidia.ko is gone from your current kernel.

5. Install your old nvidia driver:
Go to the directory you downloaded the driver in, e.g. ~/tmp
sudo ./NVIDIA-Linux-x86_64-290.10.run
Reboot afterwards:
sudo shutdown -r now

After the reboot do
startx

Did it work? If yes, you're in good shape.
 dmesg | grep nvidia
[    7.540166] nvidia: module license 'NVIDIA' taints kernel.
[    8.509525] nvidia 0000:01:00.0: PCI INT A -> GSI 18 (level, low) -> IRQ 18
[    8.509600] nvidia 0000:01:00.0: setting latency timer to 64
6. Setting up the kernel-dkms
You really want to use dkms so that you don't have re-install the graphics driver each time you upgrade your kernel.

First check
apt-cache showpkg nvidia-kernel-dkms
Provides:
295.20-1 - nvidia-kernel-295.20
290.10-1 - nvidia-kernel-290.10
195.36.31-6 - nvidia-kernel-195.36.31

OK, time to get rocking:
sudo apt-get install nvidia-kernel-dkms=290.10-1 nvidia-glx=290.10-1 libgl1-nvidia-glx=290.10-1 xserver-xorg-video-nvidia=290.10-1 nvidia-vdpau-driver=290.10-1 nvidia-alternative=290.10-1

You'll be warned about remove nvidia-install etc. That's fine.

Once the installation is done it's time to put holds on the packages so they don't accidentally upgrade

sudo su
echo "nvidia-kernel-dkms hold"| dpkg --set-selections
echo "nvidia-glx hold"| dpkg --set-selections
echo "libgl1-nvidia-glx hold"| dpkg --set-selections
echo "xserver-xorg-video-nvidia hold"| dpkg --set-selections
echo "nvidia-vdpau-driver hold"| dpkg --set-selections
echo "nvidia-alternative hold"| dpkg --set-selections
exit

7. Cleaning up
Things to do:
a. comment out the snapshot in /etc/apt/sources.list
b. move the /etc/apt/apt.conf.d/60ignore_repo_date_check file out of the way
c. sudo apt-get upgrade
Reading package lists... Done
Building dependency tree    
Reading state information... Done
The following packages have been kept back:
  libgl1-nvidia-glx nvidia-alternative nvidia-glx
  nvidia-kernel-dkms nvidia-vdpau-driver xserver-xorg-video-nvidia
d. edit your /etc/default/grub and remove the "text" item you added.
e. Run sudo update-grub
f. You can now reboot and your computer will be back to normal, sans nvidia 295.20

DONE



8. In the future
Once it is safe to upgrade, all you need to do is

sudo su
echo "nvidia-kernel-dkms install"| dpkg --set-selections
echo "nvidia-glx install"| dpkg --set-selections
echo "libgl1-nvidia-glx install"| dpkg --set-selections
echo "xserver-xorg-video-nvidia install"| dpkg --set-selections
echo "nvidia-vdpau-driver install"| dpkg --set-selections
echo "nvidia-alternative install"| dpkg --set-selections
exit
sudo apt-get update && sudo apt-get upgrade

Links to this post:
http://www.pro-chip.de/linux-mint/161-linux-mint-debian-geforce-gtx-560-ti-treiberproblem.html

02 March 2012

90. Compiling kernel 3.2.9 on Debian Testing

UPDATE: the instructions below work without modification with kernel v 3.2.9

For a more exhaustive description of how to build a kernel for debian, see here:
http://verahill.blogspot.com.au/2012/02/debian-testing-building-your-own-linux.html

I'll be brief:
You need 6.6 Gb of free space to build, and a fair amount of free time.


sudo apt-get install kernel-package fakeroot
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.9.tar.bz2
tar -xvf linux-3.2.9.tar.bz2 
cd linux-3.2.9/
cat /boot/config-`uname -r`>.config
make oldconfig
make-kpkg clean


-- apply to 32 bit only --
ln -s /home/me/tmp/linux-3.2.9/Documentation/virtual/lguest  Documentation/lguest
-- for 32 bit only end --


fakeroot make-kpkg -j4 --initrd --revision=3.2.9 kernel_image kernel_headers

where 4 is the number of cores(3)+1 (e.g. quadcore gives 5)
wait....wait...wait...takes a while...wait...wait...


mv ../linux*3.2.9*.deb .
sudo dpkg -i *.deb

Done. 
Linux tantalum 3.2.9 #1 SMP Fri Mar 2 15:21:59 EST 2012 x86_64 GNU/Linux

Minor note: Navigating Kernel.org


Each minor version has a stable release -- for 3.2.X it was 3.2.8 until 3.2.9 was released. Given that 3.3 is in the works, 3.2.9 will be the stable version of the 3.2 minor version.
"Full source" is the full kernel source, which is what we used in the example above. "Patch" is the difference between the previous version and the current version e.g. 3.2.8 vs 3.2.9 -- there's more information here. You can save both bandwidth and compile time by patching instead of doing a full download.




Build times:
Intel Celeron 32 bit (1.6 GHz)
still waiting...

AMD Athlon II X3 using -j4
real    44m56.522s
user    75m52.633s
sys     12m7.241s
Intel i5-2400 using -j5
real 22m26.712s
user 50m23.289
  sys 6m1.111s
AMD Phenom II X7 using -j7
real 28m46.599s
user 81m0.108s
sys 12m57.825s




01 March 2012

89. Compiling kernel 3.2.8 on Debian Testing -- example using kernel-packages and kernel.org source

For kernel 3.2.9, see here: http://verahill.blogspot.com.au/2012/03/debian-testing-kernel-329.html

Following: http://www.linuxplanet.com/linuxplanet/tutorials/6853/1 and http://www.sysdesign.ca/guides/linux_kernel.html  and very much http://old-releases.ubuntu.com/ubuntu/dists/hoary/main/installer-ia64/current/doc/manual/en/ch08s04.html

Update: added kernel_headers

I've added very litte to the guides, except proving that yes, the above tutorial works for the current stable kernel version (3.2.8) and the current debian testing (29/12/2012).

Here's what's new in 3.2.8 -- https://lwn.net/Articles/484042/
Here's what will be new in 3.3 -- http://www.h-online.com/open/features/Kernel-Log-Linux-3-3-goes-into-testing-1418516.html

Everything between SAFE START and END are ok -- they won't change anything serious on your system. If you're building on a 32 bit system, have a look at the end of the post before launching the make.

--  SAFE START --
Install tools:
sudo apt-get install kernel-package fakeroot
(if you use apt-bugs you may get a warning about an lguest bug. Ignore it. Look at the bottom of the post for 32 bit issues and a simple solution.)


Get the latest STABLE release from http://kernel.org/
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.2.8.tar.bz2
It's 75 M and will take a wee while.
tar -xvf linux-3.2.8.tar.bz2
cd linux-3.2.8/

To get a head-start on a configuration file, see if you have one for your current kernel:
ls /boot/config-`uname -r`

If so (I know this is clunky, but the obvious solutions didn't work...)
echo "/boot/config-`uname -r` "|xargs cat > .config

I'm running 3.2.0-1.

Alright. Here's the thing. You shouldn't edit .config unless you know what you're doing. But then how will you ever learn? I don't yet know what I'm doing, so won't lead you into kernel-configuration related temptation.

Instead, we'll just learn how to build.

First
make oldconfig
which uses the .config

But it's not completely automatic -- when it comes to new features you'll have to provide input. Hitting enter i.e. accepting the default option is probably a good idea unless you think otherwise.

Alternatively, you do
make menuconfig
and pick everything you want


Here are the new features in 3.2.8 vs 3.2.0-1: 
  Cirrus Logic (Sound Fusion) New DSP support (SND_CS46XX_NEW_DSP) [Y/n/?] (NEW)
Agere Systems HERMES II Wireless PC Card Model 0110 (WLAGS49_H2) [N/m/?] (NEW)
 Linksys HERMES II.5 WCF54G_Wireless-G_CompactFlash_Card (WLAGS49_H25) [N/m/?] (NEW) 
Y means compile into kernel, m makes a loadable module and no means no.

Now build!
make-kpkg clean
The next step takes forever, in particular if you only use one core (>1 h). It takes ca 50 minutes on an i5 with the -j5 switch. You'll also need around 6.5 Gb of free space for the compilation.
fakeroot make-kpkg -j4 --initrd --revision=3.2.8 kernel_image kernel_headers

where as usual 4 is the number of cores(3)+1. Adjust as necessary.

--SAFE END--

This really isn't dangerous, although you may not want to do it remotely without a back-up plan.

Install with
sudo dpkg -i ../linux-image-3.2.8_3.2.8_amd64.deb
sudo dpkg -i ../linux-headers-3.2.8_3.2.8_amd64.deb

That's it! You don't even have to bother with update-grub.

Reboot at your convenience and admire your handiwork:
uname -a

Linux boron 3.2.8 #2 SMP Wed Feb 29 19:27:04 EST 2012 x86_64 GNU/Lin

The deb built this way is ca 33 M, while the stock debian 3.2.0--1 is a slim 23 M.

Once you're confident that you can compile and install a kernel without mishap you can start to remove kernel modules to make it slimmer -- or start including modules of your own choosing.


Tried and tested on:
AMD Athlon II X3 (64 bit)
2 x AMD Phenom II X6 (64 bit)
Intel i5-2400 (64 bit)
Intel core 2  duo T5870 (laptop, 64 bit)
Intel Celeron 1.6 GHz (32 bit)
-- all running debian testing.


Building on 32 bit

I had some issues on an Intel Celeron 1.6 GHz 32 bit due to a bug:
make[1]: Leaving directory `/home/me/tmp/linux-3.2.8'
/usr/bin/make    ARCH=i386 \
    -C Documentation/lguest
make: *** Documentation/lguest: No such file or directory.  Stop.
make: *** [debian/stamp/build/kernel] Error 2

The failure was pretty annoying...
real 157m58.192s
user 132m27.049s
sys 12m5.589s
There's a simple solution in a forum post at http://billy.com.mx/archives/660:

"I solved it by creating a symlink Documentation/lguest to Documentation/virtual/lguest"
that means (on one line)
ln -s /home/me/tmp/linux-3.2.8/Documentation/virtual/lguest  Documentation/lguest


That's all.


Check:
ls Documentation/lguest -lah
Documentation/lguest -> /home/me/tmp/linux-3.2.8/Documentation/virtual/lguest

ls Documentation/lguest/
extract  lguest.c  lguest.txt  Makefile

And once it's installed:
uname -a
Linux kookaburra 3.2.8 #3 SMP Thu Mar 1 14:43:45 EST 2012 i686 GNU/Linu


Modules
To get a list over the modules in use on your current system:
lsmod | gawk '{printf("%s ",$1)}'| sed 's/Module//g'

zlib_deflate crc32c libcrc32c ufs qnx4 hfsplus hfs minix ntfs vfat msdos fat jfs xfs reiserfs ext3 jbd ext2 pci_stub vbok8 mperf cpufreq_stats cpufreq_conservative cpufreq_powersave cpufreq_userspace ppdev bnep rfcomm bluetooth binfmt_misc as nfs_acl sunrpc kvm_amd kvm xt_state ipt_REJECT ipt_LOG xt_limit xt_tcpudp xt_conntrack iptable_mangle ipt_MASQUERADE ip
le_filter ip_tables x_tables hwmon_vid lp loop snd_hda_codec_hdmi arc4 rt2800usb rt2800lib crc_ccitt rt2x00usb rt2x00lib xer_oss snd_usb_audio snd_pcm snd_hwdep snd_usbmidi_lib nvidia hid_logitech_dj mac80211 joydev snd_seq_midi cfg80211 rfki5100_tco snd_timer snd_seq_device edac_core edac_mce_amd parport_pc parport snd i2c_piix4 soundcore pcspkr k10temp i2c_combcache jbd2 crc16 usb_storage uas sd_mod crc_t10dif ata_generic pata_atiixp ohci_hcd thermal thermal_sys floppy ahci lib
You can use that as a source of inspiration for what to keep and what to trim.


88. Building Apache 2.4.1 on Debian Testing

WARNING:
Don't remove your existing installation of apache2 without thinking. gnome-core depends on it.

Updated 1 March 2012. Added missing information which prevented building and now provide information about auto-start using an /etc/init.d/ script. Original post at 2012-02-23

Building
 A new version of apache is kind of a big deal. Here's how to build it.

sudo apt-get install libapr1-dev uuid-dev libaprutil1-dev libmysqlclient-dev libpq-dev libsqlite3-dev rcconf
wget http://apache.mirror.aussiehq.net.au//httpd/httpd-2.4.1.tar.gz
tar -xvf httpd-2.4.1.tar.gz
cd httpd-2.4.1/
./configure
make -j5

where 5 is the number of cores+1. Four-core i5 => 4+1=5.

To install run
sudo make install
or
sudo checkinstall
sudo dpkg -i *.deb


Done.


sudo checkinstall won't work unless you first
sudo mkdir -p /usr/local/apache2/modules
(see comment below by Y&S who pointed this out)

If you don't create the directory first, you get
/usr/share/apr-1.0/build/libtool --silent --mode=install install mod_allowmethods.la /usr/local/apache2/modules/
ranlib: could not create temporary file whilst writing archive: No more archived files
make[3]: *** [install-modules-yes] Error 1
make[3]: Leaving directory `/home/me/tmp/httpd-2.4.1/modules/aaa'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/home/me/tmp/httpd-2.4.1/modules/aaa'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/me/tmp/httpd-2.4.1/modules'
make: *** [install-recursive] Error 1
****  Installation failed. Aborting package creation.

Anyway, your compiled httpd is now in /usr/local/apache2/bin/httpd
In my case /usr/local/apache2/bin is not in my PATH -- whether you want to add it or not is a matter of choice.

In order for you to bind your own httpd to port 80 you need to stop apache2 if it is running
sudo service apache2 stop


Test your build:
me@tantalum:~$ /usr/local/apache2/bin/httpd -v
Server version: Apache/2.4.1 (Unix)
Server built:   Feb 23 2012 11:51:26
So far, very easy.

I've tried it on amd64 and i386 debian testing machines.

Replacing old version of apache2
Don't try to remove apache2.2-bin since gnome-core depends on it:
http://www.linuxformat.com/forums/viewtopic.php?p=101538

The easiest way to deal with this is to do
sudo rcconf 
and de-select apache2. This way it's still installed, but won't run as a rc service.

Making it boot -- init.d script
I had a look at this: http://www.cyberciti.biz/tips/linux-write-sys-v-init-script-to-start-stop-service.html

And here's my /etc/init.d/httpd script

#!/bin/bash
# description: apache2 httpd 2.4.1 server
# Start the service httpd
start() {
        /usr/local/apache2/bin/httpd &
        echo "Up and running"
}
# Restart the service httpd
stop() {
        killall httpd
        echo "Killing httpd"
}
### main logic ###
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  *)
        echo $"Usage: $0 {start|stop}"
        exit 1
esac
exit 0
Don't forget to chmod+x


Finally,
sudo rcconf
and select httpd (it'll be at the bottom of the list)

It's not the prettiest of scripts, and you can probably do better by editing /etc/init.d/apache2

28 February 2012

86. Building sinfo 0.0.45 on Debian Testing

I use sinfo to keep an eye on my cluster:
http://www.ant.uni-bremen.de/whomes/rinas/sinfo/#down

The debian repo version is 0.0.42-1
The latest version is sinfo 0.0.45

Here's the changelog since 0.0.42
sinfo 0.0.45- Tue, 13 Mar 2012 07:07:27 +0100corrected README compile hint for FreeBSDadded configure flag --disable-IPv6 to disable IPv6 supportsinfo 0.0.44 - Tue, 13 Dec 2011 18:32:33 +0100added reconnect for TCP connectionsadded LIBADD to make it --as-needed linkable tnx to T.Hardersinfo 0.0.43 - Thu, 01 Sep 2011 09:00:13 +0200fixed printing bug (integer underflow) when using sinfo -L or -W tnx to J.Erkkilae


There's little reason for compiling it yourself, but there's really no reason not to try either. I like debian and I like using apt-get to manage my system. Learning to be a bit more independent won't hurt though.
So here we go:

--START HERE --
wget http://www.ant.uni-bremen.de/whomes/rinas/sinfo/download/sinfo-0.0.45.tar.gz
tar -xvf sinfo-0.0.45.tar.gz 
cd sinfo-0.0.45/
sudo apt-get install libboost-dev libasio-dev libboost-signals-dev
./configure
(If your interface configuration has disabled IPv6 you must use ../configure --disable-IPv6 or sinfod will silently exit)
make 
sudo checkinstall


Done.

Start the sinfo daemon by
sudo sinfod --quiet --bcastaddress=192.168.1.255


Use
sinfo
to monitor

If you had sinfo installed before, autoremove it, then edit the left-behind /etc/init.d/sinfo script and change
/usr/sbin/sinfod
 to
 /usr/sbin/local/sinfod
Otherwise see http://verahill.blogspot.com.au/2012/02/debian-testing-wheezy-64-building_23.html for an example of writing your own init.d script.


To see all the cluster nodes running sinfo, just start
sinfo
If you don't see anything, then you've most likely not opened up your firewall -- you need to be able to listen to bcast.

Build errors:

Error:
In file included from message.cc:2:0:
message.h:5:34: fatal error: boost/shared_array.hpp: No such file or directory
compilation terminated.
make[2]: *** [message.lo] Error 1
make[2]: Leaving directory `/home/me/tmp/sinfo-0.0.45/libmessage'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/me/tmp/sinfo-0.0.45/libmessage'
make: *** [all-recursive] Error 1

Solution:
sudo apt-get install libboost-dev


Error:
In file included from udpmessagereceiver.cc:2:0:
udpmessagereceiver.h:4:20: fatal error: asio.hpp: No such file or directory
compilation terminated.
make[1]: *** [udpmessagereceiver.lo] Error 1
make[1]: Leaving directory `/home/me/tmp/sinfo-0.0.45/libmessageio'
make: *** [all-recursive] Error 1

Solution:
sudo apt-get install libasio-dev
which provides
/usr/include/asio.hpp
which is different from the asio.hpp included in libboost


Error:
/usr/bin/ld: cannot find -lboost_signals-mt
collect2: ld returned 1 exit status
make[2]: *** [sinfod] Error 1
make[2]: Leaving directory `/home/me/tmp/sinfo-0.0.45/sinfod'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/me/tmp/sinfo-0.0.45/sinfod'
make: *** [all-recursive] Error 1

Solution:
sudo apt-get install libboost-signals-dev

Links to this post:
http://ant.uni-bremen.de/whomes/rinas/sinfo/

85. Nvidia bug causes evolution to crash/segmentation fault. Temporary and permanent fixes on Debian Testing

The nvidia-tls bug is affecting evolution too...
(and it's not just GNOME - http://www.linuxmintusers.de/index.php?topic=6859.0)


UPDATE: I have two nvidia boxes running debian testing. Only the one with GT 430 is exhibiting problems. My GT 520 box is unaffected.


UPDATE: Here's how to downgrade your drivers:
http://verahill.blogspot.com.au/2012/03/debian-testing-downgrading-nvidia.html

If you don't want to read the entire post, here's the summary:
1. I think the only semi-permanent solution is to downgrade from 295.20 to nvidia driver version 290.10
2. you can run evolution with
strace -o evolution.log evolution
and IT WILL NOT CRASH
3. It doesn't matter whether you use the nvidia binary straight from nvidia, using sgfxi, or use the nvidia-kernel-dkms/glx debian way. Evolution still dies.

PS strace is normally used to track system calls for the purpose trouble shooting. That it prevents evolution from crashing is completely unintended. But it works as a quick-fix.

PPS  What it does:

"The nvidia-tls libraries (/usr/lib/libnvidia-tls.so.x.y.z and /usr/lib/tls/libnvidia-tls.so.x.y.z); these files provide thread local storage support for the NVIDIA OpenGL libraries (libGL, libGLcore, and libglx). Each nvidia-tls library provides support for a particular thread local storage model (such as ELF TLS), and the one appropriate for your system will be loaded at run time."




The symptoms:
Start  evolution, and it will crash with a segmentation fault within the first ten seconds or so

dmesg points to the nvidia bug:

[19690.606196] evolution[13032]: segfault at 10 ip 00007f5a0f53ac0f sp 00007f59ddde6508 error 6 in libnvidia-tls.so.295.20[7f5a0f53a000+3000]
[21476.236668] evolution[18197]: segfault at 10 ip 00007fd4389c2c0f sp 00007fd418d56508 error 6 in libnvidia-tls.so.295.20[7fd4389c2000+3000]
[21513.224145] evolution[18387]: segfault at 10 ip 00007f2cd3e85c0f sp 00007f2cb3a44508 error 6 in libnvidia-tls.so.295.20[7f2cd3e85000+3000]
[21954.867694] evolution[19803]: segfault at 10 ip 00007f1680aa9c0f sp 00007f165bffe508 error 6 in libnvidia-tls.so.295.20[7f1680aa9000+3000]
[22129.426444] evolution[20435]: segfault at 10 ip 00007f2a05bf8c0f sp 00007f29e5725508 error 6 in libnvidia-tls.so.295.20[7f2a05bf8000+3000]


Running
CAMEL_DEBUG=all evolution >& evolution.log
three times had it crash with

First time:

DB SQL operation [BEGIN] started
Camel SQL Exec:
BEGIN
Camel SQL Exec:
COMMIT
DB Operation ended. Time Taken : 0.000060
###########
received: * LSUB (\HasNoChildren) "/" "INBOX"
received: B00005 OK Success
sending : B00006 LIST "" "*"
--> Segmentation fault

Second time:

===========
DB SQL operation [ATTACH DATABASE ':memory:' AS mem] started
Camel SQL Exec:
ATTACH DATABASE ':memory:' AS mem
POP3_STREAM_LINE (25): '-ERR unrecognized command'
DB Operation ended. Time Taken : 0.011516
###########

Database succesfully opened  

===========
DB SQL operation [ATTACH DATABASE ':memory:' AS mem] started
Camel SQL Exec:
ATTACH DATABASE ':memory:' AS mem
DB Operation ended. Time Taken : 0.010961
###########
**
GLib-GIO:ERROR:/tmp/buildd/glib2.0-2.30.2/./gio/gdbusmessage.c:1986:append_value_to_blob: assertion failed: (g_utf8_validate (v, -1, &end) && (end == v + len))
--> Segmentation fault

Third time:

===========
DB SQL operation [BEGIN] started
Camel SQL Exec:
BEGIN
Camel SQL Exec:
COMMIT
DB Operation ended. Time Taken : 0.000070
###########
sending : A00004 SELECT INBOX
--> Segmentation fault

strace:
I can't crash evolution with either strace or valgrind running. Now why is that?


Solution:
Downgrading. Which turns out to be more difficult than one would imagine.

UPDATE: Here's how to downgrade your drivers:
http://verahill.blogspot.com.au/2012/03/debian-testing-downgrading-nvidia.html

If you don't want to downgrade the nvidia drivers:
A temporary solution is, odd as it may seem, to use
strace -o evolution.log evolution
because it just refuses to crash. I don't know why, but it works. 

84. Downloading Debian installation ISOs using jigdo

Jigdo is the preferred way of downloading and maintaining debian ISOs for those who can't use torrents (e.g. company policies etc.). The advantage is that you only need to download what has changed since you last used jigdo, thus saving on traffic.

What I'm showing here is also described on the debian website -- my contribution is just to provide another, perhaps more detailed, example.

Anyway, it's fairly easy to use jigdo:
sudo apt-get install jigdo-file

mkdir ~/debiso
cd ~/debiso
jigdo-lite

Pick a url from here: http://www.debian.org/CD/jigdo-cd/#which
I'll use a jigdo file for amd64 testing by clicking here http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-cd/ and picking the following url:
http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-cd/debian-testing-amd64-CD-1.jigdo

You also need to pick a mirror -- your country mirror or a nearby university are good choices. I picked ftp://ftp.au.debian.org/debian.

Here's how it works:

me@beryllium:~/jigdo$ jigdo-lite


Jigsaw Download "lite"
Copyright (C) 2001-2005  |  jigdo@
Richard Atterer          |  atterer.net
Loading settings from `/home/me/.jigdo-lite'


-----------------------------------------------------------------
To resume a half-finished download, enter name of .jigdo file.
To start a new download, enter URL of .jigdo file.
You can also enter several URLs/filenames, separated with spaces,
or enumerate in {}, e.g. `http://server/cd-{1_NONUS,2,3}.jigdo'
jigdo [http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-cd/debian-testing-amd64-CD-1.jigdo]: http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-cd/debian-testing-amd64-CD-1.jigdo


Not downloading .jigdo file - `debian-testing-amd64-CD-1.jigdo' already present


-----------------------------------------------------------------
Images offered by `http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-cd/debian-testing-amd64-CD-1.jigdo':
  1: 'Debian GNU/Linux testing "Wheezy" - Official Snapshot amd64 CD Binary-1 20120220-05:20 (20120220)' (debian-testing-amd64-CD-1.iso)


Further information about `debian-testing-amd64-CD-1.iso':
Generated on Mon, 20 Feb 2012 05:33:08 +0000


-----------------------------------------------------------------
If you already have a previous version of the CD you are
downloading, jigdo can re-use files on the old CD that are also
present in the new image, and you do not need to download them
again. Mount the old CD ROM and enter the path it is mounted under
(e.g. `/mnt/cdrom').
Alternatively, just press enter if you want to start downloading
the remaining files.
Files to scan: 


-----------------------------------------------------------------
The jigdo file refers to files stored on Debian mirrors. Please
choose a Debian mirror as follows: Either enter a complete URL
pointing to a mirror (in the form
`ftp://ftp.debian.org/debian/'), or enter any regular expression
for searching through the list of mirrors: Try a two-letter
country code such as `de', or a country name like `United
States', or a server name like `sunsite'.
Debian mirror [http://sluglug.ucsc.edu/debian/]: ftp://ftp.au.debian.org/debian


Downloading .template file
--2012-02-28 10:22:04--  http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-cd/debian-testing-amd64-CD-1.template
Resolving cdimage.debian.org (cdimage.debian.org)... 2001:6b0:e:2018::138, 2001:6b0:e:2018::163, 130.239.18.163, ...
Connecting to cdimage.debian.org (cdimage.debian.org)|2001:6b0:e:2018::138|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 48901055 (47M) [text/plain]


Saving to: `debian-testing-amd64-CD-1.template'


100%[===================================================================================================================================================>] 48,901,055  4.92M/s   in 15s     


2012-02-28 10:22:19 (3.16 MB/s) - `debian-testing-amd64-CD-1.template' saved [48901055/48901055]

[....]

FINISHED --2012-02-28 10:37:02--
Total wall clock time: 4.1s
Downloaded: 3 files, 311K in 2.4s (128 KB/s)
Found 3 of the 3 files required by the template                                                                                                                                  
Successfully created `debian-testing-amd64-CD-1.iso'


-----------------------------------------------------------------
Finished!
The fact that you got this far is a strong indication that `debian-testing-amd64-CD-1.iso'
was generated correctly. I will perform an additional, final check,
which you can interrupt safely with Ctrl-C if you do not want to wait.


OK: Checksums match, image is good!  



All the necessary packages are downloaded so it takes a while. Once it's done, the iso is automatically built.

If you want to update your iso - delete it and run jigdo-lite again.

83. Configuring route for multiple network interfaces on Debian Testing

In my previous post I got rid of network-manager.

On my main desktop, which serves as a gateway for two subnets and serves them with access to the internet and has three ifs (eth0 goes to outside world, eth1 serves 192.168.0-127 and provides inet passthrough, eth2 serves 192.168.128-255), I had issues getting the internet connection to work once network-manager was gone -- the issue was the routing table.

Here's what I did to diagnose and solve it:

When I got rid of network manager I set up my /etc/network/interfaces like this:
auto lo
iface lo inet loopback
auto eth0

iface eth0 inet dhcp
auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

auto eth2
iface eth2 inet static
address 192.168.1.129
netmask 255.255.255.128
gateway 192.168.1.129
But it gives
sudo route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.129   0.0.0.0         UG    0      0        0 eth2
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth1
0.0.0.0         XXX.XXX.XXX.254 0.0.0.0         UG    0      0        0 eth0
XXX.XXX.XXX.0   0.0.0.0         255.255.248.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.1.128   0.0.0.0         255.255.255.128 U     0      0        0 eth2
The problem is that I DON'T want all traffic via eth2 and eth1. I want the default gateway to be my eth0. Inverting the order of the ifs in /etc/network/interfaces doesn't fix it either.

A quick fix is to do
 sudo route add default dev eth0
 which adds this as the first line:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth0
It looks like we might want to manually configure route.

Turns out you can just add the route options to your /etc/network/interfaces file

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.1

auto eth2
iface eth2 inet static
address 192.168.1.129
netmask 255.255.255.128
gateway 192.168.1.129

auto wlan0
iface wlan0 inet static
address 192.168.2.1
netmask 255.255.255.0
gateway 192.168.2.1

post-up ip route flush all
post-up route add default dev eth0
post-up route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 1000
post-up route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 eth1
post-up route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129 eth2
post-up route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.2.1 wlan0

The script gives us a nice, compact routing table on doing
sudo service networking restart

sudo route -n
Kernel IP routing table Destination     Gateway         Genmask         Flags Metric Ref    Use Iface 0.0.0.0         0.0.0.0         0.0.0.0         U     0      0        0 eth0 169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0 192.168.1.0     192.168.1.1     255.255.255.0   UG    0      0        0 eth1 192.168.1.128   192.168.1.129   255.255.255.128 UG    0      0        0 eth2

Edit::
An earlier version of this post used a separate script (see below). This works fine on boot. However, sudo service networking restart
does not invoke it -- so you may end up with a faulty route table. Thus, it is preferable to use the method above in which the route options are added to the end of /etc/network/interfaces

The following (below) is kept for posterity only:

We put the commands below into /etc/routing_table.sh:
#!/bin/sh
sudo ip route flush all
sudo route add default dev eth0
sudo route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 1000
sudo route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 eth1
sudo route add -net 192.168.1.128 netmask 255.255.255.128 gw 192.168.1.129 eth2
exit 0
We change the atttributes:
sudo chmod o-rwx /etc/routing_table.sh
sudo chmod g-rwx /etc/routing_table.sh
sudo chmod u+rwx /etc/routing_table.sh
Here user is root. This way only root can execute and edit the table. I guess the 'sudo' is a bit superfluous in our script.
To make it start on boot, add a line to your /etc/rc.local
My rc.local now looks like this:
#!/bin/sh -e echo "1" > /proc/sys/net/ipv4/ip_forward sh /etc/firewall-rules.sh sh /etc/routing_table.sh exit 0
The firewall-rules.sh script is described in another post on ip tables.