2008年4月7日 星期一

build Linux kernelon Ubuntu

承繼這篇所安裝的工具

build Linux kernel

cd 到該目錄下 /usr/src/.....
sudo make-kpkg clean
sudo fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
程式 'fakeroot' 目前尚未安裝。 您可以由輸入以下內容安裝:
sudo apt-get install fakeroot
bash: fakeroot: command not found

sudo apt-get install fakeroot
(放進Ubuntu光碟片)
or 你有iso也可以參考

在ubuntu下掛載映像檔


sudo fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

get message
dpkg-deb:正在建立套件“linux-headers-2.6.24-custom”,壓縮檔案為“../linux-headers-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb”。
cp -pf debian/control.dist debian/control
make[1]: Leaving directory `/usr/src/linux-2.6.24'
====== making target stamp-kernel-headers [new prereqs: linux-headers-2.6.24-custom linux-headers-2.6.24-custom]======
This is kernel package version 11.001.
echo done > stamp-kernel-headers
====== making target kernel_headers [new prereqs: stamp-configure stamp-prepare stamp-kernel-headers]======
This is kernel package version 11.001.


sudo cp /boot/grub/menu.lst /boot/grub/20080407menu.lst (just for myself)

sudo dpkg -i linux-image-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb

選中了曾被取消選擇的套件 linux-image-2.6.24-custom。
(正在讀取資料庫 ... 系統目前總共安裝有 140421 個檔案和目錄。)
正在解壓縮 linux-image-2.6.24-custom (從 linux-image-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb) ...
Done.
正在設定 linux-image-2.6.24-custom (2.6.24-custom-10.00.Custom) ...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
find: /lib/firmware/2.6.24-custom: 沒有此一檔案或目錄
find: /lib/firmware/2.6.24-custom: 沒有此一檔案或目錄
find: /lib/firmware/2.6.24-custom: 沒有此一檔案或目錄
find: /lib/firmware/2.6.24-custom: 沒有此一檔案或目錄
find: /lib/firmware/2.6.24-custom: 沒有此一檔案或目錄
find: /lib/firmware/2.6.24-custom: 沒有此一檔案或目錄
Running postinst hook script update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... found: (hd0,5)/boot/grub/image/love.xpm.gz

Found kernel: /boot/vmlinuz-2.6.24-generic
Found kernel: /boot/vmlinuz-2.6.24-custom
Found kernel: /boot/vmlinuz-2.6.22-14-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

sudo dpkg -i linux-headers-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb

linux-headers-2.6.22-14/
linux-headers-2.6.22-14-generic/
linux-headers-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb
nelsonchung@nelsonchung--ubuntu-NB:/usr/src$ sudo dpkg -i linux-headers-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb
選中了曾被取消選擇的套件 linux-headers-2.6.24-custom。
(正在讀取資料庫 ... 系統目前總共安裝有 142685 個檔案和目錄。)
正在解壓縮 linux-headers-2.6.24-custom (從 linux-headers-2.6.24-custom_2.6.24-custom-10.00.Custom_i386.deb) ...
正在設定 linux-headers-2.6.24-custom (2.6.24-custom-10.00.Custom) ...

OK!!

Reference:

網工阿澤-學習紀錄

ps:
摘錄man裡面對於 fakeroot 的解釋
Name
fakeroot - run a command in an environment faking root privileges for
file manipulation
DESCRIPTION
fakeroot runs a command in an environment wherein it appears to have
root privileges for file manipulation. This is useful for allowing
users to create archives (tar, ar, .deb etc.) with files in them with
root permissions/ownership.

摘錄man裡面對於 make-kgkg 的解釋
NAME
make-kpkg - build Debian kernel packages from Linux kernel sources

透過Facebook分享

沒有留言: