Skip to content
Snippets Groups Projects
Commit fcc99ded authored by cvs2svn's avatar cvs2svn
Browse files

This commit was manufactured by cvs2svn to create branch

'unlabeled-1.38.34.7.4'.
parent 51989386
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 1242 deletions
Lustre can currently build against Red Hat 2.4 and SuSE 2.6
kernel-source RPMs. All other kernel-source RPMs are *unsupported* at
this time.
Note that a Lustre-patched kernel is required for building Lustre; in
most cases a kernel-source RPM from your Linux vendor will not contain
the necessary patches.
##
## Instructions for Red Hat 2.4.x kernel-source RPMs
##
1. kernel.h
Building against a kernel-source RPM requires a special header. On
Red Hat systems, this file should be automatically created at boot
time, and saved in /boot/kernel.h.
*** If you are not running Red Hat Linux, or are not booted into the
*** kernel you are trying to build against, you need to create this
*** file manually.
*** If you do not, the Lustre build may fail, or may fail to build
*** modules that work with your kernel.
Here is an example /boot/kernel.h file. If you are building on
x86_64, the first defines should be __MODULE_KERNEL_x86_64, etc. The
other defines should be simple to figure out.
/* This file is automatically generated at boot time. */
#ifndef __BOOT_KERNEL_H_
#define __BOOT_KERNEL_H_
/* Kernel type i686-smp */
#ifndef __MODULE_KERNEL_i686
#define __MODULE_KERNEL_i686 1
#endif
#ifndef __BOOT_KERNEL_ENTERPRISE
#define __BOOT_KERNEL_ENTERPRISE 0
#endif
#ifndef __BOOT_KERNEL_BIGMEM
#define __BOOT_KERNEL_BIGMEM 0
#endif
#ifndef __BOOT_KERNEL_HUGEMEM
#define __BOOT_KERNEL_HUGEMEM 0
#endif
#ifndef __BOOT_KERNEL_SMP
#define __BOOT_KERNEL_SMP 1
#endif
#ifndef __BOOT_KERNEL_UP
#define __BOOT_KERNEL_UP 0
#endif
#endif
You should save this somewhere, and pass the location of this file to
./configure using the --with-kernel-source-header option.
2. .config
You will also need to tell Lustre about the .config file for your
kernel. The two likely locations of this file are
/boot/config-$(uname -r), and /usr/src/linux-2.4/configs/. You should
pass the location of this file to Lustre using the --with-linux-config
option.
3. An Example
Here is an example for configuring Lustre:
./configure --with-linux=/usr/src/linux-2.4.20-28.9_lustre.1.0.3 \
--with-kernel-source-header=/boot/kernel.h \
--with-linux-config=/boot/config-2.4.20-28.9_lustre.1.0.3smp
##
## Instructions for SuSE 2.6.x kernel-source RPMs
##
1. kernel-syms
In addition to the kernel-source rpm, you may need to install a
kernel-syms rpm. This should be included where you got your kernel
rpm.
2. linux-obj
You will need to choose the correct linux-obj directory for your
machine. They will be located in /usr/src/linux-$(uname
-r)-obj/$ARCH/$FLAVOR. Lustre should be configured with the
--with-linux-obj option.
3. Example
Here is an example for configuring Lustre:
./configure --with-linux=/usr/src/linux-2.6.5-7.97 \
--with-linux-obj=/usr/src/linux-2.6.5-7.97-obj/ppc64/pseries64
# Directories building kernel modules should have two files:
#
# Makefile.in:
#
# MODULES := <module-name>
# <module-name>-objs := file1.o file2.o file3.o
# @INCLUDE_RULES@
#
# and autoMakefile.am:
#
# if LIBLUSTRE
# <liblustre rules>
# endif
#
# if MODULES
# modulefs_DATA = <module-name>$(KMODEXT)
# endif
#
# DIST_SOURCES = $(<module-name>-objs:.o=.c) <other sources>
# MOSTLYCLEANFILES = *.o *.ko *.mod.c
ifeq ($(PATCHLEVEL),)
include autoMakefile
# The kernel ABI files for the nonfree modules.
KABIS := $(NONFREE_MODULES:%$(KMODEXT)=%.kabi)
all: archive-nonfree-modules
# Where to archive the nonfree modules for binary distribution.
# If this directory has a colon in it, SSH/SCP are used to go out on the network.
nonfreedir := $$HOME/nonfree
#nonfreedir := moraine.clusterfs.com:/home/lustre-nonfree
# Put the nonfree modules and corresponding KABI files into the binary
# archive. We assume that if the CVS subdirectory doesn't exist, we
# don't want to archive.
archive-nonfree-modules: $(KABIS) $(NONFREE_MODULES)
test -d CVS || exit 0; \
list="$(NONFREE_MODULES)"; for mod in $$list; do \
perl $(top_srcdir)/build/kabi -v archive $(nonfreedir) $$mod || exit $$?; \
done
# Generate the Kernel ABI files for the nonfree modules.
$(KABIS): $(NONFREE_MODULES)
for mod in $(NONFREE_MODULES); do \
CC="$(CC)" perl $(top_srcdir)/build/kabi --with-linux="$(LINUX)" module $$mod || exit $$?; \
done
fix-kext-ownership:
@if test -d $(DESTDIR)$(kextdir) ; then \
echo chown -R root:wheel $(DESTDIR)$(kextdir) ; \
chown -R root:wheel $(DESTDIR)$(kextdir) || \
echo >&2 "*** WARNING: Could not fix kext ownership for $(DESTDIR)$(kextdir)" ; \
fi
else
include @LINUX_CONFIG@
EXTRA_CFLAGS := $(EXTRA_PRE_CFLAGS)
EXTRA_CFLAGS += @EXTRA_KCFLAGS@ @UML_CFLAGS@ @CFLAGS@
EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS)
obj-m := $(patsubst %,%.o,$(MODULES))
ifeq ($(PATCHLEVEL),4)
# 2.4 rules
O_TARGET := $(firstword $(obj-m))
obj-y := $($(firstword $(MODULES))-objs)
export-objs := $(obj-y) $(filter-out $(O_TARGET),$(obj-m))
include $(TOPDIR)/Rules.make
$(MODINCL)/%.ver: %.c
@true
endif # PATCHLEVEL
endif # KERNELRELEASE
Makefile
Makefile.in
EXTRA_DIST := lustre-build.m4 lustre-build-linux.m4
if DARWIN
EXTRA_DIST += lustre-build-darwin.m4
endif
#
# LB_DARWIN_CHECK_FUNCS
#
# check for functions in the darwin kernel
# Note that this is broken for cross compiling
#
AC_DEFUN([LB_DARWIN_CHECK_FUNCS],
[AC_FOREACH([AC_Func], [$1],
[AH_TEMPLATE(AS_TR_CPP(HAVE_[]AC_Func),
[Define to 1 if you have the `]AC_Func[' function.])])dnl
for ac_func in $1
do
AC_MSG_CHECKING([for $1])
AS_IF([AC_TRY_COMMAND(nm /mach | grep "[$1]" >/dev/null 2>/dev/null)],[
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED([AS_TR_CPP([HAVE_$ac_func])]) $2
],[
AC_MSG_RESULT([no]) $3
])dnl
done
])
#
# LB_DARWIN_CONDITIONALS
#
# AM_CONDITIONALs for darwin
#
AC_DEFUN([LB_DARWIN_CONDITIONALS],
[
])
#
# LB_PROG_DARWIN
#
# darwin tests
#
AC_DEFUN([LB_PROG_DARWIN],
[kernel_framework="/System/Library/Frameworks/Kernel.framework"
#
# FIXME: there should be a better way to get these than hard coding them
#
case $target_cpu in
powerpc*)
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -arch ppc -mtune=G4 -mlong-branch"
EXTRA_KLDFLAGS="-arch ppc"
;;
i?86 | x86_64)
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -arch i386"
EXTRA_KLDFLAGS="-arch i386"
;;
esac
# Kernel of OS X is not 64bits(even in Tiger), but -m64 can be taken by gcc in Tiger
# (Tiger can support 64bits applications), so we have to eliminate -m64 while
# building kextensions for and OS X.
CC=`echo $CC | sed -e "s/\-m64//g"`
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -x c -pipe -Wno-trigraphs -fasm-blocks -g -O0"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Wno-four-char-constants -Wmost -O0"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -fmessage-length=0"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -I$kernel_framework/Headers"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -I$kernel_framework/Headers/bsd"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -I$kernel_framework/PrivateHeaders"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -fno-common -nostdinc -fno-builtin"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -finline -fno-keep-inline-functions"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -force_cpusubtype_ALL -fno-exceptions"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -msoft-float -static"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -DKERNEL -DKERNEL_PRIVATE"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -DDRIVER_PRIVATE -DAPPLE -DNeXT"
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -D__KERNEL__ -D__DARWIN__"
#
# C flags for Panther/Tiger
#
case $target_os in
darwin8*)
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -D__DARWIN8__"
;;
darwin7*)
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -ffix-and-continue"
;;
esac
#
# Debugging flags. Remove!
#
EXTRA_KCFLAGS="$EXTRA_KCFLAGS -O0 -DMACH_ASSERT=1"
EXTRA_KLDFLAGS="$EXTRA_KLDFLAGS -static -nostdlib -r"
EXTRA_KLIBS="-lkmodc++ -lkmod -lcc_kext"
KMODEXT=""
AC_SUBST(EXTRA_KLDFLAGS)
AC_SUBST(EXTRA_KLIBS)
kextdir='/System/Library/Extensions/$(firstword $(macos_PROGRAMS)).kext'
plistdir='$(kextdir)/Contents'
macosdir='$(plistdir)/MacOS'
AC_SUBST(kextdir)
AC_SUBST(plistdir)
AC_SUBST(macosdir)
LN_PROG_DARWIN
LP_PROG_DARWIN
LC_PROG_DARWIN
])
#!/usr/bin/perl
# Check the stack usage of functions
#
# Copyright Joern Engel <joern@wh.fh-wedel.de>
# Inspired by Linus Torvalds
# Original idea maybe from Keith Owens
# s390 port and big speedup by Arnd Bergmann <arnd@bergmann-dalldorf.de>
# Modified to have simpler output format by Dan Kegel
#
# Usage:
# objdump -d vmlinux | stackcheck.pl [arch]
#
# find <moduledir> -name "*.o" | while read M; do
# objdump -d $M | perl ~/checkstack.pl <arch> | \
# sed "s/^/`basename $M`: /" ; done | \
# awk '/esp/ { print $5, $2, $4 }' | sort -nr
# TODO : Port to all architectures (one regex per arch)
# check for arch
#
# $re is used for three matches:
# $& (whole re) matches the complete objdump line with the stack growth
# $1 (first bracket) matches the code that will be displayed in the output
# $2 (second bracket) matches the size of the stack growth
#
# use anything else and feel the pain ;)
{
my $arch = shift;
$x = "[0-9a-f]{2,5}"; # hex number >= 256
$d = "([0-9]{2}|[2-9])[0-9]{2}"; # decimal number >= 200
if ($arch eq "") {
$arch = `uname -m`;
}
if ($arch =~ /^i[3456]86$/) {
#c0105234: 81 ec ac 05 00 00 sub $0x5ac,%esp
$re = qr/^.*(sub \$(0x$x),\%esp)$/o;
$todec = sub { return hex($_[0]); };
} elsif ($arch =~ 'x86_64') {
# 2f60: 48 81 ec e8 05 00 00 sub $0x5e8,%rsp
$re = qr/^.*(add \$(0x$x),\%rsp)$/o;
$todec = sub { return hex($_[0]); };
} elsif ($arch =~ /^ia64$/) {
#e0000000044011fc: 01 0f fc 8c adds r12=-384,r12
$re = qr/.*(adds.*r12=-($d),r12)/o;
$todec = sub { return $_[0]; };
} elsif ($arch =~ /^mips64$/) {
#8800402c: 67bdfff0 daddiu sp,sp,-16
$re = qr/.*(daddiu.*sp,sp,-($d))/o;
$todec = sub { return $_[0]; };
} elsif ($arch =~ /^mips$/) {
#88003254: 27bdffe0 addiu sp,sp,-32
$re = qr/.*(addiu.*sp,sp,-($d))/o;
$todec = sub { return $_[0]; };
} elsif ($arch =~ /^ppc$/) {
#c00029f4: 94 21 ff 30 stwu r1,-208(r1)
$re = qr/.*(stwu.*r1,-($x)\(r1\))/o;
$todec = sub { return hex($_[0]); };
} elsif ($arch =~ /^s390x?$/) {
# 11160: a7 fb ff 60 aghi %r15,-160
$re = qr/.*(ag?hi.*\%r15,-($d))/o;
$todec = sub { return $_[0]; };
} else {
print "Usage: objdump -d vmlinux | checkstack.pl [arch]\n";
print "where arch is i386, ia64, mips, mips64, ppc, or s390\n";
print "Each output line gives a function's stack usage, name\n";
print "Lines are output in order of decreasing stack usage\n";
die("wrong or unknown architecture\n");
}
}
$funcre = qr/^[0-9a-f]* \<(.*)\>:$/;
while ($line = <STDIN>) {
if ($line =~ m/$funcre/) {
($func = $line) =~ s/$funcre/\1/;
chomp($func);
}
if ($line =~ m/$re/) {
push(@stack, &$todec($2)." ".$func);
# don't expect more than one stack allocation per function
$func .= " ** bug **";
}
}
foreach (sort { $b - $a } (@stack)) {
print $_."\n";
}
BASEDIR=${BASEDIR:-lustre/kernel_patches}
SERIESPATH=${SERIESPATH:-$BASEDIR/series}
PATCHESPATH=${PATCHESPATH:-$BASEDIR/patches}
NOUSEPATH=${NOUSEPATH:-$BASEDIR/unused}
#mkdir -p $NOUSEPATH
for PATCH in `ls $PATCHESPATH | grep -v CVS` ; do
#echo $PATCH
if ! grep -rq $PATCH $SERIESPATH ; then
echo "$PATCH"
#mv $PATCHESPATH/$PATCH $NOUSEPATH
fi
done
BASEDIR=${BASEDIR:-lustre/kernel_patches}
SERIESPATH=${SERIESPATH:-$BASEDIR/series}
PATCHESPATH=${PATCHESPATH:-$BASEDIR/patches}
for SERIES in `ls $SERIESPATH | egrep -v "CVS|~$|.orig"` ; do
#echo $SERIES
for PATCH in `cat $SERIESPATH/$SERIES`; do
#echo $PATCH
if [ ! `find $PATCHESPATH -name $PATCH` ]; then
echo "$SERIESPATH/$SERIES: patch $PATCH was not found !"
fi
done
done
#!/usr/bin/env perl
my $mode = "NONE";
my @modified, @added, @removed;
while($line = <>) {
if ($line =~ /Modified Files:/) {
$mode = "MODIFIED";
next;
}
if ($line =~ /Added Files:/) {
$mode = "ADDED";
next;
}
if ($line =~ /Removed Files:/) {
$mode = "REMOVED";
next;
}
if ($mode eq "NONE") { next; }
if ($line =~ /-------/) { next; }
chop($line);
$line =~ s/^CVS:\s+//;
$line =~ s/\s+$//;
# print "processing $line for $mode\n";
@files = split(/ /, $line);
# print "new files for $mode: ", join(', ', @files), "\n";
if ($mode eq "MODIFIED") {
push(@modified, @files);
} elsif ($mode eq "ADDED") {
push(@added, @files);
} elsif ($mode eq "REMOVED") {
push(@removed, @files);
} else {
die "Unknown mode $mode!";
}
}
print join(' ', @modified);
if ($ENV{"SHOW_ALL_FILES"} ne "no") {
print ' ', join(' ', @added), ' ', join(' ', @removed);
}
print "\n";
#!/bin/bash -e
CVS=cvs
if [ ! -f .mergeinfo ] ; then
echo ".mergeinfo doesn't exist - exit"
exit
fi
. .mergeinfo
if [ "$OPERATION" != "Land" ] ; then
echo "OPERATION must be Land - is $OPERATION"
echo "You should probably be running ${OPERATION}2.sh"
exit
fi
if [ -f "$CONFLICTS" ] ; then
echo "$CONFLICTS exists - clean up first"
cat $CONFLICTS
exit
fi
cvs update $dir 2>&1 | grep "^M" && echo "uncommitted changes" && exit 1
echo -n "Tagging as ${CHILD}_BASE_$date ..."
$CVS rtag -r $parent ${CHILD}_BASE_$date $module
echo "done"
echo -n "Tagging as ${CHILD}_BASE ..."
$CVS rtag -F -r $parent ${CHILD}_BASE $module
echo "saving .mergeinfo as .mergeinfo-$date"
mv .mergeinfo .mergeinfo-$date
echo "done"
#!/bin/awk -f
BEGIN {
nsects = 0
}
{
ARCH = $1
ARCHES[ARCH] = 1
TYPE = $2
TYPES[TYPE] = 1
NTOTAL++
ARCHTYPES[ARCH ":" TYPE] = 1
NARCHES[TYPE]++
if (NARCHES[TYPE] == 1)
NTOTALTYPES++
NTYPES[ARCH]++
if (NTYPES[ARCH] == 1)
NTOTALARCHES++
FILE = $3
cursects = nsects
while ((getline < FILE) > 0) {
if ($0 ~ /^\/\*/ || $0 ~ /^ \*\// || $0 ~ /^[ ]*$/)
continue
if ($0 ~ /^ * /) {
SECTION = gensub(/^ \* /,"",$0)
if (!(SECTION in sectno)) {
sectno[SECTION] = nsects
counts[SECTION] = 0
nsects++
} else if (cursects && cursects != nsects) {
no = sectno[SECTION]
diff = nsects - cursects
for (s in sectno) {
if (sectno[s] >= cursects)
sectno[s] = sectno[s] - cursects + no
else if (sectno[s] >= no)
sectno[s] += diff
}
}
cursects = nsect
cursym[SECTION] = counts[SECTION]
continue
}
if ($1 != "#define" && $1 != "#undef")
exit 1
SYMBOL = $2
n = index($0,SYMBOL)+length(SYMBOL)
if ($1 == "#define") {
n = index($0,SYMBOL)+length(SYMBOL)
VALUE = gensub(/^[ ]*/,"","",substr($0,n))
if (VALUE == "") VALUE = "__novalue__"
} else
VALUE = "__undefined__"
if (values[SYMBOL]) {
if (present[SYMBOL,ARCH,TYPE]) continue
present[SYMBOL,ARCH,TYPE] = 1
values[SYMBOL] = values[SYMBOL] SUBSEP ARCH ":" TYPE ":" VALUE
if (SECTION == sections[SYMBOL] && cursym[SECTION] && cursym[SECTION] != counts[SECTION]) {
no = pos[SYMBOL]
diff = counts[SECTION]-cursym[SECTION]
for (s in pos)
if (sections[s] == SECTION) {
if (pos[s] >= cursym[SECTION])
pos[s] = pos[s] - cursym[SECTION] + no
else if (pos[s] >= no)
pos[s] += diff
}
cursym[SECTION] = counts[SECTION]
}
} else {
present[SYMBOL,ARCH,TYPE] = 1
values[SYMBOL] = ARCH ":" TYPE ":" VALUE
sections[SYMBOL] = SECTION
pos[SYMBOL] = counts[SECTION]
counts[SECTION]++
}
}
close(FILE)
}
END {
for (SECTION in sectno)
x[sectno[SECTION]] = SECTION
for (i = 0; i < nsects; i++) {
SECTION = x[i]
if (i > 0)
printf "\n"
printf "/*\n * %s\n */\n", SECTION
split("",lines)
lastelse = ""
for (SYMBOL in sections)
if (sections[SYMBOL] == SECTION)
y[pos[SYMBOL]] = SYMBOL
for (j = 0; j < counts[SECTION]; j++) {
SYMBOL = y[j]
split("",ntype)
split("",total)
split(values[SYMBOL],z,SUBSEP)
split("",val)
totalsum = 0
for (k in z) {
split(z[k],l,":")
ARCH = l[1]
TYPE = l[2]
VALUE = substr(z[k],length(ARCH)+length(TYPE)+3)
if (val[VALUE])
val[VALUE] = val[VALUE] " "
val[VALUE] = val[VALUE] ARCH ":" TYPE
ntype[VALUE,TYPE] += 1
total[VALUE] += 1
totalsum += 1
}
split("",curlines)
append = 1
for (VALUE in val) {
if (total[VALUE] == NTOTAL) {
if (VALUE == "__undefined__")
curlines["1"] = "#undef " SYMBOL "\n"
else if (VALUE == "__novalue__")
curlines["1"] = "#define " SYMBOL "\n"
else
curlines["1"] = "#define " SYMBOL " " VALUE "\n"
if (!lines["1"])
append = 0
break
}
shorteststr = ""
curcount = 0
for (m = 0; m < 4; m++) {
str = ""
split(val[VALUE],yy)
if (total[VALUE] > 1 && total[VALUE] == NTOTAL - 1) {
found = 0
for (arch in ARCHES) {
for (type in TYPES) {
archtype = arch ":" type
if (ARCHTYPES [archtype] == 1) {
for (n in yy)
if (yy[n] == archtype)
break
if (yy[n] != archtype) {
found = 1
break
}
}
}
if (found)
break
}
if (NARCHES[type] > 1 && NTYPES[arch] > 1) {
str = "!defined(__module__" arch "_" type ")"
shorteststr = str
break
}
}
if (m == 0 || m == 2) {
nfull = 0
split("",yysave)
for (type in TYPES)
if (ntype[VALUE,type] == NARCHES[type]) {
if (str) str = str " || "
str = str "defined(__module__" type ")"
for (k in yy) {
split(yy[k], z, ":")
if (z[2] == type) {
yysave[k] = yy[k]
delete yy[k]
}
}
nfull++
} else
NOTYPE = type
if (m < 2 && nfull > 1 && nfull == NTOTALTYPES - 1) {
str = "!defined(__module__" NOTYPE ")"
for (k in yysave)
yy[k] = yysave[k]
for (k in yy) {
split(yy[k], z, ":")
if (z[2] != NOTYPE)
delete yy[k]
}
}
}
savestr = str
nfull = 0
split("",yysave)
for (arch in ARCHES) {
narch = 0
for (k in yy) {
split(yy[k], z, ":")
if (z[1] == arch)
narch++
}
if (narch == NTYPES[arch]) {
if (str) str = str " || "
str = str "defined(__module__" arch ")"
for (k in yy) {
split(yy[k], z, ":")
if (z[1] == arch) {
yysave[k] = yy[k]
delete yy[k]
}
}
nfull++
} else
NOARCH = arch
}
if (m < 2 && nfull > 1 && nfull == NTOTALARCHES - 1) {
str = savestr
for (k in yysave)
yy[k] = yysave[k]
if (str) str = str " || "
str = str "!defined(__module__" NOARCH ")"
for (k in yy) {
split(yy[k], z, ":")
if (z[1] != NOARCH)
delete yy[k]
}
}
if (m == 1 || m == 3) {
savestr = str
nfull = 0
split("",yysave)
for (type in TYPES) {
ntypex = 0
for (k in yy) {
split(yy[k], z, ":")
if (z[2] == type)
ntypex++
}
if (ntypex == NARCHES[type]) {
if (str) str = str " || "
str = str "defined(__module__" type ")"
for (k in yy) {
split(yy[k], z, ":")
if (z[2] == type) {
yysave[k] = yy[k]
delete yy[k]
}
}
nfull++
} else
NOTYPE = type
}
if (m < 2 && nfull > 1 && nfull == NTOTALTYPES - 1) {
str = savestr
for (k in yysave)
yy[k] = yysave[k]
if (str) str = str " || "
str = "!defined(__module__" NOTYPE ")"
for (k in yy) {
split(yy[k], z, ":")
if (z[2] != NOTYPE)
delete yy[k]
}
}
}
for (k in yy) {
split(yy[k], z, ":")
if (str) str = str " || "
str = str "defined(__module__" z[1] "_" z[2] ")"
}
if (m == 0 || length(str) < length(shorteststr))
shorteststr = str
}
str = shorteststr
if (VALUE == "__undefined__")
curlines[str] = "#undef " SYMBOL "\n"
else if (VALUE == "__novalue__")
curlines[str] = "#define " SYMBOL "\n"
else
curlines[str] = "#define " SYMBOL " " VALUE "\n"
if (!lines[str])
append = 0
}
if (append) {
for (str in curlines)
if (curlines[str])
lines[str] = lines[str] curlines[str]
} else {
if (lines["1"])
printf "%s", lines["1"]
else if (j > 0) {
ifstr = "#if "
for (str in lines)
if (lines[str] && str != lastelse) {
printf "%s %s\n%s", ifstr, str, lines[str]
ifstr = "#elif "
}
if (lastelse != "")
printf "#else\n%s", lines[lastelse]
printf "#endif\n"
}
split("",lines)
lastelse = ""
for (str in curlines)
if (curlines[str]) {
lines[str] = curlines[str]
if (totalsum == NTOTAL && length(str) > length(lastelse)) {
lastelse = str
}
}
}
}
if (lines["1"])
printf "%s", lines["1"]
else if (j > 0) {
ifstr = "#if "
for (str in lines)
if (lines[str] && str != lastelse) {
printf "%s %s\n%s", ifstr, str, lines[str]
ifstr = "#elif "
}
if (lastelse != "")
printf "#else\n%s", lines[lastelse]
printf "#endif\n"
}
}
}
#!/bin/awk -f
{
# lines in input look like ARCH TYPE path/to/TYPE/ARCH/modules/foo.ver
ARCH=$1
ARCHES[ARCH]=1
TYPE=$2
TYPES[TYPE]=1
NTOTAL++
NARCHES[TYPE]++
NTYPES[ARCH]++
FILE=$3
# read files that look like pairs of repeating
# #define __ver_foo hexstring
# #define foo _set_ver(foo)
while ((getline < FILE) > 0) {
if ($0 ~ /^[ ]*$/)
continue
if ($1 != "#define" || $2 !~ /^__ver_/)
exit 1
# this is a "#define __ver_foo somehex" line
SYMBOL=gensub(/^__ver_/,"","",$2)
VALUE=gensub(/^(smp_|2gig_|smp2gig_)/,"","",$3)
VALUE=gensub(/^(smp|2gig|smp2gig)/,"","",VALUE)
values[SYMBOL,ARCH,TYPE]=VALUE
# skip the "#define foo _set_ver(foo)" line
if ((getline < FILE) <= 0)
exit 2
if ($1 != "#define" || $2 != SYMBOL || $3 != "_set_ver(" SYMBOL ")")
exit 3
}
close(FILE)
}
END {
count=0
for (key in values)
if (values[key]) {
count++
split(key,x,SUBSEP)
SYMBOL=x[1]
ARCH=x[2]
TYPE=x[3]
# (re)initialize a few arrays to have no elements
split("",x)
split("",ntype)
split("",total)
totalsum=0
for (arch in ARCHES)
for (type in TYPES)
if (values[SYMBOL,arch,type]) {
VALUE = values[SYMBOL,arch,type]
values[SYMBOL,arch,type] = ""
ntype[VALUE,type] += 1
total[VALUE] += 1
if (x[VALUE])
x[VALUE] = x[VALUE] " "
x[VALUE] = x[VALUE] arch ":" type
}
ifstr="#if "
for (VALUE in x) {
if (total[VALUE] == NTOTAL) {
# there is only one checksum for this symbol
printf "#define __ver_%s\t_ver_str(%s)\n", SYMBOL, VALUE
printf "#define %s _set_ver(%s)\n", SYMBOL, SYMBOL
break
}
totalsum += total[VALUE]
if (totalsum == NTOTAL && ifstr == "#elif") {
# this is the last unique checksum for this symbol
printf "#else\n#define __ver_%s\t_ver_str(%s)\n", SYMBOL, VALUE
printf "#define %s _set_ver(%s)\n", SYMBOL, SYMBOL
break
}
# there must be more than one checksum still to
# print for this symbol
str=""
split(x[VALUE],y)
for (type in TYPES)
if (ntype[VALUE,type] == NARCHES[type]) {
if (str) str = str " || "
str = str "defined(__module__" type ")"
for (k in y) {
split(y[k], z, ":")
if (z[2] == type)
delete y[k]
}
}
for (arch in ARCHES) {
narch=0
for (k in y) {
split(y[k], z, ":")
if (z[1] == arch)
narch++
}
if (narch == NTYPES[arch]) {
if (str) str = str " || "
str = str "defined(__module__" arch ")"
for (k in y) {
split(y[k], z, ":")
if (z[1] == arch)
delete y[k]
}
}
}
for (k in y) {
split(y[k], z, ":")
if (str) str = str " || "
str = str "defined(__module__" z[1] "_" z[2] ")"
}
printf "%s %s\n#define __ver_%s\t_ver_str(%s)\n", ifstr, str, SYMBOL, VALUE
printf "#define %s _set_ver(%s)\n", SYMBOL, SYMBOL
ifstr="#elif "
}
if (ifstr == "#elif ")
printf "#endif\n"
}
if (!count)
printf "\n"
}
#!/bin/bash -e
CONFLICTS=cvs-merge-conflicts
CVS="cvs -z3"
if [ -f .mergeinfo ] ; then
echo ".mergeinfo exists - clean up first"
exit
fi
if [ -f $CONFLICTS ] ; then
echo "$CONFLICTS exists - clean up first"
exit
fi
if [ $# -lt 2 -o $# -gt 3 ]; then
echo "This is phase 1 of merging branches. Usage: $0 parent child dir"
exit
fi
parent=$1
PARENT=`echo $parent | sed -e "s/^b_//" | tr "[a-z]" "[A-Z]"`
child=$2
CHILD=`echo $child | sed -e "s/^b_//" | tr "[a-z]" "[A-Z]"`
date=`date +%Y%m%d_%H%M`
dir=${3:-.}
module=$(basename $(<$dir/CVS/Repository))
if [ "$module" = "lustre" ] ; then
echo >&2 "${progname}: You probably want to merge lustre or portals, not the whole tree."
echo >&2 "${progname}: Try using ${0} $parent $child lustre"
exit 1
fi
case $parent in
HEAD) : ;;
b_*|b[1-4]*) : ;;
*) parent="b_$parent" ;;
esac
case $child in
HEAD) : ;;
b_*|b[1-4]*) : ;;
*) child="b_$child"
esac
if [ "$child" != "HEAD" -a "`cat $dir/CVS/Tag 2> /dev/null`" != "T$child" ]; then
echo "This script must be run within the $child branch"
exit 1
fi
TEST_FILE=${TEST_FILE:-ChangeLog} # does this need to be smarter?
[ $dir = "build" ] && TEST_FILE=lbuild
check_tag() {
[ -z "$1" ] && echo "check_tag() missing arg" && exit3
[ "$1" = "HEAD" ] && return
$CVS log $dir/$TEST_FILE 2> /dev/null | grep -q " $1: " && return
echo "$0: tag $1 not found in $dir/$TEST_FILE"
exit 2
}
check_tag $parent
check_tag ${CHILD}_BASE
cat << EOF > .mergeinfo
parent=$parent
PARENT=$PARENT
child=$child
CHILD=$CHILD
date=$date
dir=$dir
module=$module
CONFLICTS=$CONFLICTS
OPERATION=Merge
OPERWHERE=from
EOF
echo PARENT: $PARENT parent: $parent CHILD: $CHILD child: $child date: $date
echo -n "tagging $parent as '${PARENT}_${CHILD}_UPDATE_PARENT_$date' ...."
$CVS rtag -r $parent ${PARENT}_${CHILD}_UPDATE_PARENT_$date $module
echo "done"
echo -n "tagging $child as '${PARENT}_${CHILD}_UPDATE_CHILD_$date' ...."
$CVS rtag -r $child ${PARENT}_${CHILD}_UPDATE_CHILD_$date $module
echo "done"
# Apply all of the changes to your local tree:
echo "Updating: -j ${CHILD}_BASE -j ${PARENT}_${CHILD}_UPDATE_PARENT_$date ...."
$CVS update -j ${CHILD}_BASE -j ${PARENT}_${CHILD}_UPDATE_PARENT_$date -dP $dir
echo "done"
echo -n "Recording conflicts in $CONFLICTS ..."
$CVS update | awk '/^C/ { print $2 }' > $CONFLICTS
if [ -s $CONFLICTS ] ; then
echo "Conflicts found, fix before committing."
cat $CONFLICTS
else
echo "No conflicts found"
rm -f $CONFLICTS
fi
echo "done"
echo "Build, test, commit and then run merge2.sh (no arguments)"
#!/bin/bash -e
if [ ! -f .mergeinfo ] ; then
echo ".mergeinfo doesn't exist - exit"
exit
fi
. .mergeinfo
if [ "$OPERATION" != "Merge" ] ; then
echo "OPERATION must be Merge - is $OPERATION"
echo "You should probably be running ${OPERATION}2.sh"
exit
fi
if [ -f $CONFLICTS ] ; then
echo "$CONFLICTS exists - clean up first"
cat $CONFLICTS
exit
fi
cvs update $dir 2>&1 | grep "^M" && echo "uncommitted changes" && exit 1
echo -n "Tagging ${PARENT}_${CHILD}_UPDATE_PARENT_$date as ${CHILD}_BASE_$date ..."
cvs rtag -r ${PARENT}_${CHILD}_UPDATE_PARENT_$date ${CHILD}_BASE_$date $module
echo "done"
echo -n "Tagging ${CHILD}_BASE as ${CHILD}_BASE_PREV ...."
cvs rtag -F -r ${CHILD}_BASE ${CHILD}_BASE_PREV $module
echo "done"
echo "${CHILD}_BASE_$date as ${CHILD}_BASE ..."
cvs rtag -F -r ${CHILD}_BASE_$date ${CHILD}_BASE $module
echo "saving .mergeinfo as .mergeinfo-$date"
mv .mergeinfo .mergeinfo-$date
echo "done"
This is release 0.9.2 Beta of the Lustre OS X client.
This is not a production quality release, so use it with care, and on non-production systems. The installation will overwrite the OS X kernel on your system. Un-installing this package will restore your current kernel.
Welcome to the Lustre OS X client installation
You will be guided through the steps necessary to install this software. During installation you will be required to reboot your Mac, so make sure you have saved all your data and closed applications before continuing the installation.
#!/bin/sh
#
# This script is used to create package directory tree used
# by PackageMaker in OS X.
PREFIX=$1
STAGE=$2
RESOURCE=$PWD/build/osxpack
if ! [ -d $RESOURCE ]; then
echo "Your tree seems to be missing $RESOURCE." >&2
fi
if [ "x$PREFIX" == "x" ]; then
PREFIX=/home/cfs/package
fi
if [ "x$STAGE" == "x" ]; then
STAGE=/System/Library/Extensions
fi
if ! [ -d $STAGE/llite.kext ]; then
echo "Sorry, cannot find stage files for package"
exit 1
fi
if ! [ -d $PREFIX ]; then
mkdir -p $PREFIX
fi
if ! [ -d $PREFIX/Install_resources ]; then
mkdir -p $PREFIX/Install_resources
fi
if ! [ -d $PREFIX/Package_contents ]; then
mkdir -p $PREFIX/Package_contents
fi
CONTENTS=$PREFIX/Package_contents
if ! [ -d $CONTENTS/System/Libraray/Extensions ]; then
mkdir -p $CONTENTS/System/Library/Extensions
fi
# IMPORTANT
# /etc is symlink of /private/etc in OS X, if we
# just use $CONTENTS/etc, it will OVERWRITE /etc in
# installation target, that means all files in /etc
# will be lost, the system will be corrupted.
if ! [ -d $CONTENTS/private/etc ]; then
mkdir -p $CONTENTS/private/etc
fi
if ! [ -d $CONTENTS/sbin ]; then
mkdir -p $CONTENTS/sbin
fi
cp -f $RESOURCE/*.txt $PREFIX/Install_resources/
cp -f $RESOURCE/*flight $PREFIX/Install_resources/
cp -f $RESOURCE/sysctl.conf $CONTENTS/private/etc
cp -f $RESOURCE/uninstall_lustre $CONTENTS/sbin
cp -f $RESOURCE/unload_lustre $CONTENTS/sbin
cp -rf $STAGE/llite.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/mdc.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/lov.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/osc.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/ptlrpc.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/ptlrpcs.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/obdclass.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/lvfs.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/ksocknal.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/portals.kext $CONTENTS/System/Library/Extensions
cp -rf $STAGE/libcfs.kext $CONTENTS/System/Library/Extensions
#!/bin/sh
/usr/sbin/nvram boot-args="debug=0xe zsize=256"
# Delete cache files
if [ -f /System/Library/Extensions.kextcache ]; then
rm -f /System/Library/Extensions.kextcache
fi
if [ -d /System/Library/Caches/com.apple.kernelcaches ]; then
rm -rf /System/Library/Caches/com.apple.kernelcaches
fi
touch /System/Library
#!/bin/sh
date=`date +%Y%m%d_%H%M`
backpath=/System/LustreBackup
if ! [ -d $backpath ]; then
mkdir -p $backpath
fi
backdir=${backpath}/SystemBackup
# If system has been backed up, just exit
if [ -d ${backdir} ]; then
exit 0
fi
mkdir $backdir
chmod 700 $backdir
# create backup directory
mkdir -p $backdir/System/Library/Frameworks
mkdir -p $backdir/System/Library/Extensions
mkdir -p $backdir/usr/lib
mkdir -p $backdir/usr/include
mkdir -p $backdir/private/etc
# backup the old system
cp /mach_kernel $backdir/
cp -rf /System/Library/Frameworks/IOKit.framework $backdir/System/Library/Frameworks/
cp -rf /System/Library/Frameworks/Kernel.framework $backdir/System/Library/Frameworks/
cp -rf /System/Library/Frameworks/System.framework $backdir/System/Library/Frameworks/
cp -rf /System/Library/Extensions/System.kext $backdir/System/Library/Extensions/
cp -rf /usr/include/bsm $backdir/usr/include/bsm
cp -rf /usr/include/default_pager $backdir/usr/include/default_pager
cp -rf /usr/include/dev $backdir/usr/include/dev
cp -rf /usr/include/device $backdir/usr/include/device
cp -rf /usr/include/drivers $backdir/usr/include/drivers
cp -rf /usr/include/hfs $backdir/usr/include/hfs
cp -rf /usr/include/isofs $backdir/usr/include/isofs
cp -rf /usr/include/libkern $backdir/usr/include/libkern
cp -rf /usr/include/mach $backdir/usr/include/mach
cp -rf /usr/include/mach_debug $backdir/usr/include/mach_debug
cp -rf /usr/include/machine $backdir/usr/include/machine
cp -rf /usr/include/miscfs $backdir/usr/include/miscfs
cp -rf /usr/include/net $backdir/usr/include/net
cp -rf /usr/include/netat $backdir/usr/include/netat
cp -rf /usr/include/netinet $backdir/usr/include/netinet
cp -rf /usr/include/netinet6 $backdir/usr/include/netinet6
cp -rf /usr/include/netkey $backdir/usr/include/netkey
cp -rf /usr/include/nfs $backdir/usr/include/nfs
cp -rf /usr/include/pexpert $backdir/usr/include/pexpert
cp -rf /usr/include/ppc $backdir/usr/include/ppc
cp -rf /usr/include/profile $backdir/usr/include/profile
cp -rf /usr/include/sys $backdir/usr/include/sys
cp -rf /usr/include/ufs $backdir/usr/include/ufs
cp -rf /usr/include/vfs $backdir/usr/include/vfs
cp -f /usr/lib/libIOKit.A.dylib $backdir/usr/lib/libIOKit.A.dylib
cp -f /usr/lib/libIOKit.dylib $backdir/usr/lib/libIOKit.dylib
cp -f /usr/lib/libkmod.a $backdir/usr/lib/libkmod.a
cp -f /usr/lib/libkmodc++.a $backdir/usr/lib/libkmodc++.a
if [ -f /private/etc/sysctl.conf ]; then
cp -f /private/etc/sysctl.conf $backdir/private/etc/sysctl.conf
fi
# record sysctem backup path of current installation
# echo $backdir >> $backpath/lustre-current
# echo $date > $backdir/install_date
# nmbclusters can not be modified by sysctl(it's read only)
# so we have to change it in kernel patch
## kern.ipc.nmbclusters=32768
# Keep a long enough reassembly queue.
net.inet.tcp.reass.maxsegments=4096
# max permited sockbuf
kern.ipc.maxsockbuf=8388608
# XXX
net.inet.tcp.sendspace=3217968
net.inet.tcp.recvspace=3217968
kern.maxvnodes=65536
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment