root:~> ipkg install asterisk
Blackfin Asterisk Package System (BAPs)IntroductionPackage based Build system for Blackfin Asterisk. Key differences compared to buildroot based systems like Astfin and uCasterisk:
PackagesIn addition to an IP04/IP08 uImage (kernel plus basic root filesystem) there is a growing list of packages:
Getting StartedThe installation of the BAPs uImage is still a little complex (apologies). It requires working with u-boot using the RS232 console interface. For more information on this process please see the IP04 Wiki or please post to the Blackfin Asterisk forum. However once the uImage is install life gets much easier! This process will erase your IP04 root file system so please backup anything you really need (like your asterisk conf files). 1/ Get the baseline BAPs uImage (contains kernel and basic root file system) and place it on your tftp server: http://www.rowetel.com/ucasterisk/downloads/uImage_r2.ip08
2/ Connect a RS232 cable to your IP04 (via the daughter board) and stop the boot process at the u-boot prompt. Now we are going to write the new uImage to flash. your:mac:address can be found using print at the u-boot prompt.
Install the new uImage into NAND flash using u-boot: ip04>set autostart ip04>set serverip your.tftp.server ip04>tftp 0x1000000 uImage_r2.ip08 ip04>nand erase clean ip04>nand erase ip04>nand write 0x1000000 0x0 0x300000 ip04>set bootargs ethaddr=your:mac:address root=/dev/mtdblock0 rw ip04>save ip04>bootm 0x1000000 (uClinux will boot.......)
3/ Now we have uClinux running, but using a ram-based ext2 file system (mtdblock0) for root. So we need to copy /root into the yaffs file system: On the IP04: root:~> copy_rootfs.sh root:~> reboot 4/ Now set up u-boot to mount root from yaffs (some of these env variables may be set already, use print to check): ip04>set autostart yes ip04>set bootargs ethaddr=your:mac:address root=/dev/mtdblock2 rw ip04>set nandboot 'nboot 0x2000000 0x0' ip04>set bootcmd run nandboot ip04>save ip04>reset 5/ Boot IP04 to a uClinux root prompt. Use mount to check that root is mounted on mtdblock2 (yaffs file system). Now we can install some packages using ipkg: $root:~> ipkg update $root:~> ipkg install zaptel-spi asterisk native-sounds $root:~> reboot DocumentationAfter installation many packages include documentation in the /usr/doc directory of the IP04. These are small files designed to capture Blackfin or IP04 specific information, for example simple tests and notes on differences from other versions of the same package. The documentation files can also be browsed from BAPS SVN. HOWTO - Developer1/ svn co http://svn.astfin.org/software/baps/trunk baps 2/ You need this toolchain: [baps]$ wget http://blackfin.uclinux.org/gf/download/frsrelease/ \
348/3347/blackfin-toolchain-07r1.1-3.i386.tar.gz
[baps]$ tar xzf blackfin-toolchain-07r1.1-3.i386.tar.gz
If you untar the toolchain in baps directory then it will be included in your path automatically. If you untar it somewhere else make sure the bin directories in this toolchain are in your path. 3/ Make a BAPS uImage that supports ipkg. This also configures uClinux-dist to support compiling of other packages. You need to make uClinux before making any other packages. [baps]$ make -f uClinux.mk uClinux [baps]$ cp uClinux-dist/images/uImage /tftpboot/uImage You can then try booting from your uImage via tftp, in u-boot: ip04>set autostart ip04>set bootargs ethaddr=your:mac:address root=/dev/mtdblock0 rw ip04>save ip04>tftp 0x1000000 uImage ip04>bootm Or you can flash the uImage as described in the Getting Started section above. 4/ Check out ipkg.conf: root:~> cat /etc/ipkg.conf src snapshots http://rowetel.com/ucasterisk/ipkg dest root / Try installing a simple ipkgs: root:~> ipkg update root:~> ipkg list root:~> ipkg install hello root:~> hello 5/ BAPS uses init.d type start up scripts, for example: root:~> ls /etc/init.d root:~> /etc/init.d/hello root:~> /etc/init.d/hello enable root:~> ls -l /etc/rc.d/ HOWTO - IPKGTo build the ipkg: [baps]$ make -f hello.mk hello [baps]$ make -f hello.mk hello-package [baps]$ ls ipkg To create an index file: [baps]$ cd ipkg [baps]$ ../scripts/ipkg-make-index.sh . > Packages [baps]$ scp Packages /your/web/server Then change the first line in /etc/ipkg.conf on your IP04: src snapshots http://you.web.server And try: root:~> ipkg update root:~> ipkg list NOTES: 1/ If you change the post or pre inst scripts, it is a good idea to rm the existing $(TARGET_DIR) (see Makefile for your package), as the package make scripts don't seem to recognise when post/pre scripts have been changed. 2/ To debug post/pre inst scripts #!/bin/sh -x is your friend! 3/ To test ipkgs you can rcp down to the target: [host]$ rcp ipkg/asterisk_1.4.4-1_bfin.ipk root@ip04:/root [ip04]$ ipkg install asterisk_1.4.4-1_bfin.ipk If you get complaints about MD5 mismatch, then: [ip04]$ rm /usr/lib/ipkg/lists/snapshots HOWTO - uClinux ChangesSay you have changed a busybox option, or modified some files in uClinux-dist. To capture the changes to patches in SVN: [baps]$ make -f uClinux.mk uClinux-ip04-make-patch [baps]$ svn status Tips: To change linux kernel options: [baps]$ cd uClinux-dist [uClinux-dist]$ make linux_menuconfig (kernel changes) To change user application and library settings: [baps]$ cd uClinux-dist [uClinux-dist]$ make config_menuconfig To modify the IP04 rc, motd etc: [baps]$ cd uClinux-dist/vendors/Rowetel/IP04 (mess with files) Then capture changes as above with: [baps]$ make -f uClinux.mk uClinux-ip04-make-patch Notes1/ Patch files are compatible with Astfin, so hopefully it's possible to move patches back and forth between BAPS and Astfin. 2/ See TODO.txt 3/ To debug init shell scripts, e.g. files/hello.init, add a -x to the first line if the script using vi on the IP04: #!/bin/sh -x 4/ When writing init scripts your will find the busybox msh shell has some quirks, here is a link that explains them (all one line): http://dslinux.org/cgi-bin/moin.cgi/DSLinuxMshScriptingGuide? action=show&redirect=DSLinux+msh+scripting+guide 5/ For more information on the IPKG format: http://handhelds.org/moin/moin.cgi/Ipkg 6/ On the target, the ipkg data is stored in /usr/lib/ipkg/info/ Directoriesipkg - completed packages are placed here include - from OpenWRT kamikaze, contains useful stuff for building packages. scripts - Useful scripts from OpenWRT kamikaze patch - patches for all packages files - start up scripts for packages, get copied to /etc/init.d on target G729 Codec InstallationAnalog Devices has developed an optimised g729 library for the Blackfin that can run on the IP04. Note that you require a license from Sipro to run this g729 codec legally. Here are the instructions for building and installing the g729 codec. Familiarity with compiling Blackfin code for the IP04 is assumed. 1/ Make sure the 2007 toolchain is installed as per the Developer How To above. You path should include these directories: /path/to/baps/opt/uClinux/bfin-linux-uclibc/bin /path/to/baps/opt/uClinux/bfin-uclinux/bin 2/ Change the processor type in uClinux-dist/linux-2.6.x/.config to BF533: # CONFIG_BF532 is not set CONFIG_BF533=y Rebuild the uImage. You can test it by booting the uImage from ram: ip04>tftp 0x1000000 uImage;bootm Check that it boots as a BF533. Now flash this new uImage. It is possible to install this new kernel without erasing your root file system if you just erase the first 0x300000 of flash. ip04>set autostart ip04>set serverip your.tftp.server ip04>tftp 0x1000000 uImage_bf533 ip04>nand erase clean 0x0 0x300000 ip04>nand erase 0x0 0x300000 ip04>nand write 0x1000000 0x0 0x300000 3/ Check out and build libbfgdots: $ svn co svn://sources.blackfin.uclinux.org/uclinux-dist/trunk/lib/libbfgdots libbfgdots $ cd libbfgdots; make Now rcp libg729.so from libbfgdots to /lib on your IP04. When Asterisk boots it should load the g729 codec. Check the codec is installed with show translate at the Asterisk CLI. CreditsThanks to: Jeff Knighton, Alex Tao, Ming C (Vincent) Li, Mike Taht, Keith Huang, Mark Hindess, Nick Basil and Michael O'Conner for contributing. Thanks Bruce and Jan at Voiptel for the great work on the GUI. VoipTel GUIBruce and Jan at Voiptel have recently done some great work on upgrading and debugging the AsteriskNow GUI for the IP04, using a modified version of several BAPS packages. The source code (package makefiles, GUI source etc) is available from the Voiptel upgrade site. We are working with Voiptel to make the Voiptel firmware more compatible with existing BAPS packages (for example share a common uImage, remove duplication of common packages. This will make installing the Voiptel GUI as easy as using other BAPS packages. However in the mean time, a fresh uImage installation is required. Here are the instructions (thanks Bruce) for installing the Voiptel firmware: 1/ Download uImage_r2.ip08 and place the uImage on your TFTP server.
2/ Follow steps 1-5 in the Getting Started - End User section above. 3/ If your gateway happens to be 192.168.1.1 then the IP04 should automatically go online and fetch the needed packages and install them. If not you will have to change the network settings and reboot (replace x's with your gateway IP address, and y's with the new IP04 IP address).
root:~> sed -i 's/nameserver 192.168.1.1/nameserver xxx.xxx.xxx.xxx/g' /etc/network.sh root:~> sed -i 's/gw 192.168.1.1/gw xxx.xxx.xxx.xxx/g' /etc/network.sh root:~> sed -i 's/192.168.1.100/yyy.yyy.yyy.yyy/g' /etc/network.sh root:~> reboot 4/ When the IP04 boots up again it should start the installation process, which will take 10-15m, depending on your Internet connection. 5/ Once installation completes, reboot the IP04. It will start up with the default IP addresses again, so do the following if you use different addresses:
BAPS TODOSome tasks that need doing….:
|