Skip to content

Commit 46dcd8d

Browse files
author
tjmcs
committed
Merge pull request #13 from tjmcs/tb/update-to-5.x-kernel
Updating Hanlon-Microkernel to TCL-5.x based kernel
2 parents 2c4f0a6 + 5c7bc0e commit 46dcd8d

19 files changed

Lines changed: 370 additions & 221 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ If the Hanlon Microkernel that is being built/used is a development kernel, a fi
2323

2424
In addition, this project also includes a number of additional ruby files and configuration files that are used by these services, a list of gems that are installed dynamically each time that the Microkernel boots (under the opt/gems directory), a copy of the 'bootsync.sh' script (under the opt directory in this project), and the 'hnl_mk_init.rb' script itself (which is used by that bootsync.sh script to start the appropriate Ruby-based services during the Microkernel boot process).
2525

26-
Copies of the ruby scripts that appear at the top-level of this project's directory structure can be found in the /usr/local/bin directory of the Microkernel. In addition, the files that appear in the hanlon_microkernel subdirectory of this project are all part of the HanlonMicrokernel module, and those files are placed in the /usr/local/lib/ruby/1.8 directory in the Microkernel ISO.
26+
Copies of the ruby scripts that appear at the top-level of this project's directory structure can be found in the /usr/local/bin directory of the Microkernel. In addition, the files that appear in the hanlon_microkernel subdirectory of this project are all part of the HanlonMicrokernel module, and those files are placed in the /usr/local/lib/ruby/2.0.0 directory in the Microkernel ISO.
2727

2828
It should be noted that this project also includes a set of scripts that are meant to be used to build a new instance of the Microkernel ISO. Instructions for building a new ISO instance using these scripts can be found in this project's Wiki. There are also a number of extensions to the standard Tiny Core Linux ISO that are bundled into the Hanlon Microkernel which are not included in this project. These extensions (and the other dependencies that are needed within the Hanlon Microkernel ISO that are not part of this project) are all downloaded dynamically when the Microkernel ISO is being built. Once again, instructions for building your own (custom) Microkernel ISO can be found in the project's Wiki.

additional-build-files/builtin-extensions.lst

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1+
firmware-broadcom_bnx2.tcz
2+
firmware-broadcom_bnx2x.tcz
13
openssh.tcz
24
openssl-1.0.0.tcz
35
dmidecode.tcz
46
gcc_libs.tcz
57
bash.tcz
6-
scsi-3.0.21-tinycore.tcz
7-
ruby.tcz
8+
scsi-3.8.13-tinycore.tcz
9+
ncurses.tcz
10+
ncurses-common.tcz
11+
libedit.tcz
12+
libxcb.tcz
13+
libXdmcp.tcz
14+
libXau.tcz
15+
libX11.tcz
16+
libXext.tcz
17+
libXrender.tcz
18+
libXft.tcz
19+
expat2.tcz
20+
freetype.tcz
21+
fontconfig.tcz
22+
libXss.tcz
23+
tcl.tcz
24+
tk.tcz
25+
gdbm.tcz
26+
ruby-2.0.tcz
827
lshw.deb
9-
libssl-0.9.8.tcz
10-
firmware-bnx2.tcz
1128
libgpg-error.tcz
1229
libgcrypt.tcz
1330
popt.tcz

additional-build-files/mirror-extensions.lst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
fuse.tcz
22
glib2-dev.tcz
33
glib2.tcz
4-
libdnet.tcz
54
libffi-dev.tcz
65
libffi.tcz
76
ncurses-common.tcz

build-bundle-file.sh

Lines changed: 37 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -173,20 +173,16 @@ fi
173173
TCL_ISO_URL="$MK_BUNDLE_TCL_ISO_URL"
174174
[ -z "$RUBY_GEMS_URL" -a -n "$MK_BUNDLE_RUBY_GEMS_URL" ] &&
175175
RUBY_GEMS_URL="$MK_BUNDLE_RUBY_GEMS_URL"
176-
[ -z "$OPEN_VM_TOOLS_URL" -a -n "$MK_BUNDLE_OPEN_VM_TOOLS_URL" ] &&
177-
OPEN_VM_TOOLS_URL="$MK_BUNDLE_OPEN_VM_TOOLS_URL"
178176
[ -z "$GEM_SERVER_URI" -a -n "$MK_BUNDLE_GEM_SERVER_URI" ] &&
179177
GEM_SERVER_URI="$MK_BUNDLE_GEM_SERVER_URI"
180178

181179
# Set to default anything still not specified, for which there is a reasonable
182180
# default-value
183181
[ -z "$BUNDLE_TYPE" ] && BUNDLE_TYPE='dev'
184-
[ -z "$TCL_MIRROR_URI" ] && TCL_MIRROR_URI='http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz'
185-
[ -z "$TCL_ISO_URL" ] && TCL_ISO_URL='http://distro.ibiblio.org/tinycorelinux/4.x/x86/release/Core-current.iso'
182+
[ -z "$TCL_MIRROR_URI" ] && TCL_MIRROR_URI='http://distro.ibiblio.org/tinycorelinux/5.x/x86/tcz'
183+
[ -z "$TCL_ISO_URL" ] && TCL_ISO_URL='http://distro.ibiblio.org/tinycorelinux/5.x/x86/release/Core-current.iso'
186184
[ -z "$RUBY_GEMS_URL" ] && RUBY_GEMS_URL='http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz'
187-
[ -z "$OPEN_VM_TOOLS_URL" ] && OPEN_VM_TOOLS_URL='https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/mk-open-vm-tools.tar.gz'
188-
[ -z "$IPMI_TOOLS_URL" ] && IPMI_TOOLS_URL='https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/mk-ipmi-mods-and-tools.tar.gz'
189-
[ -z "$PRIV_BUSYBOX_URL" ] && PRIV_BUSYBOX_URL='https://github.com/csc/Hanlon-Microkernel/releases/download/v1.0/mk-custom-busybox.tar.gz'
185+
[ -z "$PRIV_BUSYBOX_URL" ] && PRIV_BUSYBOX_URL='https://github.com/csc/Hanlon-Microkernel/releases/download/v2.0.0/mk-custom-busybox.tar.gz'
190186
[ -z "${DEB_PACKAGE_LIST_URL[*]}" ] && DEB_PACKAGE_LIST_URL[0]='http://distro.ibiblio.org/tinycorelinux/5.x/x86/debian_wheezy_main_i386_Packages.gz'
191187
[ -z "$DEB_MIRROR_URL" ] && DEB_MIRROR_URL='ftp://ftp.us.debian.org/debian'
192188

@@ -248,10 +244,10 @@ mkdir -p tmp-build-dir/usr/local/bin
248244
cp -p hnl_mk_*.rb tmp-build-dir/usr/local/bin
249245

250246
# create copies of the files from this project that will be placed
251-
# into the /usr/local/lib/ruby/1.8/hanlon_microkernel directory in the Hanlon
247+
# into the /usr/local/lib/ruby/2.0.0/hanlon_microkernel directory in the Hanlon
252248
# Microkernel ISO
253-
mkdir -p tmp-build-dir/usr/local/lib/ruby/1.8/hanlon_microkernel
254-
cp -p hanlon_microkernel/*.rb tmp-build-dir/usr/local/lib/ruby/1.8/hanlon_microkernel
249+
mkdir -p tmp-build-dir/usr/local/lib/ruby/2.0.0/hanlon_microkernel
250+
cp -p hanlon_microkernel/*.rb tmp-build-dir/usr/local/lib/ruby/2.0.0/hanlon_microkernel
255251

256252
# create a copy of the files from this project that will be placed into the
257253
# /opt directory in the Hanlon Microkernel ISO; as part of this process will
@@ -281,43 +277,53 @@ fi
281277

282278
# create a copy of the local TCL Extension mirror that we will be running within
283279
# our Microkernel instances
284-
mkdir -p tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz
280+
mkdir -p tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz
285281
cp -p tmp/tinycorelinux/*.yaml tmp-build-dir/tmp/tinycorelinux
286282
for file in `cat $MIRROR_LIST`; do
287283
if [ ${file##*.} != "deb" ]; then
288-
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz $TCL_MIRROR_URI/$file
289-
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz $TCL_MIRROR_URI/$file.md5.txt
290-
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz $TCL_MIRROR_URI/$file.info
291-
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz $TCL_MIRROR_URI/$file.list
292-
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz $TCL_MIRROR_URI/$file.dep
284+
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz $TCL_MIRROR_URI/$file
285+
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz $TCL_MIRROR_URI/$file.md5.txt 2> /dev/null
286+
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz $TCL_MIRROR_URI/$file.info
287+
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz $TCL_MIRROR_URI/$file.list
288+
wget $WGET_V -P tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz $TCL_MIRROR_URI/$file.dep 2> /dev/null
293289
else
294290
PKGNAME=${file%.*}
295291
echo "Installing .deb package for mirroring: $PKGNAME"
296292
./bin/download-deb-pkg --list-file "./tmp-deb/" --mirror-url "$DEB_MIRROR_URL" --output-dir ./tmp-deb $PKGNAME
297-
./bin/deb2tcz.sh ./tmp-deb/$PKGNAME.deb tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/$PKGNAME.tcz
293+
./bin/deb2tcz.sh ./tmp-deb/$PKGNAME.deb tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/$PKGNAME.tcz
298294

299295
fi
300296
done
301297

302298
# and add the files listed in the file specified by the ADDTNL_MODS_LIST parameter
303299
# to the mirror as well
304300
if [ ! -z ${ADDTNL_MODS_LIST} ]; then
301+
# remove the 'map' file associated with each module in the list
302+
while read line; do
303+
fields=( $line )
304+
full_file=${fields[0]}
305+
file=${full_file##*/}
306+
rm tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/${file}.map 2> /dev/null
307+
done < ${ADDTNL_MODS_LIST}
308+
# then add the files from the list
305309
while read line; do
306310
fields=( $line )
307311
full_file=${fields[0]}
308312
file=${full_file##*/}
309313
if [ ${file##*.} != "deb" ]; then
310-
cp -p $full_file tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz
311-
cp -p $full_file.md5.txt tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz
312-
cp -p $full_file.dep tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz
313-
rm tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/${file}.map 2> /dev/null
314-
echo "${fields[1]} ${fields[2]}" >> tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/${file}.map
314+
if [ ! -f tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/$file ]; then
315+
cp -p $full_file tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz
316+
cp -p $full_file.md5.txt tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz
317+
cp -p $full_file.dep tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz 2> /dev/null
318+
fi
319+
echo "${fields[1]} ${fields[2]}" >> tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/${file}.map
315320
else
316321
PKGNAME=${file%.*}
317-
echo "Installing .deb package as builtin: $PKGNAME"
318-
./bin/deb2tcz.sh $full_file tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/$PKGNAME.tcz
319-
rm tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/${file}.map 2> /dev/null
320-
echo "${fields[1]} ${fields[2]}" >> tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/${file}.map
322+
if [ ! -f tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/$PKGNAME.tcz ]; then
323+
echo "Installing .deb package as builtin: $PKGNAME"
324+
./bin/deb2tcz.sh $full_file tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/$PKGNAME.tcz
325+
fi
326+
echo "${fields[1]} ${fields[2]}" >> tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/${file}.map
321327
fi
322328
done < ${ADDTNL_MODS_LIST}
323329
fi
@@ -334,12 +340,12 @@ for file in `cat $BUILTIN_LIST`; do
334340
if [ $BUNDLE_TYPE != 'prod' ] || [ ! $file = 'openssh.tcz' ]; then
335341
wget $WGET_V -P tmp-build-dir/tmp/builtin/optional $TCL_MIRROR_URI/$file
336342
wget $WGET_V -P tmp-build-dir/tmp/builtin/optional $TCL_MIRROR_URI/$file.md5.txt
337-
wget $WGET_V -P tmp-build-dir/tmp/builtin/optional $TCL_MIRROR_URI/$file.dep
343+
wget $WGET_V -P tmp-build-dir/tmp/builtin/optional $TCL_MIRROR_URI/$file.dep 2> /dev/null
338344
echo $file >> tmp-build-dir/tmp/builtin/onboot.lst
339345
elif [ $BUNDLE_TYPE = 'prod' ] && [ -f tmp-build-dir/tmp/builtin/optional/$file ]
340346
then
341347
rm tmp-build-dir/tmp/builtin/optional/$file
342-
rm tmp-build-dir/tmp/builtin/optional/$file.md5.txt 2> /dev/null
348+
rm tmp-build-dir/tmp/builtin/optional/$file.md5.txt
343349
rm tmp-build-dir/tmp/builtin/optional/$file.dep 2> /dev/null
344350
fi
345351
else
@@ -361,12 +367,12 @@ if [ ! -z ${LOCAL_EXTENTS_LIST} ]; then
361367
if [ ${file##*.} != "deb" ]; then
362368
cp -p $full_file tmp-build-dir/tmp/builtin/optional
363369
cp -p $full_file.md5.txt tmp-build-dir/tmp/builtin/optional
364-
cp -p $full_file.dep tmp-build-dir/tmp/builtin/optional
370+
cp -p $full_file.dep tmp-build-dir/tmp/builtin/optional 2> /dev/null
365371
echo $file >> tmp-build-dir/tmp/builtin/onboot.lst
366372
else
367373
PKGNAME=${file%.*}
368374
echo "Installing .deb package as builtin: $PKGNAME"
369-
./bin/deb2tcz.sh $full_file tmp-build-dir/tmp/tinycorelinux/4.x/x86/tcz/$PKGNAME.tcz
375+
./bin/deb2tcz.sh $full_file tmp-build-dir/tmp/tinycorelinux/5.x/x86/tcz/$PKGNAME.tcz
370376
echo $file >> tmp-build-dir/tmp/builtin/onboot.lst
371377
fi
372378
done < ${LOCAL_EXTENTS_LIST}
@@ -417,18 +423,9 @@ ln -s /usr/local/sbin/dmidecode tmp-build-dir/usr/sbin 2> /dev/null
417423
# 1. ssh-setup-files.tar.gz -> contains the setup files needed for the
418424
# SSH/SSL (used for development access to the Microkernel); if
419425
# the '--build-prod-image' flag is set, then this file will be skipped
420-
# 2. mk-open-vm-tools.tar.gz -> contains the files needed for the
421-
# 'open_vm_tools.tcz' extension
422-
# 4. mk-ipmi-mods-and-tools.tar.gz -> contains the kernel modules and
423-
# tools needed to access the BMC associated with the node (if any)
424-
# and report back facts from the BMC to the Hanlon server
425-
# 5. mk-custom-busybox.tar.gz -> contains the custom version of busybox that
426+
# 2. mk-custom-busybox.tar.gz -> contains the custom version of busybox that
426427
# supports additional fields in the DHCP response handling process
427428
cp -p additional-build-files/*.gz tmp-build-dir/build_dir/dependencies
428-
file=`echo $OPEN_VM_TOOLS_URL | awk -F/ '{print $NF}'`
429-
wget $WGET_V -P tmp-build-dir/build_dir/dependencies $OPEN_VM_TOOLS_URL
430-
file=`echo $IPMI_TOOLS_URL | awk -F/ '{print $NF}'`
431-
wget $WGET_V -P tmp-build-dir/build_dir/dependencies $IPMI_TOOLS_URL
432429
file=`echo $PRIV_BUSYBOX_URL | awk -F/ '{print $NF}'`
433430
wget $WGET_V -P tmp-build-dir/build_dir/dependencies $PRIV_BUSYBOX_URL
434431

hanlon_microkernel/hnl_mk_configuration_manager.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require 'singleton'
88

99
module HanlonMicrokernel
10-
class RzMkConfigurationManager
10+
class HnlMkConfigurationManager
1111
# make this class a singleton class (only want one)
1212
include Singleton
1313

hanlon_microkernel/hnl_mk_fact_manager.rb

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
require 'yaml'
99

1010
module HanlonMicrokernel
11-
class RzMkFactManager
11+
class HnlMkFactManager
1212

1313
attr_accessor :prev_facts_filename
1414
attr_reader :last_saved_timestamp
@@ -56,26 +56,7 @@ def get_mac_id_array
5656
end
5757

5858
def get_uuid
59-
# loop through output of 'lshw -c system' command
60-
%x[sudo lshw -c system].each { |line|
61-
# check for line that includes the configuration (which has the
62-
# uuid value embedded in it)
63-
config_line_val = /^[ ]+configuration:\s+(.+)/.match(line)
64-
if config_line_val && config_line_val[1]
65-
# if got this far, then split the match into elements, each
66-
# of which will look like "name=value"; then look for the
67-
# element who's 'name' is 'uuid'
68-
config_line_val[1].split.each { |elem|
69-
uuid_elem_match = /^uuid=(.+)$/.match(elem)
70-
if uuid_elem_match
71-
# if got this far, we've found a match
72-
return uuid_elem_match[1]
73-
end
74-
}
75-
end
76-
}
77-
# if we got to here, no uuid was found, so return an empty string
78-
''
59+
%x[sudo dmidecode -s system-uuid].chomp
7960
end
8061

8162
end

hanlon_microkernel/hnl_mk_gem_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
require 'singleton'
1010

1111
module HanlonMicrokernel
12-
class RzMkGemController
12+
class HnlMkGemController
1313
# make this class a singleton class (only want one)
1414
include Singleton
1515

0 commit comments

Comments
 (0)