OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / Documentation / SecureEdgex86-notes.txt
1
2 SecureEdgeVPN/x86 NOTES
3 -------------------------
4
5 This file contains notes on specific details of the SecureEdgeVPN/x86
6 source build. It is written in an FAQ style. The section headers are:
7
8 1. Kernel source?
9 2. Supported target hardware?
10 3. FLASH upgrading?
11 4. Root filesystem?
12 5. Kernel boot arguments?
13 6. Serial console?
14 7. Kernel profiling?
15 8. HIFN crypto accelerator?
16 9. BIOS?
17 10. FLASH recovery?
18 11. Tools required to build?
19
20
21
22 OK, here we go...
23
24
25 1. Kernel source?
26
27 You should only select the linux-2.4.x kernel and either the glibc or uClibc
28 library when build for SnapGear/SecureEdge x86 based targets. The current
29 kernel is linux-2.4.20.
30
31
32 2. Supported target hardware?
33
34 Currently the supported platforms are:
35
36 . SnapGear SecureEdge2580 VPN router
37 . SnapGear SecureEdge2590 VPN router
38 . SnapGear SecureEdge/NAS
39 . SnapGear SecureEdge/PCMCIA
40
41
42 3. FLASH upgrading?
43
44 Upgrading the firmware is quite simple on the SecureEdge hardware. The
45 simplest method is via the web config pages, point a browser at the 
46 SecureEdgeVPN and select the "Advanced" tab and then choose "FLASH upgrade".
47
48 Alternatively you can do the update manually using the command line. Follow
49 these steps:
50
51     1.  telnet <IP-of-your-SecureEdgeVPN>
52     2.  netflash <IP-address-of-your-server> flash.bin
53
54 The upgrade method by default is via TFTP, so your server would have to
55 support this. Netflash can also load using HTTP, simply supply the URL
56 of the flash.bin file to netflash.
57
58
59 4. Root filesystem?
60
61 The default build of the SecureEdgeVPN builds the root filesystem as a
62 ROMfs type. This is a read only filesystem, within which files cannot be
63 modified once within the FLASH of the SecureEdgeVPN. (This is good for
64 security).
65
66 The filesystem is created under the "romfs" directory of the source tree.
67 You can insert any files you wish into the filesystem simply by copying
68 them into the romfs directory structure.
69
70 Alternatively you can build the SecureEdgeVPN firmware to use a true
71 read/write filesystem on the FLASH. This method uses the Journalling
72 FLASH Filesystem (JFFS2). At the top level config choose the target as
73 "SecureEdge2580-JFFS" to enable this.
74
75
76 5. Kernel boot arguments?
77
78 You can supply kernel boot line arguments by programming them into the
79 boot FLASH. (This is also where the ethernet MAC addresses are stored).
80 Use the following command line to set boot arguments:
81
82     flashw -p -o 0x2000 <arg1> <arg2> <arg3> /dev/flash/bootarg
83
84 On the next reboot these will be set as the boot arguments.
85
86
87 6. Serial console?
88
89 You can specify to use a serial console on boot using the kernel boot
90 arguments and the /etc/inittab file.
91
92 Firstly you need to tell the kernel which device is the console:
93
94     flashw -p -o 0x2000 console=ttyS0,115200 /dev/flash/bootarg
95
96 Possible console devices are ttyS0, ttyS1 and null. Setting the console
97 to null will disable a kernel console. The kernel will default to using
98 the ttyS0 device as a console if no console argument is present on the
99 command line.
100
101 Then you need to get init to spawn a login on that device by adding a
102 line to /etc/config/inittab:
103
104     console::respawn:/bin/getty 115200 -
105
106 This will spawn the usual getty style login on your chosen console device.
107 To disable the console simply remove this line from your inittab.
108
109
110 7. Kernel profiling?
111
112 It is possible, and quite simple, to use kernel profiling support. There are
113 two things you need to do. Firstly you need to enable profiling within the
114 kernel using the "profile=X" kernel boot argument. Secondly you need to use
115 the "readprofile" application (a port exists in the "user" directory).
116
117 When running with kernel profiling enabled, simply run the readprofile
118 command, and it will report profiling information. Example output would look
119 like:
120
121  19%     25 printk                                      0.0675
122   7%      9 try_to_free_buffer                          0.0147
123   6%      8 bdflush                                     0.0121
124   7%      9 generic_file_read                           0.0061
125   9%     12 memset                                      0.3529
126  15%     20 memcpy                                      0.5555
127   1%      2 memmove                                     0.0285
128 ---------------------------------------------------------------------------
129         126 total                                       0.0003
130
131 If you want to clear the profiling buffer (reset it to 0) then use the "-r"
132 switch of readprofile.
133
134 If you just want a report on current (or average) CPU utilization then you
135 need only look at the information in /proc/stat. You can use the "cpu" program
136 to report this in a nice way.
137
138
139 8. HIFN crypto accelerator?
140
141 The source tree (and standard binary build) contain a driver module for
142 the optional HIFN 7951 Crypto accellerator chip. This module implements
143 the standard libdes libraries, and is primarily used by IPsec. This driver
144 module is proprietary to SnapGear, and the source code is not included in
145 this package. 
146
147
148 9. BIOS?
149
150 The SecureEdge family of hardware products do not use a traditional PC
151 BIOS. Instead SnapGear has implemented a BIOS emulator to support generic
152 operating system booting. Standard zImage or bzImage kernels are built
153 and booted using the SnapGear Boot Loader.
154
155 This means the boot time is kept to an absolute minimum, of the order of
156 2 or 3 seconds on the SecureEdgeVPN boards.
157
158
159 10. FLASH recovery?
160
161 The SnapGear Boot Loader also contains the etherboot network boot package.
162 To invoke this simply hold in the reset button (on rear of units) and
163 turn on power to unit. The loader will detect the depressed button and
164 start etherboot, instead of the usual FLASH load and run of the Linux
165 kernel.
166
167 This mechanism facilitates recovery from programming files into FLASH that
168 are in some way non-functional.
169
170
171 11. Tools required to build?
172
173 The genromfs tool is required to convert the romfs directory structure into
174 a flash image.  You can get genromfs from:
175
176 http://www.uclinux.org/pub/uClinux/utilities/genromfs-0.3.2.tar.gz
177
178 The mknbi-linux tool is used to create network bootable images for etherboot.
179 You can get it from:
180
181  http://etherboot.sourceforge.net/distribution.html
182
183 You only need mknbi-linux if you want to either make a etherboot recover
184 image using the SecureEdge2580-Recover target, or if you want to etherboot
185 your kernel (which can speed up kernel development since you don't have to
186 reflash it each time).
187