Deployment

Да се разработи Linux/OSGi базирана разпределена сензорна система за събиране на метеорологични данни, състояща се от сензорна, сервизна и приложна части. Съставните части на системата да са гъвкаво конфигурируеми и с възможност да работят върху различни платформи. Функционалността, свързана с всеки отделен сензор да е йерархично разпределена и да може да се преконфигурира по време на работа на системата. Всеки отделен сензор или група, както и поддържаните от тях услуги да се регистрират в системата автоматично след инсталирането и пускането им в действие. Интерфейса към потребителя и персонала по поддръжката да е унифициран и достъпен чрез специализирано приложение или Интернет. Да се дефинират критерии за оценка на системата и съставните и части. Да се извърши анализ на възможни решения съобразно дефинираните критерии.

Deployment

Postby mladen » Wed Aug 17, 2011 5:28 pm

First let’s install necessary packages on host platform. Execute as root user:
Code: Select all
apt-get install tftpd-hpa nfs-kernel-server apache2

Let’s make public directory for root file system and kernel.
Code: Select all
mkdir -p /var/www/pub/9302
cd /var/www/pub/9302

Extract root file system
Code: Select all
tar -jxvf  /angstrom/build/tmp-angstrom_2008_1/deploy/glibc/images/cs-e9302/Angstrom-minimal-osgi-glibc-ipk-2011.03-cs-e9302.rootfs.tar.bz2

We are going to create virtual host for accessing local binary repository from target platform. So edit file
Code: Select all
nano /etc/apache2/sites-available/default

and add the following in the of file
Code: Select all
<VirtualHost *:8080>
        ServerAdmin webmaster@localhost

        DocumentRoot /angstrom/build/tmp-angstrom_2008_1/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /angstrom/build/tmp-angstrom_2008_1/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

Now restart apache
Code: Select all
/etc/init.d/apache2 restart

We have to make some modifications in target rootfs
Code: Select all
nano /var/www/pub/9302/etc/network/interfaces

and make eth0 with static configuration
Code: Select all
# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp
#iface eth1 inet dhcp
iface eth0 inet static
        address 192.168.1.200
        netmask 255.255.255.0
        network 192.168.1.0
        gateway 192.168.1.1

In this case IP address of target platform will be 192.168.1.200
Also edit /var/www/pub/9302/etc/resolv.conf to point to local DNS.

Next step is to configure feed links in target platform
NOTE:IP address of host platform is 192.168.1.155

Edit file
Code: Select all
nano /var/www/pub/9302/etc/opkg/base-feed.conf
and change feed location from
Code: Select all
src/gz base http://feeds.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv4t/base
to
Code: Select all
src/gz base http://192.168.1.155:8080/deploy/glibc/ipk/armv4t

Edit file
Code: Select all
nano /var/www/pub/9302/etc/opkg/cs-e9302-feed.conf
and change feed location from
Code: Select all
src/gz cs-e9302 http://feeds.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv4t/machine/cs-e9302
to
Code: Select all
src/gz cs-e9302 http://192.168.1.155:8080/deploy/glibc/ipk/cs-e9302

Edit file
Code: Select all
nano /var/www/pub/9302/etc/opkg/noarch-feed.conf
and change feed location from
Code: Select all
src/gz no-arch http://feeds.angstrom-distribution.org/feeds/unstable/ipk/glibc/all
to
Code: Select all
src/gz no-arch http://192.168.1.155:8080/deploy/glibc/ipk/all


For NFS server configuration edit file
Code: Select all
nano /etc/exports
and the following in the end of file
Code: Select all
/var/www/pub 192.168.1.0/24(rw,nohide,no_root_squash,insecure,no_subtree_check,async)


For TFTP server configuration edit file
Code: Select all
nano /etc/default/tftpd-hpa
and the change the line
Code: Select all
TFTP_DIRECTORY="/var/lib/tftpboot"
with this one
Code: Select all
TFTP_DIRECTORY="/var/www/pub"


Restart NFS and TFTP servers
Code: Select all
/etc/init.d/tftpd-hpa restart
/etc/init.d/nfs-kernel-server restart


Final step is to run our target platform. Connect RS232_0 serial port of development board to PC with baud rate of 57600. You can use any software for serial communication like PuTTY or SercureCRT(in Windows). Turn on power supply. Press CTRL + C. Use the following Redboot options:
Code: Select all
RedBoot> fconfig -l
Run script at boot: true
Boot script:
.. load -v -r -b 0x80000 -h 192.168.1.155 -m http /pub/9302/boot/zImage
.. exec -c "root=/dev/nfs nfsroot=192.168.1.155:/var/www/pub/9302 ip=192.168.1.200:192.168.1.1:255.255.255.0 console=ttyAM0,57600n8"

Boot script timeout (1000ms resolution): 5
Use BOOTP for network configuration: false
Gateway IP address: 192.168.1.1
Local IP address: 192.168.1.200
Local IP address mask: 255.255.255.0
Default server IP address: 192.168.1.1
DNS server IP address: 192.168.1.1
Set eth0 network hardware address [MAC]: true
eth0 network hardware address [MAC]: 0x00:0x00:0x00:0x00:0x54:0x33
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
RedBoot>


In configuration options above linux kernel is loading from host platform through HTTP. In case of using TFTP you should use
Code: Select all
load -v -r -b 0x80000 9302/boot/zImage


Root file system could be loaded from USB flash disk too. Please follow the instructions bellow in order to setup root file system on USB disk.
Code: Select all
mkfs -t ext2 -b 1024 -m 0 /dev/sdb

Let’s turn off checks for problems with file system
Code: Select all
tune2fs -c 0 -i 0 /dev/sdb

Mount the disk
Code: Select all
mount /dev/sdb /mount

Copy file system
Code: Select all
cp -R /var/www/pub/9302/* /mount

Unmount the disk
Code: Select all
umount /dev/sdb


Redboot option to load root file system from USB flash disk is
Code: Select all
exec -c "console=ttyAM0 root=/dev/sda1 rootdelay=6"


Example of successful boot
Code: Select all
Using base address 0x00080000 and length 0x001b4c3c
Linux version 2.6.37.2 (user@ubuntu) (gcc version 4.3.3 (GCC) ) #1 Tue Aug 16 03:31:39 EDT 2011
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
CPU: VIVT data cache, VIVT instruction cache
Machine: Cirrus Logic EDB9302 Evaluation Board
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 8016
Kernel command line: root=/dev/nfs nfsroot=192.168.1.155:/var/www/pub/9302 ip=192.168.1.200:192.168.1.1:255.255.255.0 console=ttyAM0,57600n8
PID hash table entries: 128 (order: -3, 512 bytes)
Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
Memory: 8MB 8MB 8MB 8MB = 32MB total
Memory: 28872k/28872k available, 3896k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xc6000000 - 0xfe800000   ( 904 MB)
    lowmem  : 0xc0000000 - 0xc5800000   (  88 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .init : 0xc0008000 - 0xc0023000   ( 108 kB)
      .text : 0xc0023000 - 0xc034ee00   (3248 kB)
      .data : 0xc0350000 - 0xc036a560   ( 106 kB)
NR_IRQS:120
VIC @fefb0000: id 0x00041190, vendor 0x41
VIC @fefc0000: id 0x00041190, vendor 0x41
Calibrating delay loop... 99.73 BogoMIPS (lpj=498688)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
NET: Registered protocol family 16
ep93xx clock: PLL1 running at 400 MHz, PLL2 at 192 MHz
ep93xx clock: FCLK 200 MHz, HCLK 100 MHz, PCLK 50 MHz
ep93xx dma_m2p: M2P DMA subsystem initialized
bio: create slab <bio-0> at 0
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 1024 (order: 1, 8192 bytes)
TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
TCP: Hash tables configured (established 1024 bind 1024)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
NetWinder Floating Point Emulator V0.97 (extended precision)
JFFS2 version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
msgmni has been set to 56
io scheduler noop registered
io scheduler deadline registered (default)
Serial: AMBA driver
apb:uart1: ttyAM0 at MMIO 0x808c0000 (irq = 52) is a AMBA
console [ttyAM0] enabled
apb:uart2: ttyAM1 at MMIO 0x808d0000 (irq = 54) is a AMBA
apb:uart3: ttyAM2 at MMIO 0x808e0000 (irq = 55) is a AMBA
physmap platform flash device: 01000000 at 60000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x000018
Intel/Sharp Extended Query Table at 0x0031
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
cfi_cmdset_0001: Erase suspend on write enabled
Searching for RedBoot partition table in physmap-flash.0 at offset 0xfe0000
7 RedBoot partitions found on MTD device physmap-flash.0
Creating 7 MTD partitions on "physmap-flash.0":
0x000000000000-0x000000040000 : "RedBoot"
0x000000040000-0x000000540000 : "netbsd"
0x000000540000-0x000000a40000 : "netbsd_install"
0x000000a40000-0x000000d40000 : "ramdisk.gz"
0x000000d40000-0x000000ee0000 : "dImage"
0x000000fc0000-0x000000fc1000 : "RedBoot config"
mtd: partition "RedBoot config" doesn't end on an erase block -- force read-only
0x000000fe0000-0x000001000000 : "FIS directory"
ep93xx-eth version 0.1 loading
eth0: ep93xx on-chip ethernet, IRQ 39, 00:00:00:00:54:33
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ep93xx-ohci ep93xx-ohci: EP93xx OHCI
ep93xx-ohci ep93xx-ohci: new USB bus registered, assigned bus number 1
ep93xx-ohci ep93xx-ohci: irq 56, io mem 0x80020000
usb usb1: New USB device found, idVendor=1d6b, idProduct=0001
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EP93xx OHCI
usb usb1: Manufacturer: Linux 2.6.37.2 ohci_hcd
usb usb1: SerialNumber: ep93xx
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
usbcore: registered new interface driver cdc_acm
cdc_acm: v0.26:USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver uas
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
ep93xx-rtc ep93xx-rtc: rtc core: registered ep93xx-rtc as rtc0
i2c /dev entries driver
ep93xx_wdt: EP93XX watchdog, driver version 0.3 (nCS1 disable detected)
TCP cubic registered
NET: Registered protocol family 10
NET: Registered protocol family 17
NET: Registered protocol family 15
ep93xx-rtc ep93xx-rtc: setting system clock to 1970-01-01 00:02:00 UTC (120)
usb 1-1: new full speed USB device using ep93xx-ohci and address 2
usb 1-1: New USB device found, idVendor=0951, idProduct=1607
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: DataTraveler 2.0
usb 1-1: Manufacturer: Kingston
usb 1-1: SerialNumber: 001372982BA9B9519000006C
usb 1-1: selecting invalid altsetting 1
scsi0 : usb-storage 1-1:1.0
scsi 0:0:0:0: Direct-Access     Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 0 CCS
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Gateway not on directly connected network.
sd 0:0:0:0: [sda] 7839744 512-byte logical blocks: (4.01 GB/3.73 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Assuming drive cache: write through
 sda: sda1
sd 0:0:0:0: [sda] Assuming drive cache: write through
sd 0:0:0:0: [sda] Attached SCSI removable disk
VFS: Mounted root (nfs filesystem) on device 0:12.
Freeing init memory: 108K
INIT: version 2.86 booting
Please wait: booting...
Starting udev
udevd (257): /proc/257/oom_adj is deprecated, please use /proc/257/oom_score_adj instead.
EXT3-fs (sda): error: can't find ext3 filesystem on dev sda.
EXT2-fs (sda): error: can't find an ext2 filesystem on dev sda.
EXT2-fs (sda1): warning: mounting unchecked fs, running e2fsck is recommended
Root filesystem already rw, not remounting
Caching udev devnodes
Populating dev cache
NOT configuring network interfaces: / is an NFS mount
Tue Aug 16 03:47:00 UTC 2011
INIT: Entering runlevel: 5
Creating Dropbear SSH server RSA host key.
Will output 1024 bit rsa secret key to '/etc/dropbear/dropbear_rsa_host_key'
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgwDdZLxBD/mE091ON8H9+yPw9w67os2sw8YTOO/iNJX4lUzMiikLmKjrypGDdPFd1sLXuZUU+sl64gaovKDUHhoG70+twylyOaVW8i/FABx7qcD42itl1jIS27AETWGiJNopZ2HQQjshjoRwW/DfiPQsihXoaIxcebDsMbvoANe/4YiT root@cs-e9302
Fingerprint: md5 e9:f5:58:62:9c:33:b4:2e:c6:4a:79:80:ba:9a:ea:3b
Starting Dropbear SSH server: dropbear.
Starting syslogd/klogd: done

.-------.                                           
|       |                  .-.                     
|   |   |-----.-----.-----.| |   .----..-----.-----.
|       |     | __  |  ---'| '--.|  .-'|     |     |
|   |   |  |  |     |---  ||  --'|  |  |  '  | | | |
'---'---'--'--'--.  |-----''----''--'  '-----'-'-'-'
                -'  |
                '---'

The Angstrom Distribution cs-e9302 ttyAM0

Angstrom 2011.03 cs-e9302 ttyAM0

cs-e9302 login:
mladen
 
Posts: 10
Joined: Tue Feb 22, 2011 5:16 pm

Return to OSGi based sensor network

Who is online

Users browsing this forum: No registered users and 2 guests

cron