Index: tools/autogen.py
===================================================================
--- tools/autogen.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/autogen.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -85,5 +85,5 @@
 			code = code + ("\temit_constant(%s_%s_ITEM_SIZE, sizeof(%s));\n" %
 			    (struct['name'].upper(), member['name'].upper(), member['type']))
-			
+
 	return code
 
@@ -113,5 +113,5 @@
 	""" % (generate_includes(struct), generate_struct(struct),
 	    generate_probes(struct), name.upper(), typename)
-	
+
 	return code
 
@@ -159,5 +159,5 @@
 		pairs = pairs + [res.group(1, 3)]
 	return pairs
-	
+
 
 def run():
Index: tools/autotool.py
===================================================================
--- tools/autotool.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/autotool.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -93,17 +93,17 @@
 def read_config(fname, config):
 	"Read HelenOS build configuration"
-	
+
 	inf = open(fname, 'r')
-	
+
 	for line in inf:
 		res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line)
 		if (res):
 			config[res.group(1)] = res.group(2)
-	
+
 	inf.close()
 
 def print_error(msg):
 	"Print a bold error message"
-	
+
 	sys.stderr.write("\n")
 	sys.stderr.write("######################################################################\n")
@@ -113,10 +113,10 @@
 	sys.stderr.write("######################################################################\n")
 	sys.stderr.write("\n")
-	
+
 	sys.exit(1)
 
 def print_warning(msg):
 	"Print a bold error message"
-	
+
 	sys.stderr.write("\n")
 	sys.stderr.write("######################################################################\n")
@@ -126,10 +126,10 @@
 	sys.stderr.write("######################################################################\n")
 	sys.stderr.write("\n")
-	
+
 	time.sleep(5)
 
 def sandbox_enter():
 	"Create a temporal sandbox directory for running tests"
-	
+
 	if (os.path.exists(SANDBOX)):
 		if (os.path.isdir(SANDBOX)):
@@ -141,23 +141,23 @@
 			print_error(["Please inspect and remove unexpected directory,",
 			             "entry \"%s\"." % SANDBOX])
-	
+
 	try:
 		os.mkdir(SANDBOX)
 	except:
 		print_error(["Unable to create sandbox directory \"%s\"." % SANDBOX])
-	
+
 	owd = os.getcwd()
 	os.chdir(SANDBOX)
-	
+
 	return owd
 
 def sandbox_leave(owd):
 	"Leave the temporal sandbox directory"
-	
+
 	os.chdir(owd)
 
 def check_config(config, key):
 	"Check whether the configuration key exists"
-	
+
 	if (not key in config):
 		print_error(["Build configuration of HelenOS does not contain %s." % key,
@@ -167,5 +167,5 @@
 def check_common(common, key):
 	"Check whether the common key exists"
-	
+
 	if (not key in common):
 		print_error(["Failed to determine the value %s." % key,
@@ -178,90 +178,90 @@
 	target = None
 	cc_args = []
-	
+
 	if (config['PLATFORM'] == "abs32le"):
 		check_config(config, "CROSS_TARGET")
 		platform = config['CROSS_TARGET']
-		
+
 		if (config['CROSS_TARGET'] == "arm32"):
 			gnu_target = "arm-linux-gnueabi"
 			helenos_target = "arm-helenos-gnueabi"
-		
+
 		if (config['CROSS_TARGET'] == "ia32"):
 			gnu_target = "i686-pc-linux-gnu"
 			helenos_target = "i686-pc-helenos"
-		
+
 		if (config['CROSS_TARGET'] == "mips32"):
 			cc_args.append("-mabi=32")
 			gnu_target = "mipsel-linux-gnu"
 			helenos_target = "mipsel-helenos"
-	
+
 	if (config['PLATFORM'] == "amd64"):
 		platform = config['PLATFORM']
 		gnu_target = "amd64-unknown-elf"
 		helenos_target = "amd64-helenos"
-	
+
 	if (config['PLATFORM'] == "arm32"):
 		platform = config['PLATFORM']
 		gnu_target = "arm-linux-gnueabi"
 		helenos_target = "arm-helenos-gnueabi"
-	
+
 	if (config['PLATFORM'] == "ia32"):
 		platform = config['PLATFORM']
 		gnu_target = "i686-pc-linux-gnu"
 		helenos_target = "i686-pc-helenos"
-	
+
 	if (config['PLATFORM'] == "ia64"):
 		platform = config['PLATFORM']
 		gnu_target = "ia64-pc-linux-gnu"
 		helenos_target = "ia64-pc-helenos"
-	
+
 	if (config['PLATFORM'] == "mips32"):
 		check_config(config, "MACHINE")
 		cc_args.append("-mabi=32")
-		
+
 		if ((config['MACHINE'] == "msim") or (config['MACHINE'] == "lmalta")):
 			platform = config['PLATFORM']
 			gnu_target = "mipsel-linux-gnu"
 			helenos_target = "mipsel-helenos"
-		
+
 		if ((config['MACHINE'] == "bmalta")):
 			platform = "mips32eb"
 			gnu_target = "mips-linux-gnu"
 			helenos_target = "mips-helenos"
-	
+
 	if (config['PLATFORM'] == "mips64"):
 		check_config(config, "MACHINE")
 		cc_args.append("-mabi=64")
-		
+
 		if (config['MACHINE'] == "msim"):
 			platform = config['PLATFORM']
 			gnu_target = "mips64el-linux-gnu"
 			helenos_target = "mips64el-helenos"
-	
+
 	if (config['PLATFORM'] == "ppc32"):
 		platform = config['PLATFORM']
 		gnu_target = "ppc-linux-gnu"
 		helenos_target = "ppc-helenos"
-	
+
 	if (config['PLATFORM'] == "riscv64"):
 		platform = config['PLATFORM']
 		gnu_target = "riscv64-unknown-linux-gnu"
 		helenos_target = "riscv64-helenos"
-	
+
 	if (config['PLATFORM'] == "sparc64"):
 		platform = config['PLATFORM']
 		gnu_target = "sparc64-linux-gnu"
 		helenos_target = "sparc64-helenos"
-	
+
 	if (config['COMPILER'] == "gcc_helenos"):
 		target = helenos_target
 	else:
 		target = gnu_target
-	
+
 	return (platform, cc_args, target)
 
 def check_app(args, name, details):
 	"Check whether an application can be executed"
-	
+
 	try:
 		sys.stderr.write("Checking for %s ... " % args[0])
@@ -273,18 +273,18 @@
 		             "Execution of \"%s\" has failed. Please make sure that it" % " ".join(args),
 		             "is installed in your system (%s)." % details])
-	
+
 	sys.stderr.write("ok\n")
 
 def check_app_alternatives(alts, args, name, details):
 	"Check whether an application can be executed (use several alternatives)"
-	
+
 	tried = []
 	found = None
-	
+
 	for alt in alts:
 		working = True
 		cmdline = [alt] + args
 		tried.append(" ".join(cmdline))
-		
+
 		try:
 			sys.stderr.write("Checking for %s ... " % alt)
@@ -293,10 +293,10 @@
 			sys.stderr.write("failed\n")
 			working = False
-		
+
 		if (working):
 			sys.stderr.write("ok\n")
 			found = alt
 			break
-	
+
 	if (found is None):
 		print_error(["%s is missing." % name,
@@ -306,30 +306,30 @@
 		             "",
 		             "The following alternatives were tried:"] + tried)
-	
+
 	return found
 
 def check_clang(path, prefix, common, details):
 	"Check for clang"
-	
+
 	common['CLANG'] = "%sclang" % prefix
-	
+
 	if (not path is None):
 		common['CLANG'] = "%s/%s" % (path, common['CLANG'])
-	
+
 	check_app([common['CLANG'], "--version"], "clang", details)
 
 def check_gcc(path, prefix, common, details):
 	"Check for GCC"
-	
+
 	common['GCC'] = "%sgcc" % prefix
-	
+
 	if (not path is None):
 		common['GCC'] = "%s/%s" % (path, common['GCC'])
-	
+
 	check_app([common['GCC'], "--version"], "GNU GCC", details)
 
 def check_binutils(path, prefix, common, details):
 	"Check for binutils toolchain"
-	
+
 	common['AS'] = "%sas" % prefix
 	common['LD'] = "%sld" % prefix
@@ -338,9 +338,9 @@
 	common['OBJDUMP'] = "%sobjdump" % prefix
 	common['STRIP'] = "%sstrip" % prefix
-	
+
 	if (not path is None):
 		for key in ["AS", "LD", "AR", "OBJCOPY", "OBJDUMP", "STRIP"]:
 			common[key] = "%s/%s" % (path, common[key])
-	
+
 	check_app([common['AS'], "--version"], "GNU Assembler", details)
 	check_app([common['LD'], "--version"], "GNU Linker", details)
@@ -352,5 +352,5 @@
 def check_python():
 	"Check for Python dependencies"
-	
+
 	try:
 		sys.stderr.write("Checking for PyYAML ... ")
@@ -361,29 +361,29 @@
 		             "Please make sure that it is installed in your",
 		             "system (usually part of PyYAML package)."])
-	
+
 	sys.stderr.write("ok\n")
 
 def decode_value(value):
 	"Decode integer value"
-	
+
 	base = 10
-	
+
 	if ((value.startswith('$')) or (value.startswith('#'))):
 		value = value[1:]
-	
+
 	if (value.startswith('0x')):
 		value = value[2:]
 		base = 16
-	
+
 	return int(value, base)
 
 def probe_compiler(common, typesizes):
 	"Generate, compile and parse probing source"
-	
+
 	check_common(common, "CC")
-	
+
 	outf = open(PROBE_SOURCE, 'w')
 	outf.write(PROBE_HEAD)
-	
+
 	for typedef in typesizes:
 		if 'def' in typedef:
@@ -392,11 +392,11 @@
 		if 'def' in typedef:
 			outf.write("#endif\n")
-	
+
 	outf.write(PROBE_TAIL)
 	outf.close()
-	
+
 	args = common['CC_AUTOGEN'].split(' ')
 	args.extend(["-S", "-o", PROBE_OUTPUT, PROBE_SOURCE])
-	
+
 	try:
 		sys.stderr.write("Checking compiler properties ... ")
@@ -406,5 +406,5 @@
 		print_error(["Error executing \"%s\"." % " ".join(args),
 		             "Make sure that the compiler works properly."])
-	
+
 	if (not os.path.isfile(PROBE_OUTPUT)):
 		sys.stderr.write("failed\n")
@@ -415,21 +415,21 @@
 		             output[0],
 		             output[1]])
-	
+
 	sys.stderr.write("ok\n")
-	
+
 	inf = open(PROBE_OUTPUT, 'r')
 	lines = inf.readlines()
 	inf.close()
-	
+
 	builtins = {}
-	
+
 	for j in range(len(lines)):
 		tokens = lines[j].strip().split("\t")
-		
+
 		if (len(tokens) > 0):
 			if (tokens[0] == "AUTOTOOL_DECLARE"):
 				if (len(tokens) < 8):
 					print_error(["Malformed declaration in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
-				
+
 				category = tokens[1]
 				tag = tokens[2]
@@ -439,5 +439,5 @@
 				size = tokens[6]
 				compatible = tokens[7]
-				
+
 				try:
 					compatible_int = decode_value(compatible)
@@ -445,5 +445,5 @@
 				except:
 					print_error(["Integer value expected in \"%s\" on line %s." % (PROBE_OUTPUT, j), COMPILER_FAIL])
-				
+
 				if (compatible_int == 1):
 					builtins[tag] = {
@@ -454,5 +454,5 @@
 						'size': size_int,
 					}
-	
+
 	for typedef in typesizes:
 		if not typedef['tag'] in builtins:
@@ -461,5 +461,5 @@
 		if 'sname' in typedef:
 			builtins[typedef['tag']]['sname'] = typedef['sname']
-	
+
 	return builtins
 
@@ -490,10 +490,10 @@
 def detect_sizes(probe):
 	"Detect properties of builtin types"
-	
+
 	macros = {}
-	
+
 	for type in probe.values():
 		macros['__SIZEOF_%s__' % type['tag']] = type['size']
-		
+
 		if ('sname' in type):
 			macros['__%s_TYPE__'  % type['sname']] = type['name']
@@ -502,20 +502,20 @@
 			macros['__%s_C_SUFFIX__' % type['sname']] = get_suffix(type)
 			macros['__%s_MAX__' % type['sname']] = "%d%s" % (get_max(type), get_suffix(type))
-	
+
 	if (probe['SIZE_T']['sign'] != 'unsigned'):
 		print_error(['The type size_t is not unsigned.', COMPILER_FAIL])
-	
+
 	return macros
 
 def create_makefile(mkname, common):
 	"Create makefile output"
-	
+
 	outmk = open(mkname, 'w')
-	
+
 	outmk.write('#########################################\n')
 	outmk.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
 	outmk.write('## Generated by: tools/autotool.py     ##\n')
 	outmk.write('#########################################\n\n')
-	
+
 	for key, value in common.items():
 		if (type(value) is list):
@@ -523,25 +523,25 @@
 		else:
 			outmk.write('%s = %s\n' % (key, value))
-	
+
 	outmk.close()
 
 def create_header(hdname, macros):
 	"Create header output"
-	
+
 	outhd = open(hdname, 'w')
-	
+
 	outhd.write('/***************************************\n')
 	outhd.write(' * AUTO-GENERATED FILE, DO NOT EDIT!!! *\n')
 	outhd.write(' * Generated by: tools/autotool.py     *\n')
 	outhd.write(' ***************************************/\n\n')
-	
+
 	outhd.write('#ifndef %s\n' % GUARD)
 	outhd.write('#define %s\n\n' % GUARD)
-	
+
 	for macro in sorted(macros):
 		outhd.write('#ifndef %s\n' % macro)
 		outhd.write('#define %s  %s\n' % (macro, macros[macro]))
 		outhd.write('#endif\n\n')
-	
+
 	outhd.write('\n#endif\n')
 	outhd.close()
@@ -550,5 +550,5 @@
 	config = {}
 	common = {}
-	
+
 	# Read and check configuration
 	if os.path.exists(CONFIG):
@@ -558,9 +558,9 @@
 		             "configuration phase of HelenOS build went OK. Try running",
 		             "\"make config\" again."])
-	
+
 	check_config(config, "PLATFORM")
 	check_config(config, "COMPILER")
 	check_config(config, "BARCH")
-	
+
 	# Cross-compiler prefix
 	if ('CROSS_PREFIX' in os.environ):
@@ -568,5 +568,5 @@
 	else:
 		cross_prefix = "/usr/local/cross"
-	
+
 	# HelenOS cross-compiler prefix
 	if ('CROSS_HELENOS_PREFIX' in os.environ):
@@ -574,5 +574,5 @@
 	else:
 		cross_helenos_prefix = "/usr/local/cross-helenos"
-	
+
 	# Prefix binutils tools on Solaris
 	if (os.uname()[0] == "SunOS"):
@@ -580,7 +580,7 @@
 	else:
 		binutils_prefix = ""
-	
+
 	owd = sandbox_enter()
-	
+
 	try:
 		# Common utilities
@@ -593,13 +593,13 @@
 		check_app(["make", "--version"], "Make utility", "preferably GNU Make")
 		check_app(["unzip"], "unzip utility", "usually part of zip/unzip utilities")
-		
+
 		platform, cc_args, target = get_target(config)
-		
+
 		if (platform is None) or (target is None):
 			print_error(["Unsupported compiler target.",
 				     "Please contact the developers of HelenOS."])
-		
+
 		path = "%s/%s/bin" % (cross_prefix, target)
-		
+
 		# Compatibility with earlier toolchain paths.
 		if not os.path.exists(path):
@@ -614,41 +614,41 @@
 					print_error(["Toolchain for target is not installed, or CROSS_PREFIX is not set correctly."])
 				path = "%s/%s/bin" % (cross_prefix, platform)
-		
+
 		common['TARGET'] = target
 		prefix = "%s-" % target
-		
+
 		# Compiler
 		if (config['COMPILER'] == "gcc_cross" or config['COMPILER'] == "gcc_helenos"):
 			check_gcc(path, prefix, common, PACKAGE_CROSS)
 			check_binutils(path, prefix, common, PACKAGE_CROSS)
-			
+
 			check_common(common, "GCC")
 			common['CC'] = " ".join([common['GCC']] + cc_args)
 			common['CC_AUTOGEN'] = common['CC']
-		
+
 		if (config['COMPILER'] == "gcc_native"):
 			check_gcc(None, "", common, PACKAGE_GCC)
 			check_binutils(None, binutils_prefix, common, PACKAGE_BINUTILS)
-			
+
 			check_common(common, "GCC")
 			common['CC'] = common['GCC']
 			common['CC_AUTOGEN'] = common['CC']
-		
+
 		if (config['COMPILER'] == "clang"):
 			check_binutils(path, prefix, common, PACKAGE_CROSS)
 			check_clang(path, prefix, common, PACKAGE_CLANG)
-			
+
 			check_common(common, "CLANG")
 			common['CC'] = " ".join([common['CLANG']] + cc_args)
 			common['CC_AUTOGEN'] = common['CC'] + " -no-integrated-as"
-			
+
 			if (config['INTEGRATED_AS'] == "yes"):
 				common['CC'] += " -integrated-as"
-			
+
 			if (config['INTEGRATED_AS'] == "no"):
 				common['CC'] += " -no-integrated-as"
-		
+
 		check_python()
-		
+
 		# Platform-specific utilities
 		if ((config['BARCH'] == "amd64") or (config['BARCH'] == "ia32") or (config['BARCH'] == "ppc32") or (config['BARCH'] == "sparc64")):
@@ -656,5 +656,5 @@
 			if common['GENISOIMAGE'] == 'xorriso':
 				common['GENISOIMAGE'] += ' -as genisoimage'
-		
+
 		probe = probe_compiler(common,
 			[
@@ -675,15 +675,15 @@
 			]
 		)
-		
+
 		macros = detect_sizes(probe)
-		
+
 	finally:
 		sandbox_leave(owd)
-	
+
 	common['AUTOGEN'] = "%s/autogen.py" % os.path.dirname(os.path.abspath(sys.argv[0]))
-	
+
 	create_makefile(MAKEFILE, common)
 	create_header(HEADER, macros)
-	
+
 	return 0
 
Index: tools/checkers/clang.py
===================================================================
--- tools/checkers/clang.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/checkers/clang.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -46,25 +46,25 @@
 def clang(root, job):
 	"Run Clang on a jobfile"
-	
+
 	inname = os.path.join(root, job)
-	
+
 	if (not os.path.isfile(inname)):
 		print("Unable to open %s" % inname)
 		print("Did you run \"make precheck\" on the source tree?")
 		return False
-	
+
 	inf = open(inname, "r")
 	records = inf.read().splitlines()
 	inf.close()
-	
+
 	for record in records:
 		arg = jobfile.parse_arg(record)
 		if (not arg):
 			return False
-		
+
 		if (len(arg) < 6):
 			print("Not enough jobfile record arguments")
 			return False
-		
+
 		srcfname = arg[0]
 		tgtfname = arg[1]
@@ -73,14 +73,14 @@
 		base = arg[4]
 		options = arg[5].split()
-		
+
 		srcfqname = os.path.join(base, srcfname)
 		if (not os.path.isfile(srcfqname)):
 			print("Source %s not found" % srcfqname)
 			return False
-		
+
 		# Only C files are interesting for us
 		if (tool != "cc"):
 			continue
-		
+
 		args = ['clang', '-Qunused-arguments', '--analyze',
 			'-Xanalyzer', '-analyzer-opt-analyze-headers',
@@ -88,13 +88,13 @@
 		args.extend(options)
 		args.extend(['-o', tgtfname, srcfname])
-		
+
 		cwd = os.getcwd()
 		os.chdir(base)
 		retval = subprocess.Popen(args).wait()
 		os.chdir(cwd)
-		
+
 		if (retval != 0):
 			return False
-		
+
 	return True
 
@@ -103,13 +103,13 @@
 		usage(sys.argv[0])
 		return
-	
+
 	rootdir = os.path.abspath(sys.argv[1])
 	config = os.path.join(rootdir, "HelenOS.config")
-	
+
 	if (not os.path.isfile(config)):
 		print("%s not found." % config)
 		print("Please specify the path to HelenOS build tree root as the first argument.")
 		return
-	
+
 	for job in jobs:
 		if (not clang(rootdir, job)):
@@ -117,5 +117,5 @@
 			print("Failed job: %s" % job)
 			return
-	
+
 	print
 	print("All jobs passed")
Index: tools/checkers/jobfile.py
===================================================================
--- tools/checkers/jobfile.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/checkers/jobfile.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -32,5 +32,5 @@
 def parse_arg(record):
 	"Parse jobfile line arguments"
-	
+
 	arg = []
 	i = 0
@@ -38,5 +38,5 @@
 	nil = True
 	inside = False
-	
+
 	while (i < len(record)):
 		if (inside):
@@ -56,9 +56,9 @@
 				print("Unexpected '%s'" % record[i])
 				return False
-		
+
 		i += 1
-	
+
 	if (not nil):
 		arg.append(current)
-	
+
 	return arg
Index: tools/checkers/stanse.py
===================================================================
--- tools/checkers/stanse.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/checkers/stanse.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -47,19 +47,19 @@
 def stanse(root, job):
 	"Run Stanse on a jobfile"
-	
+
 	# Convert generic jobfile to Stanse-specific jobfile format
-	
+
 	inname = os.path.join(root, job)
 	outname = os.path.join(root, "_%s" % os.path.basename(job))
-	
+
 	if (not os.path.isfile(inname)):
 		print("Unable to open %s" % inname)
 		print("Did you run \"make precheck\" on the source tree?")
 		return False
-	
+
 	inf = open(inname, "r")
 	records = inf.read().splitlines()
 	inf.close()
-	
+
 	output = []
 	for record in records:
@@ -67,9 +67,9 @@
 		if (not arg):
 			return False
-		
+
 		if (len(arg) < 6):
 			print("Not enough jobfile record arguments")
 			return False
-		
+
 		srcfname = arg[0]
 		tgtfname = arg[1]
@@ -78,27 +78,27 @@
 		base = arg[4]
 		options = arg[5]
-		
+
 		srcfqname = os.path.join(base, srcfname)
 		if (not os.path.isfile(srcfqname)):
 			print("Source %s not found" % srcfqname)
 			return False
-		
+
 		# Only C files are interesting for us
 		if (tool != "cc"):
 			continue
-		
+
 		output.append([srcfname, tgtfname, base, options])
-	
+
 	outf = open(outname, "w")
 	for record in output:
 		outf.write("{%s},{%s},{%s},{%s}\n" % (record[0], record[1], record[2], record[3]))
 	outf.close()
-	
+
 	# Run Stanse
-	
+
 	retval = subprocess.Popen(['stanse', '--checker', 'ReachabilityChecker', '--jobfile', outname]).wait()
-	
+
 	# Cleanup
-	
+
 	os.remove(outname)
 	for record in output:
@@ -106,8 +106,8 @@
 		if (os.path.isfile(tmpfile)):
 			os.remove(tmpfile)
-	
+
 	if (retval == 0):
 		return True
-	
+
 	return False
 
@@ -116,13 +116,13 @@
 		usage(sys.argv[0])
 		return
-	
+
 	rootdir = os.path.abspath(sys.argv[1])
 	config = os.path.join(rootdir, "HelenOS.config")
-	
+
 	if (not os.path.isfile(config)):
 		print("%s not found." % config)
 		print("Please specify the path to HelenOS build tree root as the first argument.")
 		return
-	
+
 	for job in jobs:
 		if (not stanse(rootdir, job)):
@@ -130,5 +130,5 @@
 			print("Failed job: %s" % job)
 			return
-	
+
 	print
 	print("All jobs passed")
Index: tools/checkers/vcc.py
===================================================================
--- tools/checkers/vcc.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/checkers/vcc.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -53,76 +53,76 @@
 def cygpath(upath):
 	"Convert Unix (Cygwin) path to Windows path"
-	
+
 	return subprocess.Popen(['cygpath', '--windows', '--absolute', upath], stdout = subprocess.PIPE).communicate()[0].strip()
 
 def preprocess(srcfname, tmpfname, base, options):
 	"Preprocess source using GCC preprocessor and compatibility tweaks"
-	
+
 	global specification
-	
+
 	args = ['gcc', '-E']
 	args.extend(options.split())
 	args.extend(['-DCONFIG_VERIFY_VCC=1', srcfname])
-	
+
 	# Change working directory
-	
+
 	cwd = os.getcwd()
 	os.chdir(base)
-	
+
 	preproc = subprocess.Popen(args, stdout = subprocess.PIPE).communicate()[0]
-	
+
 	tmpf = open(tmpfname, "w")
 	tmpf.write(specification)
-	
+
 	for line in preproc.splitlines():
-		
+
 		# Ignore preprocessor directives
-		
+
 		if (line.startswith('#')):
 			continue
-		
+
 		# Remove __attribute__((.*)) GCC extension
-		
+
 		line = re.sub(re_attribute, "", line)
-		
+
 		# Ignore unsupported __builtin_va_list type
 		# (a better solution replacing __builrin_va_list with
 		# an emulated implementation is needed)
-		
+
 		line = re.sub(re_va_list, "void *", line)
-		
+
 		tmpf.write("%s\n" % line)
-	
+
 	tmpf.close()
-	
+
 	os.chdir(cwd)
-	
+
 	return True
 
 def vcc(vcc_path, root, job):
 	"Run Vcc on a jobfile"
-	
+
 	# Parse jobfile
-	
+
 	inname = os.path.join(root, job)
-	
+
 	if (not os.path.isfile(inname)):
 		print("Unable to open %s" % inname)
 		print("Did you run \"make precheck\" on the source tree?")
 		return False
-	
+
 	inf = open(inname, "r")
 	records = inf.read().splitlines()
 	inf.close()
-	
+
 	for record in records:
 		arg = jobfile.parse_arg(record)
 		if (not arg):
 			return False
-		
+
 		if (len(arg) < 6):
 			print("Not enough jobfile record arguments")
 			return False
-		
+
 		srcfname = arg[0]
 		tgtfname = arg[1]
@@ -131,48 +131,48 @@
 		base = arg[4]
 		options = arg[5]
-		
+
 		srcfqname = os.path.join(base, srcfname)
 		if (not os.path.isfile(srcfqname)):
 			print("Source %s not found" % srcfqname)
 			return False
-		
+
 		tmpfname = "%s.preproc" % srcfname
 		tmpfqname = os.path.join(base, tmpfname)
-		
+
 		vccfname = "%s.i" % srcfname
 		vccfqname = os.path.join(base, vccfname);
-		
+
 		# Only C files are interesting for us
 		if (tool != "cc"):
 			continue
-		
+
 		# Preprocess sources
-		
+
 		if (not preprocess(srcfname, tmpfname, base, options)):
 			return False
-		
+
 		# Run Vcc
 		print(" -- %s --" % srcfname)
 		retval = subprocess.Popen([vcc_path, '/pointersize:32', '/newsyntax', cygpath(tmpfqname)]).wait()
-		
+
 		if (retval != 0):
 			return False
-		
+
 		# Cleanup, but only if verification was successful
 		# (to be able to examine the preprocessed file)
-		
+
 		if (os.path.isfile(tmpfqname)):
 			os.remove(tmpfqname)
 			os.remove(vccfqname)
-	
+
 	return True
 
 def main():
 	global specification
-	
+
 	if (len(sys.argv) < 2):
 		usage(sys.argv[0])
 		return
-	
+
 	rootdir = os.path.abspath(sys.argv[1])
 	if (len(sys.argv) > 2):
@@ -180,26 +180,26 @@
 	else:
 		vcc_path = "/cygdrive/c/Program Files (x86)/Microsoft Research/Vcc/Binaries/vcc"
-	
+
 	if (not os.path.isfile(vcc_path)):
 		print("%s is not a binary." % vcc_path)
 		print("Please supply the full Cygwin path to Vcc as the second argument.")
 		return
-	
+
 	config = os.path.join(rootdir, "HelenOS.config")
-	
+
 	if (not os.path.isfile(config)):
 		print("%s not found." % config)
 		print("Please specify the path to HelenOS build tree root as the first argument.")
 		return
-	
+
 	specpath = os.path.join(rootdir, "tools/checkers/vcc.h")
 	if (not os.path.isfile(specpath)):
 		print("%s not found." % config)
 		return
-	
+
 	specfile = file(specpath, "r")
 	specification = specfile.read()
 	specfile.close()
-	
+
 	for job in jobs:
 		if (not vcc(vcc_path, rootdir, job)):
@@ -207,5 +207,5 @@
 			print("Failed job: %s" % job)
 			return
-	
+
 	print()
 	print("All jobs passed")
Index: tools/config.py
===================================================================
--- tools/config.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/config.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -49,61 +49,61 @@
 def read_config(fname, config):
 	"Read saved values from last configuration run or a preset file"
-	
+
 	inf = open(fname, 'r')
-	
+
 	for line in inf:
 		res = re.match(r'^(?:#!# )?([^#]\w*)\s*=\s*(.*?)\s*$', line)
 		if res:
 			config[res.group(1)] = res.group(2)
-	
+
 	inf.close()
 
 def check_condition(text, config, rules):
 	"Check that the condition specified on input line is True (only CNF and DNF is supported)"
-	
+
 	ctype = 'cnf'
-	
+
 	if (')|' in text) or ('|(' in text):
 		ctype = 'dnf'
-	
+
 	if ctype == 'cnf':
 		conds = text.split('&')
 	else:
 		conds = text.split('|')
-	
+
 	for cond in conds:
 		if cond.startswith('(') and cond.endswith(')'):
 			cond = cond[1:-1]
-		
+
 		inside = check_inside(cond, config, ctype)
-		
+
 		if (ctype == 'cnf') and (not inside):
 			return False
-		
+
 		if (ctype == 'dnf') and inside:
 			return True
-	
+
 	if ctype == 'cnf':
 		return True
-	
+
 	return False
 
 def check_inside(text, config, ctype):
 	"Check for condition"
-	
+
 	if ctype == 'cnf':
 		conds = text.split('|')
 	else:
 		conds = text.split('&')
-	
+
 	for cond in conds:
 		res = re.match(r'^(.*?)(!?=)(.*)$', cond)
 		if not res:
 			raise RuntimeError("Invalid condition: %s" % cond)
-		
+
 		condname = res.group(1)
 		oper = res.group(2)
 		condval = res.group(3)
-		
+
 		if not condname in config:
 			varval = ''
@@ -112,9 +112,9 @@
 			if (varval == '*'):
 				varval = 'y'
-		
+
 		if ctype == 'cnf':
 			if (oper == '=') and (condval == varval):
 				return True
-		
+
 			if (oper == '!=') and (condval != varval):
 				return True
@@ -122,74 +122,74 @@
 			if (oper == '=') and (condval != varval):
 				return False
-			
+
 			if (oper == '!=') and (condval == varval):
 				return False
-	
+
 	if ctype == 'cnf':
 		return False
-	
+
 	return True
 
 def parse_rules(fname, rules):
 	"Parse rules file"
-	
+
 	inf = open(fname, 'r')
-	
+
 	name = ''
 	choices = []
-	
+
 	for line in inf:
-		
+
 		if line.startswith('!'):
 			# Ask a question
 			res = re.search(r'!\s*(?:\[(.*?)\])?\s*([^\s]+)\s*\((.*)\)\s*$', line)
-			
+
 			if not res:
 				raise RuntimeError("Weird line: %s" % line)
-			
+
 			cond = res.group(1)
 			varname = res.group(2)
 			vartype = res.group(3)
-			
+
 			rules.append((varname, vartype, name, choices, cond))
 			name = ''
 			choices = []
 			continue
-		
+
 		if line.startswith('@'):
 			# Add new line into the 'choices' array
 			res = re.match(r'@\s*(?:\[(.*?)\])?\s*"(.*?)"\s*(.*)$', line)
-			
+
 			if not res:
 				raise RuntimeError("Bad line: %s" % line)
-			
+
 			choices.append((res.group(2), res.group(3)))
 			continue
-		
+
 		if line.startswith('%'):
 			# Name of the option
 			name = line[1:].strip()
 			continue
-		
+
 		if line.startswith('#') or (line == '\n'):
 			# Comment or empty line
 			continue
-		
-		
+
+
 		raise RuntimeError("Unknown syntax: %s" % line)
-	
+
 	inf.close()
 
 def yes_no(default):
 	"Return '*' if yes, ' ' if no"
-	
+
 	if default == 'y':
 		return '*'
-	
+
 	return ' '
 
 def subchoice(screen, name, choices, default):
 	"Return choice of choices"
-	
+
 	maxkey = 0
 	for key, val in choices:
@@ -197,5 +197,5 @@
 		if (length > maxkey):
 			maxkey = length
-	
+
 	options = []
 	position = None
@@ -204,13 +204,13 @@
 		if (default) and (key == default):
 			position = cnt
-		
+
 		options.append(" %-*s  %s " % (maxkey, key, val))
 		cnt += 1
-	
+
 	(button, value) = xtui.choice_window(screen, name, 'Choose value', options, position)
-	
+
 	if button == 'cancel':
 		return None
-	
+
 	return choices[value][0]
 
@@ -228,21 +228,21 @@
 def infer_verify_choices(config, rules):
 	"Infer and verify configuration values."
-	
+
 	for rule in rules:
 		varname, vartype, name, choices, cond = rule
-		
+
 		if cond and (not check_condition(cond, config, rules)):
 			continue
-		
+
 		if not varname in config:
 			value = None
 		else:
 			value = config[varname]
-		
+
 		if not validate_rule_value(rule, value):
 			value = None
-		
+
 		default = get_default_rule(rule)
-		
+
 		#
 		# If we don't have a value but we do have
@@ -252,8 +252,8 @@
 			value = default
 			config[varname] = default
-		
+
 		if not varname in config:
 			return False
-	
+
 	return True
 
@@ -275,5 +275,5 @@
 	if start_index >= len(rules):
 		return True
-	
+
 	varname, vartype, name, choices, cond = rules[start_index]
 
@@ -282,10 +282,10 @@
 		if not check_condition(cond, config, rules):
 			return random_choices(config, rules, start_index + 1)
-	
+
 	# Remember previous choices for backtracking
 	yes_no = 0
 	choices_indexes = range(0, len(choices))
 	random.shuffle(choices_indexes)
-	
+
 	# Remember current configuration value
 	old_value = None
@@ -294,5 +294,5 @@
 	except KeyError:
 		old_value = None
-	
+
 	# For yes/no choices, we ran the loop at most 2 times, for select
 	# choices as many times as there are options.
@@ -320,13 +320,13 @@
 		else:
 			raise RuntimeError("Unknown variable type: %s" % vartype)
-	
+
 		config[varname] = value
-		
+
 		ok = random_choices(config, rules, start_index + 1)
 		if ok:
 			return True
-		
+
 		try_counter = try_counter + 1
-	
+
 	# Restore the old value and backtrack
 	# (need to delete to prevent "ghost" variables that do not exist under
@@ -335,14 +335,14 @@
 	if old_value is None:
 		del config[varname]
-	
+
 	return random_choices(config, rules, start_index + 1)
-	
+
 
 ## Get default value from a rule.
 def get_default_rule(rule):
 	varname, vartype, name, choices, cond = rule
-	
+
 	default = None
-	
+
 	if vartype == 'choice':
 		# If there is just one option, use it
@@ -359,5 +359,5 @@
 	else:
 		raise RuntimeError("Unknown variable type: %s" % vartype)
-	
+
 	return default
 
@@ -371,7 +371,7 @@
 def get_rule_option(rule, value):
 	varname, vartype, name, choices, cond = rule
-	
+
 	option = None
-	
+
 	if vartype == 'choice':
 		# If there is just one option, don't ask
@@ -391,5 +391,5 @@
 	else:
 		raise RuntimeError("Unknown variable type: %s" % vartype)
-	
+
 	return option
 
@@ -403,8 +403,8 @@
 def validate_rule_value(rule, value):
 	varname, vartype, name, choices, cond = rule
-	
+
 	if value == None:
 		return True
-	
+
 	if vartype == 'choice':
 		if not value in [choice[0] for choice in choices]:
@@ -424,20 +424,20 @@
 	else:
 		raise RuntimeError("Unknown variable type: %s" % vartype)
-	
+
 	return True
 
 def preprocess_config(config, rules):
 	"Preprocess configuration"
-	
+
 	varname_mode = 'CONFIG_BFB_MODE'
 	varname_width = 'CONFIG_BFB_WIDTH'
 	varname_height = 'CONFIG_BFB_HEIGHT'
-	
+
 	if varname_mode in config:
 		mode = config[varname_mode].partition('x')
-		
+
 		config[varname_width] = mode[0]
 		rules.append((varname_width, 'choice', 'Default framebuffer width', None, None))
-		
+
 		config[varname_height] = mode[2]
 		rules.append((varname_height, 'choice', 'Default framebuffer height', None, None))
@@ -445,8 +445,8 @@
 def create_output(mkname, mcname, config, rules):
 	"Create output configuration"
-	
+
 	varname_strip = 'CONFIG_STRIP_REVISION_INFO'
 	strip_rev_info = (varname_strip in config) and (config[varname_strip] == 'y')
-	
+
 	if strip_rev_info:
 		timestamp_unix = int(0)
@@ -454,9 +454,9 @@
 		# TODO: Use commit timestamp instead of build time.
 		timestamp_unix = int(time.time())
-	
+
 	timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(timestamp_unix))
-	
+
 	sys.stderr.write("Fetching current revision identifier ... ")
-	
+
 	try:
 		version = subprocess.Popen(['git', 'log', '-1', '--pretty=%h'], stdout = subprocess.PIPE).communicate()[0].decode().strip()
@@ -465,29 +465,29 @@
 		version = None
 		sys.stderr.write("failed\n")
-	
+
 	if (not strip_rev_info) and (version is not None):
 		revision = version
 	else:
 		revision = None
-	
+
 	outmk = open(mkname, 'w')
 	outmc = open(mcname, 'w')
-	
+
 	outmk.write('#########################################\n')
 	outmk.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
 	outmk.write('## Generated by: tools/config.py       ##\n')
 	outmk.write('#########################################\n\n')
-	
+
 	outmc.write('/***************************************\n')
 	outmc.write(' * AUTO-GENERATED FILE, DO NOT EDIT!!! *\n')
 	outmc.write(' * Generated by: tools/config.py       *\n')
 	outmc.write(' ***************************************/\n\n')
-	
+
 	defs = 'CONFIG_DEFS ='
-	
+
 	for varname, vartype, name, choices, cond in rules:
 		if cond and (not check_condition(cond, config, rules)):
 			continue
-		
+
 		if not varname in config:
 			value = ''
@@ -496,7 +496,7 @@
 			if (value == '*'):
 				value = 'y'
-		
+
 		outmk.write('# %s\n%s = %s\n\n' % (name, varname, value))
-		
+
 		if vartype in ["y", "n", "y/n", "n/y"]:
 			if value == "y":
@@ -506,20 +506,20 @@
 			outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, value, varname, value))
 			defs += ' -D%s=%s -D%s_%s' % (varname, value, varname, value)
-	
+
 	if revision is not None:
 		outmk.write('REVISION = %s\n' % revision)
 		outmc.write('#define REVISION %s\n' % revision)
 		defs += ' "-DREVISION=%s"' % revision
-	
+
 	outmk.write('TIMESTAMP_UNIX = %d\n' % timestamp_unix)
 	outmc.write('#define TIMESTAMP_UNIX %d\n' % timestamp_unix)
 	defs += ' "-DTIMESTAMP_UNIX=%d"\n' % timestamp_unix
-	
+
 	outmk.write('TIMESTAMP = %s\n' % timestamp)
 	outmc.write('#define TIMESTAMP %s\n' % timestamp)
 	defs += ' "-DTIMESTAMP=%s"\n' % timestamp
-	
+
 	outmk.write(defs)
-	
+
 	outmk.close()
 	outmc.close()
@@ -536,18 +536,18 @@
 	opt2path = {}
 	cnt = 0
-	
+
 	# Look for profiles
 	for name in sorted_dir(root):
 		path = os.path.join(root, name)
 		canon = os.path.join(path, fname)
-		
+
 		if os.path.isdir(path) and os.path.exists(canon) and os.path.isfile(canon):
 			subprofile = False
-			
+
 			# Look for subprofiles
 			for subname in sorted_dir(path):
 				subpath = os.path.join(path, subname)
 				subcanon = os.path.join(subpath, fname)
-				
+
 				if os.path.isdir(subpath) and os.path.exists(subcanon) and os.path.isfile(subcanon):
 					subprofile = True
@@ -555,15 +555,15 @@
 					opt2path[cnt] = [name, subname]
 					cnt += 1
-			
+
 			if not subprofile:
 				options.append(name)
 				opt2path[cnt] = [name]
 				cnt += 1
-	
+
 	(button, value) = xtui.choice_window(screen, 'Load preconfigured defaults', 'Choose configuration profile', options, None)
-	
+
 	if button == 'cancel':
 		return None
-	
+
 	return opt2path[value]
 
@@ -576,5 +576,5 @@
 	path = os.path.join(PRESETS_DIR, profile[0], MAKEFILE)
 	read_config(path, config)
-	
+
 	if len(profile) > 1:
 		path = os.path.join(PRESETS_DIR, profile[0], profile[1], MAKEFILE)
@@ -588,9 +588,9 @@
 def parse_profile_name(profile_name):
 	profile = []
-	
+
 	head, tail = os.path.split(profile_name)
 	if head != '':
 		profile.append(head)
-	
+
 	profile.append(tail)
 	return profile
@@ -600,8 +600,8 @@
 	config = {}
 	rules = []
-	
+
 	# Parse rules file
 	parse_rules(RULES_FILE, rules)
-	
+
 	# Input configuration file can be specified on command line
 	# otherwise configuration from previous run is used.
@@ -611,5 +611,5 @@
 	elif os.path.exists(MAKEFILE):
 		read_config(MAKEFILE, config)
-	
+
 	# Default mode: check values and regenerate configuration files
 	if (len(sys.argv) >= 3) and (sys.argv[2] == 'default'):
@@ -618,5 +618,5 @@
 			create_output(MAKEFILE, MACROS, config, rules)
 			return 0
-	
+
 	# Hands-off mode: check values and regenerate configuration files,
 	# but no interactive fallback
@@ -627,13 +627,13 @@
 			sys.stderr.write("Configuration error: No presets specified\n")
 			return 2
-		
+
 		if (infer_verify_choices(config, rules)):
 			preprocess_config(config, rules)
 			create_output(MAKEFILE, MACROS, config, rules)
 			return 0
-		
+
 		sys.stderr.write("Configuration error: The presets are ambiguous\n")
 		return 1
-	
+
 	# Check mode: only check configuration
 	if (len(sys.argv) >= 3) and (sys.argv[2] == 'check'):
@@ -641,5 +641,5 @@
 			return 0
 		return 1
-	
+
 	# Random mode
 	if (len(sys.argv) == 3) and (sys.argv[2] == 'random'):
@@ -653,7 +653,7 @@
 		preprocess_config(config, rules)
 		create_output(MAKEFILE, MACROS, config, rules)
-		
+
 		return 0
-	
+
 	screen = xtui.screen_init()
 	try:
@@ -661,35 +661,35 @@
 		position = None
 		while True:
-			
+
 			# Cancel out all values which have to be deduced
 			for varname, vartype, name, choices, cond in rules:
 				if (vartype == 'y') and (varname in config) and (config[varname] == '*'):
 					config[varname] = None
-			
+
 			options = []
 			opt2row = {}
 			cnt = 1
-			
+
 			options.append("  --- Load preconfigured defaults ... ")
-			
+
 			for rule in rules:
 				varname, vartype, name, choices, cond = rule
-				
+
 				if cond and (not check_condition(cond, config, rules)):
 					continue
-				
+
 				if varname == selname:
 					position = cnt
-				
+
 				if not varname in config:
 					value = None
 				else:
 					value = config[varname]
-				
+
 				if not validate_rule_value(rule, value):
 					value = None
-				
+
 				default = get_default_rule(rule)
-				
+
 				#
 				# If we don't have a value but we do have
@@ -699,5 +699,5 @@
 					value = default
 					config[varname] = default
-				
+
 				option = get_rule_option(rule, value)
 				if option != None:
@@ -705,17 +705,17 @@
 				else:
 					continue
-				
+
 				opt2row[cnt] = (varname, vartype, name, choices)
-				
+
 				cnt += 1
-			
+
 			if (position != None) and (position >= len(options)):
 				position = None
-			
+
 			(button, value) = xtui.choice_window(screen, 'HelenOS configuration', 'Choose configuration option', options, position)
-			
+
 			if button == 'cancel':
 				return 'Configuration canceled'
-			
+
 			if button == 'done':
 				if (infer_verify_choices(config, rules)):
@@ -724,5 +724,5 @@
 					xtui.error_dialog(screen, 'Error', 'Some options have still undefined values. These options are marked with the "?" sign.')
 					continue
-			
+
 			if value == 0:
 				profile = choose_profile(PRESETS_DIR, MAKEFILE, screen, config)
@@ -731,16 +731,16 @@
 				position = 1
 				continue
-			
+
 			position = None
 			if not value in opt2row:
 				raise RuntimeError("Error selecting value: %s" % value)
-			
+
 			(selname, seltype, name, choices) = opt2row[value]
-			
+
 			if not selname in config:
 				value = None
 			else:
 				value = config[selname]
-			
+
 			if seltype == 'choice':
 				config[selname] = subchoice(screen, name, choices, value)
@@ -752,5 +752,5 @@
 	finally:
 		xtui.screen_done(screen)
-	
+
 	preprocess_config(config, rules)
 	create_output(MAKEFILE, MACROS, config, rules)
Index: tools/dest_build.py
===================================================================
--- tools/dest_build.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/dest_build.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -42,9 +42,9 @@
 def duplicate_tree(src_path, dest_path, current):
 	"Duplicate source directory tree in the destination path"
-	
+
 	for name in os.listdir(os.path.join(src_path, current)):
 		if name in exclude_names:
 			next
-		
+
 		following = os.path.join(current, name)
 		src = os.path.join(src_path, following)
@@ -52,18 +52,18 @@
 		dest_parent = os.path.join(dest_path, current)
 		dest_stat = os.stat(src)
-		
+
 		# Create shadow directories
 		if stat.S_ISDIR(dest_stat.st_mode):
 			if not os.path.exists(dest):
 				os.mkdir(dest)
-			
+
 			if not os.path.isdir(dest):
 				raise IOError(errno.ENOTDIR, "Destination path exists, but is not a directory", dest)
-			
+
 			duplicate_tree(src_path, dest_path, following)
 		else:
 			# Compute the relative path from destination to source
 			relative = os.path.relpath(src, dest_parent)
-			
+
 			# Create symlink
 			if not os.path.exists(dest):
@@ -78,5 +78,5 @@
 		usage(sys.argv[0])
 		return 1
-	
+
 	# Source tree path
 	src_path = os.path.abspath(sys.argv[1])
@@ -84,22 +84,22 @@
 		print("<SRC_PATH> must be a directory")
 		return 2
-	
+
 	# Destination tree path
 	dest_path = os.path.abspath(sys.argv[2])
 	if not os.path.exists(dest_path):
 		os.mkdir(dest_path)
-	
+
 	if not os.path.isdir(dest_path):
 		print("<DEST_PATH> must be a directory")
 		return 3
-	
+
 	# Duplicate source directory tree
 	duplicate_tree(src_path, dest_path, "")
-	
+
 	# Run the build from the destination tree
 	os.chdir(dest_path)
 	args = ["make"]
 	args.extend(sys.argv[3:])
-	
+
 	return subprocess.Popen(args).wait()
 
Index: tools/ew.py
===================================================================
--- tools/ew.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/ew.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -76,5 +76,5 @@
 def pc_options(guest_width):
 	opts = ''
-	
+
 	# Do not enable KVM if running 64 bits HelenOS
 	# on 32 bits host
@@ -82,5 +82,5 @@
 	if guest_width <= host_width and not is_override('nokvm'):
 		opts = opts + ' -enable-kvm'
-	
+
 	# Remove the leading space
 	return opts[1:]
@@ -132,7 +132,7 @@
 	if is_override('nohdd'):
 		return ''
-	
+
 	hdisk_mk()
-	
+
 	return ' -drive file=hdisk.img,index=0,media=disk,format=raw'
 
@@ -208,5 +208,5 @@
 	if (not 'audio' in cfg.keys()) or cfg['audio']:
 		cmdline += qemu_audio_options()
-	
+
 	if cfg['image'] == 'image.iso':
 		cmdline += ' -boot d -cdrom image.iso'
@@ -328,5 +328,5 @@
 def fail(platform, machine):
 	print("Cannot start emulation for the chosen configuration. (%s/%s)" % (platform, machine))
-	
+
 
 def run():
Index: tools/imgutil.py
===================================================================
--- tools/imgutil.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/imgutil.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -40,21 +40,21 @@
 def align_up(size, alignment):
 	"Return size aligned up to alignment"
-	
+
 	if (size % alignment == 0):
 		return size
-	
+
 	return ((size // alignment) + 1) * alignment
 
 def count_up(size, alignment):
 	"Return units necessary to fit the size"
-	
+
 	if (size % alignment == 0):
 		return (size // alignment)
-	
+
 	return ((size // alignment) + 1)
 
 def num_of_trailing_bin_zeros(num):
 	"Return number of trailing zeros in binary representation"
-	
+
 	i = 0
 	if (num == 0): raise ValueError()
@@ -66,15 +66,15 @@
 def get_bit(number, n):
 	"Return True if n-th least-significant bit is set in the given number"
-	
+
 	return bool((number >> n) & 1)
 
 def set_bit(number, n):
 	"Return the number with n-th least-significant bit set"
-	
+
 	return number | (1 << n)
 
 class ItemToPack:
 	"Stores information about one directory item to be added to the image"
-	
+
 	def __init__(self, parent, name):
 		self.parent = parent
@@ -88,26 +88,26 @@
 def listdir_items(path):
 	"Return a list of items to be packed inside a fs image"
-	
+
 	for name in os.listdir(path):
 		if name in exclude_names:
 			continue
-		
+
 		item = ItemToPack(path, name)
-		
+
 		if not (item.is_dir or item.is_file):
 			continue
-		
+
 		yield item
 
 def chunks(item, chunk_size):
 	"Iterate contents of a file in chunks of a given size"
-	
+
 	inf = open(item.path, 'rb')
 	rd = 0
-	
+
 	while (rd < item.size):
 		data = bytes(inf.read(chunk_size))
 		yield data
 		rd += len(data)
-	
+
 	inf.close()
Index: tools/jobfile.py
===================================================================
--- tools/jobfile.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/jobfile.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -44,5 +44,5 @@
 		usage(sys.argv[0])
 		return
-	
+
 	jobfname = sys.argv[1]
 	ccname = sys.argv[2]
@@ -53,17 +53,17 @@
 	options = " ".join(sys.argv[6:])
 	cwd = os.getcwd()
-	
+
 	if srcfname.endswith(".c"):
 		toolname = "cc"
 		category = "core"
-	
+
 	if srcfname.endswith(".s"):
 		toolname = "as"
 		category = "asm"
-	
+
 	if srcfname.endswith(".S"):
 		toolname = "as"
 		category = "asm/preproc"
-	
+
 	jobfile = open(jobfname, "a")
 	fcntl.lockf(jobfile, fcntl.LOCK_EX)
@@ -71,5 +71,5 @@
 	fcntl.lockf(jobfile, fcntl.LOCK_UN)
 	jobfile.close()
-	
+
 	# Run the compiler proper.
 	os.execvp(ccname, sys.argv[2:])
Index: tools/mkarray.py
===================================================================
--- tools/mkarray.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/mkarray.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -57,5 +57,5 @@
 def main():
 	arg_check()
-	
+
 	if sys.argv[1] == "--deflate":
 		sys.argv.pop(1)
@@ -64,34 +64,34 @@
 	else:
 		compress = False
-	
+
 	dest = sys.argv[1]
 	label = sys.argv[2]
 	as_prolog = sys.argv[3]
 	section = sys.argv[4]
-	
+
 	timestamp = (1980, 1, 1, 0, 0, 0)
-	
+
 	header_ctx = []
 	desc_ctx = []
 	size_ctx = []
 	data_ctx = []
-	
+
 	src_cnt = 0
-	
+
 	archive = zipfile.ZipFile("%s.zip" % dest, "w", zipfile.ZIP_STORED)
-	
+
 	for src in sys.argv[5:]:
 		basename = os.path.basename(src)
 		plainname = os.path.splitext(basename)[0]
 		symbol = basename.replace(".", "_")
-		
+
 		print("%s -> %s" % (src, symbol))
-		
+
 		src_in = open(src, "rb")
 		src_data = src_in.read()
 		src_in.close()
-		
+
 		length = len(src_data)
-		
+
 		if compress:
 			src_data = deflate(src_data)
@@ -101,13 +101,13 @@
 		else:
 			src_fname = src
-		
+
 		if sys.version_info < (3,):
 			src_data = bytearray(src_data)
-		
+
 		length_out = len(src_data)
-		
+
 		header_ctx.append("extern uint8_t %s[];" % symbol)
 		header_ctx.append("extern size_t %s_size;" % symbol)
-		
+
 		data_ctx.append(".globl %s" % symbol)
 		data_ctx.append(".balign 8")
@@ -115,5 +115,5 @@
 		data_ctx.append("%s:" % symbol)
 		data_ctx.append("\t.incbin \"%s\"\n" % src_fname)
-		
+
 		desc_field = []
 		desc_field.append("\t{")
@@ -122,18 +122,18 @@
 		desc_field.append("\t\t.size = %u," % length_out)
 		desc_field.append("\t\t.inflated = %u," % length)
-		
+
 		if compress:
 			desc_field.append("\t\t.compressed = true")
 		else:
 			desc_field.append("\t\t.compressed = false")
-		
+
 		desc_field.append("\t}")
-		
+
 		desc_ctx.append("\n".join(desc_field))
-		
+
 		size_ctx.append("size_t %s_size = %u;" % (symbol, length_out))
-		
+
 		src_cnt += 1
-	
+
 	data = ''
 	data += '/***************************************\n'
@@ -160,5 +160,5 @@
 	zipinfo = zipfile.ZipInfo("%s.h" % dest, timestamp)
 	archive.writestr(zipinfo, data)
-	
+
 	data = ''
 	data += '/***************************************\n'
@@ -172,5 +172,5 @@
 	zipinfo = zipfile.ZipInfo("%s.s" % dest, timestamp)
 	archive.writestr(zipinfo, data)
-	
+
 	data = ''
 	data += '/***************************************\n'
@@ -187,5 +187,5 @@
 	zipinfo = zipfile.ZipInfo("%s_desc.c" % dest, timestamp)
 	archive.writestr(zipinfo, data)
-	
+
 	archive.close()
 
Index: tools/mkext2.py
===================================================================
--- tools/mkext2.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/mkext2.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -77,5 +77,5 @@
 	uint32_t rev_major            /* Major revision level */
 	padding[4] /* default reserved uid and gid */
-	
+
 	/* Following is for ext2 revision 1 only */
 	uint32_t first_inode
@@ -130,5 +130,5 @@
 	def __init__(self, filename, block_groups, blocks_per_group, inodes_per_group, block_size, inode_size, reserved_inode_count):
 		"Initialize the filesystem writer"
-		
+
 		outf = open(filename, "w+b")
 		# Set the correct size of the image, so that we can read arbitrary position
@@ -172,8 +172,8 @@
 		lpf_dir.add(self.root_inode.as_dirent('..'))
 		lpf_dir.finish()
-	
+
 	def init_gdt(self):
 		"Initialize block group descriptor table"
-		
+
 		self.superblock_positions = []
 		self.gdt = []
@@ -202,13 +202,13 @@
 			gde.directory_inode_count = 0
 			self.gdt.append(gde)
-	
+
 	def mark_block_cb(self, block):
 		"Called after a block has been allocated"
-		
+
 		self.gdt[block // self.blocks_per_group].free_block_count -= 1
-	
+
 	def mark_inode_cb(self, index, directory=False):
 		"Called after an inode has been allocated"
-		
+
 		index -= 1
 		gde = self.gdt[index // self.inodes_per_group]
@@ -216,15 +216,15 @@
 		if directory:
 			gde.directory_inode_count += 1
-	
+
 	def seek_to_block(self, block, offset=0):
 		"Seek to offset bytes after the start of the given block"
-		
+
 		if offset < 0 or offset > self.block_size:
 			raise Exception("Invalid in-block offset")
 		self.outf.seek(block * self.block_size + offset)
-	
+
 	def seek_to_inode(self, index):
 		"Seek to the start of the inode structure for the inode number index"
-		
+
 		index -= 1
 		if index < 0:
@@ -235,12 +235,12 @@
 		block = base_block + (offset // self.block_size)
 		self.seek_to_block(block, offset % self.block_size)
-	
+
 	def subtree_add(self, inode, parent_inode, dirpath, is_root=False):
 		"Recursively add files to the filesystem"
-		
+
 		dir_writer = DirWriter(inode)
 		dir_writer.add(inode.as_dirent('.'))
 		dir_writer.add(parent_inode.as_dirent('..'))
-		
+
 		if is_root:
 			dir_writer.add(self.lost_plus_found.as_dirent('lost+found'))
@@ -255,13 +255,13 @@
 				child_inode = Inode(self, newidx, Inode.TYPE_DIR)
 				self.subtree_add(child_inode, inode, item.path)
-		
+
 			dir_writer.add(child_inode.as_dirent(item.name))
 			self.write_inode(child_inode)
 
 		dir_writer.finish()
-	
+
 	def write_inode(self, inode):
 		"Write inode information into the inode table"
-		
+
 		self.seek_to_inode(inode.index)
 		self.outf.write(inode.pack())
@@ -269,13 +269,13 @@
 	def write_gdt(self):
 		"Write group descriptor table at the current file position"
-		
+
 		for gde in self.gdt:
 			data = bytes(gde.pack())
 			self.outf.write(data)
 			self.outf.seek(GDE_SIZE-len(data), os.SEEK_CUR)
-	
+
 	def write_superblock(self, block_group):
 		"Write superblock at the current position"
-		
+
 		sb = xstruct.create(STRUCT_SUPERBLOCK)
 		sb.total_inode_count = self.total_inode_count
@@ -312,33 +312,33 @@
 		sb.volume_name = 'HelenOS rdimage\0'
 		self.outf.write(bytes(sb.pack()))
-	
+
 	def write_all_metadata(self):
 		"Write superblocks, block group tables, block and inode bitmaps"
-		
+
 		bbpg = self.blocks_per_group // 8
 		bipg = self.inodes_per_group // 8
 		def window(arr, index, size):
 			return arr[index * size:(index + 1) * size]
-		
+
 		for bg_index in xrange(len(self.gdt)):
 			sbpos = self.superblock_positions[bg_index]
 			sbblock = (sbpos + 1023) // self.block_size
 			gde = self.gdt[bg_index]
-			
+
 			self.outf.seek(sbpos)
 			self.write_superblock(bg_index)
-			
+
 			self.seek_to_block(sbblock+1)
 			self.write_gdt()
-			
+
 			self.seek_to_block(gde.block_bitmap_block)
 			self.outf.write(window(self.block_allocator.bitmap, bg_index, bbpg))
-			
+
 			self.seek_to_block(gde.inode_bitmap_block)
 			self.outf.write(window(self.inode_allocator.bitmap, bg_index, bipg))
-	
+
 	def close(self):
 		"Write all remaining data to the filesystem and close the file"
-		
+
 		self.write_inode(self.root_inode)
 		self.write_inode(self.lost_plus_found)
@@ -354,14 +354,14 @@
 		self.bitmap = array.array('B', [0] * (count // 8))
 		self.mark_cb = None
-	
+
 	def __contains__(self, item):
 		"Check if the item is already used"
-		
+
 		bitidx = item - self.base
 		return get_bit(self.bitmap[bitidx // 8], bitidx % 8)
-	
+
 	def alloc(self, **options):
 		"Allocate a new item"
-		
+
 		while self.nextidx < self.count and (self.base + self.nextidx) in self:
 			self.nextidx += 1
@@ -372,8 +372,8 @@
 		self.mark_used(item, **options)
 		return item
-	
+
 	def mark_used(self, item, **options):
 		"Mark the specified item as used"
-		
+
 		bitidx = item - self.base
 		if item in self:
@@ -384,8 +384,8 @@
 		if self.mark_cb:
 			self.mark_cb(item, **options)
-	
+
 	def mark_used_all(self, items, **options):
 		"Mark all specified items as used"
-		
+
 		for item in items:
 			self.mark_used(item, **options)
@@ -395,5 +395,5 @@
 	TYPE_DIR = 2
 	TYPE2MODE = {TYPE_FILE: 8, TYPE_DIR: 4}
-	
+
 	def __init__(self, fs, index, typ):
 		self.fs = fs
@@ -406,34 +406,34 @@
 		self.type = typ
 		self.refcount = 0
-	
+
 	def as_dirent(self, name):
 		"Return a DirEntry corresponding to this inode"
 		self.refcount += 1
 		return DirEntry(name, self.index, self.type)
-	
+
 	def new_block(self, data=True):
 		"Get a new block index from allocator and count it here as belonging to the file"
-		
+
 		block = self.fs.block_allocator.alloc()
 		self.blocks += 1
 		return block
-	
+
 	def get_or_add_block(self, block):
 		"Get or add a real block to the file"
-		
+
 		if block < 12:
 			return self.get_or_add_block_direct(block)
 		return self.get_or_add_block_indirect(block)
-	
+
 	def get_or_add_block_direct(self, block):
 		"Get or add a real block to the file (direct blocks)"
-		
+
 		if self.direct[block] == None:
 			self.direct[block] = self.new_block()
 		return self.direct[block]
-	
+
 	def get_or_add_block_indirect(self, block):
 		"Get or add a real block to the file (indirect blocks)"
-		
+
 		# Determine the indirection level for the desired block
 		level = None
@@ -444,5 +444,5 @@
 
 		assert level != None
-	
+
 		# Compute offsets for the topmost level
 		block_offset_in_level = block - self.fs.indirect_limits[level-1];
@@ -452,14 +452,14 @@
 		current_block.block_id = self.indirect[level-1]
 		offset_in_block = block_offset_in_level // self.fs.indirect_blocks_per_level[level-1]
-	
+
 		# Navigate through other levels
 		while level > 0:
 			assert offset_in_block < self.fs.block_ids_per_block
-			
+
 			level -= 1
-			
+
 			self.fs.seek_to_block(current_block.block_id, offset_in_block*4)
 			current_block.unpack(self.fs.outf.read(4))
-			
+
 			if current_block.block_id == 0:
 				# The block does not exist, so alloc one and write it there
@@ -467,10 +467,10 @@
 				current_block.block_id = self.new_block(data=(level==0))
 				self.fs.outf.write(current_block.pack())
-		
+
 			# If we are on the last level, break here as
 			# there is no next level to visit
 			if level == 0:
 				break
-		
+
 			# Visit the next level
 			block_offset_in_level %= self.fs.indirect_blocks_per_level[level];
@@ -478,16 +478,16 @@
 
 		return current_block.block_id
-	
+
 	def do_seek(self):
 		"Perform a seek to the position indicated by self.pos"
-		
+
 		block = self.pos // self.fs.block_size
 		real_block = self.get_or_add_block(block)
 		offset = self.pos % self.fs.block_size
 		self.fs.seek_to_block(real_block, offset)
-		
+
 	def write(self, data):
 		"Write a piece of data (arbitrarily long) as the contents of the inode"
-		
+
 		data_pos = 0
 		while data_pos < len(data):
@@ -499,23 +499,23 @@
 			data_pos += bytes_to_write
 			self.size = max(self.pos, self.size)
-	
+
 	def align_size_to_block(self):
 		"Align the size of the inode up to block size"
-		
+
 		self.size = align_up(self.size, self.fs.block_size)
-	
+
 	def align_pos(self, bytes):
 		"Align the current position up to bytes boundary"
-		
+
 		self.pos = align_up(self.pos, bytes)
-	
+
 	def set_pos(self, pos):
 		"Set the current position"
-		
+
 		self.pos = pos
-	
+
 	def pack(self):
 		"Pack the inode structure and return the result"
-		
+
 		data = xstruct.create(STRUCT_INODE)
 		data.mode = (Inode.TYPE2MODE[self.type] << 12)
@@ -546,8 +546,8 @@
 		data.group_id_high = 0
 		return data.pack()
-		
+
 class DirEntry:
 	"Represents a linked list directory entry"
-	
+
 	def __init__(self, name, inode, typ):
 		self.name = name.encode('UTF-8')
@@ -555,13 +555,13 @@
 		self.skip = None
 		self.type = typ
-	
+
 	def size(self):
 		"Return size of the entry in bytes"
-		
+
 		return align_up(8 + len(self.name)+1, 4)
-	
+
 	def write(self, inode):
 		"Write the directory entry into the inode"
-		
+
 		head = xstruct.create(STRUCT_DIR_ENTRY_HEAD)
 		head.inode = self.inode
@@ -575,5 +575,5 @@
 class DirWriter:
 	"Manages writing directory entries into an inode (alignment, etc.)"
-	
+
 	def __init__(self, inode):
 		self.pos = 0
@@ -581,8 +581,8 @@
 		self.prev_entry = None
 		self.prev_pos = None
-	
+
 	def prev_write(self):
 		"Write a previously remembered entry"
-		
+
 		if self.prev_entry:
 			self.prev_entry.skip = self.pos - self.prev_pos
@@ -590,8 +590,8 @@
 				self.prev_entry.write(self.inode)
 				self.inode.set_pos(self.pos)
-	
+
 	def add(self, entry):
 		"Add a directory entry to the directory"
-		
+
 		size = entry.size()
 		block_size = self.inode.fs.block_size
@@ -602,8 +602,8 @@
 		self.prev_pos = self.pos
 		self.pos += size
-	
+
 	def finish(self):
 		"Write the last entry and finish writing the directory contents"
-		
+
 		if not self.inode:
 			return
@@ -614,9 +614,9 @@
 def subtree_stats(root, block_size):
 	"Recursively calculate statistics"
-	
+
 	blocks = 0
 	inodes = 1
 	dir_writer = DirWriter(None)
-	
+
 	for item in listdir_items(root):
 		inodes += 1
@@ -627,5 +627,5 @@
 			blocks += subtree_blocks
 			inodes += subtree_inodes
-	
+
 	dir_writer.finish()
 	blocks += count_up(dir_writer.pos, block_size)
@@ -640,16 +640,16 @@
 		usage(sys.argv[0])
 		return
-	
+
 	if (not sys.argv[1].isdigit()):
 		print("<EXTRA_BYTES> must be a number")
 		return
-	
+
 	extra_bytes = int(sys.argv[1])
-	
+
 	path = os.path.abspath(sys.argv[2])
 	if (not os.path.isdir(path)):
 		print("<PATH> must be a directory")
 		return
-	
+
 	block_size = 4096
 	inode_size = 128
@@ -657,12 +657,12 @@
 	blocks_per_group = 1024
 	inodes_per_group = 512
-	
+
 	blocks, inodes = subtree_stats(path, block_size)
 	blocks += count_up(extra_bytes, block_size)
 	inodes += reserved_inode_count
-	
+
 	inodes_per_group = align_up(inodes_per_group, 8)
 	blocks_per_group = align_up(blocks_per_group, 8)
-	
+
 	inode_table_blocks_per_group = (inodes_per_group * inode_size) // block_size
 	inode_bitmap_blocks_per_group = count_up(inodes_per_group // 8, block_size)
@@ -673,13 +673,13 @@
 	free_blocks_per_group -= block_bitmap_blocks_per_group
 	free_blocks_per_group -= 10 # one for SB and some reserve for GDT
-	
+
 	block_groups = max(count_up(inodes, inodes_per_group), count_up(blocks, free_blocks_per_group))
-	
+
 	fs = Filesystem(sys.argv[3], block_groups, blocks_per_group, inodes_per_group,
 	                        block_size, inode_size, reserved_inode_count)
-	
+
 	fs.subtree_add(fs.root_inode, fs.root_inode, path, is_root=True)
 	fs.close()
-	
+
 if __name__ == '__main__':
 	main()
Index: tools/mkfat.py
===================================================================
--- tools/mkfat.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/mkfat.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -41,8 +41,8 @@
 def subtree_size(root, cluster_size, dirent_size):
 	"Recursive directory walk and calculate size"
-	
+
 	size = 0
 	files = 2
-	
+
 	for item in listdir_items(root):
 		if item.is_file:
@@ -52,42 +52,42 @@
 			size += subtree_size(item.path, cluster_size, dirent_size)
 			files += 1
-	
+
 	return size + align_up(files * dirent_size, cluster_size)
 
 def root_entries(root):
 	"Return number of root directory entries"
-	
+
 	return len(os.listdir(root))
 
 def write_file(item, outf, cluster_size, data_start, fat, reserved_clusters):
 	"Store the contents of a file"
-	
+
 	prev = -1
 	first = 0
-	
+
 	for data in chunks(item, cluster_size):
 		empty_cluster = fat.index(0)
 		fat[empty_cluster] = 0xffff
-		
+
 		if (prev != -1):
 			fat[prev] = empty_cluster
 		else:
 			first = empty_cluster
-		
+
 		prev = empty_cluster
-		
+
 		outf.seek(data_start + (empty_cluster - reserved_clusters) * cluster_size)
 		outf.write(data)
-	
+
 	return first, item.size
 
 def write_directory(directory, outf, cluster_size, data_start, fat, reserved_clusters, dirent_size, empty_cluster):
 	"Store the contents of a directory"
-	
+
 	length = len(directory)
 	size = length * dirent_size
 	prev = -1
 	first = 0
-	
+
 	i = 0
 	rd = 0;
@@ -99,7 +99,7 @@
 		else:
 			first = empty_cluster
-		
+
 		prev = empty_cluster
-		
+
 		data = bytes()
 		data_len = 0
@@ -107,13 +107,13 @@
 			if (i == 0):
 				directory[i].cluster = empty_cluster
-			
+
 			data += directory[i].pack()
 			data_len += dirent_size
 			i += 1
-		
+
 		outf.seek(data_start + (empty_cluster - reserved_clusters) * cluster_size)
 		outf.write(data)
 		rd += len(data)
-	
+
 	return first, size
 
@@ -188,8 +188,8 @@
 def fat_lchars(name):
 	"Filter FAT legal characters"
-	
+
 	filtered_name = b''
 	filtered = False
-	
+
 	for char in name.encode('ascii', 'replace').upper():
 		if char in lchars:
@@ -198,37 +198,37 @@
 			filtered_name += b'_'
 			filtered = True
-	
+
 	return (filtered_name, filtered)
 
 def fat_name83(name, name83_list):
 	"Create a 8.3 name for the given name"
-	
+
 	ascii_name, lfn = fat_lchars(name)
 	# Splitting works only on strings, not on bytes
 	ascii_parts = ascii_name.decode('utf8').split('.')
-	
+
 	short_name = ''
 	short_ext = ''
-	
+
 	if len(ascii_name) > 11:
 		lfn = True
-	
+
 	if len(ascii_parts) > 0:
 		short_name = ascii_parts[0]
 		if len(short_name) > 8:
 			lfn = True
-	
+
 	if len(ascii_parts) > 1:
 		short_ext = ascii_parts[-1]
 		if len(short_ext) > 3:
 			lfn = True
-	
+
 	if len(ascii_parts) > 2:
 		lfn = True
-	
+
 	if lfn == False:
 		name83_list.append(short_name + '.' + short_ext)
 		return (short_name.ljust(8)[0:8], short_ext.ljust(3)[0:3], False)
-	
+
 	# For filenames with multiple extensions, we treat the last one
 	# as the actual extension. The rest of the filename is stripped
@@ -236,16 +236,16 @@
 	for part in ascii_parts[1:-1]:
 		short_name += part
-	
+
 	for number in range(1, 999999):
 		number_str = ('~' + str(number)).upper()
-		
+
 		if len(short_name) + len(number_str) > 8:
 			short_name = short_name[0:8 - len(number_str)]
-		
+
 		short_name += number_str;
-		
+
 		if not (short_name + '.' + short_ext) in name83_list:
 			break
-	
+
 	name83_list.append(short_name + '.' + short_ext)
 	return (short_name.ljust(8)[0:8], short_ext.ljust(3)[0:3], True)
@@ -253,46 +253,46 @@
 def create_lfn_dirent(name, seq, checksum):
 	"Create LFN directory entry"
-	
+
 	entry = xstruct.create(LFN_DIR_ENTRY)
 	name_rest = name[26:]
-	
+
 	if len(name_rest) > 0:
 		entry.seq = seq
 	else:
 		entry.seq = seq | 0x40
-	
+
 	entry.name1 = name[0:10]
 	entry.name2 = name[10:22]
 	entry.name3 = name[22:26]
-	
+
 	entry.attr = 0x0F
 	entry.rec_type = 0
 	entry.checksum = checksum
 	entry.cluster = 0
-	
+
 	return (entry, name_rest)
 
 def lfn_checksum(name):
 	"Calculate LFN checksum"
-	
+
 	checksum = 0
 	for i in range(0, 11):
 		checksum = (((checksum & 1) << 7) + (checksum >> 1) + ord(name[i])) & 0xFF
-	
+
 	return checksum
 
 def create_dirent(name, name83_list, directory, cluster, size):
 	short_name, short_ext, lfn = fat_name83(name, name83_list)
-	
+
 	dir_entry = xstruct.create(DIR_ENTRY)
-	
+
 	dir_entry.name = short_name
 	dir_entry.ext = short_ext
-	
+
 	if (directory):
 		dir_entry.attr = 0x30
 	else:
 		dir_entry.attr = 0x20
-	
+
 	dir_entry.lcase = 0x18
 	dir_entry.ctime_fine = 0 # FIXME
@@ -303,24 +303,24 @@
 	dir_entry.mdate = 0 # FIXME
 	dir_entry.cluster = cluster
-	
+
 	if (directory):
 		dir_entry.size = 0
 	else:
 		dir_entry.size = size
-	
+
 	if not lfn:
 		return [dir_entry]
-	
+
 	long_name = name.encode('utf_16_le')
 	entries = [dir_entry]
-	
+
 	seq = 1
 	checksum = lfn_checksum(dir_entry.name + dir_entry.ext)
-	
+
 	while len(long_name) > 0:
 		long_entry, long_name = create_lfn_dirent(long_name, seq, checksum)
 		entries.append(long_entry)
 		seq += 1
-	
+
 	entries.reverse()
 	return entries
@@ -328,10 +328,10 @@
 def create_dot_dirent(empty_cluster):
 	dir_entry = xstruct.create(DOT_DIR_ENTRY)
-	
+
 	dir_entry.signature = 0x2e
 	dir_entry.name = b'       '
 	dir_entry.ext = b'   '
 	dir_entry.attr = 0x10
-	
+
 	dir_entry.ctime_fine = 0 # FIXME
 	dir_entry.ctime = 0 # FIXME
@@ -342,15 +342,15 @@
 	dir_entry.cluster = empty_cluster
 	dir_entry.size = 0
-	
+
 	return dir_entry
 
 def create_dotdot_dirent(parent_cluster):
 	dir_entry = xstruct.create(DOTDOT_DIR_ENTRY)
-	
+
 	dir_entry.signature = [0x2e, 0x2e]
 	dir_entry.name = b'      '
 	dir_entry.ext = b'   '
 	dir_entry.attr = 0x10
-	
+
 	dir_entry.ctime_fine = 0 # FIXME
 	dir_entry.ctime = 0 # FIXME
@@ -361,23 +361,23 @@
 	dir_entry.cluster = parent_cluster
 	dir_entry.size = 0
-	
+
 	return dir_entry
 
 def recursion(head, root, outf, cluster_size, root_start, data_start, fat, reserved_clusters, dirent_size, parent_cluster):
 	"Recursive directory walk"
-	
+
 	directory = []
 	name83_list = []
-	
+
 	if not head:
 		# Directory cluster preallocation
 		empty_cluster = fat.index(0)
 		fat[empty_cluster] = 0xFFFF
-		
+
 		directory.append(create_dot_dirent(empty_cluster))
 		directory.append(create_dotdot_dirent(parent_cluster))
 	else:
 		empty_cluster = 0
-	
+
 	for item in listdir_items(root):
 		if item.is_file:
@@ -387,5 +387,5 @@
 			rv = recursion(False, item.path, outf, cluster_size, root_start, data_start, fat, reserved_clusters, dirent_size, empty_cluster)
 			directory.extend(create_dirent(item.name, name83_list, True, rv[0], rv[1]))
-	
+
 	if head:
 		outf.seek(root_start)
@@ -410,5 +410,5 @@
 	uint32_t hidden            /* hidden sectors */
 	uint32_t sectors_big       /* total number of sectors (if sectors == 0) */
-	
+
 	/* Extended BIOS Parameter Block */
 	uint8_t drive              /* physical drive number */
@@ -438,18 +438,18 @@
 		usage(sys.argv[0])
 		return
-	
+
 	if (not sys.argv[1].isdigit()):
 		print("<EXTRA_BYTES> must be a number")
 		return
-	
+
 	extra_bytes = int(sys.argv[1])
-	
+
 	path = os.path.abspath(sys.argv[2])
 	if (not os.path.isdir(path)):
 		print("<PATH> must be a directory")
 		return
-	
+
 	fat16_clusters = 4096
-	
+
 	sector_size = 512
 	cluster_size = 4096
@@ -458,5 +458,5 @@
 	fat_count = 2
 	reserved_clusters = 2
-	
+
 	# Make sure the filesystem is large enough for FAT16
 	size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size + extra_bytes
@@ -467,15 +467,15 @@
 		else:
 			size = fat16_clusters * cluster_size + reserved_clusters * cluster_size
-	
+
 	root_size = align_up(root_entries(path) * dirent_size, cluster_size)
-	
+
 	fat_size = align_up(align_up(size, cluster_size) // cluster_size * fatent_size, sector_size)
-	
+
 	sectors = (cluster_size + fat_count * fat_size + root_size + size) // sector_size
 	root_start = cluster_size + fat_count * fat_size
 	data_start = root_start + root_size
-	
+
 	outf = open(sys.argv[3], "wb")
-	
+
 	boot_sector = xstruct.create(BOOT_SECTOR)
 	boot_sector.jmp = [0xEB, 0x3C, 0x90]
@@ -499,5 +499,5 @@
 	else:
 		boot_sector.sectors_big = 0
-	
+
 	boot_sector.drive = 0x80
 	boot_sector.extboot_signature = 0x29
@@ -506,32 +506,32 @@
 	boot_sector.fstype = b'FAT16   '
 	boot_sector.boot_signature = [0x55, 0xAA]
-	
+
 	outf.write(boot_sector.pack())
-	
+
 	empty_sector = xstruct.create(EMPTY_SECTOR)
-	
+
 	# Reserved sectors
 	for i in range(1, cluster_size // sector_size):
 		outf.write(empty_sector.pack())
-	
+
 	# FAT tables
 	for i in range(0, fat_count):
 		for j in range(0, fat_size // sector_size):
 			outf.write(empty_sector.pack())
-	
+
 	# Root directory
 	for i in range(0, root_size // sector_size):
 		outf.write(empty_sector.pack())
-	
+
 	# Data
 	for i in range(0, size // sector_size):
 		outf.write(empty_sector.pack())
-	
+
 	fat = array.array('L', [0] * (fat_size // fatent_size))
 	fat[0] = 0xfff8
 	fat[1] = 0xffff
-	
+
 	recursion(True, path, outf, cluster_size, root_start, data_start, fat, reserved_clusters, dirent_size, 0)
-	
+
 	# Store FAT
 	fat_entry = xstruct.create(FAT_ENTRY)
@@ -541,5 +541,5 @@
 			fat_entry.next = fat[j]
 			outf.write(fat_entry.pack())
-	
+
 	outf.close()
 
Index: tools/mktmpfs.py
===================================================================
--- tools/mktmpfs.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/mktmpfs.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -69,5 +69,5 @@
 def recursion(root, outf):
 	"Recursive directory walk"
-	
+
 	for item in listdir_items(root):
 		if item.is_file:
@@ -77,10 +77,10 @@
 			dentry.fname = item.name.encode('ascii')
 			dentry.flen = item.size
-			
+
 			outf.write(dentry.pack())
-			
+
 			for data in chunks(item, 4096):
 				outf.write(data)
-		
+
 		elif item.is_dir:
 			dentry = xstruct.create(DENTRY_DIRECTORY % len(item.name))
@@ -88,13 +88,13 @@
 			dentry.fname_len = len(item.name)
 			dentry.fname = item.name.encode('ascii')
-			
+
 			outf.write(dentry.pack())
-			
+
 			recursion(item.path, outf)
-			
+
 			dentry = xstruct.create(DENTRY_NONE)
 			dentry.kind = TMPFS_NONE
 			dentry.fname_len = 0
-			
+
 			outf.write(dentry.pack())
 
@@ -103,27 +103,27 @@
 		usage(sys.argv[0])
 		return
-	
+
 	path = os.path.abspath(sys.argv[1])
 	if (not os.path.isdir(path)):
 		print("<PATH> must be a directory")
 		return
-	
+
 	outf = open(sys.argv[2], "wb")
-	
+
 	header = xstruct.create(HEADER)
 	header.tag = b"TMPFS"
-	
+
 	outf.write(header.pack())
-	
+
 	recursion(path, outf)
-	
+
 	dentry = xstruct.create(DENTRY_NONE)
 	dentry.kind = TMPFS_NONE
 	dentry.fname_len = 0
-	
+
 	outf.write(dentry.pack())
-	
+
 	outf.close()
-	
+
 if __name__ == '__main__':
 	main()
Index: tools/toolchain.sh
===================================================================
--- tools/toolchain.sh	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/toolchain.sh	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -85,7 +85,7 @@
 	HEADER="$2"
 	BODY="$3"
-	
+
 	FNAME="/tmp/conftest-$$"
-	
+
 	echo "#include ${HEADER}" > "${FNAME}.c"
 	echo >> "${FNAME}.c"
@@ -95,12 +95,12 @@
 	echo "	return 0;" >> "${FNAME}.c"
 	echo "}" >> "${FNAME}.c"
-	
+
 	cc $CFLAGS -c -o "${FNAME}.o" "${FNAME}.c" 2> "${FNAME}.log"
 	RC="$?"
-	
+
 	if [ "$RC" -ne "0" ] ; then
 		if [ "${DEPENDENCY}" == "isl" ]; then
 			BUILD_ISL=true
-			
+
 			echo " isl not found. Will be downloaded and built with GCC."
 		else
@@ -134,5 +134,5 @@
 		echo
 		echo "Script failed: $2"
-		
+
 		exit 1
 	fi
@@ -142,10 +142,10 @@
 	FILE="$1"
 	SUM="$2"
-	
+
 	COMPUTED="`md5sum "${FILE}" | cut -d' ' -f1`"
 	if [ "${SUM}" != "${COMPUTED}" ] ; then
 		echo
 		echo "Checksum of ${FILE} does not match."
-		
+
 		exit 2
 	fi
@@ -193,5 +193,5 @@
 	echo "feature that is not fully supported."
 	echo
-	
+
 	exit 3
 }
@@ -203,14 +203,14 @@
 show_countdown() {
 	TM="$1"
-	
+
 	if [ "${TM}" -eq 0 ] ; then
 		echo
 		return 0
 	fi
-	
+
 	echo -n "${TM} "
 	change_title "${TM}"
 	sleep 1
-	
+
 	TM="`expr "${TM}" - 1`"
 	show_countdown "${TM}"
@@ -243,13 +243,13 @@
 	FILE="$2"
 	CHECKSUM="$3"
-	
+
 	if [ ! -f "${FILE}" ] ; then
 		change_title "Downloading ${FILE}"
 		wget -c "${SOURCE}${FILE}" -O "${FILE}".part
 		check_error $? "Error downloading ${FILE}."
-		
+
 		mv "${FILE}".part "${FILE}"
 	fi
-	
+
 	check_md5 "${FILE}" "${CHECKSUM}"
 }
@@ -257,9 +257,9 @@
 source_check() {
 	FILE="$1"
-	
+
 	if [ ! -f "${FILE}" ] ; then
 		echo
 		echo "File ${FILE} not found."
-		
+
 		exit 4
 	fi
@@ -268,5 +268,5 @@
 cleanup_dir() {
 	DIR="$1"
-	
+
 	if [ -d "${DIR}" ] ; then
 		change_title "Removing ${DIR}"
@@ -279,8 +279,8 @@
 	DIR="$1"
 	DESC="$2"
-	
+
 	change_title "Creating ${DESC}"
 	echo ">>> Creating ${DESC}"
-	
+
 	mkdir -p "${DIR}"
 	test -d "${DIR}"
@@ -292,25 +292,25 @@
 	BASE="$2"
 	ORIGINAL="`pwd`"
-	
+
 	mkdir -p "${OUTSIDE}"
-	
+
 	cd "${OUTSIDE}"
 	check_error $? "Unable to change directory to ${OUTSIDE}."
 	ABS_OUTSIDE="`pwd`"
-	
+
 	cd "${BASE}"
 	check_error $? "Unable to change directory to ${BASE}."
 	ABS_BASE="`pwd`"
-	
+
 	cd "${ORIGINAL}"
 	check_error $? "Unable to change directory to ${ORIGINAL}."
-	
+
 	BASE_LEN="${#ABS_BASE}"
 	OUTSIDE_TRIM="${ABS_OUTSIDE:0:${BASE_LEN}}"
-	
+
 	if [ "${OUTSIDE_TRIM}" == "${ABS_BASE}" ] ; then
 		echo
 		echo "CROSS_PREFIX cannot reside within the working directory."
-		
+
 		exit 5
 	fi
@@ -320,8 +320,8 @@
 	FILE="$1"
 	DESC="$2"
-	
+
 	change_title "Unpacking ${DESC}"
 	echo " >>> Unpacking ${DESC}"
-	
+
 	case "${FILE}" in
 		*.gz)
@@ -345,8 +345,8 @@
 	PATCH_STRIP="$2"
 	DESC="$3"
-	
+
 	change_title "Patching ${DESC}"
 	echo " >>> Patching ${DESC} with ${PATCH_FILE}"
-	
+
 	patch -t "-p${PATCH_STRIP}" <"$PATCH_FILE"
 	check_error $? "Error patching ${DESC}."
@@ -357,14 +357,14 @@
 	check_dependecies
 	show_countdown 10
-	
+
 	BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
 	GCC_SOURCE="ftp://ftp.gnu.org/gnu/gcc/gcc-${GCC_VERSION}/"
 	GDB_SOURCE="ftp://ftp.gnu.org/gnu/gdb/"
 	ISL_SOURCE="http://isl.gforge.inria.fr/"
-	
+
 	download_fetch "${BINUTILS_SOURCE}" "${BINUTILS}" "9e8340c96626b469a603c15c9d843727"
 	download_fetch "${GCC_SOURCE}" "${GCC}" "6bf56a2bca9dac9dbbf8e8d1036964a8"
 	download_fetch "${GDB_SOURCE}" "${GDB}" "06c8f40521ed65fe36ebc2be29b56942"
-	
+
 	if $BUILD_ISL ; then
 		download_fetch "${ISL_SOURCE}" "${ISL}" "11436d6b205e516635b666090b94ab32"
@@ -426,5 +426,5 @@
 build_target() {
 	PLATFORM="$1"
-	
+
 	# This sets the *_TARGET variables
 	set_target_from_platform "$PLATFORM"
@@ -434,5 +434,5 @@
 		TARGET="$LINUX_TARGET"
 	fi
-	
+
 	WORKDIR="${BASEDIR}/${TARGET}"
 	INSTALL_DIR="${WORKDIR}/PKG"
@@ -442,11 +442,11 @@
 	OBJDIR="${WORKDIR}/gcc-obj"
 	GDBDIR="${WORKDIR}/gdb-${GDB_VERSION}"
-	
+
 	if [ -z "${CROSS_PREFIX}" ] ; then
 		CROSS_PREFIX="/usr/local/cross"
 	fi
-	
+
 	PREFIX="${CROSS_PREFIX}/${TARGET}"
-	
+
 	echo ">>> Downloading tarballs"
 	source_check "${BASEDIR}/${BINUTILS}"
@@ -456,16 +456,16 @@
 		source_check "${BASEDIR}/${ISL}"
 	fi
-	
+
 	echo ">>> Removing previous content"
 	cleanup_dir "${WORKDIR}"
-	
+
 	create_dir "${OBJDIR}" "GCC object directory"
-	
+
 	check_dirs "${PREFIX}" "${WORKDIR}"
-	
+
 	echo ">>> Unpacking tarballs"
 	cd "${WORKDIR}"
 	check_error $? "Change directory failed."
-	
+
 	unpack_tarball "${BASEDIR}/${BINUTILS}" "binutils"
 	unpack_tarball "${BASEDIR}/${GCC}" "GCC"
@@ -475,5 +475,5 @@
 		mv "${ISLDIR}" "${GCCDIR}"/isl
 	fi
-	
+
 	echo ">>> Applying patches"
 	for p in $BINUTILS_PATCHES ; do
@@ -486,9 +486,9 @@
 		patch_sources "${SRCDIR}/${p}" 0 "GDB"
 	done
-	
+
 	echo ">>> Processing binutils (${PLATFORM})"
 	cd "${BINUTILSDIR}"
 	check_error $? "Change directory failed."
-	
+
 	change_title "binutils: configure (${PLATFORM})"
 	CFLAGS=-Wno-error ./configure \
@@ -498,18 +498,18 @@
 		--enable-deterministic-archives
 	check_error $? "Error configuring binutils."
-	
+
 	change_title "binutils: make (${PLATFORM})"
 	make all
 	check_error $? "Error compiling binutils."
-	
+
 	change_title "binutils: install (${PLATFORM})"
 	make install "DESTDIR=${INSTALL_DIR}"
 	check_error $? "Error installing binutils."
-	
-	
+
+
 	echo ">>> Processing GCC (${PLATFORM})"
 	cd "${OBJDIR}"
 	check_error $? "Change directory failed."
-	
+
 	change_title "GCC: configure (${PLATFORM})"
 	PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" "${GCCDIR}/configure" \
@@ -521,14 +521,14 @@
 		--disable-shared --enable-lto --disable-werror
 	check_error $? "Error configuring GCC."
-	
+
 	change_title "GCC: make (${PLATFORM})"
 	PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all-gcc
 	check_error $? "Error compiling GCC."
-	
+
 	change_title "GCC: install (${PLATFORM})"
 	PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install-gcc "DESTDIR=${INSTALL_DIR}"
 	check_error $? "Error installing GCC."
-	
-	
+
+
 	# No GDB support for RISC-V so far
 	if [ "$PLATFORM" != "riscv64" ] ; then
@@ -536,5 +536,5 @@
 		cd "${GDBDIR}"
 		check_error $? "Change directory failed."
-		
+
 		change_title "GDB: configure (${PLATFORM})"
 		PATH="$PATH:${INSTALL_DIR}/${PREFIX}/bin" ./configure \
@@ -543,21 +543,21 @@
 			--enable-werror=no --without-guile
 		check_error $? "Error configuring GDB."
-		
+
 		change_title "GDB: make (${PLATFORM})"
 		PATH="${PATH}:${PREFIX}/bin:${INSTALL_DIR}/${PREFIX}/bin" make all
 		check_error $? "Error compiling GDB."
-		
+
 		change_title "GDB: make (${PLATFORM})"
 		PATH="${PATH}:${INSTALL_DIR}/${PREFIX}/bin" make install "DESTDIR=${INSTALL_DIR}"
 		check_error $? "Error installing GDB."
 	fi
-	
+
 	# Symlink clang and lld to the install path.
 	CLANG="`which clang 2> /dev/null || echo "/usr/bin/clang"`"
 	LLD="`which ld.lld 2> /dev/null || echo "/usr/bin/ld.lld"`"
-	
+
 	ln -s $CLANG "${INSTALL_DIR}/${PREFIX}/bin/${TARGET}-clang"
 	ln -s $LLD "${INSTALL_DIR}/${PREFIX}/bin/${TARGET}-ld.lld"
-	
+
 	if $REAL_INSTALL ; then
 		echo ">>> Moving to the destination directory."
@@ -566,11 +566,11 @@
 		mv "${INSTALL_DIR}/${PREFIX}" "${PREFIX}"
 	fi
-	
+
 	cd "${BASEDIR}"
 	check_error $? "Change directory failed."
-	
+
 	echo ">>> Cleaning up"
 	cleanup_dir "${WORKDIR}"
-	
+
 	echo
 	echo ">>> Cross-compiler for ${TARGET} installed."
@@ -647,21 +647,21 @@
 		build_target "arm32" &
 		wait
-		
+
 		build_target "ia32" &
 		build_target "ia64" &
 		wait
-		
+
 		build_target "mips32" &
 		build_target "mips32eb" &
 		wait
-		
+
 		build_target "mips64" &
 		build_target "ppc32" &
 		wait
-		
+
 		build_target "riscv64" &
 		build_target "ppc64" &
 		wait
-		
+
 		build_target "sparc64" &
 		wait
Index: tools/travis.sh
===================================================================
--- tools/travis.sh	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/travis.sh	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -119,5 +119,5 @@
 elif [ "$1" = "install" ]; then
     set -x
-    
+
     # Install dependencies
     sudo apt-get -qq update || exit 1
@@ -133,5 +133,5 @@
 elif [ "$1" = "run" ]; then
     set -x
-    
+
     # Expected output filename (bootable image)
     H_OUTPUT_FILENAME=`h_get_arch_config $H_ARCH_CONFIG_OUTPUT_FILENAME`
@@ -150,9 +150,9 @@
     fi
 
-	
+
     # Build it
     make "PROFILE=$H_ARCH" HANDS_OFF=y || exit 1
     test -s "$H_OUTPUT_FILENAME" || exit 1
-    
+
     echo
     echo "HelenOS for $H_ARCH built okay."
@@ -165,5 +165,5 @@
         echo "Repository used is $H_HARBOURS_REPOSITORY."
         echo
-        
+
         H_HELENOS_HOME=`pwd`
         cd "$HOME" || exit 1
@@ -181,7 +181,7 @@
                 echo "machine =" `echo "$H_ARCH" | cut -d/ -f 2`
             ) >hsct.conf || exit 1
-            
+
             # "$HOME/helenos-harbours/hsct.sh" init "$H_HELENOS_HOME" "$H_ARCH" build >/dev/null 2>/dev/null || exit 1
-            
+
             "$HOME/helenos-harbours/hsct.sh" update || exit 1
 
@@ -196,7 +196,7 @@
                     tail -n 100 "run-$HARBOUR.log"
                 fi
-                
+
             done
-            
+
             if [ -n "$FAILED_HARBOURS" ]; then
                 echo
Index: tools/xstruct.py
===================================================================
--- tools/xstruct.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/xstruct.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -72,5 +72,5 @@
 	def size(self):
 		return struct.calcsize(self._format_)
-	
+
 	def pack(self):
 		args = []
@@ -90,5 +90,5 @@
 				args.append(value)
 		return struct.pack(self._format_, *args)
-	
+
 	def unpack(self, data):
 		values = struct.unpack(self._format_, data)
@@ -100,7 +100,7 @@
 def create(definition):
 	"Create structure object"
-	
+
 	tokens = definition.split(None)
-	
+
 	# Initial byte order tag
 	format = {
@@ -111,5 +111,5 @@
 	inst = Struct()
 	args = []
-	
+
 	# Member tags
 	comment = False
@@ -120,30 +120,30 @@
 				comment = False
 			continue
-		
+
 		if (token == "/*"):
 			comment = True
 			continue
-		
+
 		if (variable != None):
 			subtokens = token.split("[")
-			
+
 			length = None
 			if (len(subtokens) > 1):
 				length = int(subtokens[1].split("]")[0])
 				format += "%d" % length
-			
+
 			format += variable
-			
+
 			inst.__dict__[subtokens[0]] = None
 			args.append((subtokens[0], variable, length))
-			
+
 			variable = None
 			continue
-		
+
 		if (token[0:8] == "padding["):
 			size = token[8:].split("]")[0]
 			format += "%dx" % int(size)
 			continue
-		
+
 		variable = {
 			"char":     lambda: "s",
@@ -152,5 +152,5 @@
 			"uint32_t": lambda: "L",
 			"uint64_t": lambda: "Q",
-			
+
 			"int8_t":   lambda: "b",
 			"int16_t":  lambda: "h",
@@ -158,5 +158,5 @@
 			"int64_t":  lambda: "q"
 		}[token]()
-	
+
 	inst.__dict__['_format_'] = format
 	inst.__dict__['_args_'] = args
Index: tools/xtui.py
===================================================================
--- tools/xtui.py	(revision 1b20da07baaa3e3c424f62c927274e676e4295cd)
+++ tools/xtui.py	(revision a35b458e9db1ca95e679799dc7c1b12c83359ca3)
@@ -35,5 +35,5 @@
 def call_dlg(dlgcmd, *args, **kw):
 	"Wrapper for calling 'dialog' program"
-	
+
 	indesc, outdesc = os.pipe()
 	pid = os.fork()
@@ -41,15 +41,15 @@
 		os.dup2(outdesc, 2)
 		os.close(indesc)
-		
+
 		dlgargs = [dlgcmd]
 		for key, val in kw.items():
 			dlgargs.append('--' + key)
 			dlgargs.append(val)
-		
+
 		dlgargs += args
 		os.execlp(dlgcmd, *dlgargs)
-	
+
 	os.close(outdesc)
-	
+
 	try:
 		errout = os.fdopen(indesc, 'r')
@@ -61,14 +61,14 @@
 		os.system('reset')
 		raise
-	
+
 	if (not os.WIFEXITED(status)):
 		# Reset terminal
 		os.system('reset')
 		raise EOFError
-	
+
 	status = os.WEXITSTATUS(status)
 	if (status == 255):
 		raise EOFError
-	
+
 	return (status, data)
 
@@ -79,5 +79,5 @@
 except ImportError:
 	newt = False
-	
+
 	dlgcmd = os.environ.get('DIALOG', 'dialog')
 	if (call_dlg(dlgcmd, '--print-maxsize')[0] != 0):
@@ -91,35 +91,35 @@
 def width_fix(screen, width):
 	"Correct width to screen size"
-	
+
 	if (width + width_extra > screen.width):
 		width = screen.width - width_extra
-	
+
 	if (width <= 0):
 		width = screen.width
-	
+
 	return width
 
 def height_fix(screen, height):
 	"Correct height to screen size"
-	
+
 	if (height + height_extra > screen.height):
 		height = screen.height - height_extra
-	
+
 	if (height <= 0):
 		height = screen.height
-	
+
 	return height
 
 def screen_init():
 	"Initialize the screen"
-	
+
 	if (newt):
 		return snack.SnackScreen()
-	
+
 	return None
 
 def screen_done(screen):
 	"Cleanup the screen"
-	
+
 	if (newt):
 		screen.finish()
@@ -127,5 +127,5 @@
 def choice_window(screen, title, text, options, position):
 	"Create options menu"
-	
+
 	maxopt = 0
 	for option in options:
@@ -133,41 +133,41 @@
 		if (length > maxopt):
 			maxopt = length
-	
+
 	width = maxopt
 	height = len(options)
-	
+
 	if (newt):
 		width = width_fix(screen, width + width_extra)
 		height = height_fix(screen, height)
-		
+
 		if (height > 3):
 			large = True
 		else:
 			large = False
-		
+
 		buttonbar = snack.ButtonBar(screen, ('Done', 'Cancel'))
 		textbox = snack.TextboxReflowed(width, text)
 		listbox = snack.Listbox(height, scroll = large, returnExit = 1)
-		
+
 		cnt = 0
 		for option in options:
 			listbox.append(option, cnt)
 			cnt += 1
-		
+
 		if (position != None):
 			listbox.setCurrent(position)
-		
+
 		grid = snack.GridForm(screen, title, 1, 3)
 		grid.add(textbox, 0, 0)
 		grid.add(listbox, 0, 1, padding = (0, 1, 0, 1))
 		grid.add(buttonbar, 0, 2, growx = 1)
-		
+
 		retval = grid.runOnce()
-		
+
 		return (buttonbar.buttonPressed(retval), listbox.current())
 	elif (dialog):
 		if (width < 35):
 			width = 35
-		
+
 		args = []
 		cnt = 0
@@ -175,28 +175,28 @@
 			args.append(str(cnt + 1))
 			args.append(option)
-			
+
 			cnt += 1
-		
+
 		kw = {}
 		if (position != None):
 			kw['default-item'] = str(position + 1)
-		
+
 		status, data = call_dlg(dlgcmd, '--title', title, '--extra-button', '--extra-label', 'Done', '--menu', text, str(height + height_extra), str(width + width_extra), str(cnt), *args, **kw)
-		
+
 		if (status == 1):
 			return ('cancel', None)
-		
+
 		try:
 			choice = int(data) - 1
 		except ValueError:
 			return ('cancel', None)
-		
+
 		if (status == 0):
 			return (None, choice)
-		
+
 		return ('done', choice)
-	
+
 	sys.stdout.write("\n *** %s *** \n%s\n\n" % (title, text))
-	
+
 	maxcnt = len(str(len(options)))
 	cnt = 0
@@ -204,8 +204,8 @@
 		sys.stdout.write("%*s. %s\n" % (maxcnt, cnt + 1, option))
 		cnt += 1
-	
+
 	sys.stdout.write("\n%*s. Done\n" % (maxcnt, '0'))
 	sys.stdout.write("%*s. Quit\n\n" % (maxcnt, 'q'))
-	
+
 	while True:
 		if (position != None):
@@ -217,8 +217,8 @@
 				sys.stdout.write("Selection[0]: ")
 		inp = sys.stdin.readline()
-		
+
 		if (not inp):
 			raise EOFError
-		
+
 		if (not inp.strip()):
 			if (position != None):
@@ -229,32 +229,32 @@
 				else:
 					inp = '0'
-		
+
 		if (inp.strip() == 'q'):
 			return ('cancel', None)
-		
+
 		try:
 			choice = int(inp.strip())
 		except ValueError:
 			continue
-		
+
 		if (choice == 0):
 			return ('done', 0)
-		
+
 		if (choice < 1) or (choice > len(options)):
 			continue
-		
+
 		return (None, choice - 1)
 
 def error_dialog(screen, title, msg):
 	"Print error dialog"
-	
+
 	width = len(msg)
-	
+
 	if (newt):
 		width = width_fix(screen, width)
-		
+
 		buttonbar = snack.ButtonBar(screen, ['Ok'])
 		textbox = snack.TextboxReflowed(width, msg)
-		
+
 		grid = snack.GridForm(screen, title, 1, 2)
 		grid.add(textbox, 0, 0, padding = (0, 0, 0, 1))
