Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107637
  • 博文数量: 29
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 240
  • 用 户 组: 普通用户
  • 注册时间: 2014-07-11 15:42
个人简介

多少人爱你青春欢畅的时辰, 爱你的美丽假意和真心, 只有一个人爱你那朝圣者的灵魂, 爱你衰老了的连上痛苦的皱纹.

文章分类

全部博文(29)

文章存档

2018年(1)

2015年(2)

2014年(26)

我的朋友

分类: 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- libgssglue-devel net-snmp-devel libyaml # 创建 CentOS-6 内核时需要它们。


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


  • eval ./configure --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-linux=/lib/modules/2.6.32-504.el6.local.x86_64/source --with-linux-obj=/lib/modules/2.6.32-504.el6.local.x86_64/build --with-release=2.6.32_504.el6.local.x86_64 --enable-tests --enable-modules --without-zfs --with-kmp-moddir=extra

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



pastedGraphic.png

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


  • 编辑lustre的kernel.spec文件

创建.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


阅读(1824) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~