Permalink
Browse files

Added the scripts used during the process of building the Razor Micro…

…kernel ISO to the project, will be available starting with this version of the Microkernel (v0.2.1.0)
  • Loading branch information...
Tom McSweeney
Tom McSweeney committed Mar 11, 2012
1 parent 8f831d7 commit b0e4480de92f95e9054d8664684ce2b7aeba9ddd
Showing with 74 additions and 4 deletions.
  1. +39 −0 iso-build-files/build_iso_yaml.rb
  2. +31 −0 iso-build-files/rebuild_iso.sh
  3. +4 −4 rz_mk_control_server.rb
@@ -0,0 +1,39 @@
#!/usr/bin/env ruby
#
# Used during the ISO building process to build a YAML file (iso-metadata.yaml) that
# will be saved in the directory named in the first command-line argument (which, for
# our Microkernel ISO files, will be at the root of the Microkernel ISO's' filesystem)
#
# EMC Confidential Information, protected under EMC Bilateral Non-Disclosure Agreement.
# Copyright © 2012 EMC Corporation, All Rights Reserved
#
# @author Tom McSweeney
require 'yaml'
if ARGV.length != 2
puts "USAGE: #{$0} DIR_NAME ISO_VERSION"
puts " (example #{$0} /tmp v0.2.1.0"
end
# take the first argument as the directory to create the YAML file in
dir_name = ARGV[0]
# if the named file doesn't exist or it does and it isn't a directory, then exit
if !File.exist?(dir_name) || !File.directory?(dir_name)
puts "#{$0} Error: '#{dir_name}' is not a directory"
exit(-1)
end
# build the YAML file
yaml_hash = Hash.new
yaml_hash['iso_version'] = ARGV[1]
yaml_hash['kernel'] = 'vmlinuz'
yaml_hash['initrd'] = 'core.gz'
yaml_hash['iso_build_time'] = Time.now.utc
# and save it to the iso-metadata.yaml file in the specified directory
iso_filename = dir_name + File::SEPARATOR + 'iso-metadata.yaml'
File.open(iso_filename, 'w') { |file|
YAML::dump(yaml_hash, file)
}
@@ -0,0 +1,31 @@
#!/bin/sh
if [ $# -ne 1 ]
then
echo "USAGE: `echo $0 | awk -F'/' '{print $(NF)}' -` ISO_VERSION"
echo " where ISO_VERSION is the version of the ISO file you are creating"
echo " (it will be transformed into a filename that looks like:"
echo ' rz_mk_dev-image_${ISO_VERSION}.iso'
exit
fi
ISO_VERSION=$1
ISO_NAME=rz_mk_dev-image.${ISO_VERSION}.iso
DIR_NAME=`pwd`
set -x
# run chroot and ldconfig on the tmp directory (preparing it for construction
# of a bootable core.gz file)
chroot ${DIR_NAME}/tmp depmod -a 3.0.3-tinycore
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}
# finally, build the ISO itself (using the contents of the newiso directory as input
mkisofs -l -J -R -V TC-custom -no-emul-boot -boot-load-size 4 -boot-info-table -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -o ${ISO_NAME} newiso
View
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
# this is rz_mk_control_server.rb
# it starts up a WEBrick server that can be used to control the Microkernel
# (commands to the Microkernel are invoked using Servlets running in the
# WEBrick instance)
# this is rz_mk_control_server.rb script
#
# it is the Microkernel Controller script, and is started as a daemon process using
# the associated rz_mk_controller.rb script
#
# EMC Confidential Information, protected under EMC Bilateral Non-Disclosure Agreement.
# Copyright © 2012 EMC Corporation, All Rights Reserved

0 comments on commit b0e4480

Please sign in to comment.