16
RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved.

RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

Embed Size (px)

Citation preview

Page 1: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

RDC R321x/R323x

Web UI & System Configuration Design March. 23, 2006 draft version 0.99

RDC Semiconductor Co., Ltd. All Rights Reserved.

Page 2: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

2

Architecture – Linux Boot Up

Linux Kernel Boot Up & Initialization

Get & Check configuration in Flash

Read configuration data, then initial & enable application

Configuration data stored in the Flash

Get default configuration in Filesystem Default configuration data stored in the RAMDisk

Yes, FoundNo, not found

Page 3: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

3

System Configuration & Flash Format

Address define in the //linux2425/drivers/mtd/maps/physmap.c

Linux Kernel

Configuration Database

Ram Disk(File System)

Redboot

0x1F0000

0x200000

0x3E0000

0x3FFFFF

0x000000

Page 4: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

4

Get/Store Configuration in the Flash

• Get the configuration1. Read data from the flash (MTD block 2)

cat /dev/mtdblock/2 > /tmp/config.tar.gz

2. Decompress the data & check the formattar -zxvf /tmp/config.tar.gzif [ -r /tmp/configuration/sysinfo.conf] ….

• Store the configuration1. Compress the configuration data into a file

tar -cvzf /tmp/config.tar.gz /tmp/configuration

2. Store the file to the flash (MTD block 2)cat /tmp/config.tar.gz > /dev/mtdblock/2

Page 5: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

5

System Configuration - File Lists

sysinfo.conf lan.conf wan.conf wireless.conf manage.conf

Put in the /tmp/configuration directory Demo & show configuration file

. /tmp/configuration : run time configuration data base

. /http/config.tar.gz : default configuration file

Page 6: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

6

System Configuration - Data Structure

# start eth1 Tag to define start DHCP_SERVER=ON Variable, Value IPADDR=1.1.1.246 SUBNETMASK=255.255.254.0# end eth1 Tag to define end

Example : lan.conf

Page 7: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

7

Linux Boot Up – Start Service

inittab (/etc)

rcS (/etc/init.d)

S50StartService (/etc/init.d)

getmac.sh (/etc/app)getlan.sh …nat.sh …

RDC’s application entry point1. Get & check configuration file2. Invoke individual process

Process Functions 1. Read the variable, value pair2. Apply and enable the configuration

( Demo and explain the program: S50StartService & getmac.sh )

Page 8: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

8

Web UI – Http daemon start up

•Http daemon start up

Linux boot up initialization

Startup http daemon

S50StartService(/etc/init.d) will start up the thttp daemon (/http) ### Start Http Daemon #### chmod 755 /http/webroot r+x attribute chmod 644 /http/webroot/*.htm r attribute, no x chmod 755 /http/webroot/*.cgi r+x attribute /http/thttpd -C /http/thttpd.conf

Page 9: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

9

Web UI – thttp.conf

user=rootcgipat=**.cgilogfile=/tmp/thttpd.log Must be assignedpidfile=/tmp/thttpd.pidport=80Globalpasswddir=/http/webroot Html pathnochroot

•Put in the /http directory

Page 10: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

10

Web UI – Show html

Http daemon receive html request

RDC’s CGI function

Get the run time configuration data

Run timeConfiguration Database

(/tmp/configuration)

Patch & output

( Demo lan_eth1.cgi & lan_eth1.htm )

Page 11: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

11

Web UI – Post and Save configuration

Http Daemon receive POST request

RDC’s CGI function

Call proccgi - Get the value to enviroment parameter

Get the value and save torun time configuration space

Run timeConfiguration Database

(/tmp/configuration)

( Demo lan_eth1.cgi & lan_eth1.htm )

Page 12: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

12

Files List - Review

• S50StartService (/etc/init.d/) RDC main entry point in Linux system boot up• /etc/app Get & apply configuration function directory• /etc/http

1. config.tar.gz Default configuration file2. thttpd, thttpd.conf Http daemon3. /etc/http/configuration Original default configuration file lists (No compressed, no used in the run time code ,can be removed to save memory)4. /etc/http/webroot HTML & CGI root files

• /tmp1. thttpd.log, thttpd.pid Http daemon log files2. config.tar.gz From the flash or default configuration file3. /tmp/configuration Run time configuration data base

• brctl,iptables,iwpriv Put in the /etc/app directory• proccgi Put in the /sbin directory

Page 13: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

13

Web Firmware Upgrade

A tar-ball file include upgrade.lst and all image file( bzImage, redboot.bin, root_fs_i386.ext2.gz).

upgrade.lst control what image will be upgrade

upgrade.lst contents

# start upgrade_files

KERNEL_IMAGE=bzImage

ROOT_IMAGE=root_fs_i386.ext2.gz

REDBOOT_IMAGE=redboot.bin

# end upgrade_files

Page 14: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

14

Next version

• Improvement

1. Support Javascript on html, let user configure it more friendly

• Add on functions1. DHCP Client in the Wan site2. DHCP Server in the Lan site3. Wireless WEP security support4. FTP/Samba IDE/USB storage access

Page 15: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

15

Q & A

Page 16: RDC R321x/R323x Web UI & System Configuration Design March. 23, 2006 draft version 0.99 RDC Semiconductor Co., Ltd. All Rights Reserved

Think Big - IBM

Think Different - Apple

We Think Things Even Beyond - RDC