File Description - ihipop/winsun_mininas_v1 GitHub Wiki

artifacts folder

This folder stores 'artifacts', that is, various kinds of files that is used in build process or to be copied to output folder. But they themselves are not modified during any process.

busybox-i686.md5               # md5 checksum for busybox-i686
cmdline.usb                    # cmdline for (bootable) usb driver
diagram.dot                    # graphviz diagram
diagram.ps                     # postscript file generated from dot file
example-preseed.txt            # example preseed file from debian documentation
gzip                           # statically-linked gzip, busybox in netboot initrd has no gzip
kbl_kernel_config              # kernel config file for kbl
ker-app                        # kernel version for linux-image and -headers deb naming
kernel_config                  # kernel config file for custom kernel
ker-rev                        # kernel revision for linux-image and -headers deb naming
kexec-tools-2.0.10.tar.gz.md5  # md5 checksum for kexec source tarball
netboot.tar.gz.md5             # md5 checksum for debian netboot tarball
post_inst                      # post-installation script for on-target installation
post_inst_hook                 # hook script for post-installation script
preseed.cfg                    # preseeding file for hacked netboot
spl-0.6.4.2.tar.gz.md5         # md5 checksum for spl source tarball
zfs-0.6.4.2.tar.gz.md5         # md5 checksum for zfs source tarball

preseeding.cfg

This is the configuration file for debian installer preseeding. Preseeding is the technique to automate debian installation. We use this file to automate some (but not all) steps in usb-drive based installation.

post_inst

This file is a script file put into the modifiled netboot initrd. At the last stage, select exit to shell in debian installation menu (by double click the ESC key), run this script manually.

post_inst_hook

This script is put in output/boot folder and will be called by post_inst script. It is used to further customize the installation process, adding deb packages, adding python packages, deploying web service scripting files, etc.

ker-app and ker-rev

There are two customizable string in make-kpkg command options.

  • --append-to-version
  • --revision

The first string will be concatenated to kernel version (uname -r), it will also infect the kernel module and linux header file folder name.

For example, if --append-to-version=-001 is provided, the kernel version will be 2.6.39-001. The corresponding kernel module folder will be /lib/modules/2.6.39-001 and the header file folder will be /usr/src/linux-headers-2.6.39-001. Also, in /boot folder, you will find vmlinuz-2.6.39-001, System.map-2.6.39-001, initrd.img-2.6.39-001, config-2.6.39-001, etc.

NOTICE: The dash (-) in -001 is a part of append-to-version string. Without it, the kernel version will look like 2.6.39001. In the project, we use dot (.) as the prefix, so the kernel string looks like 2.6.39.001.

It is possible to build different kernel image and headers deb package with different append-to-version, and install all of them simultaneously. This is exactly the way the Debian or Ubuntu install kernel and headers packages. The advantages of this scheme, is that, you can install newer kernel or revert to previous one, smoothly.

The revision string is just a string embedded in the deb package name. It will not affect kernel version string, any kernel-related file name or folder name. If you install another kernel deb package with the same version and append-to-version string, but with different revision string, the package management system will simply overwrite the older file, rather than create a new copy. This is probably not what you want and sometimes dangerous. So this string is mainly for developers to tag different kernel or header packages.

Both strings will be embedded into the deb package name. The rule is, for example:

linux-images-2.6.39[append-to-version]_[revision]_i386.deb

If append-to-version is -001 and revision is 000, then the deb name should be:

linux-images-2.6.39-001_000_i386.deb

We store these two strings in file ker-app and ker-rev respectively. ker-app only stores the numeric part, without the dot (.) prefix. The post_inst script will prefix it when launching make-kpkg command. ker-rev stores revision string, which is only used for developers to differentiate files versions.

ker-app should be maintained manually by developers. Each time, the kernel source code or configuration are changed, this number should be incremented by 1. It is not suitable to use git hash (or its short version) for this string, because not every git commit change kernel, so there is no need to rebuild all deb packages for kernel image, headers, spl and zfs. Only when kernel is really modified, these files should be updated.

gzip

This is statically-linked gzip executable (i386). It is put into the repackaged netboot initrd. The busybox executable in the package does not have gzip applet. Replacing it with the statically-linked busybox-i686 will cause other problems. So I built the gzip from source code and pack the executable to initrd.

It is required for tar-ing the target file system or zip the dd image on the fly.

cache folder

This folder can be empty initially. After the build script runs for the first time, the following files will be downloaded or built, and are stored here. They are all invariant. So no need to delete them when rebuilding the targets.

26662613   868 -rw-r-----  1 ma ma   883644 Oct 13 14:37 busybox-i686
28638619   944 -rwxrwxr-x  1 ma ma   964108 Oct 18 12:11 kexec
28638606   372 -rw-rw-r--  1 ma ma   380875 Jun 25 18:14 kexec-tools-2.0.10.tar.gz
28638607 12712 -rw-rw-r--  1 ma ma 13014911 May  1  2013 netboot.tar.gz
28773038   548 -rw-rw-r--  1 ma ma   558098 Jun 26 06:35 spl-0.6.4.2.tar.gz
28773039  2376 -rw-rw-r--  1 ma ma  2429581 Jun 26 06:36 zfs-0.6.4.2.tar.gz

disc folder

Stores Intel CEFDK PR29 iso images.

patches folder

Stores cefdk (including kernel) patch files.

scripts folder

Stores scripting file

template folder

template folder stores files and folders for building initrd. We build 3 initrd files. One for kbl, which is stored in kbl_initramfs subfolder; One for usb boot, which is decompress and re-compress on-the-fly, so there is no template files here. And the last one is for cefdk ramdisk, all required files are stored in cefdk_initrd subfolder.

output folder

There are three subfolders.

kbl

the kbl kernel, which is a bzImage with initrd built-in.

boot

-rwxr-xr-x 1 ma ma  3353280 Oct 19 09:14 bzImage
-rw-rw-r-- 1 ma ma       34 Oct 19 09:14 cmdline
-rw-rw-r-- 1 ma ma        8 Oct 19 09:14 git-short-hash
-rw-rw-r-- 1 ma ma        4 Oct 19 09:14 ker-app
-rw-rw-r-- 1 ma ma    66589 Oct 19 09:14 kernel_config
-rw-rw-r-- 1 ma ma        4 Oct 19 09:14 ker-rev
-rw-rw-r-- 1 ma ma 99985216 Oct 19 09:14 linux-2.6.39.tar.gz
-rwxrwxr-x 1 ma ma      101 Oct 19 09:14 post_inst_hook
-rw-rw-r-- 1 ma ma 10952522 Oct 19 09:14 ramdisk
-rw-rw-r-- 1 ma ma   558098 Oct 19 09:14 spl-0.6.4.2.tar.gz
-rw-rw-r-- 1 ma ma  2429581 Oct 19 09:14 zfs-0.6.4.2.tar.gz

bzImage is custom kernel for usb drive. ramdisk is the initrd. cmdline is the bootargs. git-short-hash contains current git version. ker-app and ker-rev stores kernel version. kernel_config is the configuration file. linux-2.6.39.tar.gz is cleaned source package. post_inst_hook is hook script for on-target installation. spl and zfs source tarball are also included for building corresponding deb packages on target.

cefdk

outputs for cefdk build, including bzImage, ramdisk.ext2.tar.gz and lib.modules.full.tar.gz