~~NOCACHE~~ ===== Build System ===== The following applies to * PTXdist 2012.07 (BSP 0102) * PTXdist 2012.04 (up to BSP 0101) Use always the PTXdist version the BSP was developed for. ===== Preparing the development host ===== Please note:\\ Ubuntu 10.04 or newer required for the toolchain. To install PTXdist you need a Linux OS like Ubuntu. The BSP needs some additional packages which are normally not installed. These packages are: * gawk * dialog * ncurses-dev * bison * flex * quilt * texinfo * gettext * g++ * libxml-parser-perl For development it is recommended to have an [[en:tftp|tftp server]] for image download and update and an [[en:nfs|nfs server]] for network mounted rootfs configured and running. ==== Build system installation ==== Use always the buildsystem version the BSP was developed for After installing all packages download PTXdist source, configure, compile and install. See [[en:arm:tqma35:linux:downloads| download page]] for links. Extract the package ptxdist-.tar.bz2 to a temporary directory and call: $ ./configure $ make $ sudo make install This will install PTXdist to /usr/local. Afterwards please configure PTXdist with: $ ptxdist setup You have to setup the following things: * ftp / http proxies * username and mail address * path for archive of downloaded source packages (aka local package pool) * and some more features ... ==== Toolchain installation ==== See [[en:arm:tqma35:linux:downloads| download page]] for links to toolchain download. If using precompiled toolchain install to ///opt//. Otherwise following the documentation for building toolchains. Normally the toolchain is alredy configured in the BSP. So nothing further to setup. ==== Installation of the BSP ==== Extract the package TQC-ARM-BSP-REV.tgz to any directory (e.g. ///opt// or ///home//): $ cd /opt/projekte $ tar -xvf TQC-ARM-BSP-REV.tgz $ cd TQC-ARM-BSP-REV ===== Using the build system ===== ==== Getting help ==== The manual is your friend. See [[en:arm:tqma28:linux:ptxdist:downloads|Downloads]] where to get it. ==== Configuration === To configure the system (e.g. add additional packages) you can start the PTXdist menu: $ ptxdist menu To add additional packages to your root filesystem simply use the ptxdist tool. The ncurses based UI is the same that is used by the linux kernel with "make menuconfig". It can be used the following way: * use the up / down arrow keys to navigate in the menu * use the left / right arrow keys to navigate between buttons * select / deselect packages and options using the SPACE key * enter submenus or press buttons using the ENTER key Dependencies between packages should be “automagically” resolved. Software is organized in sections. === Compilation === Select one of the supported hardware platforms (platformconfig) **BSP 0102:** * tqma35-mba35 (TQMa35 AA / AB variant on MBa35) * tqma35-mba35ca (TQMa35 AB variant on MBa35-CA) **up to BSP 0101:** * tqma35-aa (TQMa35 AA variant on MBa35) * tqma35-ab (TQMa35 AB variant on MBa35) * tqma35-mbaca (TQMa35 AB variant on MBa35-CA) Select one of the supported software configs (ptxconfig) * minimal (minimal rootfs with busybox init, this our default target) * qt (busybox rootfs with qt) * systemd (rootfs with systemd init) **BSP 0102:** * select special packages for TQMa35 (collectionconfig) and start building the images. $ ptxdist platform configs/platforms/tqma35//platformconfig $ ptxdist select configs/systems//ptxconfig $ ptxdist collection configs/platforms/tqma35/ptxcollection $ ptxdist go $ ptxdist images PTXdist downloads some packages. If it reports some errors please * verify your internet connection or proxy settings. * make sure the package source is correct. Some packege source pages will change from time to time. (You can always try to download the source package manually and copy it to your package pool) * some packages like bootloaders and kernels where you can select versions need to know about there hash sums. You have to enter the correct hash in the ptxdsit configuration. ==== Adding own packages ==== PTXdist needs a package for every bit you need in your root FS. To add your software, files etc. you have to provide local packages. Follow the instructions of the developers section in the PTXdist manual. PTXdist provides templates as starting point for own packages. Type $ ptxdist newpackage to see what package templates exist. ==== Adapting BSP for an own product ==== The BSP was developed for the starterkit. To use it in a product with special needs or a different basebord we suggest to define an own platform. To start with it make a copy of the platform definition and select the new platform definition $ cd $ cp -r /configs/platforms/tqma35/ to /configs/platforms/tqma35/ $ ptxdist platform /configs/platforms//platformconfig To start configuring your new platform type $ ptxdist platformconfig The first thing to change should be the platform name. Adapt things like kernel configuration, image creation etc. to your needs. The new system will be built under /platform- The software in the rootfs BSP was selected to give a starting point. To use it in a product with special needs we suggest to define an own software configuration. To start with it make a copy of software config and select the new software configuration $ cd $ cp -r /configs/systems/ to /configs/systems/ $ ptxdist select /configs/systems//ptxconfig Please read the build system documentation howto go further. ===== Deployment ===== Finally, you will find the built images in //platform-/images//. * Root file system images To update bootloader / kernel in a running system you have to copy the images in your tftp directory. If you rename the images to the names defined in the bootloader environment you can use the update scripts from the bootloader : * run prg_kernel * run prg_uboot To update your root file system in NOR flash follow these instructions: erase ${ramdisk_addr} tftp ${loadaddr} cp.b ${loadaddr} ${ramdisk_addr} ${filesize} * Rootfs-Image: jffs2 image, has to be copied to your TFTP server * last address: last address of root fs partition in NOR flash, max. 0xA1FFFFFF (depends on used partition scheme) This can be automated using u-boot env: setenv rootfs rootfs.jffs2 setenv ramdisk_end setenv prg_rootfs ’tftpboot ${loadaddr} ${rootfs}; erase ${ramdisk_addr} ${ramdisk_end}; cp.b ${loadaddr} ${ramdisk_addr} ${filesize};’ Then you can call * run prg_rootfs to update the root file system. ==== Using different boot media ==== === NOR === U-Boot is stored on NOR. This is factory default. === NFS === To boot the TQMa35 from network you need a working bootloader in NOR which is able to get the kernel image over tftp and to provide the kernel with commandline settigns for NFS. You have to provide the images via tftp and nfs and to configure the bootloader to work with your tftp-server and your nfs-server. === eMMC === Currently only rootfs on eMMC is supported. Modify your u-boot env to support root file system on eMMC (it is assumed that the first partition is used and ext2 is used as the file system): setenv emmcargs ’setenv bootargs rootfstype=ext2 root=/dev/mmcblk0p1 ro rootwait’ setenv flash_emmc ’run emmcargs addcons ; bootm ${kernel_addr}’ setenv bootcmd 'run flash_emmc' To write the file system data to the eMMC card partition: * boot system with Rootfs from NFS / NOR or SD-Card * copy root.cpio to an SD card * insert SD-card in MBa35 SD-card slot * mount the SD card partition * format or clear eMMC partition * mount the eMMC card * unarchive the root.cpio file to the mounted eMMC partition * unmount partition === SD-card === Currently only rootfs on SD-card is supported. Modify your u-boot env to support root file system on eMMC (it is assumed that the first partition is used and ext2 is used as the file system): setenv sdargs ’setenv bootargs rootfstype=ext2 root=/dev/mmcblk0p1 ro rootwait’ setenv flash_emmc ’run sdargs addcons ; bootm ${kernel_addr}’ setenv bootcmd 'run flash_emmc' To write the file system data to the SD card partition, * fomat card * mount the partition * unarchive the root.cpio file to the mounted partition * unmount partition