world leader in high performance signal processing
Trace: » pc_ubuntu_setup

pc_ubuntu_setup

  1. Install ubuntu system
    • We use the latest ubuntu 12.04 system for the regression PCs.
    • Find a CD which have the ubuntu 12.04 iso image, and press the F12 in the beginning to enable the PC enter the CD/DVD start.
      In the process of install linux system, there will be serveral configuration pages for you to make selection. Generally we make default choices except that we set default language to English, and set the user name as “test” and the password also “test”.
      After finishing the installation, start the machine, we get ubuntu graphics interface started, we start a shell as our terminal/console from which we can start our specific setting.
  2. Config the PC ubuntu
    • Set the root password as “blackfin”:
      $ sudo passwd root
    • Use apt-get install to install the following packages through DHCP allocated ipaddress.
      $ sudo apt-get install vim-nox openssh-server expect default-jdk minicom ckermit gawk \
      git-core  g++ bison  flex  gettext texinfo  libncurses5-dev subversion meld \
       rsh-client  mpg123 python-setuptools python-dev netperf  tftpd-hpa \
      uuid-dev genromfs samba cifs-utils xz-utils intltool ethtool libtool wakeonlan 
      Package mpg123 is for audio test. Package uuid-dev is for host-e2fsprogs. Package genromfs is for xip test. Package intltool is for linphone test. Package wakeonlan is for ethernet wakeup test. Install vim-nox is for tool vimdiff. Install default-jdk is for openjdk-6-jdk
    • Configure static network ipaddress using network interfaces instead of DHCP ( Notice : 10.99.29.xx is available only in lab, before moving eth0 should remain the DHCP setting):
      • Don't use network-manager as it handles multiple network cards badly. Disable network-manager in file /etc/rc.local by adding following scripts:
        service network-manager stop
        ifup eth0 eth1
      • Set ethernet config in /etc/network/interfaces, bellow is an example. Usually we set eth0 to 10.99.29.xx subnet, and eth1 to 10.100.4.xx subnet. If eth* is not in desired order, modify file /etc/udev/rules.d/70-persistent-net.rules to ensure eth0 is on-board NIC. For Ubuntu 12.04, don't edit resolv.conf directly for dns setting, add dns setting here.
        auto lo
        iface lo inet loopback
        
        #use this setting before move the machine into lab
        #auto eth0
        #iface eth0 inet dhcp
        
        iface eth0 inet static
        address 10.99.29.87
        netmask 255.255.255.0
        broadcast 10.99.29.255
        gateway 10.99.29.1
        
        #dns setting for 12.04
        dns-nameservers 10.64.53.110
        dns-search analog.com
        
        iface eth1 inet static
        address 10.100.4.174
        netmask 255.255.255.0
        broadcast 10.100.4.255
    • Configure SSH server:
      • openssh-server should have been installed in previous apt-get install command. This tool enable us operate the host machine remotely.
      • If log in via ssh is slow, set UseDNS to no in /etc/ssh/sshd_config may help. Then restart ssh server.
        sudo service ssh restart
    • How to install funkload
      $ apt-get install python-setuptools python-webunit python-docutils gnuplot
      $ sudo easy_install -U funkload 
    • Minicom setup:
      • Type in command “sudo minicom -s”, choose “Serial port setup”, set “Serial Device” to /dev/ttyS0, set “Bps/Par/Bits” to 57600 8N1 and “Hardware Flow Control” to No.
      • Choose “Modem and dialing” to delete useless log (A B C D E F G H K L). Finally “Save setup as dfl”.
      • Add user test to dialout group for using minicom.
         $ sudo adduser test dialout
    • Tftp server.
      • On ubuntu 12.04, it supports tftpd-hpa as the server quite well .
        1. Install tftpd-hpa
        $ sudo apt-get install tftpd-hpa -y
        2. Default tftp server directory is /etc/default/tftpd-hpa. Need to generate /tftpboot directory and change tftp server directory to /tftpboot.
        sudo vi /etc/default/tftpd-hpa
        Change TFTP_DIRECTORY to /tftpboot.
        # /etc/default/tftpd-hpa
        
        TFTP_USERNAME="tftp"
        TFTP_DIRECTORY="/tftpboot"
        TFTP_ADDRESS="0.0.0.0:69"
        TFTP_OPTIONS="--secure"

        $ sudo mkdir /tftpboot
        $ sudo chmod 777 /tftpboot
        $ sudo service tftpd-hpa restart
        Run “ps auxf” on host, seeing the following line to make sure tftpd is started:

         /usr/sbin/in.tftpd --listen --user tftp --address 0.0.0.0:69 --secure /tftpboot

        Notice: If there is /etc/xinetd.d/tftp exists, it would conflict with tftpd-hpa setting, so make sure only enable tftpd-hpa.
        3. After reboot PC, if tftp server still seems not work, run following command to restart tftp server:

        $ sudo service tftpd-hpa restart
        You can also add file /etc/network/if-up.d/tftpd-hpa with following scripts to make sure tftpd-hpa is started after ethernet is up.

        #!/bin/sh
        service tftpd-hpa restart

        Don't forget to change mode of file tftpd-hpa to 755.

        $ sudo chmod 755 tftpd-hpa

  • Configure prompt
    • Ubuntu has a prompt which is too long and complicated, and makes serial test fail. So in /home/test/.bashrc I reset PS1 value(example is in 10.99.29.85): PS1='\u@\h:\W\$ '.
  • Change hostname. Edit /etc/hostname and change to the new value.
    $ sudo vi /etc/hostname
    Edit /etc/hosts and change the old 127.0.1.1 line to your new hostname.
    $ sudo vi /etc/hosts
    Now after a reboot, hostname will be the new one. To change without a reboot, you can run following command:
    $ sudo service hostname start
  • set up ssh config to enable scp without entering password manually each time. Edit /etc/ssh/ssh_config:
    StrictHostKeyChecking no
    UserKnownHostsFile /dev/null
  • Nfs server
    sudo apt-get install nfs-kernel-server   
    sudo vi /etc/exports 
    (add)  /tftpboot *(rw,sync,no_root_squash,no_subtree_check)
    sudo /etc/init.d/nfs-kernel-server start or sudo service nfs-kernel-server start 
  • Samba: add configure sector in /etc/samba/smb.conf ;
    [users]
     comment = All users
     browseable = yes
     path = /home
     read only = no
     create mask = 0755

    then run command in terminel:

    sudo smbpasswd -x test
    sudo smbpasswd -a test
    sudo restart smbd
    sudo restart nmbd
    • There are 720p video files in FIXME on 10.99.29.85, copy that to local machine where need to test HDMI 720p.
    • USB ethernet test need to install an extra ethernet card. Check configuration on 10.99.29.86 as an example.
  • PC set up for audio testing:
    • Install following package we need.
      $ apt-get install libsndfile1-dev plotutils gnuplot
    • In ubuntu 12.04, libfftw3-dev can not work with our snd2fftw, so remove new version and install older version of fftw. We use fftw-3.1.2.tar.gz.
      $ tar -xf fftw-3.1.2.tar.gz 
      $ ./configure --prefix=/usr --enable-shared=yes 
      $ sudo make install
      Then build snd2fftw in uclinux-dist/testsuites/audio/snd2fftw/src, install it to host PC.
    • Hardware connection: connect audio card in and out to PC headphone and mic in front panel.
    • Then run alsamixer to configure audio setting in PC.
      $ sudo alsamixer
    • When configure playback in alsamixer, diable Front Mic and adjust master/PCM/headphone to a proper level.
    • When configure Capture in alsamixer, set Input Source to Front Mic and adjust Capture to a proper level.
  • Set up node machine for Jenkins
    • use ssh mode to start node.
    • copy usefull tar packages to /home/test/workspace/dl to shorten the time for first build.
    • copy toolchain to host PC /opt directory. Set toolchain export command to alias “pex” in your home directory .bash_aliases.
      alias pex='export PATH=/opt/uClinux/bfin-uclinux/bin:/opt/uClinux/bfin-elf/bin:/opt/uClinux/bfin-linux-uclibc/bin:$PATH'
    • copy ./startup.sh to host PC home directory(for example,/home/test).
    • copy reset_board to host PC.
    • set up network.
  • To fix stubs.h missing bug (7146) in speedx.
    apt-get install gcc-multilib  
    ln -sf /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu/stubs-32.h
  • How to run smart update via commond line?
    apt-get update
    apt-get dist-upgrade or apt-get upgrade
  • If the kermit can't work ,please:
    scp test@10.99.24.xx:/home/test/.kerm*  .  
  • To install Ubuntu host for toolchain test, more packages to be used. Please refer to doc: install linux