多少人爱你青春欢畅的时辰, 爱你的美丽假意和真心, 只有一个人爱你那朝圣者的灵魂, 爱你衰老了的连上痛苦的皱纹.
分类: LINUX
2015-03-20 16:22:13
Lustre client compute
1.Basic Environment Building
1.1 准备安装
? yum groupinstall "Development Tools” # 这样做会确定你拥有编译时所需的一切工具。
? yum install ncurses-devel # 你必须这样才能让 make *config 这个指令正确地执行。
? yum install qt-devel # 如果你打算用 make xconfig 而不是 make gconfig 或 make menuconfig,才须要这样做。
? yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel rpmdevtools kernel-debuginfo kernel-debuginfo-common-
No crc32 pclmulqdq crypto api found, enable internal pclmulqdq based crc32
libgssapi or libgssglue is not found, which is required by GSS.
checking shrinker has 'count_objects'... no
Preparing the Lustre source
1.Create a user build with the home directory /home/build
useradd -m build
2.Switch to the user build and change to the build $HOMEdirectory.
su build
cd $HOME
3.Get the MASTER branch from Whamcloud git.
git clone git://git.whamcloud.com/fs/lustre-release.git //地址要修改一下
cd lustre-release
4.Run sh ./autogen.sh
# sh ./autogen.sh
Checking for a complete tree...
checking for automake-1.9 >= 1.9... found 1.9.6
...
...
configure.ac:10: installing `./config.sub'
configure.ac:12: installing `./install-sh'
configure.ac:12: installing `./missing'
Running autoconf
Prepare the kernel source
In this walk-thru, the kernel is built using rpmbuild - a tool specific to RPM based distributions.
1.Get the kernel source. First create the directory structure, then get the source from the RPM. Create a .rpmmacros file to install the kernel source in our user dir.
cd $HOME
mkdir -p kernel/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
cd kernel
echo '%_topdir %(echo $HOME)/kernel/rpmbuild' > ~/.rpmmacros
2.Install the kernel source:
download kernel-2.6.32-504.8.1.el6.src.rpm
rpm -ivh kernel-2.6.32-504.8.1.el6.src.rpm 2>&1 | grep -v mockb
3.Prepare the source using rpmbuild.
cd ~/kernel/rpmbuild
rpmbuild -bp --target=`uname -m` ./SPECS/kernel.spec
vim SPECS/kernel.spec
revise line.18, to 18 %define buildid .localJKofv1
rpmbuild -bp --target=`uname -m` ./SPECS/kernel.spec
This will end with:
...
gpg: Total number processed: 1
gpg: imported: 1
+ gpg --homedir . --export --keyring ./kernel.pub Red
gpg: WARNING: unsafe permissions on homedir `.'
+ gcc -o scripts/bin2c scripts/bin2c.c
+ scripts/bin2c ksign_def_public_key __initdata
+ cd ..
+ exit 0
Patch the kernel source with the Lustre code.
1.enter the directory ~/kernel/rpmbuild/BUILD/kernel-2.6.32-504.8.1.el6/linux-2.6.32-504.8.1.el6.localjkofv1.x86_64/
cd ~/kernel/rpmbuild/BUILD/kernel-2.6.32-504.8.1.el6/linux-2.6.32-504.8.1.el6.localjkofv1.x86_64/
2.overwrite the .config file with ~/lustre-release/lustre/kernel_patches/kernel_configs/kernel-2.6.32-2.6-rhel6-x86_64.config
cp ~/lustre-release/lustre/kernel_patches/kernel_configs/kernel-2.6.32-2.6-rhel6-x86_64.config ./.config
make oldconfig
make menuconfig
vim .config
cp .config configs/kernel-2.6.32-`uname -m`-[type].config
cp configs/* ~/kernel/rpmbuild/SOURCES
创建.config 文件复制到configs/kernel*.config中,把configs中的文件复制到SOURCES中
修改kernel的文件:
cd ~/kernel/rpmbuild/SPECS
cp kernel.spec kernel.spec.distro
vi kernel.spec
请把第 929 行:
cp $RPM_SOURCE_DIR/config-* .
改为:
cp $RPM_SOURCE_DIR/kernel-*.config .
? 删除第 933行。它含有:
make -f %{SOURCE20} VERSION=%{version} configs
添加以下内容到kernel.spec中
1077 make -s %{?cross_opts} ARCH=$Arch %{oldconfig_target} > /dev/null
1078 cp /home/mockbuild/lustre-release/lustre/kernel_patches/kernel_configs/kernel-2.6.32-2.6-rhel6-x86_64.config /home/mockbuild/kernel/rpmbuild/BUILDROOT/.config
1079 ln -sf /home/mockbuild/lustre-release/lustre/kernel_patches/series/2.6-rhel6.series series
1080 ln -sf /home/mockbuild/lustre-release/lustre/kernel_patches/patches patches
1081 /usr/bin/quilt push -av
1082 make include/asm
1083 make include/linux/version.h
1084 make SUBDIRS=scripts
1085 make include/linux/utsrelease.h
1086 make -s %{?cross_opts} ARCH=$Arch V=1 %{?_smp_mflags} $MakeTarget %{?sparse_mflags}
rpmbuild -bb --target=x86_64 --with firmware --without kabichk --without debug --without xen kernel.spec 2> ~/logs/build/build-err.log | tee ~/logs/build/build-out.log
yum install python-docutils -y
./configure --with-linux=/home/mockbuild/kernel/rpmbuild/BUILD/kernel-2.6.32-504.8.1.el6/linux-2.6.32-504.8.1.el6.localjkofv1.x86_64/
configure client:
./configure —with-linux=/home/mockbuild/kernel/rpmbuild/BUILD/kernel-2.6.32-504.8.1.el6/linux-2.6.32-504.8.1.el6.localjkofv1.x86_64/ --disable-server