Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 98 lines (86 sloc) 3.618 kb
. ./
# bring in the git derived version number...
. ./
case $# in
;; # nothing to do
if test x"$1" != x"${ISO_VERSION}"; then
echo "overriding version from [${ISO_VERSION}] to [${1}]"
ISO_VERSION="$1" # override git version
echo "USAGE: `echo $0 | awk -F'/' '{print $(NF)}' -` [VERSION]"
echo " where VERSION will override the version number of the ISO file from git"
echo " (it will be transformed into a filename that looks like:"
echo ' rz_mk_dev-image_${ISO_VERSION}.iso'
exit 1
# We need to work out which of the set of tool names for building ISO images
# is used on this platform, and save it for later.
if exists genisoimage; then
elif exists mkisofs; then
echo "Rebuilding the ISO image requires genisoimage or mkisofs."
exit 1
# We run the guest busybox using the host platform toolchain, so we should
# test if it works or not. We can't use a host busybox because some platforms
# *cough* Ubuntu *cough* don't ship the depmod applet.
# This invocation is enough to run the guest Busybox on a 32-bit or 64-bit
# kernel, without needing to depend on host libraries matching the guest, or
# chroot, or anything super-fancy like that.
busybox() {
"${PWD}/tmp/lib/" "${PWD}/tmp/bin/busybox" \
if ! busybox true; then
echo "It looks like I can't Unable to locate a working busybox for depmod!"
echo "I tried the TCL busybox too, and it failed even with chroot."
echo "If you see 'No such file or directory' above you probably need to install"
echo "the 32-bit libc on your machine!"
exit 1
set -x
# build the YAML file in the Microkernel's filesystem that will be used to
# display this same version information during boot
./add_version_to_mk_fs.rb tmp ${ISO_VERSION}
# Run depmod and ldconfig on the tmp directory, preparing it for construction
# of a bootable core.gz file in the event we added kernel modules or shared
# libraries in our unpacking.
# We also replace an absolute symlink in the module directory with a relative
# symlink, to allow depmod to correctly follow it without having to chroot.
# This is entirely compatible, but not done upstream, unfortunately.
kernelver="$(ls "${DIR_NAME}/extract/lib/modules")"
rm -f tmp/lib/modules/${kernelver}/kernel.tclocal
ln -s ../../../usr/local/lib/modules/${kernelver}/kernel \
busybox depmod -a -b "${DIR_NAME}/tmp" ${kernelver}
/sbin/ldconfig -r "${DIR_NAME}/tmp"
# build the new core.gz file (containing the contents of the tmp directory)
cd tmp
find | cpio -o -H newc | gzip -2 > ../core.gz
cd ..
# compress the file and copy it to the correct location for building the ISO
advdef -z4 core.gz
cp -p core.gz newiso/boot/
# build the YAML file needed for use in Razor, place it into the root of the
# ISO filesystem
./build_iso_yaml.rb newiso ${ISO_VERSION} boot/vmlinuz boot/core.gz
# finally, build the ISO itself from the newiso directory
"${GENISO}" -l -J -R -V TC-custom \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-b boot/isolinux/isolinux.bin \
-c boot/isolinux/ \
-o "${ISO_NAME}" newiso
Jump to Line
Something went wrong with that request. Please try again.