EihiS

January 13, 2014

. Raspbian Hot Notes

Filed under: Uncategorized — admin @ 2:41 pm

Errors when compiling crosstool-NG on a x86_64 ubuntu 14.04 version :

after ./configure , and make , make install fails :

The Error thrown is : (extract)
[ERROR]    check_fds.c:85:1: internal compiler error: Segmentation fault
[ERROR]    make[3]: *** [/home/eihis/crosstool-ng-1.20.0/ctng/.build/arm-rpi-linux-gnueabi/build/build-libc-startfiles/csu/check_fds.o] Error 1
[ERROR]    make[2]: *** [csu/subdir_lib] Error 2
[ERROR]    make[1]: *** [csu/subdir_lib] Error 2
[ERROR]
[ERROR]  >>
[ERROR]  >>  Build failed in step 'Installing C library headers & start files'
[ERROR]  >>        called in step '(top-level)'

The bug comes from xubuntu 14.04 packed with gcc/g++ versions 4.8.
Downgrade to 4.7 for gcc and g++ fixes the error.
Howto :
use APT-GET to download gcc-4.7 and g++-4.7
then from console :
sudo update-alternatives --remove-all gcc
sudo update-alternatives --remove-all g++
(will complaint about no alternatives, if using a fresh install of xubuntu )

then declare alternatives for gcc/g++ :
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc

sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.7 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++

Now you can choose the gcc/g++ compile time versions using :
  • sudo update-alternatives --config gcc

A small text selector comes, asking for the current selected version for compilation, looking like that :

There are 2 choices for the alternative gcc (providing /usr/bin/gcc).

  Selection    Path              Priority   Status
------------------------------------------------------------
* 0            /usr/bin/gcc-4.8   20        auto mode
  1            /usr/bin/gcc-4.7   10        manual mode
  2            /usr/bin/gcc-4.8   20        manual mode

Press enter to keep the current choice[*], or type selection number: _
... for c++ :
  • sudo update-alternatives --config g++

finally, check by typing, if in a doubt :

  • gcc --version
  • g++ --version

for informations, here is the complete listing and times for compilation of crosstool-NG for the raspberry-pi ARM architecture, on my xubuntu quad-core machine :

ct-ng build
[INFO ]  Performing some trivial sanity checks
[INFO ]  Build started 20141103.111133
[INFO ]  Building environment variables
[INFO ]  =================================================================
[INFO ]  Retrieving needed toolchain components' tarballs
[INFO ]  Retrieving needed toolchain components' tarballs: done in 0.25s (at 00:03)
[INFO ]  =================================================================
[INFO ]  Extracting and patching toolchain components
[INFO ]  Extracting and patching toolchain components: done in 3.18s (at 00:06)
[INFO ]  =================================================================
[INFO ]  Installing GMP for host
[INFO ]  Installing GMP for host: done in 48.04s (at 00:54)
[INFO ]  =================================================================
[INFO ]  Installing MPFR for host
[INFO ]  Installing MPFR for host: done in 19.63s (at 01:14)
[INFO ]  =================================================================
[INFO ]  Installing PPL for host
[INFO ]  Installing PPL for host: done in 175.03s (at 04:09)
[INFO ]  =================================================================
[INFO ]  Installing CLooG for host
[INFO ]  Installing CLooG for host: done in 8.53s (at 04:18)
[INFO ]  =================================================================
[INFO ]  Installing MPC for host
[INFO ]  Installing MPC for host: done in 10.63s (at 04:28)
[INFO ]  =================================================================
[INFO ]  Installing binutils for host
[INFO ]  Installing binutils for host: done in 58.48s (at 05:27)
[INFO ]  =================================================================
[INFO ]  Installing pass-1 core C compiler
[INFO ]  Installing pass-1 core C compiler: done in 243.32s (at 09:30)
[INFO ]  =================================================================
[INFO ]  Installing kernel headers
[INFO ]  Installing kernel headers: done in 15.74s (at 09:46)
[INFO ]  =================================================================
[INFO ]  Installing C library headers & start files
[INFO ]  Installing C library headers & start files: done in 40.20s (at 10:26)
[INFO ]  =================================================================
[INFO ]  Installing pass-2 core C compiler
[INFO ]  Installing pass-2 core C compiler: done in 269.43s (at 14:55)
[INFO ]  =================================================================
[INFO ]  Installing C library
[INFO ]  Installing C library: done in 377.16s (at 21:13)
[INFO ]  =================================================================
[INFO ]  Installing final compiler
[INFO ]  Installing final compiler: done in 332.47s (at 26:45)
[INFO ]  =================================================================
[INFO ]  Installing libelf for the target
[INFO ]  Installing libelf for the target: done in 7.62s (at 26:53)
[INFO ]  =================================================================
[INFO ]  Installing dmalloc
[INFO ]  Installing dmalloc: done in 11.39s (at 27:04)
[INFO ]  =================================================================
[INFO ]  Installing D.U.M.A.
[INFO ]  Installing D.U.M.A.: done in 2.19s (at 27:06)
[INFO ]  =================================================================
[INFO ]  Installing cross-gdb
[INFO ]  Installing cross-gdb: done in 114.71s (at 29:01)
[INFO ]  =================================================================
[INFO ]  Installing gdbserver
[INFO ]  Installing gdbserver: done in 7.09s (at 29:08)
[INFO ]  =================================================================
[INFO ]  Installing ltrace
[INFO ]  Installing ltrace: done in 3.18s (at 29:11)
[INFO ]  =================================================================
[INFO ]  Cleaning-up the toolchain's directory
[INFO ]    Stripping all toolchain executables
[INFO ]  Cleaning-up the toolchain's directory: done in 4.73s (at 29:16)
[INFO ]  Build completed at 20141103.114049
[INFO ]  (elapsed: 29:16.28)
[INFO ]  Finishing installation (may take a few seconds)...

Compilation of pk2cmd from sources (linux/MAC , github):

  • apt-get install libusb++-dev ( many hours lost understanding where was this missing dependency. c++ , not c ! )
  • (su) make linux ( fix depencies errors if any )
  • (su) make install
  • file is created under /usr/local/bin , named pk2cmd
  • modify .bashrc for PATH , add :export PATH=$PATH:/usr/share/pk2
  • reopen root shell , check by typing pk2cmd ?

Installing Bootable RaspBian on a 1GB CARD (Raspberry PI 512M)

  • use a very good image from this website :https://www.linuxsystems.it/raspbian-wheezy-armhf-raspberry-pi-minimal-image/
  • as on the website explained, resize from 1GB to the physical SD size ( my case : a 2GB SD ) with gparted,if needed.
  • first login : User root , password rqspberry ( keyboard is still qwerty one )
  • then ” loadkeys fr ” and everything goes fine (your country code)
  • apt-get update

df -a gives a :

Filesystem     1K-blocks   Used Available Use% Mounted on
rootfs           1740592 452552   1286284  27% /
/dev/root        1740592 452552   1286284  27% /
devtmpfs          216108      0    216108   0% /dev
tmpfs              44876    196     44680   1% /run
tmpfs               5120      0      5120   0% /run/lock
proc                   0      0         0    - /proc
sysfs                  0      0         0    - /sys
tmpfs             110020      0    110020   0% /run/shm
devpts                 0      0         0    - /dev/pts
/dev/mmcblk0p1     50396  18483     31913  37% /boot
  • as stated by the author, ssh is enabled and a remote connection is done out of the box.
  • I need a web server, with php :
  1. apt-get install lighttpd
  2. from the remote machine, firefox to the RPi’s ip gives a wonderfull :

  1. Get PHP for this :
    apt-get -y install php5-common php5-cgi php5
  2. then :
    lighty-enable-mod fastcgi-php
  3. Now, restart lighttpd service :
    service lighttpd force-reload
  4. Some unconfigured VARS are thrown away , like :
    LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
  5. Time to test :
  6. cd /var/www
  7. nano test.php
  8. type in : <?php echo “hello world!” ?>
  9. ctrl-o to save , ctrl-x to exit
  10. then from remote machine, : http://type.the.rpi.ip/test.php gives a wonderfull :

A new df -a gives :

Filesystem     1K-blocks   Used Available Use% Mounted on
rootfs           1740592 483424   1255412  28% /
/dev/root        1740592 483424   1255412  28% /
devtmpfs          216108      0    216108   0% /dev
tmpfs              44876    200     44676   1% /run
tmpfs               5120      0      5120   0% /run/lock
proc                   0      0         0    - /proc
sysfs                  0      0         0    - /sys
tmpfs             110020      0    110020   0% /run/shm
devpts                 0      0         0    - /dev/pts
/dev/mmcblk0p1     50396  18483     31913  37% /boot

.Really good ! for a 34.5MB more, grabbed GCC , doing apt-get install gcc

Added 2016 , january.

In case of :

any write to /dev/sdc (SD card) from an image saved, use ’sync’ after DD has ended ensures the data have been flushed (written) before removing the SD card

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

314159265358979323846264338327950288
419716939937510582097494459230781640
628620899862803482534211706798214808

cat{ } { post_504 } { } 2009-2015 EIhIS Powered by WordPress