由於 kernel 的程式碼自 2.6.12 版起,在提供的 tar-archives 中多加了 git commit ID 的 extended header ,如果你的 tar 版本較舊,就會出現一個警告訊息,進而產生一個 pax_global_header 的檔案。
tar xjf linux-2.6.19.7.tar.bz2
tar: pax_global_header: Unknown file type 'g', extracted as normal file
tar --version
tar (GNU tar) 1.13.25
Copyright (C) 2001 Free Software Foundation, Inc.
This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute it under the terms of the GNU General Public License;
see the file named COPYING for details.
Written by John Gilmore and Jay Fenlason.
查了一下,雖然這是一個無關痛癢的警告,不過出現實還是怪怪的,如果可以將 tar 的版本升級至 1.14 以後,就能夠避掉這樣的警告訊息。因為習慣在 RPM 的系統下處理作業,而該主機的環境卻仍停留在 Fedora Core 2 ,就連 The Fedora Legacy Project 都不再維護,所以興起了自己編譯 tar RPM 的念頭。
曾經有將新版的 sendmail 由 Tar Ball 轉成 RPM 的經驗,所以編譯環境已經存在,不再贅述,這次依然如法泡製一番!
1.安裝 tar 的 SOURCE RPM:
rpm -ivh tar-1.13.25-14.1.legacy.src.rpm
2.下載新版 tar 原始碼,置於 /usr/src/redhat/SOURCES/ 目錄中:
wget http://ftp.gnu.org/gnu/tar/tar-1.20.tar.bz2
3.編輯 SPEC 檔,保留 man page 的 patch,否則無法編譯成功:
diff -urN tar-vic.spec tar.spec
--- tar-vic.spec 2008-06-08 14:12:06.936689000 +0800
+++ tar.spec 2006-03-09 08:25:32.000000000 +0800
@@ -1,7 +1,7 @@
Summary: A GNU file archiving program.
Name: tar
-Version: 1.20
-Release: vic
+Version: 1.13.25
+Release: 14.1.legacy
License: GPL
Group: Applications/Archiving
Source: ftp://ftp.gnu.org/pub/gnu/tar/tar-%{version}.tar.bz2
@@ -32,13 +32,13 @@
%prep
%setup -q
%patch0 -p1 -b .manpage
-#%patch1 -p1 -b .sock
-#%patch2 -p1 -b .253
-#%patch6 -p1 -b .librt
-#%patch7 -p1 -b .err
-#%patch8 -p1 -b .absn
-#%patch9 -p1 -b .argv
-#%patch10 -p1 -b .dots
+%patch1 -p1 -b .sock
+%patch2 -p1 -b .253
+%patch6 -p1 -b .librt
+%patch7 -p1 -b .err
+%patch8 -p1 -b .absn
+%patch9 -p1 -b .argv
+%patch10 -p1 -b .dots
4.產生 RPM 檔:
rpmbuild -ba /usr/src/redhat/SPECS/tar.spec
5.安裝升級 tar:
rpm -Uvh /usr/src/redhat/RPMS/i386/tar-1.20-vic.i386.rpm
6.不再出現警告訊息:
tar xjf tar-1.20.tar.bz2
tar --version
tar (GNU tar) 1.20
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.