20170623_jeffrey - silenceuncrio/diary GitHub Wiki
0925
ariel 放了一台從 CXR 退回來的 M301 在我桌上請我幫忙用 Mfgtool 重燒 image
不過在重燒之前 morris 請我看一下倒底是發生什麼問題
U-Boot 2015.04imx_v2015.04_4.1.15_1.2.0_ga+gede7538 (Dec 26 2016 - 06:05:47)
CPU: Freescale i.MX6UL rev1.1 at 396 MHz
CPU: Temperature 36 C
Reset cause: POR
Board: MX6UL 14x14 EVK
I2C: ready
DRAM: 512 MiB
force_idle_bus: sda=0 scl=0 sda.gp=0x1d scl.gp=0x1c
NAND: 256 MiB
MMC: FSL_SDHC: 0
Display: TFT43AB (480x272)
Video: 480x272x24
In: serial
Out: serial
Err: serial
Net: Phy 1 not found
PHY reset timed out
FEC1
Normal Boot
Hit any key to stop autoboot: 0
run primary app
run bootargs_b
bootargs for room b
...
Starting kernel ...
...
Running local boot scripts (/etc/rc.local)attach MTD device 10 (mtd10) to UBI - ubi1:config_b
UBI device number 1, total 124 LEBs (15745024 bytes, 15.0 MiB), available 0 LEBs (0 bytes), LEB size 126976 bytes (124.0 KiB)
modprobe: can't load module cryptodev (extra/cryptodev.ko): Invalid argument
error
Freescale i.MX Release Distro 4.1.15-1.2.0 m300 /dev/ttymxc0
m300 login:
注意到 rc.local
有被叫起來
不過出現以下錯誤後就停掉了
modprobe: can't load module cryptodev (extra/cryptodev.ko): Invalid argument
error
這是因為 rc.local
執行 modprobe cryptodev
時出錯的關係
# Ariel: icospromsg need to before icosconfig for share memory init
modprobe cryptodev
/usr/sbin/seqcmdd -C /var/seqcmdd/ipt_cmd &
/usr/sbin/icospromsg &
/usr/sbin/icosconfig bootinit
/usr/sbin/rs485 --enable > /dev/null 2>&1
/usr/sbin/read_modem &
/usr/sbin/icos/gpio_button.sh \
--click "reboot" \
--hold "heartbeat_all_led.sh; rm -rf /etc/icos/* ; reboot" \
--active-low 1 \
--hold-exit 5 0 &
# Ariel: make icos watch dog to be the last one.Max timeout is 128 seconds.
/usr/sbin/icoswdog -T 120 &
0940
看一下目前的版本跟 modprobe cryptodev
相關的部分
root@Mobile Router:/# find / -name cryptodev.ko
/lib/modules/4.1.15-1.2.0+g77f6154/extra/cryptodev.ko
find: /proc/7121: No such file or directory
find: /proc/7125: No such file or directory
正常的話會發現 /lib/modules/4.1.15-1.2.0+g77f6154/extra/cryptodev.ko
其實在 /lib/modules/4.1.15-1.2.0+g77f6154/extra
有以下的 file
root@Mobile Router:/lib/modules/4.1.15-1.2.0+g77f6154/extra# ls
8192du.ko GobiNet.ko cryptodev.ko
0945
再回頭看一下從 CXR 退回來的 M301
root@m300:~# find / -name cryptodev.ko
/lib/modules/4.1.15-1.2.0+g77f6154/extra/cryptodev.ko
root@m300:~#
cryptodev.ko
也有阿...
注意到 CXR 這一台目前是從 image b 開機
root@m300:~# df
Filesystem 1024-blocks Used Available Use% Mounted on
ubi0:rootfs_b 81080 26788 50116 35% /
devtmpfs 90860 0 90860 0% /dev
tmpfs 254892 136 254756 0% /run
tmpfs 254892 28 254864 0% /var/volatile
ubi1:config_b 7796 96 7268 1% /mnt/data
連續開機失敗兩次後會切換回 image a
這時開機就成功了
從 web 畫面得到 Software MCSV 為 012C000000129946
這是今年 2017-03-10
的 V1.2 版本
先放著等 morris 和 ariel 開會出來後再問他們看看還要收集什麼資訊
1030
目前 branch feature/vrrp
裡混著 feature/low-temperature-boot-up
的修改
commit 7642975ca2c401dc01031455d804a53bc25ca2ac
Author: jeffrey <[email protected]>
Date: Wed Jun 21 11:11:56 2017 +0800
Update 'keepalived' recipe for 'vrrp' function
commit 30d98fdd49da430506d4048f1fe2202a75ae3319
Author: jeffrey <[email protected]>
Date: Fri Jun 9 11:42:55 2017 +0800
Correct the way to use the variables while 'do_configure()' the keepalived recipe
commit a23c20d23f970f781741c5dc530830f7871f0611
Author: jeffrey <[email protected]>
Date: Thu Jun 8 10:27:46 2017 +0800
Add 'keepalived' recipe for 'vrrp' function
commit 778ef03457e2ba2e75939d4c93943b5fd25ed6b0
Author: jeffrey <[email protected]>
Date: Tue Jun 6 16:24:44 2017 +0800
- restore the original CPUFreq governor after our application initialization complete
- original CPUFreq governor - interactive
commit db30ae4e0470671f4264816f1112c46f626ac451
Author: jeffrey <[email protected]>
Date: Tue Jun 6 09:55:17 2017 +0800
Rollback the modification of 'CONFIG_MICREL_SWITCH'
commit f099bc1febf36a2fedf6b67a6dab598d3851e0eb
Author: jeffrey <[email protected]>
Date: Mon Jun 5 13:08:06 2017 +0800
Change 'CONFIG_CPU_FREQ_DEFAULT_GOV' from 'interactive' to 'powersave'
- because power on fail under -25C when linux kernel try to mount the rootfs on NAND Flash
- for testing on power on at -40C when linux kernel try to mount the rootfs on DAND Flash
- lower CPU frequency
試著把 feature/low-temperature-boot-up
的修改拿掉
1045
直接刪掉 feature/vrrp
再重新利用 git flow feature
建立一個 vrrp 的 feature branch
➜ M300 git:(develop) git flow feature start vrrp
Switched to a new branch 'feature/vrrp'
Summary of actions:
- A new branch 'feature/vrrp' was created, based on 'develop'
- You are now on branch 'feature/vrrp'
Now, start committing on your feature. When done, use:
git flow feature finish vrrp
➜ M300 git:(feature/vrrp)
先修改 meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
在 RDEPENDS_${PN}
加上 keepalived
diff --git a/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb b/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
index 190910f..234d9fe 100644
--- a/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
+++ b/meta-proscend/recipes-core/prosrc/prosrc_0.1.bb
@@ -22,7 +22,7 @@ RDEPENDS_${PN} += "GobiNet-mod"
RDEPENDS_${PN} += "8192du-mod wireless-tools rng-tools hostapd wpa-supplicant"
# Ethx tool
RDEPENDS_${PN} += "ethtool"
-RDEPENDS_${PN} += "ppp ppp-oe iptables iperf dnsmasq pptp-linux bridge-utils dhcp-server dhcp-client openvpn openssl openssl-conf iproute2 iproute2-tc procps socat strongswan cryptodev-module mtd-utils mtd-utils-ubifs imx-kobs tar bzip2 jq shadow libqmi net-snmp net-snmp-server-snmpd mosquitto"
+RDEPENDS_${PN} += "ppp ppp-oe iptables iperf dnsmasq pptp-linux bridge-utils dhcp-server dhcp-client openvpn openssl openssl-conf iproute2 iproute2-tc procps socat strongswan cryptodev-module mtd-utils mtd-utils-ubifs imx-kobs tar bzip2 jq shadow libqmi net-snmp net-snmp-server-snmpd mosquitto keepalived"
# ======================================
# Build dependence
新增 meta-proscend/recipes-extended/keepalived/keepalived_1.3.5.bb
SUMMARY = "High Availability monitor built upon LVS, VRRP and service pollers"
DESCRIPTION = "Keepalived is a routing software written in C. The main goal \
of this project is to provide simple and robust facilities for loadbalancing \
and high-availability to Linux system and Linux based infrastructures. \
Loadbalancing framework relies on well-known and widely used Linux Virtual \
Server (IPVS) kernel module providing Layer4 loadbalancing \
"
HOMEPAGE = "http://www.keepalived.org/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRC_URI = "http://www.keepalived.org/software/${BP}.tar.gz"
SRC_URI[md5sum] = "9964d295ec9d34ed3408b57d28847b68"
SRC_URI[sha256sum] = "c0114d86ea4c896557beb0d9367819a423ffba772bc5d7c548dc455e6b3bd048"
DEPENDS = "libnfnetlink openssl"
inherit autotools pkgconfig systemd update-rc.d
PACKAGECONFIG ??= "libnl snmp \
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
"
PACKAGECONFIG[libnl] = "--enable-libnl,--disable-libnl,libnl"
PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp,net-snmp"
PACKAGECONFIG[systemd] = "--with-init=systemd --with-systemdsystemunitdir=${systemd_system_unitdir},--with-init=SYSV,systemd"
EXTRA_OECONF = "--disable-libiptc"
EXTRA_OEMAKE = "initdir=${sysconfdir}/init.d"
do_install_append() {
if [ -f ${D}${sysconfdir}/init.d/${BPN} ]; then
chmod 0755 ${D}${sysconfdir}/init.d/${BPN}
sed -i 's#rc.d/##' ${D}${sysconfdir}/init.d/${BPN}
fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -D -m 0644 ${B}/${BPN}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
fi
}
FILES_${PN} += "${datadir}/snmp/mibs/KEEPALIVED-MIB.txt"
INITSCRIPT_NAME = "keepalived"
INITSCRIPT_PARAMS = "remove"
SYSTEMD_SERVICE_${PN} = "keepalived.service"
SYSTEMD_AUTO_ENABLE ?= "disable"
再新增 meta-proscend/recipes-extended/keepalived/keepalived_1.3.5.bbappend
PACKAGECONFIG_remove = "snmp"
do_install_append() {
rm -rf ${D}/usr/share/snmp
}
先 compile 試試
1130
目前懷疑從 CXR 退回來的 M301 是直接從 V1.2 的 image a
直接 upgrade 成後續 rootfs 做了加密的版本
這會導致 V1.2 的 image a
在做 firmware upgrade 時解不開 rootfs
但當時的 V1.2 的 firmware upgrade 的 script 並沒有考慮到錯誤的狀況
會造成 image b
並沒有被複製到新的 rootfs 而繼續保留之前的 rootfs
目前不再繼續追這個問題
直接使用 mfgtool 燒錄最後一次 release 的版本 - V1.50
1305
試著將 branch 'feature/vrrp' build 出來的 image upgrade 看看
已經確認 keepalived 該有的套件都有被安裝到
先做 commit
commit 8ad6576c8b366fcb5c65ade476767b3cfd908136
Author: jeffrey <[email protected]>
Date: Fri Jun 23 13:15:30 2017 +0800
Add 'keepalived' recipe for implementing the 'VRRP' feature
1530
剛剛開完 M300 週會
- RSTP schedule 先不估
- 不過業務面已經說會在 Q3 release
- VRRP schedule 拉到 7/14
- 保留兩個禮拜的整合測試
- 七月底會 release V1.51
- 今天下班前先估
RIP I/II
和OSPF
- M300 會被編入 BU 2(BU 1 事業部是原有的產品線)
- BU Head: Jim(Pioneer 確定做到月底)
- 業務: Cindy
- FAE: Borchen
- RD: ariel, john, jeffrey, aaron
- aaron 實做的 MQTT Brocker 先不做 TLS
- 要考慮的層面太多
- M301 的 switch 要能 per port 收送
- 目前該項需求跟 john 的
VLAN
工作項目綁在一起
- 目前該項需求跟 john 的
1610
先佈置一下 VRRP 的測試環境
參考 VRRP (Virtual Router Redundancy Protocol) Keepalived Configuration
手上有
- M300
- M301
- MSI U90 Notebook(Ubuntu 16.04)
- DLINK DES-1005D 5-Port Fast Ethernet Switch
- DLINK DGS-1005A 5-Port Gigabit Ethernet Switch
- 連接到公司網路: 網段 192.168.0.0
先規劃一下我的測試環境 topology
+------+
| |
+------+ M300 +------+
| | | |
+------+ +--------+ | +------+ |
| | | +-+-+ +-+------+
| PC +----+ | | +---+
| | | LAN Subnet | | | +-------------+
+------+ | | | WAN Subnet | | |
+----+ | | +----+ DHCP Server |
+----+--+ +------+ +-+--+ | | |
| | | | +-------+ +-------------+
+-------+ M301 +------+
| |
+------+
盤一下怎麼分配
- PC
- MSI U90 Notebook(Ubuntu 16.04)
- LAN Subnet
- DLINK DES-1005D 5-Port Fast Ethernet Switch
- M300
- M301
- WAN Subnet
- DLINK DGS-1005A 5-Port Gigabit Ethernet Switch
- DHCP Server
- 直接用公司的 DHCP Server - 192.168.0.250/24
1705
monkeyjj time