2015年6月22日 星期一

Linux kernel mtdparts


Documentation/kernel-parameters.txt
drivers/mtd/cmdlinepart.c

 * mtdparts=[; *   := :[,]
 * := [@][][ro][lk]
CN5700 EVB, openwrt image https://downloads.openwrt.org/snapshots/trunk/octeon/generic/, Linux 3.18.14.
For Cavium Octeon, mtd-id is phy_mapped_flash:
[   33.269307] phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank. Manufacturer ID 0x000001 Chip ID 0x001001
This works for me:
mtdparts=phys_mapped_flash:2176k(U-Boot)ro,6008k(rootfs),8k(u-boot-env)ro

Managing flash storage with Linux
http://free-electrons.com/blog/managing-flash-storage-with-linux/
mtdparts=omap2-nand.0:128k(X-Loader)ro,256k(U-Boot)ro,128k(Environment),4m(Kernel)ro,32m(RootFS)ro,-(Data)

2015年6月16日 星期二

awk

 awk '/Tech/ && $1>200 {print $2, $4,$5}' e 

Awk Introduction Tutorial – 7 Awk Print Examples
http://www.thegeekstuff.com/2010/01/awk-introduction-tutorial-7-awk-print-examples/

linux shell awk 語法 @ 血落閣 :: 隨意窩 Xuite日誌
http://blog.xuite.net/mb1016.flying/linux/28111008-linux+shell+awk+%E8%AA%9E%E6%B3%95

Awk - A Tutorial and Introduction - by Bruce Barnett
http://www.grymoire.com/Unix/Awk.html

2015年6月15日 星期一

MIPS Exception


http://scc.ustc.edu.cn/zlsc/lxwycj/200910/W020100308600770617815.pdf
8 Coprocessor 0 Registers, p.73
8.1 Coprocessor 0 Register Summary, p73
8.22 Cause Register (CP0 Register 13, Select 0), p113
Table 8-25 Cause Register ExcCode Field, p116
8.18 Status Register (CP Register 12, Select 0), p98


15.5. MIPS Exception Handling
http://www.cs.uwm.edu/classes/cs315/Bacon/Lecture/HTML/ch15s05.html

MIPS 通用寄存器 + 指令 - gujing001的专栏 - 博客频道 - CSDN.NET
http://blog.csdn.net/gujing001/article/details/8476685

CPU Registers
https://www.doc.ic.ac.uk/lab/secondyear/spim/node10.html

http://bbs.csdn.net/topics/390067643

这是mips core 报异常了。也就是status的bit 1置位了。
在status的bit1(EXL) 置位的时候, coprocessor 0的某些寄存器可以帮助你分析具体出错的位置,以及原因。

一般,如果不是一些特别的error错误,看epc就可以找到引起kernel panic的位置,可以理解为引起exception的pc值,如果是某些比较特别的错误,就得看 errorepc了。

针对楼主这个问题, cause寄存器的值为 00800034, 看来使用的应该是VI模式的中断机制,其中,bit 2- 6 是 01101, 也 就是 13, 查一下mips的 coprocessor的手册,就会发现,其代表ExcCode, 也就是exception code,为13的 话,就是发生了trap异常。
结合epc,也就是 在 指令地址为 80010ed0 do_ade+0x388/0xa1c 的位置,有一条trap指令执行了。

How to Encrypt Your Bash Shell Script on Linux Using SHC

http://www.datsi.fi.upm.es/~frosal/
http://www.datsi.fi.upm.es/~frosal/sources/CHANGES
http://www.datsi.fi.upm.es/~frosal/sources/shc.html
http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9.tgz

How to Encrypt Your Bash Shell Script on Linux Using SHC
http://www.thegeekstuff.com/2012/05/encrypt-bash-shell-script/

2015年6月12日 星期五

IPSec stateful failover

HighAvailability - strongSwan
https://wiki.strongswan.org/projects/1/wiki/HighAvailability

strongSwan ha Tests
https://www.strongswan.org/uml/testresults/ha/index.html

IpsecStandards - strongSwan
https://wiki.strongswan.org/projects/strongswan/wiki/IpsecStandards

Not Supported: RFC 6311: Protocol Support for High Availability of IKEv2/IPsec
[strongSwan] Automated test ha/both-active fails
https://lists.strongswan.org/pipermail/users/2012-July/003299.html
> Our HA solution works different and is not based on RFC 6311. In fact,
> we don't need any additional protocol support in IKEv2 between server
> and client, all the synchronization is done between the cluster nodes
> directly.




Cisco High Availability Solution: Stateful Failover for IPsec - Cisco
http://www.cisco.com/c/en/us/products/collateral/ios-nx-os-software/ios-ipsec/white_paper_c11_472859.html
Stateful Failover for IP Security (IPsec) allows a router to continue processing and forwarding IPsec packets after a planned or unplanned outage occurs. A backup (secondary) router automatically takes over the tasks of the active (primary) router if the active router loses connectivity for any reason. This process is transparent to the user and requires neither adjustment nor reconfiguration of any remote peer.

Stateful IPsec VPN High-Availability Alternatives - IPSec Virtual Private Network Fundamentals
http://flylib.com/books/en/2.45.1.50/1/
Recall that in stateless IPsec failover, there is a reconvergence delay directly attributable to rebuilding IPsec SAs with the redundant router upon failover.

Stateful IPsec HA builds the appropriate entries in the redundant VPN gateway's SADB in advance and employs a mechanism to accurately maintain state parity between the active and standby VPN gateways, thereby effectively precluding the need for IPsec to renegotiate Phase 1 and Phase 2 SAs upon failover
RFC 6311 - Protocol Support for High Availability of IKEv2/IPsec
https://tools.ietf.org/html/rfc6311

RFC 6027 - IPsec Cluster Problem Statement
https://tools.ietf.org/html/rfc6027

Proposed IPsec HA Cluster Protocol
http://www.ietf.org/proceedings/78/slides/ipsecme-3.pdf