前回の続き。ネットワークが繋がらないことにはどうにもならないので、今日はインストール直後からちゃんとネットワークが動くように頑張ってみた。ELRepo使えばいいじゃんって話もあるけど自分の勉強もかねて自力で頑張ってみる。やっぱり先輩はいるもので、ここやここでやりかたを解説していた。正直いままでDKMSしか知らなかったのでKMPとか初めて知った。これは読むべき。ていうか事前に読んでる前提で以下の話。超勉強になるぜ勉強するぜ。 1.RPMパッケージを作る
1.1.rpmmacroを作る
とりあえず手元にある./.rpmmacrosをベースに作ってみる。OS配布サーバの/root以下にするとこんな感じか。 %_topdir /root/rpmbuild %_smp_mflags -j3 %__arch_install_post /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot %packager Anatano Namae <anatano_namae@dokosoko.com> %_signature gpg %_gpg_path /root/.gnupg %_gpg_name Anatano Namae <anatano_namae@dokosoko.com> %_gpgbin /usr/bin/gpg ### 1.2.GPG鍵を作る
で、/root/rpmbuildディレクトリを作る。パーミッションは700で。その下にBUILD/BUILDROOT/RPMS/SOURCES/SPECS/SRPMSの各ディレクトリを作る。 # mkdir BUILD BUILDROOT RPMS SOURCES SPECS SRPMS # ls -l total 24 drwxr-xr-x 2 root root 4096 Jan 26 23:04 BUILD drwxr-xr-x 2 root root 4096 Jan 26 23:04 BUILDROOT drwxr-xr-x 2 root root 4096 Jan 26 23:04 RPMS drwxr-xr-x 2 root root 4096 Jan 26 23:04 SOURCES drwxr-xr-x 2 root root 4096 Jan 26 23:04 SPECS drwxr-xr-x 2 root root 4096 Jan 26 23:04 SRPMS # ### 1.4.specファイルを作る
ここはELRepoのを拝借。以下掲載。 # cat /usr/src/redhat/SPECS/atl1e-kmod.spec # Define the kmod package name here. %define kmod_name atl1e Name: %{kmod_name}-kmod Version: 1.0.1.0 Release: 3.el5.elrepo Group: System Environment/Kernel License: GPL v2 Summary: %{kmod_name} kernel modules for Atheros(R) L1E Gigabit Ethernet NICs URL: http://www.atheros.com/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build-%(%{__id_u} -n) ExclusiveArch: i686 x86_64 # Sources. Source0: %{kmod_name}-%{version}.tar.bz2 Source10: kmodtool-%{kmod_name} # If kversion isn’t defined on the rpmbuild line, build for the current kernel. %{!?kversion: %define kversion %(uname -r)} # Define the variants for each architecture. %define basevar "" %ifarch i686 %define paevar PAE %endif %ifarch i686 x86_64 %define xenvar xen %endif # If kvariants isn’t defined on the rpmbuild line, build all variants for this architecture. %{!?kvariants: %define kvariants %{?basevar} %{?xenvar} %{?paevar}} # Magic hidden here. %define kmodtool sh %{SOURCE10} %{expand:%(%{kmodtool} rpmtemplate_kmp %{kmod_name} %{kversion} %{kvariants} 2>/dev/null)} %description This package provides the %{kmod_name} kernel modules for the Atheros(R) L1E Gigabit Ethernet NIC with the PCI-Express interface. It is built to depend upon the specific ABI provided by a range of releases of the same variant of the Linux kernel and not on any one specific build. %prep %setup -q -c -T -a 0 for kvariant in %{kvariants} ; do %{__cp} -a %{kmod_name}-%{version} _kmod_build_$kvariant %{__cat} «-EOF >_kmod_build_$kvariant/%{kmod_name}.conf override %{kmod_name} * weak-updates/%{kmod_name} EOF done %build for kvariant in %{kvariants} ; do ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} pushd _kmod_build_$kvariant %{__make} -C “${ksrc}” modules M=$PWD popd done %install export INSTALL_MOD_PATH=$RPM_BUILD_ROOT export INSTALL_MOD_DIR=extra/%{kmod_name} for kvariant in %{kvariants} ; do ksrc=%{_usrsrc}/kernels/%{kversion}${kvariant:+-$kvariant}-%{_target_cpu} pushd _kmod_build_$kvariant %{__make} -C “${ksrc}” modules_install M=$PWD %{__install} -d ${INSTALL_MOD_PATH}/etc/depmod.d/ %{__install} %{kmod_name}.conf ${INSTALL_MOD_PATH}/etc/depmod.d/ popd done # Strip the module(s). find ${INSTALL_MOD_PATH} -type f -name *.ko -exec strip –strip-debug {} ; %clean %{__rm} -rf $RPM_BUILD_ROOT %changelog * Fri Oct 09 2009 Alan Bartlett ajb@elrepo.org - Revised the kmodtool file and this spec file. * Wed Jul 29 2009 Alan Bartlett ajb@elrepo.org - Revised the kmodtool file and this spec file. * Tue Mar 24 2009 Alan Bartlett ajb@elrepo.org - Added the .elrepo tag and code to strip the module(s). * Sat Dec 27 2008 Alan Bartlett ajb@elrepo.org - Revised this spec file. * Mon Dec 15 2008 Alan Bartlett ajb@elrepo.org - Added a .el5 identifier to the release. * Sun Nov 30 2008 Alan Bartlett ajb@elrepo.org - Initial build of the kmod packages. # ### 1.5.ソースファイルをコピーする。これもELRepoのrpmをほどいたものから拝借
1.6.ビルドの時にいるので、kernel-PAE-devel, kernel-xen-develをインストール
rpmbuild -bb –target i686 ./SPECS/atl1e-kmod.spec Building target platforms: i686 Building for target i686 Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.19714 + umask 022 + cd /root/rpmbuild/BUILD + LANG=C + export LANG + unset DISPLAY + cd /root/rpmbuild/BUILD + rm -rf atl1e-kmod-1.0.1.0 + /bin/mkdir -p atl1e-kmod-1.0.1.0 + cd atl1e-kmod-1.0.1.0 + /usr/bin/bzip2 -dc /root/rpmbuild/SOURCES/atl1e-1.0.1.0.tar.bz2 + tar -xf - + STATUS=0 + ‘[’ 0 -ne 0 ‘]’ ++ /usr/bin/id -u + ‘[’ 0 = 0 ‘]’ + /bin/chown -Rhf root . ++ /usr/bin/id -u + ‘[’ 0 = 0 ‘]’ + /bin/chgrp -Rhf root . + /bin/chmod -Rf a+rX,u+w,g-w,o-w . + for kvariant in ‘""’ xen PAE + /bin/cp -a atl1e-1.0.1.0 _kmod_build_ + /bin/cat + for kvariant in ‘""’ xen PAE + /bin/cp -a atl1e-1.0.1.0 _kmod_build_xen + /bin/cat + for kvariant in ‘""’ xen PAE + /bin/cp -a atl1e-1.0.1.0 _kmod_build_PAE + /bin/cat + exit 0 Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.22401 + umask 022 + cd /root/rpmbuild/BUILD + cd atl1e-kmod-1.0.1.0 + LANG=C + export LANG + unset DISPLAY + for kvariant in ‘""’ xen PAE + ksrc=/usr/src/kernels/2.6.18-164.el5-i686 + pushd _kmod_build_ ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_ ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/bin/make -C /usr/src/kernels/2.6.18-164.el5-i686 modules M=/root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_ make: Entering directory /usr/src/kernels/2.6.18-164.el5-i686' CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/at\_main.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/at\_hw.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/at\_param.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/at\_ethtool.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/kcompat.o LD [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/atl1e.o Building modules, stage 2. MODPOST CC /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/atl1e.mod.o LD [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/atl1e.ko make: Leaving directory
/usr/src/kernels/2.6.18-164.el5-i686’ + popd ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + for kvariant in ‘""’ xen PAE + ksrc=/usr/src/kernels/2.6.18-164.el5-xen-i686 + pushd _kmod_build_xen ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_xen ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/bin/make -C /usr/src/kernels/2.6.18-164.el5-xen-i686 modules M=/root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_xen make: Entering directory /usr/src/kernels/2.6.18-164.el5-xen-i686' CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/at\_main.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/at\_hw.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/at\_param.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/at\_ethtool.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/kcompat.o LD [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/atl1e.o Building modules, stage 2. MODPOST CC /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/atl1e.mod.o LD [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/atl1e.ko make: Leaving directory
/usr/src/kernels/2.6.18-164.el5-xen-i686’ + popd ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + for kvariant in ‘""’ xen PAE + ksrc=/usr/src/kernels/2.6.18-164.el5-PAE-i686 + pushd _kmod_build_PAE ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_PAE ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/bin/make -C /usr/src/kernels/2.6.18-164.el5-PAE-i686 modules M=/root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_PAE make: Entering directory /usr/src/kernels/2.6.18-164.el5-PAE-i686' CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/at\_main.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/at\_hw.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/at\_param.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/at\_ethtool.o CC [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/kcompat.o LD [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/atl1e.o Building modules, stage 2. MODPOST CC /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/atl1e.mod.o LD [M] /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/atl1e.ko make: Leaving directory
/usr/src/kernels/2.6.18-164.el5-PAE-i686’ + popd ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + exit 0 Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.95856 + umask 022 + cd /root/rpmbuild/BUILD + cd atl1e-kmod-1.0.1.0 + LANG=C + export LANG + unset DISPLAY + export INSTALL_MOD_PATH=/var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root + INSTALL_MOD_PATH=/var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root + export INSTALL_MOD_DIR=extra/atl1e + INSTALL_MOD_DIR=extra/atl1e + for kvariant in ‘""’ xen PAE + ksrc=/usr/src/kernels/2.6.18-164.el5-i686 + pushd _kmod_build_ ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_ ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/bin/make -C /usr/src/kernels/2.6.18-164.el5-i686 modules_install M=/root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_ make: Entering directory /usr/src/kernels/2.6.18-164.el5-i686' INSTALL /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_/atl1e.ko DEPMOD 2.6.18-164.el5 make: Leaving directory
/usr/src/kernels/2.6.18-164.el5-i686’ + /usr/bin/install -d /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root/etc/depmod.d/ + /usr/bin/install atl1e.conf /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root/etc/depmod.d/ + popd ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + for kvariant in ‘""’ xen PAE + ksrc=/usr/src/kernels/2.6.18-164.el5-xen-i686 + pushd _kmod_build_xen ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_xen ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/bin/make -C /usr/src/kernels/2.6.18-164.el5-xen-i686 modules_install M=/root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_xen make: Entering directory /usr/src/kernels/2.6.18-164.el5-xen-i686' INSTALL /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_xen/atl1e.ko DEPMOD 2.6.18-164.el5xen make: Leaving directory
/usr/src/kernels/2.6.18-164.el5-xen-i686’ + /usr/bin/install -d /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root/etc/depmod.d/ + /usr/bin/install atl1e.conf /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root/etc/depmod.d/ + popd ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + for kvariant in ‘""’ xen PAE + ksrc=/usr/src/kernels/2.6.18-164.el5-PAE-i686 + pushd _kmod_build_PAE ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_PAE ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/bin/make -C /usr/src/kernels/2.6.18-164.el5-PAE-i686 modules_install M=/root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/_kmod_build_PAE make: Entering directory /usr/src/kernels/2.6.18-164.el5-PAE-i686' INSTALL /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0/\_kmod\_build\_PAE/atl1e.ko DEPMOD 2.6.18-164.el5PAE make: Leaving directory
/usr/src/kernels/2.6.18-164.el5-PAE-i686’ + /usr/bin/install -d /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root/etc/depmod.d/ + /usr/bin/install atl1e.conf /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root/etc/depmod.d/ + popd ~/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + find /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root -type f -name ‘.ko’ -exec strip –strip-debug ‘{}’ ‘;’ + /usr/lib/rpm/find-debuginfo.sh /root/rpmbuild/BUILD/atl1e-kmod-1.0.1.0 + /usr/lib/rpm/check-rpaths /usr/lib/rpm/check-buildroot + /usr/lib/rpm/redhat/brp-compress + /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip + /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump + /usr/lib/rpm/brp-python-bytecompile + /usr/lib/rpm/redhat/brp-java-repack-jars Processing files: kmod-atl1e-1.0.1.0-3.el5.elrepo Finding Provides: /usr/lib/rpm/redhat/find-provides Finding Requires: /usr/lib/rpm/redhat/find-requires Provides: kabi-modules = 2.6.18-164.el5 atl1e-kmod = 1.0.1.0-3.el5.elrepo modalias(pci:v00001969d00001026svsdbcsci) = 1.0.1.0 Requires(interp): /bin/sh /bin/sh /bin/sh Requires(rpmlib): rpmlib(VersionedDependencies) <= 3.0.3-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 Requires(post): /sbin/depmod /bin/sh Requires(preun): /bin/sh Requires(postun): /sbin/depmod /bin/sh Requires: kernel(rhel5_mm_ga) = 09f63dfab81bba7e01a2bf693f5ce125db466051 kernel(rhel5_drivers_pci_ga) = 33d9e0612417f727a0d8311c229fe8a80c65bb65 kernel(rhel5_net_core_ga) = 5aae342a66dcbcc14a7c1c001624f73a13620809 kernel(rhel5_kernel_module_ga) = 1b051ce57d6b18fdf071786f6f7296d3d0ab28f9 kernel(rhel5_kernel_ga) = 2cd142708e2d573b2de522df5df87aaeb7c1d298 kernel(rhel5_kernel_irq_ga) = 828c3f468e7a640d409d2bf24b4676e457406917 kernel(rhel5_init_ga) = e18da0926c862eaed98f20f312403ea33c944cbd kernel(rhel5_arch_i386_kernel_ga) = d1c30e0a553e9225eebd1b866e0d3ed7a6154147 kernel(rhel5_net_sched_ga) = 85d96cb2f432b540922c05edf889854d63884830 kernel(rhel5_vmlinux_ga) = 2bf444396ff7060828059d7a5379435140aee48a kernel(rhel5_arch_i386_mm_ga) = 0164a9bd3f1d0935cd3dcb734785179f25c1a064 kernel(rhel5_net_ethernet_ga) = 9c3c45aebe364e710f059016c591287b76553c11 Processing files: kmod-atl1e-xen-1.0.1.0-3.el5.elrepo Finding Provides: /usr/lib/rpm/redhat/find-provides Finding Requires: /usr/lib/rpm/redhat/find-requires Provides: kabi-modules = 2.6.18-164.el5xen atl1e-kmod = 1.0.1.0-3.el5.elrepo modalias(pci:v00001969d00001026svsdbcsci*) = 1.0.1.0 Requires(interp): /bin/sh /bin/sh /bin/sh Requires(rpmlib): rpmlib(VersionedDependencies) <= 3.0.3-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 Requires(post): /sbin/depmod /bin/sh Requires(preun): /bin/sh Requires(postun): /sbin/depmod /bin/sh Requires: kernel(rhel5_mm_ga) = 5016f99aaf599aa846aa6937d9f20b5b1c4e3575 kernel(rhel5_net_sched_ga) = f37da797205bc94ee3ef5c164fe5e1f648db3483 kernel(rhel5_net_core_ga) = f7b50e8442f1ebbdb5da72ae720b178334020d33 kernel(rhel5_kernel_module_ga) = d5735208bc6503ccd8948759997ed61fb6889451 kernel(rhel5_kernel_ga) = 52c756e7a0505cfbcd0285fd99a855956b18c37b kernel(rhel5_drivers_pci_ga) = 454a29c6f654e93a3899a3fa29d214ea326c98bc kernel(rhel5_kernel_irq_ga) = 828c3f468e7a640d409d2bf24b4676e457406917 kernel(rhel5_init_ga) = e18da0926c862eaed98f20f312403ea33c944cbd kernel(rhel5_net_ethernet_ga) = 9c11f8f984fd4c5de39b059a170378fb6b676650 kernel(rhel5_arch_i386_kernel_ga) = 4b96372e997f8b63b9592eed1bf476f98ba7469d kernel(rhel5_vmlinux_ga) = d1de93c7337d058f90834388c99daa94ca262d90 ksym(pci_enable_msi) = 7e2b784b kernel(rhel5_arch_i386_mm_ga) = c4f1b9a53127e1f1ab1680c9a78e23b73ff1b054 kernel(rhel5_arch_i386_mach_xen_ga) = f140ac8f99498655de6d2128067bff4946e3cbcf ksym(pci_disable_msi) = e6abde88 Processing files: kmod-atl1e-PAE-1.0.1.0-3.el5.elrepo Finding Provides: /usr/lib/rpm/redhat/find-provides Finding Requires: /usr/lib/rpm/redhat/find-requires Provides: kabi-modules = 2.6.18-164.el5PAE atl1e-kmod = 1.0.1.0-3.el5.elrepo modalias(pci:v00001969d00001026svsdbcsci*) = 1.0.1.0 Requires(interp): /bin/sh /bin/sh /bin/sh Requires(rpmlib): rpmlib(VersionedDependencies) <= 3.0.3-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 Requires(post): /sbin/depmod /bin/sh Requires(preun): /bin/sh Requires(postun): /sbin/depmod /bin/sh Requires: kernel(rhel5_mm_ga) = 6332c6ed3ca143359798a4529631ebefa894a9c9 kernel(rhel5_drivers_pci_ga) = 50086fb8ed28719cd834e4faca88e0dd8e6451eb kernel(rhel5_net_core_ga) = d9d07c04de86c56d6fa0af24917e03af183200f8 kernel(rhel5_kernel_module_ga) = 6a580650b415bc0a40b1d9914dac45fe3eb24526 kernel(rhel5_kernel_ga) = 20c31f5714940a261cdf954d5a8195d6bcffc42a kernel(rhel5_kernel_irq_ga) = 828c3f468e7a640d409d2bf24b4676e457406917 kernel(rhel5_init_ga) = e18da0926c862eaed98f20f312403ea33c944cbd kernel(rhel5_net_ethernet_ga) = 17934f3ea7f56deeaa9b45e5fa8ea47db815ac51 kernel(rhel5_net_sched_ga) = 2210a9a7709720cd845203f97b52c4d2c2758a5c kernel(rhel5_arch_i386_kernel_ga) = 122d62e3da674471acbdef78d5c2cc8206275af9 kernel(rhel5_vmlinux_ga) = 60527c0937744189fdc3fcc5dd43601b259d0cf1 kernel(rhel5_arch_i386_mm_ga) = 7fd3d573119f55b3123fce44b3c6dd1961226949 Processing files: atl1e-kmod-debuginfo-1.0.1.0-3.el5.elrepo Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root Wrote: /root/rpmbuild/RPMS/i686/kmod-atl1e-1.0.1.0-3.el5.elrepo.i686.rpm Wrote: /root/rpmbuild/RPMS/i686/kmod-atl1e-xen-1.0.1.0-3.el5.elrepo.i686.rpm Wrote: /root/rpmbuild/RPMS/i686/kmod-atl1e-PAE-1.0.1.0-3.el5.elrepo.i686.rpm Wrote: /root/rpmbuild/RPMS/i686/atl1e-kmod-debuginfo-1.0.1.0-3.el5.elrepo.i686.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.12479 + umask 022 + cd /root/rpmbuild/BUILD + cd atl1e-kmod-1.0.1.0 + /bin/rm -rf /var/tmp/atl1e-kmod-1.0.1.0-3.el5.elrepo-build-root + exit 0 # で、見るとrpmファイルができている。 # find .|grep -v BUILD . ./SRPMS ./SPECS ./SPECS/atl1e-kmod.spec ./RPMS ./RPMS/i686 ./RPMS/i686/atl1e-kmod-debuginfo-1.0.1.0-3.el5.elrepo.i686.rpm ./RPMS/i686/kmod-atl1e-xen-1.0.1.0-3.el5.elrepo.i686.rpm ./RPMS/i686/kmod-atl1e-1.0.1.0-3.el5.elrepo.i686.rpm ./RPMS/i686/kmod-atl1e-PAE-1.0.1.0-3.el5.elrepo.i686.rpm ./SOURCES ./SOURCES/kmodtool-atl1e ./SOURCES/atl1e-1.0.1.0.tar.bz2 # できたrpmファイルに署名する。 # cd RPMS/i686 # for i in ls -1 *.rpm
> do > rpm –addsign $i > done Enter pass phrase: Pass phrase is good. atl1e-kmod-debuginfo-1.0.1.0-3.el5.elrepo.i686.rpm: gpg: WARNING: standard input reopened gpg: WARNING: standard input reopened Enter pass phrase: Pass phrase is good. kmod-atl1e-1.0.1.0-3.el5.elrepo.i686.rpm: gpg: WARNING: standard input reopened gpg: WARNING: standard input reopened Enter pass phrase: Pass phrase is good. kmod-atl1e-PAE-1.0.1.0-3.el5.elrepo.i686.rpm: gpg: WARNING: standard input reopened gpg: WARNING: standard input reopened Enter pass phrase: Pass phrase is good. kmod-atl1e-xen-1.0.1.0-3.el5.elrepo.i686.rpm: gpg: WARNING: standard input reopened gpg: WARNING: standard input reopened # おk。じゃあ次に進む。 2.できたrpmを配布するためにリポジトリを作る
前回インストールしたリポジトリとは別のものを作る。混ぜると危険。(今回ここでめちゃめちゃハマった) まずrpm本体ファイルをコピーする # cd /root/rpmbuild # mkdir -p /var/www/html/ore/CentOS # cp RPMS/*.rpm /var/www/html/ore/CentOS/ コピーしただけじゃリポジトリの一部として認識できないのでcreaterepoする。まずはcreaterepoをインストール。 # yum –disablerepo=* –enablerepo=c5-media install createrepo んでcreaterepoする。 # cd /var/www/html/ore # mkdir repodata # touch repodata/comps.xml # createrepo -g repodata/comps.xml -o /var/www/html/ore /var/www/html/ore 4/4 - CentOS/lapack-3.0-37.el5.i386.rpm m6.rpm Saving Primary metadata Saving file lists metadata Saving other metadata # とりあえずモジュールが含まれているかどうか確認。 # cd repodata # zcat filelist.xml.gz | grep kmod-atl1e /etc/depmod.d/atl1e.conf/lib/modules/2.6.18-164.el5xen/extra/atl1e/atl1e.ko/lib/modules/2.6.18-164.el5xen/lib/modules/2.6.18-164.el5xen/extra/lib/modules/2.6.18-164.el5xen/extra/atl1e /etc/depmod.d/atl1e.conf/lib/modules/2.6.18-164.el5/extra/atl1e/atl1e.ko/lib/modules/2.6.18-164.el5/lib/modules/2.6.18-164.el5/extra/lib/modules/2.6.18-164.el5/extra/atl1e /etc/depmod.d/atl1e.conf/lib/modules/2.6.18-164.el5PAE/extra/atl1e/atl1e.ko/lib/modules/2.6.18-164.el5PAE/lib/modules/2.6.18-164.el5PAE/extra/lib/modules/2.6.18-164.el5PAE/extra/atl1e # おk。入ってるっぽいな。 じゃあkickstartの設定ファイルを編集してkmod-atl1eを追加。今回i686-PAEカーネルが入るのでそれを反映して。 # cd /var/www/html # vi ks_centos54.cfg 変更部分は赤字 # Kickstart file automatically generated by anaconda. install #cdrom url –url http://172.16.0.1/dist repo –name=dist –baseurl=http://172.16.0.1/dist repo –name=ore –baseurl=http://172.16.0.1/ore lang en_US.UTF-8 keyboard jp106 network –device eth0 –bootproto dhcp #rootpw –iscrypted $1$.DqY.ln7$yOJvWGbmFjuU6aiPwF9KA0 rootpw password firewall –enabled –port=22:tcp authconfig –enableshadow –enablemd5 selinux –disabled timezone Asia/Tokyo bootloader –location=mbr –driveorder=hda # The following is the partition information you requested # Note that any partitions you deleted are not expressed # here so unless you clear all partitions first, this is # not guaranteed to work clearpart –all –drives=sda part /boot –fstype ext3 –size=100 –ondisk=sda part pv.2 –size=0 –grow –ondisk=sda volgroup VolGroup00 –pesize=32768 pv.2 logvol swap –fstype swap –name=LogVol01 –vgname=VolGroup00 –size=768 –grow –maxsize=1536 logvol / –fstype ext3 –name=LogVol00 –vgname=VolGroup00 –size=1024 –grow %packages @admin-tools @base @core @development-libs @development-tools @editors @ftp-server @java @java-development @legacy-network-server @legacy-software-development @legacy-software-support @mail-server @network-server @ruby @server-cfg @system-tools @text-internet @web-server @smb-server kmod-atl1e-PAE (<–これを追加した) keyutils kexec-tools trousers fipscheck device-mapper-multipath perl-Convert-ASN1 imake audit 3.じゃあクライアントをkickstartしてみるか
で、インストール直後からネットワークも使えてよいことになった! 4.報告書作成
これ書いた 5.脳内反省会