Ubuntu を pxeを利用していれます





http://d.hatena.ne.jp/Yudoufu/20090321/1237585660 を参考にしました。



サーヴァーは openbsdをつかいます。

まず dhcp サーヴァーの用意です。

1)# more /etc/sysctl.conf
--------------------------
net.inet.ip.forwarding=1



2)# cat /etc/dhcpd.interfaces
-------------------------
fxp1



3) cat /etc/dhcpd.conf

option domain-name "my.domain";

subnet 192.168.72.0 netmask 255.255.255.0 {

option routers 192.168.72.250;

option domain-name-servers 202.224.32.1;

filename "pxelinux.0";

range 192.168.72.3 192.168.72.12;

}

4)-bash-3.2$ cat /etc/rc.conf.local

ntpd_flags= # enabled during install

dhcpd_flags="" # for normal use: ""





それから tftpdサーヴァーの用意です。

1)-bash-3.2$ cat /etc/inetd.conf

tftp dgram udp wait root /usr/libexec/tftpd tftpd -s /tftpboot



これをみると /tftpboot  のフォルダで動くのがわかります。

したがって

mkdir /tftpboot





あとは

cd /tftpboot
wget http://archive.ubuntu.com/ubuntu/dists/jaunty/main/installer-i386/current/images/netboot/netboot.tar.gz

そして

tar xvzf netboot.tar.gz すると



ls -l /tftpboot

total 21576

-rw-r--r-- 1 root wheel 11013563 Apr 18 02:03 netboot.tar.gz

lrwxr-xr-x 1 root wheel 32 Sep 3 09:15 pxelinux.0 -> ubuntu-installer/i386/pxelinux.0

lrwxr-xr-x 1 root wheel 34 Sep 3 09:15 pxelinux.cfg -> ubuntu-installer/i386/pxelinux.cfg

drwxr-xr-x 3 root wheel 512 Apr 18 01:08 ubuntu-installer

-rw-r--r-- 1 root wheel 56 Apr 18 01:08 version.info

が自動的にできてます。





あとは librettoを nキーを押しながら電源を

いれると ネットワークインストールができます。

便利です。



Libretto L2という

CDドライブがついておらず、

また、USBからのブートもできない

というちょっと厄介な機種でPUPPYの導入です。


そのため  PXEサーバーを用意するだけでなく 

Libretto L2に USBメモリを差し込まないといけません。

PXEサーバー側は
$ ls -l /tftpboot
total 7316
-r--r--r-- 1 root wheel 2048 Sep 10 08:31 boot.cat
-rwxr-xr-x 1 root wheel 163 Sep 10 08:33 boot.msg
-rwxr-xr-x 1 root wheel 1051 Sep 10 08:33 help.msg
-rwxr-xr-x 1 root wheel 1827360 Sep 10 08:44 initrd.gz
-rwxr-xr-x 1 root wheel 14776 Sep 10 08:42 isolinux.bin
-rwxr-xr-x 1 root wheel 138 Sep 10 08:33 isolinux.cfg
-rwxr-xr-x 1 root wheel 48378 Sep 10 08:33 logo.16
lrwxr-xr-x 1 root wheel 12 Sep 10 08:41 pxelinux.0 -> isolinux.bin
drwxr-xr-x 2 root wheel 512 Sep 10 08:34 pxelinux.cfg
-rwxr-xr-x 1 root wheel 1797720 Sep 10 08:44 vmlinuz


ここでリンクを作ったのは PXEサーバー(これはopenbsdなのですが)で
$ cat /etc/dhcpd.conf
option domain-name "my.domain";
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.250;
option domain-name-servers 202.224.32.1;
filename "pxelinux.0";
range 192.168.1.83 192.168.1.84;
}
と "pxelinux.0" という名前だからです。


なお 
$ ls -l /tftpboot/pxelinux.cfg/
total 4
-r--r--r-- 1 root wheel 169 Sep 10 10:45 default
および
$ cat /tftpboot/pxelinux.cfg/default
default puppy
display boot.msg
prompt 1
timeout 80
F1 boot.msg
F2 help.msg
label puppy
kernel vmlinuz
append initrd=initrd.gz root=/dev/ram0
です。


libretto L2は 
USBメモリに
-rwx------ 1 tuyosi root 2048 2009-09-10 05:05      boot.cat
-rwx------ 1 tuyosi root 163 2009-09-10 05:05       boot.msg
-rwx------ 1 tuyosi root 1051 2009-09-10 05:05      help.msg
-rwx------ 1 tuyosi root 1827360 2009-09-10 05:05   initrd.gz
-rwx------ 1 tuyosi root 12241 2009-09-10 05:05     isolinux.bin
-rwx------ 1 tuyosi root 138 2009-09-10 05:05       isolinux.cfg
-rwx------ 1 tuyosi root 48378 2009-09-10 05:05     logo.16
-rwx------ 1 tuyosi root 125390848 2009-09-10 05:05 pup_420p1retroJP.sfs
-rwx------ 1 tuyosi root 1797720 2009-09-10 05:05   vmlinuz
をいれといたものを差し込んでおいて
nキーを押しながら 電源をいれたらできます。


こうしていれた 日本語板puppy ですが、 skypeがないようなので
英語板のpuppy421にいれなおしました。
すると skypeはあって起動はするのですが、 音とか skype認証がうまくいかないので
元の 日本語板puppy にもどしました。


戻すのに 再インストールは面倒なので、
puppy421フォルダに 日本語板puppyのファイルをコピーするだけでOKです。
つまり lennyで立ち上げ
mount -o loop -t iso9660  日本語puppy.iso  /mnt/tmp
cp -R  /mnt/tmp/*  /puppy42
だけです。


これで現在は以下のような姿です。
lib:/home/tuyosi# ls -l /
合計 15
drwxr-xr-x   2 root root 2408 2009-08-17 05:55 bin
drwxr-xr-x   3 root root  280 2009-09-07 06:07 boot
drwxr-xr-x  14 root root 3240 2009-09-13 04:02 dev
drwxr-xr-x 112 root root 5712 2009-09-13 04:06 etc
drwxr-xr-x   3 root root   72 2009-08-17 07:03 home
lrwxrwxrwx   1 root root   28 2009-08-17 05:29 initrd.img ->
boot/initrd.img-2.6.26-2-486
drwxr-xr-x  13 root root 4560 2009-09-07 06:00 lib
drwxr-xr-x   3 root root   96 2009-08-17 05:19 media
drwxr-xr-x   3 root root   72 2009-09-12 15:23 mnt
drwxr-xr-x   2 root root   48 2009-08-17 05:21 opt
dr-xr-xr-x  86 root root    0 2009-09-13 04:01 proc
drwxr-xr-x   2 root root  400 2009-09-12 15:25 puppy421
drwxr-xr-x   2 root root  400 2009-09-13 04:24 puppy421-BackUp
drwxr-xr-x   6 root root  288 2009-09-12 15:21 root
drwxr-xr-x   2 root root 3752 2009-09-07 06:00 sbin
drwxr-xr-x   2 root root   48 2008-09-16 16:38 selinux
drwxr-xr-x   2 root root   48 2009-08-17 05:21 srv
drwxr-xr-x  11 root root    0 2009-09-13 04:01 sys
drwxrwxrwt   7 root root  232 2009-09-13 04:11 tmp
drwxr-xr-x  11 root root  264 2009-08-17 05:52 usr
drwxr-xr-x  15 root root  360 2009-08-17 06:50 var
lrwxrwxrwx   1 root root   25 2009-08-17 05:29 vmlinuz ->
boot/vmlinuz-2.6.26-2-486
なってます。



つまり lennyのなかの フォルダpuppy421が 日本語puppyそのものです。
したがって puppy421フォルダをコピーしたら パピーのバックアップになります。



なお
 lib:/home/tuyosi# ls -l /puppy421
合計 750420
-rw-r--r-- 1 root root         0 2009-09-12 02:21 ATAHD
-r--r--r-- 1 root root      2048 2009-09-12 15:25 boot.cat
-rwxr-xr-x 1 root root       163 2009-09-12 15:25 boot.msg
-rwxr-xr-x 1 root root      1051 2009-09-12 15:25 help.msg
-rwxr-xr-x 1 root root   1827360 2009-09-12 15:25 initrd.gz
-rwxr-xr-x 1 root root     12241 2009-09-12 15:25 isolinux.bin
-rwxr-xr-x 1 root root       138 2009-09-12 15:25 isolinux.cfg
-rwxr-xr-x 1 root root     48378 2009-09-12 15:25 logo.16
-rwxr-xr-x 1 root root 125390848 2009-09-12 15:25 pup_420p1retroJP.sfs
-rwxr-xr-x 1 root root 101711872 2009-09-12 02:21 pup_421.sfs
-rw-r--r-- 1 root root 536870912 2009-09-12 03:39 pup_save-pup_save2fs.2fs
-rwxr-xr-x 1 root root   1797720 2009-09-12 15:25 vmlinuz
です。




なお パピーのためには
title Puppy Linux 421 frugal
rootnoverify (hd0,0)
kernel /puppy421/vmlinuz pmedia=atahd psubdir=puppy421 nosmp
initrd /puppy421/initrd.gz

/boot/grub/menu.lst
にくわるだけでOKです。
けっきょく puppyでの libretto L2の 全画面表示は以下です。

























xorg.conf 


#############################
Section "Module"
Load        "dbe"       # Double buffer extension
SubSection  "extmod"
Option    "omit xfree86-dga"   # don't initialise the DGA extension
EndSubSection
Load        "type1"
Load        "freetype"
Load       "xtrap"
Load       "glx"
Load       "dri"
EndSection



Section "Files"
RgbPath "/usr/X11R7/lib/X11/rgb"
FontPath   "/usr/X11R7/lib/X11/fonts/misc/"
FontPath   "/usr/X11R7/lib/X11/fonts/Type1/"
FontPath   "/usr/X11R7/lib/X11/fonts/TTF/"
EndSection



Section "ServerFlags"
Option "RandR" "on"
EndSection



Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
EndSection



Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
Option      "XkbRules" "xorg"
Option      "XkbModel" "pc102"
Option      "XkbLayout" "jp" #xkeymap0
EndSection



Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option      "Protocol" "IMPS/2" #mouse0protocol
Option      "Device" "/dev/mouse"
Option      "ZAxisMapping" "4 5" #scrollwheel
EndSection



Section "Monitor"
Identifier   "Monitor0"
VendorName   "TOS"
ModelName    "5088"
HorizSync    30-76
VertRefresh  56-76
ModeLine "1280x600" 60.0 1280 1328 1512 1712 600 601 603 625
Option      "PreferredMode" "1600x1200"
EndSection



Section "Modes"
Identifier "Modes0"
EndSection



Section "Device"
Identifier  "Card0"
Driver "vesa"
VendorName  "S3 Inc."
BoardName   "86C270-294 Savage/IX-MV"
BusID       "PCI:0:4:0"
EndSection



Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
DefaultDepth 16

Subsection "Display"
Depth       16
Modes "1280x600"
EndSubsection
EndSection