樹心幽徑

20160119nat -iptables
2016/01/19,14:34

[root@localhost ~]# cat /etc/rc.d/rc.local#!/bin/sh#/usr/sbin/dhcpd &iptables -Fiptables -t nat -Fiptables -t mangle -Fecho "1" > /proc/sys/net/ipv4/ip_forwardmodprobe ip_nat_ftpmodprobe ip_nat_ircmodprobe ip_conntrack_ftpmodprobe ip_conntrack_irc
iptables -t nat -A POSTROUTING -s 10.2.2.0/24  -j MASQUERADEiptables -A INPUT -i em1 -m state --state RELATED,ESTABLISHED -j ACCEPTiptables -P FORWARD DROP#iptables -I FORWARD -o em1 -s 10.2.2.0/24 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.40 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.39 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.38 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.37 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.36 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.35 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.34 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.33 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.32 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.31 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.30 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.29 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.28 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.27 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.26 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.25 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.24 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.23 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.22 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.21 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.20 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.19 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.18 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.17 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.16 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.15 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.14 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.13 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.12 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.11 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.10 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.9 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.8 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.7 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.6 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.5 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.4 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.3 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.2 -j ACCEPTiptables -I FORWARD -o em1 -s 10.2.2.1 -j ACCEPT
iptables -A FORWARD -i em1 -m state --state RELATED,ESTABLISHED -j ACCEPTiptables -A FORWARD -o em1 -j LOG --log-prefix=natdeny#iptables -I FORWARD -o em1 -p tcp --dport 80 -s 10.2.2.0/24 -j ACCEPT#iptables -I FORWARD -o eth0 -s 10.2.2.40 -j ACCEPT#iptables -I FORWARD -o em1 -p tcp --dport 80 -j ACCEPT

iptables -t mangle -P PREROUTING DROP#iptables -t mangle -I PREROUTING -i em2 -s 10.2.2.0/24 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.40 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.39 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.38 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.37 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.36 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.35 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.34 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.33 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.32 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.31 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.30 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.29 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.28 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.27 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.26 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.25 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.24 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.23 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.22 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.21 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.20 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.19 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.18 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.17 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.16 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.15 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.14 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.13 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.12 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.11 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.10 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.9 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.8 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.7 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.6 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.5 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.4 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.3 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.2 -j ACCEPTiptables -t mangle -I PREROUTING -i em2 -s 10.2.2.1 -j ACCEPTiptables -t mangle -A PREROUTING -i em1 -m state --state RELATED,ESTABLISHED -j ACCEPTiptables -t mangle -A PREROUTING -i em2 -j LOG --log-prefix=Mnatdeny

20160113修改Hostname
2016/01/13,15:01

[root@tree ~]# cat /etc/hosts
127.0.0.1   tree localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


[root@tree ~]# cat /etc/sysconfig/network
# Created by anaconda
NETWORKING=yes
HOSTNAME=tree
GATEWAY=163.25.20.254

[root@tree ~]# hostname tree

REF:http://www.ichiayi.com/wiki/tech/linux_hostname

 

20160113換Linux核心(kernel-3.16.7)過程
2016/01/13,14:53

20160113換Linux核心(kernel-3.16.7)過程

(1) 查系統現況

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.19.8 #3 SMP Wed Jan 13 07:43:30 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost ~]# date
Wed Jan 13 13:28:52 CST 2016
[root@localhost ~]#


(2) 下載核心linux-3.16.7.tar.gz
[root@localhost ~]# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.7.tar.gz
--2016-01-13 13:15:24--  https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.7.tar.gz
Resolving www.kernel.org (www.kernel.org)... 199.204.44.194, 198.145.20.140, 149.20.4.69, ...
Connecting to www.kernel.org (www.kernel.org)|199.204.44.194|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 121773906 (116M) [application/x-gzip]
Saving to: ‘linux-3.16.7.tar.gz’


(3)解開核心
[root@localhost ~]# tar xvzf linux-3.16.7.tar.gz


(4) 建立/usr/src/linux符號連結
[root@localhost ~]# rm  /usr/src/linux
rm: remove symbolic link ‘/usr/src/linux’? y
[root@localhost ~]# ln -s /root/linux-3.16.7 /usr/src/linux
[root@localhost ~]# ls /usr/src -l
total 12
drwxr-xr-x. 2 root root 4096 Jul  8  2013 debug
drwxr-xr-x  2 root root 4096 Jan 11 13:06 ipt-netflow-
drwxr-xr-x. 4 root root 4096 Jan  6 17:06 kernels
lrwxrwxrwx  1 root root   18 Jan 13 13:30 linux -> /root/linux-3.16.7
[root@localhost ~]#

(5)用現有的組態為預設值建立核心組態

[root@localhost ~]# cd /usr/src/linux/
[root@localhost linux]# cp /boot/config-3.19.8 .config
[root@localhost linux]# pwd
/usr/src/linux
[root@localhost linux]#
[root@localhost linux]# make menuconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
.config:880:warning: symbol value 'm' invalid for BRIDGE_NETFILTER
.config:1345:warning: symbol value 'm' invalid for OPENVSWITCH_GRE
.config:1346:warning: symbol value 'm' invalid for OPENVSWITCH_VXLAN
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.


(6)閱讀說明檔
[root@localhost linux]# cat README |more

(7)編譯核心
[root@localhost linux]# make
ok

(8)列出剛編譯完成的核心
[root@localhost linux]# ls arch/x86/boot/bzImage -l
-rw-r--r-- 1 root root 5490256 Jan 13 14:11 arch/x86/boot/bzImage
[root@localhost linux]#

(9)查看不可手動修改的開機選單設定檔
[root@localhost linux]# cat /boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
:
(10)將新編的核心 及 組態檔 及System.map 拷至/boot目錄分別為vmlinuz-3.16.7及config-3.16.7 及 System.map-3.16.7
[root@localhost linux]# cp arch/x86/boot/bzImage /boot/vmlinuz-3.16.7
[root@localhost linux]# cp .config /boot/config-3.16.7
[root@localhost linux]# cp System.map /boot/System.map-3.16.7
[root@localhost linux]#

(11)安裝新的核心模組至/lib/modules/3.16.7
[root@localhost linux]# make modules_install
:
  INSTALL /lib/firmware/yam/1200.bin
  INSTALL /lib/firmware/yam/9600.bin
  DEPMOD  3.16.7
[root@localhost linux]# ll /lib/modules/
total 24
drwxr-xr-x  6 root root 4096 Jan  5 17:34 3.14.27-100.fc19.i686.PAE
drwxr-xr-x  3 root root 4096 Jan 13 14:41 3.16.7
drwxr-xr-x  3 root root 4096 Jan 13 07:55 3.19.8
drwxr-xr-x  4 root root 4096 Jan 11 13:06 3.9.5
drwxr-xr-x  6 root root 4096 Jan  6 16:03 3.9.5-301.fc19.i686
drwxr-xr-x. 6 root root 4096 Jan  6 12:46 3.9.5-301.fc19.i686.PAE
[root@localhost linux]#

(12)建立initramfs
[root@localhost linux]# dracut -v /boot/initramfs-3.16.7.img 3.16.7
:
I: -rw------- 1 root root 17653321 Jan 13 14:42 /boot/initramfs-3.16.7.img


(13)列出/boot

[root@localhost linux]# cd /boot
[root@localhost boot]# mv initramfs-3.19.8.img old3.initramfs-3.19.8.img
[root@localhost boot]# mv System.map-3.19.8 old3.System.map-3.19.8
[root@localhost boot]# mv vmlinuz-3.19.8 old3.vmlinuz-3.19.8
[root@localhost boot]# mv config-3.19.8 old3.config-3.19.8

[root@localhost linux]# chmod 755 /boot/vmlinuz-3.16.7
[root@localhost boot]# ll /boot
total 220126
-rw-r--r--  1 root root   144293 Jan 13 14:37 config-3.16.7
-rw-r--r--  1 root root   130928 Jun 12  2013 config-3.9.5-301.fc19.i686
-rw-r--r--. 1 root root   128562 Jun 12  2013 config-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root   128296 Jan 11 07:34 config-3.9.5-treehrt
drwxr-xr-x. 6 root root     1024 Jan 13 08:00 grub2
-rw-------. 1 root root 25509635 Dec 23 12:26 initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
-rw-------  1 root root 17653321 Jan 13 14:42 initramfs-3.16.7.img
-rw-------  1 root root  8745331 Jan  6 16:03 initramfs-3.9.5-301.fc19.i686.img
-rw-------. 1 root root 16779573 Dec 23 12:26 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-------  1 root root 17736016 Jan 11 07:42 initramfs-3.9.5.img
-rw-------  1 root root  8236814 Jan 11 07:47 initramfs-3.9.5-treehrt.img
-rw-r--r--. 1 root root   557284 Jan  5 17:34 initrd-plymouth.img
drwx------. 2 root root    12288 Dec 23 12:05 lost+found
-rw-r--r--  1 root root   148506 Jan 12 16:14 old2.config-3.19.8
-rw-------  1 root root 26308183 Jan 12 16:29 old2.initramfs-3.19.8.img
-rw-r--r--  1 root root  2348934 Jan 12 16:14 old2.System.map-3.19.8
-rwxr-xr-x  1 root root  5675104 Jan 12 16:14 old2.vmlinuz-3.19.8
-rw-r--r--  1 root root   148612 Jan 13 07:51 old3.config-3.19.8
-rw-------  1 root root 19461944 Jan 13 07:57 old3.initramfs-3.19.8.img
-rw-r--r--  1 root root  2348934 Jan 13 07:51 old3.System.map-3.19.8
-rw-r--r--  1 root root  5675104 Jan 13 07:51 old3.vmlinuz-3.19.8
-rw-r--r--  1 root root   142005 Dec 18  2014 old.config-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root    97454 Jan 11 17:27 old.config-3.19.8
-rw-------  1 root root  9162360 Jan  5 17:34 old.initramfs-3.14.27-100.fc19.i686.PAE.img
-rw-------  1 root root  8242449 Jan 11 17:31 old.initramfs-3.19.8.img
-rw-------  1 root root  2244508 Dec 18  2014 old.System.map-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root  2513181 Jan 11 17:28 old.System.map-3.19.8
-rwxr-xr-x  1 root root  5471888 Dec 18  2014 old.vmlinuz-3.14.27-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  5738112 Jan 11 17:27 old.vmlinuz-3.19.8
-rw-r--r--  1 root root  2268451 Jan 13 14:37 System.map-3.16.7
-rw-------  1 root root  2017641 Jun 12  2013 System.map-3.9.5-301.fc19.i686
-rw-------. 1 root root  2055042 Jun 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  2052858 Jan 11 07:35 System.map-3.9.5-treehrt
-rwxr-xr-x. 1 root root  5025072 Dec 23 12:26 vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
-rwxr-xr-x  1 root root  5490256 Jan 13 14:36 vmlinuz-3.16.7
-rwxr-xr-x  1 root root  4939088 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686
-rwxr-xr-x. 1 root root  5025072 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
-rwxr-xr-x  1 root root  5013728 Jan 11 07:33 vmlinuz-3.9.5-treehrt
[root@localhost boot]#


(14)建立核心開機選單,最新編譯者為第1選項(預設選項)
[root@localhost boot]#  grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.16.7
Found initrd image: /boot/initramfs-3.16.7.img
Found linux image: /boot/vmlinuz-3.9.5-treehrt
Found initrd image: /boot/initramfs-3.9.5-treehrt.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.img
Found linux image: /boot/vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
Found initrd image: /boot/initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
done
[root@localhost boot]# reboot


(15)遠端重開機查看,新的Linux核心成功運中中

Good, It's success!!


[root@localhost ~]# uname -a
Linux localhost.localdomain 3.16.7 #1 SMP Wed Jan 13 14:11:09 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  10.2.2.0/24          anywhere
[root@localhost ~]#


(16)參考文章

REF 1:http://linux.vbird.org/linux_basic/0540kernel.php
REF 2:http://linux.vbird.org/linux_basic/redhat6.1/linux_10kernel.php

20160112換Linux核心(kernel-3.19.8)過程
2016/01/13,13:21

20160112換Linux核心(kernel-3.19.8)過程
(1) 查系統現況
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.9.5 #1 SMP Thu Jan 7 13:12:24 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost ~]# date
Mon Jan 11 15:09:55 CST 2016
[root@localhost ~]#

(2) 下載核心linux-3.19.8.tar.gz

[root@localhost ~]# wget ftp://linux.cis.nctu.edu.tw/kernel/linux/kernel/v3.x/linux-3.19.8.tar.gz
:
2016-01-11 15:16:03 (355 KB/s) - ‘linux-3.19.8.tar.gz’ saved [123146642]
[root@localhost ~]#

(3)解開核心

[root@localhost ~]# tar xvzf linux-3.19.8.tar.gz

(4) 建立/usr/src/linux符號連結

[root@localhost ~]# rm  /usr/src/linux
rm: remove symbolic link ‘/usr/src/linux’? y
[root@localhost ~]# ln -s /root/linux-3.19.8 /usr/src/linux
[root@localhost ~]# ls /usr/src -l
total 12
drwxr-xr-x. 2 root root 4096 Jul  8  2013 debug
drwxr-xr-x  2 root root 4096 Jan 11 13:06 ipt-netflow-
drwxr-xr-x. 4 root root 4096 Jan  6 17:06 kernels
lrwxrwxrwx  1 root root   18 Jan 11 17:07 linux -> /root/linux-3.19.8
[root@localhost ~]#


(5)用現有的組態為預設值建立核心組態

[root@localhost ~]# cd /usr/src/linux/

[root@localhost linux]# cp /boot/old.config-3.14.27-100.fc19.i686.PAE .config

[root@localhost linux]# make menuconfig

(6)閱讀說明檔
[root@localhost linux]# cat README |more

(7)編譯核心
[root@localhost linux]# make
ok

(8)列出剛編譯完成的核心
[root@localhost linux]# ls arch/x86/boot/bzImage -l
-rw-r--r-- 1 root root 5675104 Jan 12 15:54 arch/x86/boot/bzImage
[root@localhost linux]#

(9)查看不可手動修改的開機選單設定檔
[root@localhost linux]# cat /boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
:
(10)將新編的核心 及 組態檔 及System.map 拷至/boot目錄分別為vmlinuz-3.19.8及config-3.19.8 及 System.map-3.19.8
[root@localhost linux]# cp arch/x86/boot/bzImage /boot/vmlinuz-3.19.8
[root@localhost linux]# cp .config /boot/config-3.19.8
[root@localhost linux]# cp System.map /boot/System.map-3.19.8
[root@localhost linux]#

(11)安裝新的核心模組至/lib/modules/3.19.8
[root@localhost linux]# rm -rf /lib/modules/3.19.8
[root@localhost linux]# ls /lib/modules
3.14.27-100.fc19.i686.PAE  3.9.5  3.9.5-301.fc19.i686  3.9.5-301.fc19.i686.PAE
[root@localhost linux]# make modules_install
:
:
  INSTALL /lib/firmware/yam/9600.bin
  DEPMOD  3.19.8

[root@localhost linux]# ll /lib/modules/
total 20
drwxr-xr-x  6 root root 4096 Jan  5 17:34 3.14.27-100.fc19.i686.PAE
drwxr-xr-x  3 root root 4096 Jan 12 16:19 3.19.8
drwxr-xr-x  4 root root 4096 Jan 11 13:06 3.9.5
drwxr-xr-x  6 root root 4096 Jan  6 16:03 3.9.5-301.fc19.i686
drwxr-xr-x. 6 root root 4096 Jan  6 12:46 3.9.5-301.fc19.i686.PAE
[root@localhost linux]#

(12)建立initramfs
[root@localhost linux]# dracut -v /boot/initramfs-3.19.8.img 3.19.8
:
I: Wrote /boot/initramfs-3.19.8.img:
I: -rw------- 1 root root 26308183 Jan 12 16:29 /boot/initramfs-3.19.8.img
[root@localhost linux]#

(13)列出/boot
[root@localhost linux]# ll /boot
total 168178
-rw-r--r--  1 root root   148506 Jan 12 16:14 config-3.19.8
-rw-r--r--  1 root root   130928 Jun 12  2013 config-3.9.5-301.fc19.i686
-rw-r--r--. 1 root root   128562 Jun 12  2013 config-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root   128296 Jan 11 07:34 config-3.9.5-treehrt
drwxr-xr-x. 6 root root     1024 Jan 11 17:47 grub2
-rw-------. 1 root root 25509635 Dec 23 12:26 initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
-rw-------  1 root root 26308183 Jan 12 16:29 initramfs-3.19.8.img
-rw-------  1 root root  8745331 Jan  6 16:03 initramfs-3.9.5-301.fc19.i686.img
-rw-------. 1 root root 16779573 Dec 23 12:26 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-------  1 root root 17736016 Jan 11 07:42 initramfs-3.9.5.img
-rw-------  1 root root  8236814 Jan 11 07:47 initramfs-3.9.5-treehrt.img
-rw-r--r--. 1 root root   557284 Jan  5 17:34 initrd-plymouth.img
drwx------. 2 root root    12288 Dec 23 12:05 lost+found
-rw-r--r--  1 root root   142005 Dec 18  2014 old.config-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root    97454 Jan 11 17:27 old.config-3.19.8
-rw-------  1 root root  9162360 Jan  5 17:34 old.initramfs-3.14.27-100.fc19.i686.PAE.img
-rw-------  1 root root  8242449 Jan 11 17:31 old.initramfs-3.19.8.img
-rw-------  1 root root  2244508 Dec 18  2014 old.System.map-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root  2513181 Jan 11 17:28 old.System.map-3.19.8
-rwxr-xr-x  1 root root  5471888 Dec 18  2014 old.vmlinuz-3.14.27-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  5738112 Jan 11 17:27 old.vmlinuz-3.19.8
-rw-r--r--  1 root root  2348934 Jan 12 16:14 System.map-3.19.8
-rw-------  1 root root  2017641 Jun 12  2013 System.map-3.9.5-301.fc19.i686
-rw-------. 1 root root  2055042 Jun 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  2052858 Jan 11 07:35 System.map-3.9.5-treehrt
-rwxr-xr-x. 1 root root  5025072 Dec 23 12:26 vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
-rw-r--r--  1 root root  5675104 Jan 12 16:14 vmlinuz-3.19.8
-rwxr-xr-x  1 root root  4939088 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686
-rwxr-xr-x. 1 root root  5025072 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
-rwxr-xr-x  1 root root  5013728 Jan 11 07:33 vmlinuz-3.9.5-treehrt
[root@localhost linux]#
[root@localhost linux]# chmod 755 /boot/vmlinuz-3.19.8

(14)建立核心開機選單,最新編譯者為第1選項(預設選項)
[root@localhost linux]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.19.8
Found initrd image: /boot/initramfs-3.19.8.img
Found linux image: /boot/vmlinuz-3.9.5-treehrt
Found initrd image: /boot/initramfs-3.9.5-treehrt.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.img
Found linux image: /boot/vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
Found initrd image: /boot/initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
done
[root@localhost linux]#


[root@localhost linux]# date
Tue Jan 12 16:38:34 CST 2016
[root@localhost linux]# uname -a
Linux localhost.localdomain 3.9.5 #1 SMP Thu Jan 7 13:12:24 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost linux]# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.8.3/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-i686-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.3-20140911/obj-i686-redhat-linux/cloog-install --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.8.3 20140911 (Red Hat 4.8.3-7) (GCC)
[root@localhost linux]#

(15)遠端重開機查看,新的Linux核心成功運中中
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.19.8 #2 SMP Tue Jan 12 15:54:22 CST 2016 i686 i686 i386 GNU  /Linux

Good, It's success!!
(15b)But
[root@localhost ~]# iptables -t nat -L
iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
[root@localhost ~]#


(16)參考文章
REF 1:http://linux.vbird.org/linux_basic/0540kernel.php
REF 2:http://linux.vbird.org/linux_basic/redhat6.1/linux_10kernel.php

(17)
[root@localhost linux]# make menuconfig

(18)
[root@localhost linux]# make
scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CERTS   kernel/x509_certificate_list
  - Including cert signing_key.x509
  AS      kernel/system_certificates.o
  LD      kernel/built-in.o
  CC [M]  net/ipv4/netfilter/nf_nat_l3proto_ipv4.o
  CC [M]  net/ipv4/netfilter/nf_nat_proto_icmp.o
  LD [M]  net/ipv4/netfilter/nf_nat_ipv4.o
  CC [M]  net/ipv4/netfilter/nf_nat_h323.o
  CC [M]  net/ipv4/netfilter/nf_nat_pptp.o
  CC [M]  net/ipv4/netfilter/nf_nat_snmp_basic.o
  CC [M]  net/ipv4/netfilter/nf_nat_masquerade_ipv4.o
  CC [M]  net/ipv4/netfilter/nf_nat_proto_gre.o
  CC [M]  net/ipv4/netfilter/nft_chain_nat_ipv4.o
  CC [M]  net/ipv4/netfilter/nft_masq_ipv4.o
  CC [M]  net/ipv4/netfilter/iptable_nat.o
  CC [M]  net/ipv4/netfilter/ipt_MASQUERADE.o
  CC [M]  net/ipv6/netfilter/nf_nat_l3proto_ipv6.o
  CC [M]  net/ipv6/netfilter/nf_nat_proto_icmpv6.o
  LD [M]  net/ipv6/netfilter/nf_nat_ipv6.o
  CC [M]  net/ipv6/netfilter/nft_chain_nat_ipv6.o
  CC [M]  net/netfilter/nf_conntrack_core.o
  LD [M]  net/netfilter/nf_conntrack.o
  CC [M]  net/netfilter/nf_conntrack_netlink.o
  CC [M]  net/netfilter/nf_nat_core.o
  CC [M]  net/netfilter/nf_nat_proto_unknown.o
  CC [M]  net/netfilter/nf_nat_proto_common.o
  CC [M]  net/netfilter/nf_nat_proto_udp.o
  CC [M]  net/netfilter/nf_nat_proto_tcp.o
  CC [M]  net/netfilter/nf_nat_helper.o
  LD [M]  net/netfilter/nf_nat.o
  CC [M]  net/netfilter/nf_nat_redirect.o
  CC [M]  net/netfilter/nf_nat_proto_dccp.o
  CC [M]  net/netfilter/nf_nat_proto_udplite.o
  CC [M]  net/netfilter/nf_nat_proto_sctp.o
  CC [M]  net/netfilter/nf_nat_ftp.o
  CC [M]  net/netfilter/nf_nat_irc.o
  CC [M]  net/netfilter/nf_nat_sip.o
  CC [M]  net/netfilter/nft_nat.o
  CC [M]  net/netfilter/nft_masq.o
  CC [M]  net/netfilter/xt_nat.o
  CC [M]  net/netfilter/xt_NETMAP.o
  CC [M]  net/netfilter/xt_REDIRECT.o
  CC [M]  net/netfilter/ipvs/ip_vs_ftp.o
  CHK     include/generated/uapi/linux/version.h
  LINK    vmlinux
  LD      vmlinux.o
  MODPOST vmlinux.o
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  LD      init/built-in.o
  KSYM    .tmp_kallsyms1.o
  KSYM    .tmp_kallsyms2.o
  LD      vmlinux
  SORTEX  vmlinux
  SYSMAP  System.map
  TEST    posttest
Succeed: decoded and checked 1990523 instructions
  TEST    posttest
arch/x86/tools/insn_sanity: Success: decoded and checked 1000000 random instructions with 0 errors (seed:0xd3597a2f)
  VOFFSET arch/x86/boot/voffset.h
  OBJCOPY arch/x86/boot/compressed/vmlinux.bin
  RELOCS  arch/x86/boot/compressed/vmlinux.relocs
  GZIP    arch/x86/boot/compressed/vmlinux.bin.gz
  MKPIGGY arch/x86/boot/compressed/piggy.S
  AS      arch/x86/boot/compressed/piggy.o
  LD      arch/x86/boot/compressed/vmlinux
  ZOFFSET arch/x86/boot/zoffset.h
  AS      arch/x86/boot/header.o
  CC      arch/x86/boot/version.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  OBJCOPY arch/x86/boot/vmlinux.bin
  BUILD   arch/x86/boot/bzImage
Setup is 17100 bytes (padded to 17408 bytes).
System is 5526 kB
CRC abdc9002
Kernel: arch/x86/boot/bzImage is ready  (#3)
  Building modules, stage 2.
  MODPOST 2629 modules
  CC      net/ipv4/netfilter/ipt_MASQUERADE.mod.o
  LD [M]  net/ipv4/netfilter/ipt_MASQUERADE.ko
  CC      net/ipv4/netfilter/iptable_nat.mod.o
  LD [M]  net/ipv4/netfilter/iptable_nat.ko
  LD [M]  net/ipv4/netfilter/nf_nat_h323.ko
  LD [M]  net/ipv4/netfilter/nf_nat_ipv4.ko
  CC      net/ipv4/netfilter/nf_nat_masquerade_ipv4.mod.o
  LD [M]  net/ipv4/netfilter/nf_nat_masquerade_ipv4.ko
  LD [M]  net/ipv4/netfilter/nf_nat_pptp.ko
  LD [M]  net/ipv4/netfilter/nf_nat_proto_gre.ko
  LD [M]  net/ipv4/netfilter/nf_nat_snmp_basic.ko
  LD [M]  net/ipv4/netfilter/nft_chain_nat_ipv4.ko
  CC      net/ipv4/netfilter/nft_masq_ipv4.mod.o
  LD [M]  net/ipv4/netfilter/nft_masq_ipv4.ko
  LD [M]  net/ipv6/netfilter/nf_nat_ipv6.ko
  LD [M]  net/ipv6/netfilter/nft_chain_nat_ipv6.ko
  LD [M]  net/netfilter/ipvs/ip_vs_ftp.ko
  LD [M]  net/netfilter/nf_conntrack.ko
  LD [M]  net/netfilter/nf_conntrack_netlink.ko
  LD [M]  net/netfilter/nf_nat.ko
  LD [M]  net/netfilter/nf_nat_ftp.ko
  LD [M]  net/netfilter/nf_nat_irc.ko
  LD [M]  net/netfilter/nf_nat_proto_dccp.ko
  LD [M]  net/netfilter/nf_nat_proto_sctp.ko
  LD [M]  net/netfilter/nf_nat_proto_udplite.ko
  LD [M]  net/netfilter/nf_nat_redirect.ko
  LD [M]  net/netfilter/nf_nat_sip.ko
  CC      net/netfilter/nft_masq.mod.o
  LD [M]  net/netfilter/nft_masq.ko
  LD [M]  net/netfilter/nft_nat.ko
  LD [M]  net/netfilter/xt_NETMAP.ko
  LD [M]  net/netfilter/xt_REDIRECT.ko
  CC      net/netfilter/xt_nat.mod.o
  LD [M]  net/netfilter/xt_nat.ko

(19)
[root@localhost boot]# mv vmlinuz-3.19.8 old2.vmlinuz-3.19.8
[root@localhost boot]# mv initramfs-3.19.8.img old2.initramfs-3.19.8.img
[root@localhost boot]# mv System.map-3.19.8 old2.System.map-3.19.8
[root@localhost boot]# mv config-3.19.8 old2.config-3.19.8

(20)
[root@localhost boot]# cd /usr/src/linux/
[root@localhost linux]# cp arch/x86/boot/bzImage /boot/vmlinuz-3.19.8
[root@localhost linux]# cp .config /boot/config-3.19.8
[root@localhost linux]# cp System.map /boot/System.map-3.19.8
[root@localhost linux]#

(21)
[root@localhost linux]# make modules_install
:
  INSTALL sound/usb/usx2y/snd-usb-us122l.ko
  INSTALL sound/usb/usx2y/snd-usb-usx2y.ko
  DEPMOD  3.19.8
[root@localhost linux]#
(22)
[root@localhost linux]# ll /lib/modules/
total 20
drwxr-xr-x  6 root root 4096 Jan  5 17:34 3.14.27-100.fc19.i686.PAE
drwxr-xr-x  3 root root 4096 Jan 13 07:55 3.19.8
drwxr-xr-x  4 root root 4096 Jan 11 13:06 3.9.5
drwxr-xr-x  6 root root 4096 Jan  6 16:03 3.9.5-301.fc19.i686
drwxr-xr-x. 6 root root 4096 Jan  6 12:46 3.9.5-301.fc19.i686.PAE
[root@localhost linux]#

(23)
[root@localhost linux]#  dracut -v /boot/initramfs-3.19.8.img 3.19.8
:
I: Wrote /boot/initramfs-3.19.8.img:
I: -rw------- 1 root root 19461944 Jan 13 07:57 /boot/initramfs-3.19.8.img

(24)
[root@localhost linux]#  ll /boot
total 195167
-rw-r--r--  1 root root   148612 Jan 13 07:51 config-3.19.8
-rw-r--r--  1 root root   130928 Jun 12  2013 config-3.9.5-301.fc19.i686
-rw-r--r--. 1 root root   128562 Jun 12  2013 config-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root   128296 Jan 11 07:34 config-3.9.5-treehrt
drwxr-xr-x. 6 root root     1024 Jan 12 17:53 grub2
-rw-------. 1 root root 25509635 Dec 23 12:26 initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
-rw-------  1 root root 19461944 Jan 13 07:57 initramfs-3.19.8.img
-rw-------  1 root root  8745331 Jan  6 16:03 initramfs-3.9.5-301.fc19.i686.img
-rw-------. 1 root root 16779573 Dec 23 12:26 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-------  1 root root 17736016 Jan 11 07:42 initramfs-3.9.5.img
-rw-------  1 root root  8236814 Jan 11 07:47 initramfs-3.9.5-treehrt.img
-rw-r--r--. 1 root root   557284 Jan  5 17:34 initrd-plymouth.img
drwx------. 2 root root    12288 Dec 23 12:05 lost+found
-rw-r--r--  1 root root   148506 Jan 12 16:14 old2.config-3.19.8
-rw-------  1 root root 26308183 Jan 12 16:29 old2.initramfs-3.19.8.img
-rw-r--r--  1 root root  2348934 Jan 12 16:14 old2.System.map-3.19.8
-rwxr-xr-x  1 root root  5675104 Jan 12 16:14 old2.vmlinuz-3.19.8
-rw-r--r--  1 root root   142005 Dec 18  2014 old.config-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root    97454 Jan 11 17:27 old.config-3.19.8
-rw-------  1 root root  9162360 Jan  5 17:34 old.initramfs-3.14.27-100.fc19.i686.PAE.img
-rw-------  1 root root  8242449 Jan 11 17:31 old.initramfs-3.19.8.img
-rw-------  1 root root  2244508 Dec 18  2014 old.System.map-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root  2513181 Jan 11 17:28 old.System.map-3.19.8
-rwxr-xr-x  1 root root  5471888 Dec 18  2014 old.vmlinuz-3.14.27-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  5738112 Jan 11 17:27 old.vmlinuz-3.19.8
-rw-r--r--  1 root root  2348934 Jan 13 07:51 System.map-3.19.8
-rw-------  1 root root  2017641 Jun 12  2013 System.map-3.9.5-301.fc19.i686
-rw-------. 1 root root  2055042 Jun 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  2052858 Jan 11 07:35 System.map-3.9.5-treehrt
-rwxr-xr-x. 1 root root  5025072 Dec 23 12:26 vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
-rw-r--r--  1 root root  5675104 Jan 13 07:51 vmlinuz-3.19.8
-rwxr-xr-x  1 root root  4939088 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686
-rwxr-xr-x. 1 root root  5025072 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
-rwxr-xr-x  1 root root  5013728 Jan 11 07:33 vmlinuz-3.9.5-treehrt
[root@localhost linux]#

(25)
[root@localhost linux]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.19.8
Found initrd image: /boot/initramfs-3.19.8.img
Found linux image: /boot/vmlinuz-3.9.5-treehrt
Found initrd image: /boot/initramfs-3.9.5-treehrt.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.img
Found linux image: /boot/vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
Found initrd image: /boot/initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
done
[root@localhost linux]#
[root@localhost linux]# uname -a
Linux localhost.localdomain 3.19.8 #2 SMP Tue Jan 12 15:54:22 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost linux]# reboot


(26)

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.19.8 #3 SMP Wed Jan 13 07:43:30 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost ~]#

(27) But
[root@localhost ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination

(28)

[root@localhost ~]# /etc/rc.d/rc.local
[root@localhost ~]# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain POSTROUTING (policy ACCEPT)
target     prot opt source               destination
MASQUERADE  all  --  10.2.2.0/24          anywhere
[root@localhost ~]#

[root@localhost ~]# cat /etc/rc.d/rc.local
#!/bin/sh
#/usr/sbin/dhcpd &

iptables -t nat -F
echo "1" > /proc/sys/net/ipv4/ip_forward
modprobe ip_nat_ftp
modprobe ip_nat_irc
modprobe ip_conntrack_ftp
modprobe ip_conntrack_irc

#iptables -t nat -A POSTROUTING -o eth0 -s 10.1.1.0/24  -j MASQUERADE
iptables -t nat -A POSTROUTING -s 10.2.2.0/24  -j MASQUERADE

[root@localhost ~]#

20160108換Linux核心(kernel-3.19.8)過程
2016/01/08,15:31

(1) 查系統現況
[root@localhost ~]# date
五  1月  8 11:31:26 CST 2016


[root@localhost ~]# uname -a
Linux localhost.localdomain 3.14.19-100.fc19.i686.PAE #1 SMP Wed Sep 17 22:23:56                                             

UTC 2014 i686 i686 i386 GNU/Linux
[root@localhost ~]#

(2) 下載核心linux-3.19.8.tar.gz
[root@localhost ~]# wget ftp://linux.cis.nctu.edu.tw/kernel/linux/kernel/v3.x/linux-3.19.8.tar.gz
--2016-01-08 11:42:07--  ftp://linux.cis.nctu.edu.tw/kernel/linux/kernel/v3.x/linux-3.19.8.tar.gz
           => ‘linux-3.19.8.tar.gz’
:
長度: 123146642 (117M) (非正式資料)

100%[===================================================================================>] 123,146,642  466KB/s   in 5m 24s

2016-01-08 11:47:36 (371 KB/s) - ‘linux-3.19.8.tar.gz’ saved [123146642]

[root@localhost ~]#


(3)解開核心
[root@localhost ~]# tar xvzf linux-3.19.8.tar.gz
:
linux-3.19.8/virt/kvm/vfio.h

[root@localhost ~]# ll|grep linux
drwxrwxr-x  23 root root      4096  5月 11  2015 linux-3.19.8
-rw-r--r--   1 root root 123146642  1月  8 11:47 linux-3.19.8.tar.gz
[root@localhost ~]# pwd
/root
[root@localhost ~]#

(4) 建立/usr/src/linux符號連結

 
[root@localhost ~]# ln -s /root/linux-3.19.8 /usr/src/linux
[root@localhost ~]# ls /usr/src -l
總計 8
drwxr-xr-x. 2 root root 4096  7月  8  2013 debug
drwxr-xr-x. 2 root root 4096  7月  8  2013 kernels
lrwxrwxrwx  1 root root   18  1月  8 11:54 linux -> /root/linux-3.19.8
[root@localhost ~]#

[root@localhost ~]# cd /usr/src/linux/

[root@localhost linux]# ls
arch     CREDITS        drivers   include  Kbuild   lib          mm      REPORTING-BUGS  security  usr
block    crypto         firmware  init     Kconfig  MAINTAINERS  net     samples         sound     virt
COPYING  Documentation  fs        ipc      kernel   Makefile     README  scripts         tools

(5)用現有的組態為預設值建立核心組態
[root@localhost linux]# make menuconfig
:

#
# using defaults found in /boot/config-3.14.19-100.fc19.i686.PAE
#
/boot/config-3.14.19-100.fc19.i686.PAE:1304:warning: symbol value 'm' invalid for CGROUP_NET_PRIO
configuration written to .config
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
[root@localhost linux]#

(6)閱讀說明檔
[root@localhost linux]# cat README |more

 

(7)編譯核心

[root@localhost linux]# make

(8)列出剛編譯完成的核心

[root@localhost linux]# ls arch/x86/boot/bzImage -l
-rw-r--r-- 1 root root 5675104  1月  8 12:41 arch/x86/boot/bzImage

[root@localhost linux]# date
五  1月  8 14:30:15 CST 2016

(9)查看不可手動修改的開機選單設定檔
[root@localhost linux]# cat /boot/grub2/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
:
(10)將新編的核心及組態檔拷至/boot目錄分別為vmlinuz-3.19.8及config-3.19.8

[root@localhost linux]# ll arch/x86/boot/bzImage
-rw-r--r-- 1 root root 5675104  1月  8 12:41 arch/x86/boot/bzImage
[root@localhost linux]# cp arch/x86/boot/bzImage /boot/vmlinuz-3.19.8
[root@localhost linux]# cp .config /boot/config-3.19.8


(11)安裝新的核心模組至/lib/modules/3.19.8
[root@localhost linux]# make modules_install

:  INSTALL /lib/firmware/keyspan_pda/keyspan_pda.fw
  INSTALL /lib/firmware/keyspan_pda/xircom_pgs.fw
  INSTALL /lib/firmware/cpia2/stv0672_vp4.bin
  INSTALL /lib/firmware/yam/1200.bin
  INSTALL /lib/firmware/yam/9600.bin
  DEPMOD  3.19.8


[root@localhost linux]# ll /lib/modules/
總計 12
drwxr-xr-x  6 root root 4096 10月  9  2014 3.14.19-100.fc19.i686.PAE
drwxr-xr-x  3 root root 4096  1月  8 14:53 3.19.8
drwxr-xr-x. 6 root root 4096  9月 22  2014 3.9.5-301.fc19.i686.PAE

(12)建立initramfs
[root@localhost linux]# dracut -v /boot/initramfs-3.19.8.img 3.19.8

:

I: Wrote /boot/initramfs-3.19.8.img:
I: -rw------- 1 root root 19669879  1月  8 15:13 /boot/initramfs-3.19.8.img
[root@localhost linux]#

(13)列出/boot
[root@localhost linux]# ll /boot
總計 97608
-rw-r--r--  1 root root   141987  9月 18  2014 config-3.14.19-100.fc19.i686.PAE
-rw-r--r--  1 root root   148440  1月  8 14:47 config-3.9.18
-rw-r--r--. 1 root root   128562  6月 12  2013 config-3.9.5-301.fc19.i686.PAE
drwxr-xr-x. 6 root root     1024 10月  9  2014 grub2
-rw-------. 1 root root 25527215  9月 22  2014 initramfs-0-rescue-6436dc21b02146c9bd2e8bb5d12ce2c1.img
-rw-------  1 root root  9110043 10月  9  2014 initramfs-3.14.19-100.fc19.i686.PAE.img
-rw-------  1 root root 19669879  1月  8 15:13 initramfs-3.19.8.img
-rw-------. 1 root root 16800247  9月 22  2014 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-r--r--. 1 root root   557301 10月  9  2014 initrd-plymouth.img
drwx------. 2 root root    12288  9月 22  2014 lost+found
-rw-------  1 root root  2242184  9月 18  2014 System.map-3.14.19-100.fc19.i686.PAE
-rw-r--r--  1 root root  2348934  1月  8 15:00 System.map-3.19.8
-rw-------. 1 root root  2055042  6月 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rwxr-xr-x. 1 root root  5025072  9月 22  2014 vmlinuz-0-rescue-6436dc21b02146c9bd2e8bb5d12ce2c1
-rwxr-xr-x  1 root root  5465744  9月 18  2014 vmlinuz-3.14.19-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  5675104  1月  8 14:46 vmlinuz-3.19.8
-rwxr-xr-x. 1 root root  5025072  6月 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
[root@localhost linux]#


(14)建立核心開機選單,最新編譯者為第1選項(預設選項)
[root@localhost linux]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.19.8
Found initrd image: /boot/initramfs-3.19.8.img
Found linux image: /boot/vmlinuz-3.14.19-100.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.14.19-100.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-0-rescue-6436dc21b02146c9bd2e8bb5d12ce2c1
Found initrd image: /boot/initramfs-0-rescue-6436dc21b02146c9bd2e8bb5d12ce2c1.img
Found FreeDOS on /dev/sda1
Found Fedora release 8 (Werewolf) on /dev/mapper/VolGroup00-LogVol00
done

(15)遠端重開機查看,新的Linux核心成功運中中

[root@localhost linux]# reboot

[root@localhost ~]# uname -a
Linux localhost.localdomain 3.19.8 #1 SMP Fri Jan 8 12:41:11 CST 2016 i686 i686 i386 GNU/Linux
[root@localhost ~]#

Good, It's success!!

(16)參考文章

REF 1:http://linux.vbird.org/linux_basic/0540kernel.php
REF 2:http://linux.vbird.org/linux_basic/redhat6.1/linux_10kernel.php

20160107-11 make linux-3.9.5 kernel
2016/01/07,15:06

(1)
download linux kernel linux-3.9.5.tar.gz
[root@localhost ~]# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.9.5.tar.gz
--2016-01-06 17:18:27--  https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.9.5.tar.gz
:
linux-3.9.5.tar.gz     100%[=============================>] 103.68M   357KB/s   in 10m 56ss
2016-01-06 17:29:24 (162 KB/s) - ‘linux-3.9.5.tar.gz’ saved [108711952/108711952]

[root@localhost ~]# pwd
/root
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.9.5-301.fc19.i686.PAE #1 SMP Tue Jun 11 19:46:44 UTC 2013 i686 i686 i386 GNU/Linux
[root@localhost ~]# date
Thu Jan  7 07:29:36 CST 2016
[root@localhost ~]#

(2)
[root@localhost ~]# tar xvzf linux-3.9.5.tar.gz

(3)
[root@localhost ~]# ln -s /root/linux-3.9.5 /usr/src/linux

[root@localhost ~]# ls /usr/src
debug  kernels  linux
[root@localhost ~]# cd /usr/src/linux/
[root@localhost linux]# ls
arch     crypto         fs       Kbuild   linux        net             scripts   usr
block    Documentation  include  Kconfig  MAINTAINERS  README          security  virt
COPYING  drivers        init     kernel   Makefile     REPORTING-BUGS  sound
CREDITS  firmware       ipc      lib      mm           samples         tools
[root@localhost linux]# make menuconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
 *** Unable to find the ncurses libraries or the
 *** required header files.
 *** 'make menuconfig' requires the ncurses libraries.
 ***
 *** Install ncurses (ncurses-devel) and try again.
 ***
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

(4)
[root@localhost linux]# yum install ncurses-devel

(5)
[root@localhost linux]# make menuconfig
:
  │ │     [ ] 64-bit kernel                                                          │ │
  │ │         General setup  --->                                                    │ │
  │ │     [*] Enable loadable module support  --->                                   │ │
  │ │     -*- Enable the block layer  --->                                           │ │
  │ │         Processor type and features  --->                                      │ │
  │ │         Power management and ACPI options  --->                                │ │
  │ │         Bus options (PCI etc.)  --->                                           │ │
  │ │         Executable file formats / Emulations  --->                             │ │
  │ │     -*- Networking support  --->                                               │ │
  │ │         Device Drivers  --->                                                   │ │
  │ │         Firmware Drivers  --->                                                 │ │
  │ │         File systems  --->                                                     │ │
  │ │         Kernel hacking  --->                                                   │ │
  │ │         Security options  --->                                                 │ │
  │ │     -*- Cryptographic API  --->                                                │ │
  │ │     -*- Virtualization  --->                                                   │ │
  │ │         Library routines  --->   

:
     Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon)

  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
#
# using defaults found in /boot/config-3.9.5-301.fc19.i686.PAE
#
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

[root@localhost linux]#


(4)
[root@localhost linux]# cat README |more



(5)
[root@localhost linux]# make mrproper
  CLEAN   .
  CLEAN   arch/x86/kernel/cpu
  CLEAN   arch/x86/kernel
  CLEAN   arch/x86/realmode/rm
  CLEAN   arch/x86/vdso
  CLEAN   arch/x86/lib
  CLEAN   crypto/asymmetric_keys
  CLEAN   drivers/gpu/drm/radeon
  CLEAN   drivers/scsi/aic7xxx
  CLEAN   drivers/tty/vt
  CLEAN   drivers/video/logo
  CLEAN   firmware
  CLEAN   kernel/debug/kdb
  CLEAN   kernel
  CLEAN   lib/raid6
  CLEAN   lib
  CLEAN   security/selinux
  CLEAN   usr
  CLEAN   Documentation/accounting
  CLEAN   Documentation/auxdisplay
  CLEAN   Documentation/connector
  CLEAN   Documentation/filesystems
  CLEAN   Documentation/ia64
  CLEAN   Documentation/laptops
  CLEAN   Documentation/misc-devices/mei
  CLEAN   Documentation/networking/timestamping
  CLEAN   Documentation/networking
  CLEAN   Documentation/pcmcia
  CLEAN   Documentation/spi
  CLEAN   Documentation/timers
  CLEAN   Documentation/watchdog/src
  CLEAN   arch/x86/boot/compressed
  CLEAN   arch/x86/boot
  CLEAN   arch/x86/tools
  CLEAN   .tmp_versions
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   scripts/mod
  CLEAN   scripts/selinux/genheaders
  CLEAN   scripts/selinux/mdp
  CLEAN   scripts
  CLEAN   include/config usr/include include/generated arch/x86/include/generated
  CLEAN   .config .version include/generated/uapi/linux/version.h Module.symvers signing_key.priv signing_key.x509

x509.genkey extra_certificates
[root@localhost linux]#



(6)
[root@localhost linux]# make menuconfig

 │         Processor family (Pentium-4/Celeron(P4-based)/Pentium-4 M/older Xeon)  │
:
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTCC  scripts/kconfig/mconf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
#
# using defaults found in /boot/config-3.9.5-301.fc19.i686.PAE
#
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

[root@localhost linux]#


(7)
[root@localhost linux]# make


(8)
[root@localhost linux]# date
Thu Jan  7 14:27:07 CST 2016

[root@localhost linux]# ls arch/x86/boot/bzImage -l
-rw-r--r-- 1 root root 5013728 Jan  7 13:12 arch/x86/boot/bzImage
[root@localhost linux]#

[root@localhost linux]# ls /boot -l
total 85903
-rw-r--r--  1 root root   142005 Dec 18  2014 config-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root   130928 Jun 12  2013 config-3.9.5-301.fc19.i686
-rw-r--r--. 1 root root   128562 Jun 12  2013 config-3.9.5-301.fc19.i686.PAE
drwxr-xr-x. 6 root root     1024 Jan  6 16:03 grub2
-rw-------. 1 root root 25509635 Dec 23 12:26 initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
-rw-------  1 root root  9162360 Jan  5 17:34 initramfs-3.14.27-100.fc19.i686.PAE.img
-rw-------  1 root root  8745331 Jan  6 16:03 initramfs-3.9.5-301.fc19.i686.img
-rw-------. 1 root root 16779573 Dec 23 12:26 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-r--r--. 1 root root   557284 Jan  5 17:34 initrd-plymouth.img
drwx------. 2 root root    12288 Dec 23 12:05 lost+found
-rw-------  1 root root  2244508 Dec 18  2014 System.map-3.14.27-100.fc19.i686.PAE
-rw-------  1 root root  2017641 Jun 12  2013 System.map-3.9.5-301.fc19.i686
-rw-------. 1 root root  2055042 Jun 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rwxr-xr-x. 1 root root  5025072 Dec 23 12:26 vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
-rwxr-xr-x  1 root root  5471888 Dec 18  2014 vmlinuz-3.14.27-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  4939088 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686
-rwxr-xr-x. 1 root root  5025072 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
[root@localhost linux]#

(9)

[root@localhost ~]# cd /usr/src/linux/
[root@localhost linux]# ls
arch                firmware  lib              net               sound
block               fs        linux            README            System.map
COPYING             include   MAINTAINERS      REPORTING-BUGS    tools
CREDITS             init      Makefile         samples           usr
crypto              ipc       mm               scripts           virt
Documentation       Kbuild    modules.builtin  security          vmlinux
drivers             Kconfig   modules.order    signing_key.priv  vmlinux.o
extra_certificates  kernel    Module.symvers   signing_key.x509  x509.genkey
[root@localhost linux]# ls arch/x86/boot/bzImage -l
-rw-r--r-- 1 root root 5013728 Jan  7 13:12 arch/x86/boot/bzImage
[root@localhost linux]# cp arch/x86/boot/bzImage /boot/vmlinuz-3.9.5-treehrt
[root@localhost linux]# cp .config /boot/config-3.9.5-treehrt
[root@localhost linux]# cp System.map /boot/System.map-3.9.5-treehrt
[root@localhost linux]# ll /boot
total 92931
-rw-r--r--  1 root root   142005 Dec 18  2014 config-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root   130928 Jun 12  2013 config-3.9.5-301.fc19.i686
-rw-r--r--. 1 root root   128562 Jun 12  2013 config-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root   128296 Jan 11 07:34 config-3.9.5-treehrt
drwxr-xr-x. 6 root root     1024 Jan  6 16:03 grub2
-rw-------. 1 root root 25509635 Dec 23 12:26 initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
-rw-------  1 root root  9162360 Jan  5 17:34 initramfs-3.14.27-100.fc19.i686.PAE.img
-rw-------  1 root root  8745331 Jan  6 16:03 initramfs-3.9.5-301.fc19.i686.img
-rw-------. 1 root root 16779573 Dec 23 12:26 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-r--r--. 1 root root   557284 Jan  5 17:34 initrd-plymouth.img
drwx------. 2 root root    12288 Dec 23 12:05 lost+found
-rw-------  1 root root  2244508 Dec 18  2014 System.map-3.14.27-100.fc19.i686.PAE
-rw-------  1 root root  2017641 Jun 12  2013 System.map-3.9.5-301.fc19.i686
-rw-------. 1 root root  2055042 Jun 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  2052858 Jan 11 07:35 System.map-3.9.5-treehrt
-rwxr-xr-x. 1 root root  5025072 Dec 23 12:26 vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
-rwxr-xr-x  1 root root  5471888 Dec 18  2014 vmlinuz-3.14.27-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  4939088 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686
-rwxr-xr-x. 1 root root  5025072 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  5013728 Jan 11 07:33 vmlinuz-3.9.5-treehrt
[root@localhost linux]#

(10)
[root@localhost linux]# make modules_install
:
  INSTALL /lib/firmware/yam/1200.bin
  INSTALL /lib/firmware/yam/9600.bin
  DEPMOD  3.9.5

[root@localhost linux]#  ll /lib/modules/
total 16
drwxr-xr-x  6 root root 4096 Jan  5 17:34 3.14.27-100.fc19.i686.PAE
drwxr-xr-x  3 root root 4096 Jan 11 07:39 3.9.5
drwxr-xr-x  6 root root 4096 Jan  6 16:03 3.9.5-301.fc19.i686
drwxr-xr-x. 6 root root 4096 Jan  6 12:46 3.9.5-301.fc19.i686.PAE
[root@localhost linux]#



(11)

[root@localhost linux]# dracut -v /boot/initramfs-3.9.5.img 3.9.5
:
I: *** Creating image file done ***
I: Wrote /boot/initramfs-3.9.5.img:
I: -rw------- 1 root root 17736016 Jan 11 07:42 /boot/initramfs-3.9.5.img

(12)
[root@localhost linux]#  ll /boot
total 110253
-rw-r--r--  1 root root   142005 Dec 18  2014 config-3.14.27-100.fc19.i686.PAE
-rw-r--r--  1 root root   130928 Jun 12  2013 config-3.9.5-301.fc19.i686
-rw-r--r--. 1 root root   128562 Jun 12  2013 config-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root   128296 Jan 11 07:34 config-3.9.5-treehrt
drwxr-xr-x. 6 root root     1024 Jan  6 16:03 grub2
-rw-------. 1 root root 25509635 Dec 23 12:26 initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
-rw-------  1 root root  9162360 Jan  5 17:34 initramfs-3.14.27-100.fc19.i686.PAE.img
-rw-------  1 root root  8745331 Jan  6 16:03 initramfs-3.9.5-301.fc19.i686.img
-rw-------. 1 root root 16779573 Dec 23 12:26 initramfs-3.9.5-301.fc19.i686.PAE.img
-rw-------  1 root root 17736016 Jan 11 07:42 initramfs-3.9.5.img
-rw-r--r--. 1 root root   557284 Jan  5 17:34 initrd-plymouth.img
drwx------. 2 root root    12288 Dec 23 12:05 lost+found
-rw-------  1 root root  2244508 Dec 18  2014 System.map-3.14.27-100.fc19.i686.PAE
-rw-------  1 root root  2017641 Jun 12  2013 System.map-3.9.5-301.fc19.i686
-rw-------. 1 root root  2055042 Jun 12  2013 System.map-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  2052858 Jan 11 07:35 System.map-3.9.5-treehrt
-rwxr-xr-x. 1 root root  5025072 Dec 23 12:26 vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
-rwxr-xr-x  1 root root  5471888 Dec 18  2014 vmlinuz-3.14.27-100.fc19.i686.PAE
-rwxr-xr-x  1 root root  4939088 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686
-rwxr-xr-x. 1 root root  5025072 Jun 12  2013 vmlinuz-3.9.5-301.fc19.i686.PAE
-rw-r--r--  1 root root  5013728 Jan 11 07:33 vmlinuz-3.9.5-treehrt
[root@localhost linux]#

(13)
[root@localhost linux]# dracut -v /boot/initramfs-3.9.5-treehrt.img 3.9.5-treehrt
:
I: Wrote /boot/initramfs-3.9.5-treehrt.img:
I: -rw------- 1 root root 8236814 Jan 11 07:47 /boot/initramfs-3.9.5-treehrt.img

(14)
[root@localhost linux]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.14.27-100.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.14.27-100.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-treehrt
Found initrd image: /boot/initramfs-3.9.5-treehrt.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.img
Found linux image: /boot/vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
Found initrd image: /boot/initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
done
[root@localhost linux]#

(15)
[root@localhost linux]# mv /boot/vmlinuz-3.14.27-100.fc19.i686.PAE /boot/old.vmlinuz-3.14.27-100.fc19.i686.PAE
[root@localhost linux]# mv /boot/initramfs-3.14.27-100.fc19.i686.PAE.img /boot/old.initramfs-3.14.27-

100.fc19.i686.PAE.img
[root@localhost linux]#

[root@localhost linux]# grub2-mkconfig -o /boot/grub2/grub.cfg                             Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.9.5-treehrt
Found initrd image: /boot/initramfs-3.9.5-treehrt.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686.PAE
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.PAE.img
Found linux image: /boot/vmlinuz-3.9.5-301.fc19.i686
Found initrd image: /boot/initramfs-3.9.5-301.fc19.i686.img
Found linux image: /boot/vmlinuz-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8
Found initrd image: /boot/initramfs-0-rescue-fe190f81d1ab45818aafd3f4c1c5edd8.img
done

(16)
[root@localhost linux]# reboot


[root@localhost ~]# uname -a
Linux localhost.localdomain 3.9.5 #1 SMP Thu Jan 7 13:12:24 CST 2016 i686 i686 i386 GNU/Linux

[root@localhost ~]# date
Mon Jan 11 07:54:09 CST 2016

[root@localhost ~]#  iptables -L -nvx
Chain INPUT (policy ACCEPT 726 packets, 84523 bytes)
    pkts      bytes target     prot opt in     out     source               destination   

Chain FORWARD (policy ACCEPT 14229 packets, 6534383 bytes)
    pkts      bytes target     prot opt in     out     source               destination   

Chain OUTPUT (policy ACCEPT 186 packets, 23787 bytes)
    pkts      bytes target     prot opt in     out     source               destination   
[root@localhost ~]#

REF 1:http://linux.vbird.org/linux_basic/0540kernel.php
REF 2:http://linux.vbird.org/linux_basic/redhat6.1/linux_10kernel.php

用退牙器把斷在牆中的水龍頭斷處取出
2016/01/04,13:08

用退牙器把斷在牆中的水龍頭斷處取出。
http://insecta.idv.tw/farmer/20160102.JPG

用水管和保特瓶製作了一個唧水用的管子,把水由田裡的水槽中抽出來灌溉
2016/01/04,13:07

用水管和保特瓶製作了一個唧水用的管子,把水由田裡的水槽中抽出來灌溉。
http://insecta.idv.tw/farmer/20151230.JPG

fedora 19 設定時區指令2
2016/01/04,07:49

[root@localhost ~]# timedatectl list-timezones

:

[root@localhost ~]# timedatectl set-timezone Asia/Taipei
[root@localhost ~]# date
Mon Jan  4 07:47:02 CST 2016

[root@localhost ~]# timedatectl status
      Local time: Mon 2016-01-04 07:48:18 CST
  Universal time: Sun 2016-01-03 23:48:18 UTC
        RTC time: Sun 2016-01-03 23:48:10
        Timezone: Asia/Taipei (CST, +0800)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a
[root@localhost ~]#

 


[root@localhost ~]# date
Mon Jan  4 20:51:23 CST 2016
[root@localhost ~]# date 010407532016
Mon Jan  4 07:53:00 CST 2016
[root@localhost ~]# date
Mon Jan  4 07:53:02 CST 2016
[root@localhost ~]#  /sbin/hwclock -w
[root@localhost ~]# date
Mon Jan  4 07:53:15 CST 2016

 
Accessible and Valid XHTML 1.0 Strict and CSS Powered by LifeType