2018年9月22日 星期六

note for autoconf - CH1 Introduction


Autoconf是一個用於生成shell script的工具(我們稱這個script為“configure”),可自動配置source code以適應Posix系統。“configure”可獨立運行(用戶不需要使用Autoconf)。“configure”在運行時不需要手動用戶干預; 甚至不需要指定係統類型的參數。 而且“configure”會測試source code/package所需的環境。Autoconf的目標是讓每個user都能夠輕鬆的執行“configure”。Autoconf在其目標方面非常成功,多數抱怨都是關於編寫Autoconf,而不是由此產生的“configure”的行為。


    參考資料:
  • https://www.gnu.org/software/autoconf/manual/index.html, Autoconf documentation
  • https://bootlin.com/pub/conferences/2016/elc/petazzoni-autotools-tutorial/petazzoni-autotools-tutorial.pdf, GNU Autotools: a tutorial




2018年9月9日 星期日

Mount UBI with nandsim


UBI/UBIFS無法使用loop-back方式mount, 不過我們可以使用NAND simulator將UBI燒入到nandsim中.
root@vista:~# mkfs.ubifs -m 2KiB -e 129024 -c 2048 -r ubifs-root -x zlib ubifs.img
root@vista:~# cat ubi.ini
[ubi_rfs]
mode=ubi
image=ubifs.img
vol_id=0
vol_type=dynamic
vol_name=ubi_rfs
vol_alignment=1
vol_flags=autoresize

root@vista:~# ubinize -o my.ubi -p 128KiB -m 2KiB -O 512 ubi.ini
ubinize: volume size was not specified in section "ubi_rfs", assume minimum to fit image "ubifs.img"1806336 bytes (1.7 MiB)
root@vista:~# modprobe nandsim first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15
root@vista:~# ubiformat /dev/mtd0 -f my.ubi
ubiformat: mtd0 (nand), size 268435456 bytes (256.0 MiB), 2048 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 2047 -- 100 % complete
ubiformat: 2048 eraseblocks have valid erase counter, mean value is 3
ubiformat: flashing eraseblock 15 -- 100 % complete
ubiformat: formatting eraseblock 2047 -- 100 % complete
ubiformat: formatting eraseblock 2047 -- 100 % complete
root@vista:~# ubiattach -m 0
UBI device number 0, total 2048 LEBs (264241152 bytes, 252.0 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
root@vista:~# ubinfo -a
UBI version:                    1
Count of UBI devices:           1
UBI control device major/minor: 10:55
Present UBI devices:            ubi0

ubi0
Volumes count:                           1
Logical eraseblock size:                 129024 bytes, 126.0 KiB
Total amount of logical eraseblocks:     2048 (264241152 bytes, 252.0 MiB)
Amount of available logical eraseblocks: 0 (0 bytes)
Maximum count of volumes                 128
Count of bad physical eraseblocks:       0
Count of reserved physical eraseblocks:  40
Current maximum erase counter value:     9
Minimum input/output unit size:          2048 bytes
Character device major/minor:            245:0
Present volumes:                         0

Volume ID:   0 (on ubi0)
Type:        dynamic
Alignment:   1
Size:        2002 LEBs (258306048 bytes, 246.3 MiB)
State:       OK
Name:        ubi_rfs
Character device major/minor: 245:1

root@vista:~# mount -t ubifs /dev/ubi0_0 www

Usage: mkfs.ubifs [OPTIONS] target
Make a UBIFS file system image from an existing directory tree
Options:
-r, -d, --root=DIR       build file system from directory DIR
-m, --min-io-size=SIZE   minimum I/O unit size
-e, --leb-size=SIZE      logical erase block size
-c, --max-leb-cnt=COUNT  maximum logical erase block count
-x, --compr=TYPE         compression type - "lzo", "favor_lzo", "zlib" or
                         "none" (default: "lzo")

# mkfs.ubifs -F -r </path/to/your/rootfs/tree> -m <min io size> -e <LEB size> -c 
        <Erase Blocks count> -o </path/to/output/Image.ubifs>
<min io size> Equals the page-size of the used NAND-Flash
<LEB size> Logical Erase Block size
<Erase Blocks count> maximum logical erase block count
mkfs.ubifs -m 2KiB -e 129024 -c 2048 -r ubifs-root -x zlib ubifs.img這些相關參數是先用ubiformat確認的, 不過-e是在mount failed的時候看dmesg的


Usage: ubinize [-o filename] [-p ] [-m ] [-s ] [-O ] [-e ]
                [-x ] [-Q ] [-v] [-h] [-V] [--output=] [--peb-size=]
                [--min-io-size=] [--sub-page-size=] [--vid-hdr-offset=]
                [--erase-counter=] [--ubi-ver=] [--image-seq=] [--verbose] [--help]
                [--version] ini-file
-p, --peb-size=       size of the physical eraseblock of the flash
                             this UBI image is created for in bytes,
                             kilobytes (KiB), or megabytes (MiB)
                             (mandatory parameter)
-m, --min-io-size=    minimum input/output unit size of the flash
                             in bytes
-O, --vid-hdr-offset=   offset if the VID header from start of the
                             physical eraseblock (default is the next
                             minimum I/O unit or sub-page after the EC
                             header)

# ubinize -vv -o <output image> -m <min io size> -p <PEB size>KiB 
        -s <subpage-size> -O <VID-hdr-offset> <configuration file>
<min io size> Equals the page-size of the used NAND-Flash
<PEB size> Physical Erase Block size (in KiB) - Equals the block size of
        the NAND-Flash
<Erase Blocks count> Count of the available Erase Blocks
<subpage-size> Subpage size in bytes. Default value is the minimum 
        input/output size (page-size)
<VID-hdr-offset> offset if the VID header from start of the PEB 
        (default is the next min I/O unit or sub-page after the EC header)
<configuration file> Path to a configuration file.

ubinize -o my.ubi -p 128KiB -m 2KiB -O 512 ubi.ini這些參數也是在ubiformat修正的, 如-O 512


    參考資料:
  • http://www.linux-mtd.infradead.org/faq/ubifs.html#L_loop_mount, Can UBIFS mount loop-back devices?
  • https://elinux.org/UBIFS, UBIFS
  • http://www.linux-mtd.infradead.org/faq/nand.html#L_nand_nandsim, How do I use NAND simulator?




2018年9月2日 星期日

How to clone MDM9207 codeaurora/openembedded


筆記一下How to clone MDM9207 codeaurora/openembedded
brook@vista:~/oe-9x07$ git clone https://gerrit.googlesource.com/git-repo
Cloning into 'git-repo'...
remote: Counting objects: 139, done
remote: Total 4069 (delta 2714), reused 4069 (delta 2714)
Receiving objects: 100% (4069/4069), 1.21 MiB | 0 bytes/s, done.
Resolving deltas: 100% (2714/2714), done.
Checking connectivity... done.
brook@vista:~/oe-9x07$ ln -s git-repo/repo
brook@vista:~/oe-9x07$ ./repo init -u git://codeaurora.org/quic/le/le/manifest.git -b release -m LE.UM.1.0.2-34100-9x07.xml
Get https://gerrit.googlesource.com/git-repo/clone.bundle
Get https://gerrit.googlesource.com/git-repo
Get git://codeaurora.org/quic/le/le/manifest.git
remote: Counting objects: 4009, done.
remote: Compressing objects: 100% (191/191), done.
remote: Total 4009 (delta 84), reused 0 (delta 0)        KiB/s
Receiving objects: 100% (4009/4009), 1.07 MiB | 706.00 KiB/s, done.
Resolving deltas: 100% (2191/2191), done.
From git://codeaurora.org/quic/le/le/manifest
 * [new branch]      IMM.LE.1.0 -> origin/IMM.LE.1.0
 * [new branch]      release    -> origin/release
...
...
Your identity is: Brook Kuo <rene3210 at gmail.com>
If you want to change this, please re-run 'repo init' with --config-name

repo has been initialized in /home/brook/oe-9x07

brook@vista:~/oe-9x07$ ./repo sync
Fetching project platform/vendor/qcom/titanium_32
remote: Counting objects: 5758, done.
remote: Compressing objects: 100% (375/375), done.
remote: Total 5758 (delta 305), reused 380 (delta 177)
Receiving objects: 100% (5758/5758), 1.02 MiB | 868.00 KiB/s, done.
Resolving deltas: 100% (3639/3639), done.
From git://codeaurora.org/platform/vendor/qcom/titanium_32
 * [new branch]      LA.BR.1.3.7_rb1.11 -> caf/LA.BR.1.3.7_rb1.11
...
...
Fetching projects: 100% (58/58), done.
Checking out files: 100% (52804/52804), done. files:  23% (12539/52804)
Checking out files: 100% (622/622), done. out files:  26% (167/622)
Syncing work tree: 100% (58/58), done.



    參考資料
  • https://gerrit.googlesource.com/git-repo/, repo - The Multiple Git Repository Tool
  • https://wiki.codeaurora.org/xwiki/bin/QLBEP/, Open Embedded for MSM




note - Blue Ocean Strategy


藍海策略提供了一個清晰的4步驟流程(買方效益→價格→成本→推行),協助企業擺脫競爭對手,並且建立起一片獲利強勁成長的藍海。
這套4步驟流程是環繞著藍海策略和公平程序(fair process)的概念和分析工具所設計的,透過這套流程,經理人和他們的團隊可以在研擬嚴謹和具體的策略的同時,不至於見樹不見林、掌握大願景。
    參考資料:
  • https://www.managertoday.com.tw/articles/view/51294, 8個要點,一次讀懂藍海策略

2018年9月1日 星期六

note - The Balanced ScoreCard


平衡計分卡不能為企業創造策略,但能幫組織有效執行策略。平衡計分卡以組織的共同願景與戰略為內核,將公司的願景與戰略轉化為下屬各責任部門(如各事業部)在財務(Financial)顧客(Customer)內部流程(Internal Processes)創新與學習(Innovation&Learning)等四個方面的系列具體目標(即成功的因素),並設置相應的四張計分卡,其基本框架見下圖:

優點:
企業向來以財務數字做為績效衡量的標準,但無論是業績目標或營收、投資報酬率等,都是反映過去行動所獲致的成果;簡單說,財務數字衡量的是「過去的績效」,是一種「落後指標」,而非創造未來績效的指引。
平衡計分卡的理念在於:在財務衡量(落後指標)之外,積極找出能夠創造未來財務成果的「績效驅動因素」(performance driver),也就是相較財務成果而言的「領先指標」,例如顧客滿意度、高效率的流程、員工能力、士氣等,讓「績效衡量制度」能與「策略」配合一致。
平衡計分卡不僅是一種管理手段,也體現了一種管理思想,就是:只有量化的指標才是可以考核的,必須將要考核的指標進行量化

缺點:
平衡計分卡中有一些條目是很難解釋清楚或者是衡量出來的。財務指標當然不是問題,而非財務指標往往很難去建立起來。



    參考資料:
  • http://wiki.mbalib.com/zh-tw/%E5%B9%B3%E8%A1%A1%E8%AE%A1%E5%88%86%E5%8D%A1, 平衡計分卡
  • https://www.managertoday.com.tw/articles/view/2489, 5分鐘!了解「平衡計分卡」





熱門文章