タグ・アーカイブ: kernel

CentOS 5.4 x86_64で運用している自宅サーバですが、yum check-updateすると

kmod-kvm.x86_64                       83-105.el5_4.22                    updates
kvm.x86_64                            83-105.el5_4.22                    updates
kvm-qemu-img.x86_64                   83-105.el5_4.22                    updates

とのこと。アップデート自体は

# yum update

でOKですが、これらパッケージはホストOSのカーネルモジュールをアップデートするので、以下の手順を実行して修正を有効にする必要があります。

1. KVMゲストの仮想マシン(VM)をすべて停止します。

2. ハイパーバイザマシンをリブートするか、またはスーパーユーザとして、(「lsmod」を使用して確認した)kvm、ksm、kvm-intel、 kvm-amdの各モジュールのうち現在実行されているものすべてを(「modprobe -r [module]」を使用して)削除し、(「modprobe [module]」を使用して)リロードします。

3. KVMゲストのVMを再起動します。

※ 参考サイト
http://jp.redhat.com/support/errata/RHBA/RHBA-2009-1488J.html
http://www.jp.redhat.com/support/errata/RHBA/RHBA-2009-1423J.html
https://rhn.redhat.com/errata/RHSA-2010-0088.html

せっかくこないだカーネルを手動で2.6.9-78.0.1にしたばかりなのに、yumのリポジトリにしっかり転がり込んできてましたよ。(´・ω・`)
というわけで、自宅のサーバは普通にyumでアップデートしました。仕事場のマシンも、明日アップデートしようそうしよう。

■■ 今のカーネルバージョン確認

[oresama@intra1 ~]$ uname -a
Linux intra1.stellarcube.com 2.6.9-67.0.22.EL #1 Wed Jul 23 17:17:45 EDT 2008 i686 i686 i386 GNU/Linux

[oresama@intra1 ~]$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-67.0.22.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-67.0.22.EL ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.9-67.0.22.EL.img

■■ redhat-releaseの確認

[oresama@intra1 ~]$ cat /etc/redhat-release
CentOS release 4.6 (Final)

■■ yumのアップデート確認

[oresama@intra1 ~]$ sudo yum check-update
Loading "fastestmirror" plugin
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished

acl.i386                                 2.2.23-5.4.el4         base
apr-util.i386                            0.9.4-22.el4           base
at.i386                                  3.1.8-82.el4           base
audit.i386                               1.0.16-3.el4           base
audit-libs.i386                          1.0.16-3.el4           base
authconfig.i386                          4.6.10-7.el4           base
autofs.i386                              1:4.1.3-234            base
bash.i386                                3.0-19.7               base
bind.i386                                20:9.2.4-30.el4        base
bind-libs.i386                           20:9.2.4-30.el4        base
bind-utils.i386                          20:9.2.4-30.el4        base
binutils.i386                            2.15.92.0.2-25         base
centos-release.i386                      6:4-7                  base
comps.i386                               2:4.7CENTOS-0.20080805 base
coreutils.i386                           5.2.1-31.8.el4         base
cpio.i386                                2.5-16.el4             base
cpp.i386                                 3.4.6-10               base
crash.i386                               4.0-5.0.0.1            base
cryptsetup.i386                          0.1-6                  base
cups-libs.i386                           1:1.1.22-0.rc1.9.27    base
device-mapper.i386                       1.02.25-2.el4          base
dhclient.i386                            7:3.0.1-62.EL4         base
dhcp.i386                                7:3.0.1-62.EL4         bas
e
dhcpv6_client.i386                       0.10-24_EL4            base
diffutils.i386                           2.8.1-12.1.el4         base
diskdumputils.i386                       1.4.1-5                base
dmraid.i386                              1.0.0.rc14-9_RHEL4_U7. base
e2fsprogs.i386                           1.35-12.17.el4         base
e2fsprogs-devel.i386                     1.35-12.17.el4         base
file.i386                                4.10-5.el4             base
gcc.i386                                 3.4.6-10               base
glibc.i686                               2.3.4-2.41             base
glibc-common.i386                        2.3.4-2.41             base
glibc-devel.i386                         2.3.4-2.41             base
glibc-headers.i386                       2.3.4-2.41             base
glibc-kernheaders.i386                   2.4-9.1.103.EL         base
gtk2.i386                                2.4.13-24.el4          base
hal.i386                                 0.4.2-8.EL4            base
httpd.i386                               2.0.52-41.ent.centos4  base
httpd-suexec.i386                        2.0.52-41.ent.centos4  base
hwdata.noarch                            0.146.33.EL-11         base
initscripts.i386                         7.93.33-1.centos4      base
iproute.i386                             2.6.9-4.el4            base
ipsec-tools.i386                         0.3.3-7.el4_7          update
iputils.i386                             20020927-21.el4        base
isdn4k-utils.i386                        3.2-18.p1.5            base
kernel.i686                              2.6.9-78.0.1.EL        update
kernel-utils.i386                        1:2.4-14.1.117         base
krb5-devel.i386                          1.3.4-60.el4           base
krb5-libs.i386                           1.3.4-60.el4           base
krb5-workstation.i386                    1.3.4-60.el4           base
lftp.i386                                3.0.6-4.el4            base
libacl.i386                              2.2.23-5.4.el4         base
libgcc.i386                              3.4.6-10               base
libstdc++.i386                           3.4.6-10               base
libtiff.i386                          
;   3.6.1-12.el4_7.2       update
libuser.i386                             0.52.5-1.el4.3         base
libxml2.i386                             2.6.16-12.5            update
libxml2-python.i386                      2.6.16-12.5            update
libxslt.i386                             1.1.11-1.el4_7.2       update
logrotate.i386                           3.7.1-10.RHEL4         base
logwatch.noarch                          5.2.2-4.el4            base
lvm2.i386                                2.02.37-3.el4          base
make.i386                                1:3.80-7.EL4           base
man-pages.noarch                         1.67-15.el4            base
mgetty.i386                              1.1.31-14.el4          base
mod_ssl.i386                             1:2.0.52-41.ent.centos base
module-init-tools.i386                   3.1-0.pre5.3.10        base
mysql.i386                               4.1.22-2.el4           base
mysql-devel.i386                         4.1.22-2.el4           base
net-snmp-libs.i386                       5.1.2-13.el4           base
net-tools.i386                           1.60-39.el4            base
newt.i386                                0.51.6-10.el4          base
nfs-utils.i386                           1.0.6-87.EL4           base
nscd.i386                                2.3.4-2.41             base
nss_ldap.i386                            253-5.el4              base
ntp.i386                                 4.2.0.a.20040617-8.el4 base
openldap.i386                            2.2.13-12.el4          base
openssh.i386                             3.9p1-11.el4_7         update
openssh-clients.i386                     3.9p1-11.el4_7         update
openssh-server.i386                      3.9p1-11.el4_7         update
pam.i386                                 0.77-66.25             base
pam-devel.i386                           0.77-66.25             base
pam_krb5.i386                            2.1.17-6.el4           base
parted.i386                              1.6.19-22.EL           base
popt.i386                                1.9.1-26_nonptl        base
postfix.i386                             2:2.2.10-1.2.1.el4_7   update
procps.i386                              3.2.3-8.12            
base
python.i386                              2.3.4-14.7.el4         base
quota.i386                               1:3.12-7.el4           base
rhnlib.noarch                            2.1.2-11.el4           base
rpm.i386                                 4.3.3-26_nonptl        base
rpm-build.i386                           4.3.3-26_nonptl        base
rpm-libs.i386                            4.3.3-26_nonptl        base
rpm-python.i386                          4.3.3-26_nonptl        base
rpmdb-CentOS.i386                        2:4.7-0.20080805       base
samba.i386                               3.0.28-0.el4.9         base
samba-client.i386                        3.0.28-0.el4.9         base
samba-common.i386                        3.0.28-0.el4.9         base
sed.i386                                 4.1.2-7.el4            base
setup.noarch                             2.5.37-1.7             base
shadow-utils.i386                        2:4.0.3-66.RHEL4       base
sos.noarch                               1.7-6.6.el4            base
specspo.noarch                           9.0.92-3               base
squid.i386                               7:2.5.STABLE14-4.el4   base
sysklogd.i386                            1.4.1-27.el4           base
sysstat.i386                             5.0.5-19.el4           base
system-config-network-tui.noarch         1.3.22.0.EL.4.6-1.el4  base
tcl.i386                                 8.4.7-4.el4            base
tcsh.i386                                6.13-10.el4            base
tzdata.noarch                            2008e-1.el4            update
udev.i386                                039-10.22.el4          base
unzip.i386                               5.51-10.el4            base
up2date.i386                             4.7.1-17.el4.centos    base
usermode.i386                            1.74-2.el4.1           base
util-linux.i386                          2.12a-20.el4           base
vixie-cron.i386                          4:4.1-50.el4           base
xinetd.i386                              2:2.3.13-4.5.el4       base
xorg-x11-Mesa-libGL.i386                 6.8.2-1.EL.52          base
xorg-x11-libs.i386                       6.8.2-1.EL.52          base
zip.i386                               &n
bsp; 2.3-29.EL4             base

■■ yum update

[oresama@intra1 ~]$ sudo yum update
Loading "fastestmirror" plugin
Setting up Update Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
(中略)
Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 kernel                  i686       2.6.9-78.0.1.EL  update             12 M
Updating:
 acl                     i386       2.2.23-5.4.el4   base               59 k
 apr-util                i386       0.9.4-22.el4     base               51 k
 at                      i386       3.1.8-82.el4     base               54 k
 audit                   i386       1.0.16-3.el4     base              202 k
 audit-libs              i386       1.0.16-3.el4     base               39 k
 authconfig              i386       4.6.10-7.el4     base              289 k
 autofs                  i386       1:4.1.3-234      base              291 k
 bash                    i386       3.0-19.7         base              1.7 M
 bind                    i386       20:9.2.4-30.el4  base              582 k
 bind-libs               i386       20:9.2.4-30.el4  base              568 k
 bind-utils              i386       20:9.2.4-30.el4  base              142 k
 binutils                i386       2.15.92.0.2-25   base              2.9 M
 centos-release          i386       6:4-7            base               22 k
 comps                   i386       2:4.7CENTOS-0.20080805  base              9.5 M
 coreutils               i386       5.2.1-31.8.el4   base              2.9 M
 cpio                    i386       2.5-16.el4       base               47 k
 cpp                     i386       3.4.6-10         base              1.6 M
 crash                   i386       4.0-5.0.0.1      base              1.4 M
 cryptsetup              i386       0.1-6            base              441 k
 cups-libs               i386       1:1.1.22-0.rc1.9.27  base              112 k
 device-mapper           i386       1.02.25-2.el4    base              564 k
 dhclient                i386       7:3.0.1-62.EL4   base              226 k
 dhcp                    i386       7:3.0.1-62.EL4   base              565 k
 dhcpv6_client           i386       0.10-24_EL4      base               71 k
 diffutils               i386       2.8.1-12.1.el4   base  &n
bsp;           204 k
 diskdumputils           i386       1.4.1-5          base              110 k
 dmraid                  i386       1.0.0.rc14-9_RHEL4_U7.el4  base              692 k
 e2fsprogs               i386       1.35-12.17.el4   base              776 k
 e2fsprogs-devel         i386       1.35-12.17.el4   base              485 k
 file                    i386       4.10-5.el4       base              259 k
 gcc                     i386       3.4.6-10         base              4.4 M
 glibc                   i686       2.3.4-2.41       base              6.0 M
 glibc-common            i386       2.3.4-2.41       base               16 M
 glibc-devel             i386       2.3.4-2.41       base              1.9 M
 glibc-headers           i386       2.3.4-2.41       base              588 k
 glibc-kernheaders       i386       2.4-9.1.103.EL   base              696 k
 gtk2                    i386       2.4.13-24.el4    base              4.3 M
 hal                     i386       0.4.2-8.EL4      base              153 k
 httpd                   i386       2.0.52-41.ent.centos4  base              902 k
 httpd-suexec            i386       2.0.52-41.ent.centos4  base               30 k
 hwdata                  noarch     0.146.33.EL-11   base              447 k
 initscripts             i386       7.93.33-1.centos4  base              1.3 M
 iproute                 i386       2.6.9-4.el4      base              683 k
 ipsec-tools             i386       0.3.3-7.el4_7    update            221 k
 iputils                 i386       20020927-21.el4  base              104 k
 isdn4k-utils            i386       3.2-18.p1.5      base              3.6 M
 kernel-utils            i386       1:2.4-14.1.117   base              1.0 M
 krb5-devel              i386       1.3.4-60.el4     base              825 k
 krb5-libs               i386       1.3.4-60.el4     base              486 k
 krb5-workstation        i386       1.3.4-60.el4     base              826 k
 lftp                    i386       3.0.6-4.el4      base              706 k
 libacl                  i386       2.2.23-5.4.el4   base               16 k
 libgcc                  i386       3.4.6-10         base               64 k
 libstdc++               i386       3.4.6-10         base              283 k
 libtiff                 i386       3.6.1-12.el4_7.2  upda
te            254 k
 libuser                 i386       0.52.5-1.el4.3   base              326 k
 libxml2                 i386       2.6.16-12.5      update            621 k
 libxml2-python          i386       2.6.16-12.5      update            440 k
 libxslt                 i386       1.1.11-1.el4_7.2  update            436 k
 logrotate               i386       3.7.1-10.RHEL4   base               35 k
 logwatch                noarch     5.2.2-4.el4      base              133 k
 lvm2                    i386       2.02.37-3.el4    base              2.1 M
 make                    i386       1:3.80-7.EL4     base              336 k
 man-pages               noarch     1.67-15.el4      base              3.9 M
 mgetty                  i386       1.1.31-14.el4    base              428 k
 mod_ssl                 i386       1:2.0.52-41.ent.centos4  base              100 k
 module-init-tools       i386       3.1-0.pre5.3.10  base              356 k
 mysql                   i386       4.1.22-2.el4     base              3.1 M
 mysql-devel             i386       4.1.22-2.el4     base              2.1 M
 net-snmp-libs           i386       5.1.2-13.el4     base              1.7 M
 net-tools               i386       1.60-39.el4      base              341 k
 newt                    i386       0.51.6-10.el4    base               82 k
 nfs-utils               i386       1.0.6-87.EL4     base              193 k
 nscd                    i386       2.3.4-2.41       base              140 k
 nss_ldap                i386       253-5.el4        base              1.1 M
 ntp                     i386       4.2.0.a.20040617-8.el4.centos  base              1.2 M
 openldap                i386       2.2.13-12.el4    base              237 k
 openssh                 i386       3.9p1-11.el4_7   update            326 k
 openssh-clients         i386       3.9p1-11.el4_7   update            349 k
 openssh-server          i386       3.9p1-11.el4_7   update            212 k
 pam                     i386       0.77-66.25       base              1.9 M
 pam-devel               i386       0.77-66.25       base               85 k
 pam_krb5                i386       2.1.17-6.el4     base               94 k
 parted                  i386       1.6.19-22.EL     base              490 k
 popt                    i386       1.9.1-26_nonptl  ba
se               60 k
 postfix                 i386       2:2.2.10-1.2.1.el4_7  update            3.0 M
 procps                  i386       3.2.3-8.12       base              189 k
 python                  i386       2.3.4-14.7.el4   base              4.8 M
 quota                   i386       1:3.12-7.el4     base              304 k
 rhnlib                  noarch     2.1.2-11.el4     base              101 k
 rpm                     i386       4.3.3-26_nonptl  base              651 k
 rpm-build               i386       4.3.3-26_nonptl  base              459 k
 rpm-libs                i386       4.3.3-26_nonptl  base              784 k
 rpm-python              i386       4.3.3-26_nonptl  base               81 k
 rpmdb-CentOS            i386       2:4.7-0.20080805  base               29 M
 samba                   i386       3.0.28-0.el4.9   base               16 M
 samba-client            i386       3.0.28-0.el4.9   base              4.5 M
 samba-common            i386       3.0.28-0.el4.9   base              7.6 M
 sed                     i386       4.1.2-7.el4      base              167 k
 setup                   noarch     2.5.37-1.7       base               31 k
 shadow-utils            i386       2:4.0.3-66.RHEL4  base              594 k
 sos                     noarch     1.7-6.6.el4      base              102 k
 specspo                 noarch     9.0.92-3         base              4.3 M
 squid                   i386       7:2.5.STABLE14-4.el4  base              1.1 M
 sysklogd                i386       1.4.1-27.el4     base               68 k
 sysstat                 i386       5.0.5-19.el4     base              116 k
 system-config-network-tui  noarch     1.3.22.0.EL.4.6-1.el4  base              1.4 M
 tcl                     i386       8.4.7-4.el4      base              898 k
 tcsh                    i386       6.13-10.el4      base              586 k
 tzdata                  noarch     2008e-1.el4      update            453 k
 udev                    i386       039-10.22.el4    base              843 k
 unzip                   i386       5.51-10.el4      base              142 k
 up2date                 i386       4.7.1-17.el4.centos  base              1.8 M
 usermode                i386       1.74-2.el4.1     base              138 k
 util-linux              i386 &
nbsp;     2.12a-20.el4     base              1.5 M
 vixie-cron              i386       4:4.1-50.el4     base               81 k
 xinetd                  i386       2:2.3.13-4.5.el4  base              128 k
 xorg-x11-Mesa-libGL     i386       6.8.2-1.EL.52    base              388 k
 xorg-x11-libs           i386       6.8.2-1.EL.52    base              2.7 M
 zip                     i386       2.3-29.EL4       base              114 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update     120 Package(s)
Remove       0 Package(s)
Total download size: 192 M
Is this ok [y/N]: y
(後略)
Installed: kernel.i686 0:2.6.9-78.0.1.EL
Updated: acl.i386 0:2.2.23-5.4.el4 apr-util.i386 0:0.9.4-22.el4 at.i386 0:3.1.8-82.el4 audit.i386 0:1.0.16-3.el4 audit-libs.i386 0:1.0.16-3.el4 authconfig.i386 0:4.6.10-7.el4 autofs.i386 1:4.1.3-234 bash.i386 0:3.0-19.7 bind.i386 20:9.2.4-30.el4 bind-libs.i386 20:9.2.4-30.el4 bind-utils.i386 20:9.2.4-30.el4 binutils.i386 0:2.15.92.0.2-25 centos-release.i386 6:4-7 comps.i386 2:4.7CENTOS-0.20080805 coreutils.i386 0:5.2.1-31.8.el4 cpio.i386 0:2.5-16.el4 cpp.i386 0:3.4.6-10 crash.i386 0:4.0-5.0.0.1 cryptsetup.i386 0:0.1-6 cups-libs.i386 1:1.1.22-0.rc1.9.27 device-mapper.i386 0:1.02.25-2.el4 dhclient.i386 7:3.0.1-62.EL4 dhcp.i386 7:3.0.1-62.EL4 dhcpv6_client.i386 0:0.10-24_EL4 diffutils.i386 0:2.8.1-12.1.el4 diskdumputils.i386 0:1.4.1-5 dmraid.i386 0:1.0.0.rc14-9_RHEL4_U7.el4 e2fsprogs.i386 0:1.35-12.17.el4 e2fsprogs-devel.i386 0:1.35-12.17.el4 file.i386 0:4.10-5.el4 gcc.i386 0:3.4.6-10 glibc.i686 0:2.3.4-2.41 glibc-common.i386 0:2.3.4-2.41 glibc-devel.i386 0:2.3.4-2.41 glibc-headers.i386 0:2.3.4-2.41 glibc-kernheaders.i386 0:2.4-9.1.103.EL gtk2.i386 0:2.4.13-24.el4 hal.i386 0:0.4.2-8.EL4 httpd.i386 0:2.0.52-41.ent.centos4 httpd-suexec.i386 0:2.0.52-41.ent.centos4 hwdata.noarch 0:0.146.33.EL-11 initscripts.i386 0:7.93.33-1.centos4 iproute.i386 0:2.6.9-4.el4 ipsec-tools.i386 0:0.3.3-7.el4_7 iputils.i386 0:20020927-21.el4 isdn4k-utils.i386 0:3.2-18.p1.5 kernel-utils.i386 1:2.4-14.1.117 krb5-devel.i386 0:1.3.4-60.el4 krb5-libs.i386 0:1.3.4-60.el4 krb5-workstation.i386 0:1.3.4-60.el4 lftp.i386 0:3.0.6-4.el4 libacl.i386 0:2.2.23-5.4.el4 libgcc.i386 0:3.4.6-10 libstdc++.i386 0:3.4.6-10 libtiff.i386 0:3.6.1-12.el4_7.2 libuser.i386 0:0.52.5-1.el4.3 libxml2.i386 0:2.6.16-12.5 libxml2-python.i386 0:2.6.16-12.5 libxslt.i386 0:1.1.11-1.el4_7.2 logrotate.i386 0:3.7.1-10.RHEL4 logwatch.noarch 0:5.2.2-4.el4 lvm2.i386 0:2.02.37-3.el4 make.i386 1:3.80-7.EL4 man-pages.noarch 0:1.67-15.el4 mgetty.i386 0:1.1.31-14.el4 mod_ssl.i386 1:2.0.52-41.ent.centos4 module-init-tools.i386 0:3.1-0.pre5.3.10 mysql.i386 0:4.1.22-2.el4 mysql-devel.i386 0:4.1.22-2.el4 net-snmp-libs.i386 0:5.1.2-13.el4 net-tools.i386 0:1.60-39.el4 newt.i386 0:0.51.6-10.el4 nfs-utils.i386 0:1.0.6-87.EL4 nscd.i386 0:2.3.4-2.41 nss_ldap.i386 0:253-5.el4 ntp.i386 0:4.2.0.a.20040617-8.el4.centos openldap.i386 0:2.2.13-12.el4 openssh.i386 0:3.9p1-11.el4_7 openssh-clients.i386 0:3.9p1-11.el4_7 openssh-server.i386 0:3.9p1-11.el4_7 pam.i386 0:0.77-66.25 pam-devel.i386 0:0.77-66.25 pam_krb5.i386 0:2.1.17-6.el4 parted.i386 0:1.6.19-22.EL popt.i386 0:1.9.1-26_nonptl postfix.i386 2:2.2.10-1.2.1.el4_7 procps.i386 0:3.2.3-8.12 python.i386 0:2.3.4-14.7.el4 quota.i386 1:3.12-7.el4 rhnlib.noarch 0:2.1.2-11.el4 rpm.i386 0:4.3.3-26_nonptl rpm-build.i386 0:4.3.3-26_nonptl rpm-libs.i386 0:4.3.3-26_nonptl rpm-python.i386 0:4.3.3-26_nonptl rpmdb-CentOS.i386 2:4.7-0.20080805 samba.i386 0:3.0.28-0.el4.9 samba-client.i386 0:3.0.28-0.el4.9 samba-common.i386 0:3.0.28-0.el4.9 sed.i386 0:4.1.2-7.el4 setup.noarch 0:2.5.37-1.7 shadow-utils.i386 2:4.0.3-66.RHEL4 sos.noarch 0:1.7-6.6.el4 specspo.noarch 0:9.0.92-3 squid.i386 7:2.5.STABLE14-4.el4 sysklogd.i386 0:1.4.1-27.el4 sysstat.i386 0:5.0.5-19.el4 system-config-network-tui.noarch 0:1.3.22.0.EL.4.6-1.el4 tcl.i386 0:8.4.7-4.el4 tcsh.i386 0:6.13-10.el4 tzdata.noarch 0:2008e-1.el4 udev.i386 0:039-10.22.el4 unzip.i386 0:5.51-10.el4 up2date.i386 0:4.7.1-17.el4.centos usermode.i386 0:1.74-2.el4.1 util-linux.i386 0:2.12a-20.el4 vixie-cron.i386 4:4.1-50.el4 xinetd.i386 2:2.3.13-4.5.el4 xorg-x11-Mesa-libGL.i386 0:6.8.2-1.EL.52 xorg-x11-libs.i386 0:6.8.2-1.EL.52 zip.i386 0:2.3-29.EL4
Complete!

■■ grub.confの確認

[oresama@intra1 ~]$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-78.0.1.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-78.0.1.EL ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.9-78.0.1.EL.img
title CentOS (2.6.9-67.0.22.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-67.0.22.EL ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.9-67.0.22.EL.img

■■ redhat-releaseの確認

[oresama@intra1 ~]$ cat /etc/redhat-release
CentOS release 4.7 (Final)

■■ 再起動

[oresama@intra1 ~]$ sudo /sbin/reboot

Broadcast message from root (pts/0) (Mon Sep 15 23:21:51 2008):

The system is going down for reboot NOW!

■■ 再起動後のカーネルバージョン確認

[oresama@intra1 ~]$ uname -a
Linux intra1.stellarcube.com 2.6.9-78.0.1.EL #1 Tue Aug 5 10:49:42 EDT 2008 i686 i686 i386 GNU/Linux

[shasta@intra1 ~]$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0
)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-78.0.1.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-78.0.1.EL ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.9-78.0.1.EL.img
title CentOS (2.6.9-67.0.22.EL)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-67.0.22.EL ro root=/dev/VolGroup00/LogVol00
        initrd /initrd-2.6.9-67.0.22.EL.img

以上、終了。
ね、簡単でしょ?

客先のRHEL4.6(諸々のパッケージはアップデート済)とほぼ同一の環境をCentOSで構築する必要が出てきたので、とりあえずカーネルのバージョンをあわせましょうということになりました。なので、カーネルを 現状の 2.6.9-67.0.22.EL から kernel-2.6.9-78.0.1.EL にアップデートすることにします。

■■ 現状

今回利用するマシンはCentOS 4.6 (ただし、インストールメディアがCentOS 4.4 ServerCDしかなかったので、4.4から4.6へとアップデートした) です。まずは現時点でのカーネルのバージョンを確認します。

[oresama@localhost ~]$ uname -r
2.6.9-67.0.22.EL

次に、rpmパッケージとしてインストールされているカーネルを調べます。

[oresama@localhost ~]$ rpm -q kernel
kernel-2.6.9-42.EL
kernel-2.6.9-67.0.22.EL

■■ あげたいカーネルのバージョン

■ 目標

kernel-2.6.9-78.0.1

■ 探してみた

いつもの RPM Search から探します。大抵のRPMパッケージはココで探せばどうにかなりますんでw

Search results for kernel-2.6.9-78.0.1 :
Filename  Distribution  File size
kernel-2.6.9-78.0.1.EL.x86_64.rpm  Other  13522 kB
kernel-2.6.9-78.0.1.EL.src.rpm  Other  54042 kB
kernel-2.6.9-78.0.1.EL.src.rpm  RedHat EL 4  54042 kB
kernel-2.6.9-78.0.1.EL.i686.rpm  Other  12528 kB

Search results for kernel-2.6.9-78 :
Filename  Distribution  File size
kernel-2.6.9-78.EL.x86_64.rpm  Other  13521 kB
kernel-2.6.9-78.EL.src.rpm  Other  54049 kB
kernel-2.6.9-78.EL.src.rpm  RedHat EL 4  54049 kB
kernel-2.6.9-78.EL.i686.rpm  Other  12532 kB
kernel-2.6.9-78.0.1.EL.x86_64.rpm  Other  13522 kB
kernel-2.6.9-78.0.1.EL.src.rpm  Other  54042 kB
kernel-2.6.9-78.0.1.EL.src.rpm  RedHat EL 4  54042 kB
kernel-2.6.9-78.0.1.EL.i686.rpm  Other  12528 kB

今回探した中に、バイナリ形式のrpmがあったのですが、ビルドしたマシンが「Other」になっている・・・つまり、ビルドしたマシンがCentOS 4 とか RedHat EL 4 になっていないのが不安なので、ソースrpm ( SRPM ) を落としてきて自分でビルドすることにしました。

■ ダウンロード

[oresama@localhost ~]$ wget
ftp://ftp.pbone.net/mirror/ftp.redhat.com/pub/redhat/linux/updates/enterprise/4ES/en/os/SRPMS/kernel-2.6.9-78.0.1.EL.src.rpm
--08:08:33--  ftp://ftp.pbone.net/mirror/ftp.redhat.com/pub/redhat/linux/updates/enterprise/4ES/en/os/SRPMS/kernel-2.6.9-78.0.1.EL.src.rpm
          => `kernel-2.6.9-78.0.1.EL.src.rpm'
proxy.example.co.jp をDNSに問いあわせています... 10.0.4.53
proxy.example.co.jp|10.0.4.53|:8080 に接続しています... 接続しました。
Proxy による接続要求を送信しました、応答を待っています... 200 OK
長さ: 55,338,333 (53M) [application/x-rpm]

 0% [
                                                               ]
371,882       78.79K/s    ETA 14:44

■■ カーネルのビルドに必要なパッケージを導入する

■ gccの導入

[root@localhost ~]# yum install gcc
(中略)
Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 gcc                     i386       3.4.6-9          base              4.4 M
Installing for dependencies:
 cpp                     i386       3.4.6-9          base              1.6 M
 glibc-devel             i386       2.3.4-2.39       base              1.9 M
 glibc-headers           i386       2.3.4-2.39       base              587 k
 glibc-kernheaders       i386       2.4-9.1.100.EL   base              695 k

Transaction Summary
=============================================================================
Install      5 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 9.2 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): glibc-kernheaders- 100% |=========================| 695 kB    00:07
(2/5): gcc-3.4.6-9.i386.r 100% |=========================| 4.4 MB    00:24
(3/5): glibc-headers-2.3. 100% |=========================| 587 kB    00:01
(4/5): cpp-3.4.6-9.i386.r 100% |=========================| 1.6 MB    00:07
(5/5): glibc-devel-2.3.4- 100% |=========================| 1.9 MB    00:10
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing: cpp                          ######################### [1/5]
 Installing: glibc-kernheaders            ######################### [2/5]
 Installing: glibc-headers                ######################### [3/5]
 Installing: glibc-devel                  ######################### [4/5]
 Installing: gcc                          ######################### [5/5]

Installed: gcc.i386 0:3.4.6-9
Dependency Installed: cpp.i386 0:3.4.6-9 glibc-devel.i386 0:2.3.4-2.39
glibc-headers.i386 0:2.3.4-2.39 glibc-k
ernheaders.i386
0:2.4-9.1.100.EL
Complete!

■ redhat-rpm-configの導入

[root@localhost ~]# yum install redhat-rpm-config
(中略)
Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 redhat-rpm-config       noarch     8.0.32.1-4       base               41 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 41 k
Is this ok [y/N]: y

■■ rpm-buildの導入

ソースRPMからrpmを作り出すのに、rpm-buildパッケージが必要になります。
nullpopopoではよく自分でSRPMからrpmパッケージをビルドするので、何度か見たことがある作業かも知れません。

■ rpm-buildパッケージのインストール

[root@localhost ~]# yum install rpm-build
(中略)
Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 rpm-build               i386       4.3.3-23_nonptl  base              458 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 458 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): rpm-build-4.3.3-23 100% |=========================| 458 kB    00:03
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
 Installing: rpm-build                    ######################### [1/1]

Installed: rpm-build.i386 0:4.3.3-23_nonptl
Complete!

■ ビルド環境構築

[oresama@localhost ~]$ mkdir -p rpm/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
[oresama@localhost ~]$ ll rpm/
合計 20
drwxrwxr-x  2 oresama oresama 4096  9月 11 08:18 BUILD
drwxrwxr-x  2 oresama oresama 4096  9月 11 08:18 RPMS
drwxrwxr-x  2 oresama oresama 4096  9月 11 08:18 SOURCES
drwxrwxr-x  2 oresama oresama 4096  9月 11 08:18 SPECS
drwxrwxr-x  2 oresama oresama 4096  9月 11 08:18 SRPMS

[oresama@localhost ~]$ vi .rpmmacros
%_topdir                %(echo $HOME)/rpm
%_builddir              %{_topdir}/BUILD
%_rpmdir                %{_topdir}/RPMS
%_sourcedir             %{_topdir}/SOURCES
%_specdir               %{_topdir}/SPECS
%_srcrpmdir             %{_topdir}/SRPMS

■■ カーネルのソースRPMのインストール

[oresama@localhost ~]$ rpm -ivh kernel-2.6.9-78.0.1.EL.src.rpm

■■ カーネルのソースRPMからRPMをビルドする

※ 注意!

カーネルに諸々のパッチを当てたりするので、相当に時間がかかります。 (っ´∀`)っ ゃー の環境では、昼飯前にビルドを開始して、15:40頃にビルドが終了しましたw
また、ディスクも4GB近く消費しますので、空き領域を充分に確認してください。

[oresama@localhost ~]$ cd rpm/SPECS/
[oresama@localhost SPECS]$ rpmbuild --ba --target i686 kernel-2.6.spec

Wrote: /home/oresama/rpm/SRPMS/kernel-2.6.9-78.0.1.EL.src.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-devel-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-smp-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-smp-devel-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-hugemem-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-hugemem-devel-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-xenU-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-xenU-devel-2.6.9-78.0.1.EL.i686.rpm
Wrote: /home/oresama/rpm/RPMS/i686/kernel-debuginfo-2.6.9-78.0.1.EL.i686.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.75321
+ umask 022
+ cd /home/oresama/rpm/BUILD
+ cd kernel-2.6.9
+ rm -rf /var/tmp/kernel-2.6.9-78.0.1.EL-root
+ exit 0

このように表示されたらOK。

■■ カーネルのアップデート

[oresama@localhost SPECS]$ cd ../RPMS/i686/

■ 今インストールされているカーネルのパッケージを確認する

[oresama@localhost i686]$ rpm -qa | grep -i kernel
kernel-2.6.9-67.0.22.EL         ← 今時点で一番新しいカーネル
kernel-utils-2.4-13.1.105       ← kernel-utils
kernel-2.6.9-42.EL              ← もともと入っていたカーネル

[oresama@localhost i686]$ uname -r
2.6.9-67.0.22.EL

[oresama@localhost i686]$ sudo cat /boot/grub/grub.conf
Password:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-67.0.22.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-67.0.22.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-67.0.22.EL.img
title CentOS_ServerCD (2.6.9-42.EL)
       root (hd0,0)
  &nbs
p;    kernel /vmlinuz-2.6.9-42.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-42.EL.img

よって、今はkernel-2.6.9-67.0.22ELで立ち上がっていることがこれでわかる。

■ パッケージのアップデート試験

依存関係のあるパッケージなどないか、確認する。

[oresama@localhost i686]$ rpm --test -ivh kernel-2.6.9-78.0.1.EL.i686.rpm
Preparing...                ########################################### [100%]

依存関係のエラーなどは出てこなかった。

■ パッケージのアップデート

[oresama@localhost i686]$ su ← cdするのが面倒いので、-なしでrootになる
Password:
[root@localhost i686]# pwd
/home/oresama/rpm/RPMS/i686

[root@localhost i686]# rpm -ivh kernel-2.6.9-78.0.1.EL.i686.rpm
Preparing...                ########################################### [100%]
  1:kernel                 ########################################### [100%]

[root@localhost i686]# exit
exit

■ カーネルのバージョン確認

[oresama@localhost i686]$ rpm -qa | grep -i kernel
kernel-2.6.9-78.0.1.EL
kernel-2.6.9-67.0.22.EL
kernel-utils-2.4-13.1.105
kernel-2.6.9-42.EL

[oresama@localhost i686]$ sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-78.0.1.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-78.0.1.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-78.0.1.EL.img
title CentOS (2.6.9-67.0.22.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-67.0.22.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-67.0.22.EL.img
title CentOS_ServerCD (2.6.9-42.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-42.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-42.EL.img

これで、再起動後に新しいカーネルであがってくることが期待できる。

■■ 再起動

[oresama@localhost ~]$ su -
[root@localhost ~]# reboot

■■ 再起動後の確認

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.9-78.0.1.EL #1 Thu Sep 11 08:51:50 JST 2008 i686 i686 i386 GNU/Linux

[root@localhost ~]# cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-78.0.1.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-78.0.1.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-78.0.1.EL.img
title CentOS (2.6.9-67.0.22.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-67.0.22.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-67.0.22.EL.img
title CentOS_ServerCD (2.6.9-42.EL)
       root (hd0,0)
       kernel /vmlinuz-2.6.9-42.EL ro root=/dev/VolGroup00/LogVol00
       initrd /initrd-2.6.9-42.EL.img

期待通り!

■■ カーネルのバージョンが勝手に上がらないようにする

yum check-updateをかけたときに、たまたまカーネルの新バージョンがリリースされていたら、せっかく客先マシンのカーネルバージョンにあわせた意味がなくなってしまいます。このため、 yumのアップデート対象からカーネルをはずすのを忘れずに!

[root@localhost ~]# cd /etc/
[root@localhost etc]# cp -p yum.conf yum.conf.2008091101
[root@localhost etc]# vi yum.conf

[main]

# PUT YOUR REPOS HERE OR IN separate files named file.repo
の間に、カーネルをyumのアップデート対象からはずす記述をする。

exclude=kernel*

この1行を追記する。

こうすることで、「kernel」から始まるパッケージがアップデート対象から外れます。
以上で、カーネルをSRPMからビルドしてアップデートする作業は終了です。

ね、簡単でしょ?