install rpm-build
install redhat-rpm-config
yum install gcc
yum install ncurses-devel
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.2.tar.bz2
tar -xjf linux-2.6.33.2.tar.bz2
cd linux-2.6.33.2
make menuconfig
General setup ---> enable deprecated sysfs features which may confuse old userspace
append scripts/package/mkspec
echo "%post"
echo "if [ \`uname -i\` == \"x86_64\" -o \`uname -i\` == \"i386\" ]; then"
echo " if [ -f /etc/sysconfig/kernel ]; then"
echo " /bin/sed -i -e 's/^DEFAULTKERNEL=kernel-smp$/DEFAULTKERNEL=kernel/' /etc/sysconfig/kernel || exit \$?"
echo " fi"
echo "fi"
echo "/sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install "$KERNELRELEASE" || exit \$?"
echo ""
echo "%preun"
echo "/sbin/new-kernel-pkg --rminitrd --rmmoddep --remove "$KERNELRELEASE" || exit \$?"
echo ""
make -j4 binrpm-pkg
rpm -ihv /usr/src/redhat/RPMS/x86_64/kernel-2.6.33.2-5.x86_64.rpm
Почему при сборке
ОтветитьУдалитьmake -j4 binrpm-pkg
выдает ошибку
RPM build errors:
Could not canonicalize hostname: centosso
Unable to write payload to /root/rpmbuild/RPMS/i386/kernel-2.6.33.2-2.i386.rpm:
Машина стоит внутри локалки на ней пока ничего нет