- 要看一下 Documentation/early-userspace/README
- Documentation/filesystems/ramfs-rootfs-initramfs.txt:
- usr/Makefile: 中有 ramfs-input
ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上
2009年7月7日 星期二
initrd ? initramfs - todo
2009年7月3日 星期五
gnu make 的 call function
The syntax of thecall
function is:$(call variable,param,param,...)make
執行這道命時,會賦予param...一個暫時的變數名稱$(1)
,$(2)
, etc. 變數$(0)
則是 variable.Then variable is expanded as a
make
variable in the context of these temporary assignments. Thus, any reference to$(1)
in the value of variable will resolve to the first param in the invocation ofcall
.If variable is the name of a builtin function, the builtin function is always invoked (even if a
make
variable by that name also exists).examples
This macro simply reverses its arguments:
reverse = $(2) $(1)foo = $(call reverse,a,b)foo 會是 `b a'.
This one is slightly more interesting: it defines a macro to search for the first instance of a program in
PATH
:pathsearch = $(firstword $(wildcard $(addsufix /$(1),$(subst :, ,$(PATH)))))LS := $(call pathsearch,ls)
Now the variable LS contains /bin/ls
or similar.
The call
function can be nested. Each recursive invocation gets its own local values for $(1)
, etc. that mask the values of higher-level call
. For example, here is an implementation of a map function:
map = $(foreach a,$(2),$(call $(1),$(a)))
Now you can map a function that normally takes only one argument, such as origin
, to multiple values in one step:
o = $(call map,origin,o map MAKE)
and end up with o containing something like `file file default'.
A final caution: be careful when adding whitespace to the arguments to call
. As with other functions, any whitespace contained in the second and subsequent arguments is kept; this can cause strange effects. It's generally safest to remove all extraneous whitespace when providing parameters to call
.
uimage 的 quiet_cmd_uimage ...
arch/arm/boot/Makefile其中:
quiet_cmd_uimage = UIMAGE $@ cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ -C none -a $(LOADADDR) -e $(LOADADDR) \ -n 'Linux-$(KERNELRELEASE)' -d $< $@但是我到處都找不到 ref quiet_cmd_uimage 和 cmd_uimage 的地方。 後來找到原來是 .. Kbuild
Kbuild 的 instruction:
quiet_cmd_CMD = 要顯示的 cmd_CMD = 要執行的有關Kbuild 在 kernel/Documentation/kbuild/makefile.txt 有說明:
--- 6.7 Custom kbuild commands When kbuild is executing with KBUILD_VERBOSE=0, then only a shorthand of a command is normally displayed. To enable this behaviour for custom commands kbuild requires two variables to be set: quiet_cmd_<command> - what shall be echoed cmd_<command> - the command to execute Example: # quiet_cmd_image = BUILD $@ cmd_image = $(obj)/tools/build $(BUILDFLAGS) \ $(obj)/vmlinux.bin > $@ targets += bzImage $(obj)/bzImage: $(obj)/vmlinux.bin $(obj)/tools/build FORCE $(call if_changed,image) @echo 'Kernel: $@ is ready' When updating the $(obj)/bzImage target, the line BUILD arch/i386/boot/bzImage will be displayed with "make KBUILD_VERBOSE=0".
uImage 和 mkimage
make xx_config make coldconfig make dep make uImage就可以build 出 uImage。 uImage 和以往zImage, bzImage 不同的是..她需要用 tools/mkimage 這個 tool 來包裝過:
- build vmlinux (ELF binary format)
{CROSS_COMPILE)-objcopy -O binary -R .note -R .comment -S vmlinux linu.bin
gzip -9 linux.bin
- 包裝:
mkimage -A arm -O linux -T kernel -C gzip -a 0 -e 0 -n "Linux Kernel Image" -d linux.bin.gz uImage
Usage: ../kernel/scripts/mkimage -l image -l == list image header information ../kernel/scripts/mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image -A == set architecture to 'arch' -O == set operating system to 'os' -T == set image type to 'type' -C == set compression type 'comp' -a == set load address to 'addr' (hex) -e == set entry point to 'ep' (hex) -n == set image name to 'name' -d == use image data from 'datafile' -x == set XIP (execute in place)
2009年7月1日 星期三
worklog : build android from source
build/core/build-system.html然後,run
build/envsetup.sh就可以多出幾個command,可以用 "help" 指令 (run 完後直接key "help")看一下..
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment: - croot: Changes directory to the top of the tree. - m: Makes from the top of the tree. - mm: Builds all of the modules in the current directory. - mmm: Builds all of the modules in the supplied directories. - cgrep: Greps on all local C/C++ files. - jgrep: Greps on all local Java files. - resgrep: Greps on all local res/*.xml files. - godir: Go to the directory containing a file. Look at the source to view more functions. The complete list is: add_lunch_combo cgrep check_product check_variant choosecombo chooseproduct choosetype choosevariant croot findmakefile gdbclient get_abs_build_var getbugreports get_build_var getprebuilt gettop godir help isviewserverstarted jgrep lunch m mm mmm pid printconfig print_lunch_menu resgrep runhat runtest runtest_py setpaths set_sequence_number set_stuff_for_environment settitle smoketest startviewserver stopviewserver tapas tracedmdump其中有關"mm" 這個command 的使用方法,在 SipX Android Build Environment 有提到。
這個 build-system.html 也包含很多其他的說明,像是 # 如何增加一個 project 到 android build system # 各種 build target 的差異 # 各種 clean 的差異
標籤
- 3g (19)
- 工作的備worklog (93)
- 自言自語 (36)
- 草稿 (1)
- 亂亂寫 (8)
- 翻譯 (3)
- administration (76)
- alsa (7)
- android (299)
- apple (5)
- application (42)
- archlinux (1)
- audio (3)
- avr (6)
- backup_restore (2)
- bluetooth (5)
- bookmark (38)
- bootloader (21)
- browser (5)
- cellphone (28)
- command (8)
- Configuration (27)
- debug (7)
- django (1)
- driver (15)
- earphone (1)
- editor (1)
- EFL (1)
- ffmpeg (18)
- Filesystem (4)
- GCC (8)
- Gentoo (1)
- google (1)
- Graphic (3)
- hardware (40)
- hero (7)
- hibernation (9)
- iMX51 (38)
- Info (3)
- Install (30)
- java (4)
- Kernel (102)
- language (2)
- life (2)
- make (11)
- MantainLog (38)
- MCU_P (9)
- memo (8)
- microcontroller (3)
- MINGW (7)
- network (19)
- OpenCL (1)
- OS (11)
- package (3)
- pad (1)
- ProblemAndSolve (15)
- programming (8)
- Python (7)
- raspberry_pi (23)
- SDL (2)
- sensation (13)
- setup (3)
- software_package (36)
- SQL (1)
- suspend (2)
- ToDo (5)
- tool (3)
- ubuntu (1)
- VersionControl (45)
- Virtualization (15)
- VLC (5)
- wheezy (1)
- wifi (3)
- Windows (16)
- xiaomi (1)
- xperia (1)