Wednesday, November 18, 2015

Step by Step of Building Root File System of STreamPlug ST2100 on Ubuntu 64

1. Download codesourcery toolchain
http://www.codesourcery.com/sgpp/lite/arm/portal/package4573/public/arm-none-linux-gnueabi/arm-2009q1-203-arm-none-linux-gnueabi.bin

2. Change your default shell from bash to dash
sudo dpkg-reconfigure dash

3. Install the Java SE and add to PATH
export PATH=user/local/jdk1.8.0_25/bin:$PATH

4. Install the toochain, and copy the whole folder to /opt/arm-2009q1
cp -r /CodeSourcery/Sourcery_G++_Lite /opt/arm-2009q1

5. For Ubuntu x86 64-bit, we need install 32-bit libraries
Refer to this link: https://sourcery.mentor.com/sgpp/lite/arm/portal/kbentry62
Ubuntu 12.04 and later
Since 12.04 Ubuntu introduced Multi Arch (https://wiki.ubuntu.com/MultiarchSpec) and removed ia32-libs ia32-libs-gtk packages from the repository. To install 32-bit libs you need the run the following command line:
sudo apt-get update
sudo apt-get install libgtk2.0-0:i386 libxtst6:i386 gtk2-engines-murrine:i386 \
lib32stdc++6 libxt6:i386 libdbus-glib-1-2:i386 libasound2:i386
Note, you may need to run the following command first if the message Unable to locate package <package name> appears:
sudo dpkg --add-architecture i386

6. make okl_streamplug_minimal_board_buildroot_defconfig

7. make

8. Fix the error "./stdio.h:456:1: 'gets' undeclared here (not in a function)
Open "output/build/host-m4-1.4.15/lib/stdio.h", and mark the line 455 & 456:
#undef gets
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");

9. Fix the autoconf building error "must be after `@defmac' to use `@defmacx'"
find the file output/build/host-autoconf-2.65/doc/autoconf.texi and patch it

Content of the Patch file: (Copy & save it as "autoconf_patch")
 --- a/doc/autoconf.texi  
 +++ b/doc/autoconf.texi  
 @@ -15,7 +15,7 @@  
  @c The ARG is an optional argument. To be used for macro arguments in  
  @c their documentation (@defmac).  
  @macro ovar{varname}  
 -@r{[}@var{\varname\}@r{]}@c  
 +@r{[}@var{\varname\}@r{]}  
  @end macro  
  @c @dvar(ARG, DEFAULT)  
 @@ -23,7 +23,7 @@  
  @c The ARG is an optional argument, defaulting to DEFAULT. To be used  
  @c for macro arguments in their documentation (@defmac).  
  @macro dvar{varname, default}  
 -@r{[}@var{\varname\} = @samp{\default\}@r{]}@c  
 +@r{[}@var{\varname\} = @samp{\default\}@r{]}  
  @end macro  
  @c Handling the indexes with Texinfo yields several different problems.  
 @@ -8014,10 +8014,10 @@ variables, respectively. The computed linker flags are cached in  
  @code{ac_cv_f77_libs} or @code{ac_cv_fc_libs}, respectively.  
  @end defmac  
 -@defmac AC_F77_DUMMY_MAIN (@ovar{action-if-found}, @dvar{action-if-not-found, @  
 - AC_MSG_FAILURE})  
 -@defmacx AC_FC_DUMMY_MAIN (@ovar{action-if-found}, @dvar{action-if-not-found, @  
 - AC_MSG_FAILURE})  
 +@defmac AC_F77_DUMMY_MAIN (@ovar{action-if-found}, @  
 + @dvar{action-if-not-found, AC_MSG_FAILURE})  
 +@defmacx AC_FC_DUMMY_MAIN (@ovar{action-if-found}, @  
 + @dvar{action-if-not-found, AC_MSG_FAILURE})  
  @acindex{F77_DUMMY_MAIN}  
  @cvindex F77_DUMMY_MAIN  
  @acindex{FC_DUMMY_MAIN}  
 @@ -8268,8 +8268,8 @@ results in @code{ac_cv_fc_srcext_@var{ext}} and  
  @code{ac_cv_fc_pp_srcext_@var{ext}} variables, respectively.  
  @end defmac  
 -@defmac AC_FC_PP_DEFINE (@ovar{action-if-success}, @dvar{action-if-failure, @  
 - AC_MSG_FAILURE})  
 +@defmac AC_FC_PP_DEFINE (@ovar{action-if-success}, @  
 + @dvar{action-if-failure, AC_MSG_FAILURE})  
  @acindex{FC_PP_DEFINE}  
  @caindex fc_pp_define  
 @@ -8287,8 +8287,8 @@ The result of this test is cached in the @code{ac_cv_fc_pp_define}  
  variable.  
  @end defmac  
 -@defmac AC_FC_FREEFORM (@ovar{action-if-success}, @dvar{action-if-failure, @  
 - AC_MSG_FAILURE})  
 +@defmac AC_FC_FREEFORM (@ovar{action-if-success}, @  
 + @dvar{action-if-failure, AC_MSG_FAILURE})  
  @acindex{FC_FREEFORM}  
  @caindex fc_freeform  
 @@ -8314,8 +8314,8 @@ The result of this test, or @samp{none} or @samp{unknown}, is cached in  
  the @code{ac_cv_fc_freeform} variable.  
  @end defmac  
 -@defmac AC_FC_FIXEDFORM (@ovar{action-if-success}, @dvar{action-if-failure, @  
 - AC_MSG_FAILURE})  
 +@defmac AC_FC_FIXEDFORM (@ovar{action-if-success}, @  
 + @dvar{action-if-failure, AC_MSG_FAILURE})  
  @acindex{FC_FIXEDFORM}  
  @caindex fc_fixedform  

patch autoconf.texi < autoconf_patch


10.  Fix the problem in ncurses "gpm.h: No such file or directory"
Add "--without-gpm" in  "[Buildroot folder]/package/ncurses/ncurses.mk"


11. Fix problem "pciutils-3.1.7.tar.gz" can't be unzip
change version to 3.1.8 in "[Buildroot folder]/package/pciutils/pciutils.mk"