P-Plamoでは、
前回までに紹介したように、
squashfsは、
そのため現在のP-Plamoでは、
一方、
squashfsファイルの展開
squashfsは書き込みや変更ができないファイルシステムなので、
以下ではUSBメモリは/dev/
まず、
# mkdir /tmp/loop # mount -o loop /media/disk/isolinux/rootimg.squash /tmp/loop # df -h Filesystem サイズ 使用 残り 使用% マウント位置 /dev/sda1 19G 8.8G 8.8G 50% / none 1013M 184K 1013M 1% /dev /media 1013M 4.0K 1013M 1% /media ... /dev/sdb1 3.8G 1.6G 2.2G 42% /media/disk /dev/loop0 1.6G 1.6G 0 100% /tmp/loop
Plamo-4.
# ls -lh /tmp/loop 合計 0 drwxr-xr-x 2 root root 862 3月 4日 15:45 bin/ drwxr-xr-x 2 root root 166 3月 28日 01:24 boot/ drwxr-xr-x 2 root root 3 3月 4日 17:10 cdrom/ ... drwxr-xr-x 21 root root 412 10月 5日 2009年 var/
この/tmp/
# cd /tmp/loop ; cp -av * /mnt/P-Plamo/Contents/ `bin' -> `/mnt/P-Plamo/Contents/bin' `bin/Mail' -> `/mnt/P-Plamo/Contents/bin/Mail' `bin/bash' -> `/mnt/P-Plamo/Contents/bin/bash' `bin/bash-static' -> `/mnt/P-Plamo/Contents/bin/bash-static' ...
なお、
約5GB強を書き出すためそれなりに時間がかかりますが、
# du -h 4.2M /mnt/P-Plamo/Contents/bin 3.5M /mnt/P-Plamo/Contents/boot ... 23M /mnt/P-Plamo/Contents/var 5.4G /mnt/P-Plamo/Contents/
squashfsファイルの修正
上述のように書き出したsquashfsファイルの中身は、
Google ChromeはPlamo Linuxのパッケージには正式採用されていませんが、
% wget ftp://plamo.linet.gr.jp/pub/Plamo-test/for-4.7x/google_chrome-5.0.375.99-i386-P1.tgz .... 2010-07-09 23:00:21 (22.2 MB/s) - `google_chrome-5.0.375.99-i386-P1.tgz' へ保存終了 [25479801]
なお、
Google Chromeはlibbz2.
% wget ftp://plamo.linet.gr.jp/pub/Plamo-4.7/plamo/00_base/bzip2-1.0.5-i586-P4.tgz ... 2010-07-09 23:05:49 (3.30 MB/s) - `bzip2-1.0.5-i586-P4.tgz' へ保存終了 [132090]
これらのパッケージで先に取り出したsquashfs用の環境を更新します。そのためにはsquashfs用の環境にchrootして、
# mv google_chrome-5.0.375.99-i386-P1.tgz bzip2-1.0.5-i586-P4.tgz /mnt/P-Plamo/Contents/tmp/ # chroot /mnt/P-Plamo/Contents/ bash-3.2# cd tmp ; updatepkg bzip2-1.0.5-i586-P4.tgz old:3, new:4 removing bzip2-1.0.5 (P3) Removing package bzip2... ... bzip2-1.0.5-i586-P4 のインストール中 PACKAGE DESCRIPTION: bzip2-1.0.5-i586-P4 のインストールスクリプトを実行中 bash-3.2# installpkg google_chrome-5.0.375.99-i386-P1.tgz google_chrome-5.0.375.99-i386-P1 のインストール中 PACKAGE DESCRIPTION: google_chrome-5.0.375.99-i386-P1 のインストールスクリプトを実行中 bash-3.2# rm *.tgz bash-3.2# exit exit #
必要なパッケージの更新、
# cd /mnt/P-Plamo/Contents # /usr/bin/mksquashfs * ../rootimg.squash -b 1024KB -comp lzma -noappend Parallel mksquashfs: Using 2 processors Creating 4.0 filesystem on ../rootimg.squash, block size 1048576. Exportable Squashfs 4.0 filesystem, lzma compressed, data block size 1048576 compressed data, compressed metadata, compressed fragments duplicates are removed Filesystem size 1617769.31 Kbytes (1579.85 Mbytes) 32.15% of uncompressed filesystem size (5031353.65 Kbytes) .... sys (3) daemon (2) uucp (14) # ls -lh ../rootimg.squash -rwx------ 1 root root 1.6G 7月 10日 09:51 ../rootimg.squash
新しく作ったsquashfsファイルをUSBメモリにコピーします。
# cp ../rootimg.squash /media/disk/isolinux/rootimg.squash # cd / ; sync ; sync ; umount /media/disk
以上の作業でP-Plamoからgoogle-chromeが使えるようになりました。

P-Plamoでのカーネル更新
P-Plamoのカスタマイズのもう1つの例として、
前節同様、
# cp kernel-2.6.32.16_plamoSMP-i586-P1.tgz /mnt/P-Plamo/Contents/tmp/ # cp kernel_headers-2.6.32.16_plamoSMP-i386-P1.tgz /mnt/P-Plamo/Contents/tmp/ # chroot /mnt/P-Plamo/Contents bash-3.2# updatepkg -f kernel-2.6.32.16_plamoSMP-i586-P1.tgz Removing package kernel... Removing files: --> Deleting symlink boot/System.map --> Deleting symlink boot/config .... PACKAGE DESCRIPTION: kernel-2.6.32.16_plamoSMP-i586-P1 のインストールスクリプトを実行中 bash-3.2# updatepkg -f kernel_headers-2.6.32.16_plamoSMP-i386-P1.tgz Removing package kernel_headers... Removing files: --> usr/include/drm/drm.h was found in another package. Skipping. ... kernel_headers-2.6.32.16_plamoSMP-i386-P1 のインストール中 PACKAGE DESCRIPTION: bash-3.2# exit #
前節同様、
# cd /mnt/P-Plamo/Contents ; /usr/bin/mksquashfs * ../rootimg.squash -b 1024KB -comp lzma -noappend Parallel mksquashfs: Using 2 processors Creating 4.0 filesystem on ../rootimg.squash, block size 1048576. .... uucp (14) # -lh ../rootimg.squash -rwx------ 1 root root 1.6G 7月 10日 11:23 ../rootimg.squash # cp ../rootimg.squash /media/disk/isolinux/rootimg.squash
以上の作業でsquashfsファイルの更新は完了ですが、
まず、
# cp /mnt/P-Plamo/Contents/boot/vmlinuz-2.6.32.16_plamoSMP /media/disk/isolinux/ # cp /media/disk/isolinux/{vmlinuz-2.6.32.16_plamoSMP,vmlinuz}
次にinitrd.
# cd /media/disk/isolinux ; gunzip initrd.gz # mount initrd /tmp/loop -o loop # cd /tmp/loop/lib/modules # ls -l 合計 689,152 -rw-r--r-- 1 root root 27,513 3月 29日 10:20 atkbd.ko -rw-r--r-- 1 root root 170,572 3月 29日 10:20 aufs.ko -rw-r--r-- 1 root root 35,960 3月 29日 10:20 cdrom.ko .... # for i in *.ko ; do > find /mnt/P-Plamo/Contents/lib/modules/2.6.32.16-plamoSMP -name $i -exec cp {} . \; > done #ls -l 合計 690,176 -rw-r--r-- 1 root root 27,513 7月 10日 11:46 atkbd.ko -rw-r--r-- 1 root root 171,506 7月 10日 11:46 aufs.ko -rw-r--r-- 1 root root 35,960 7月 10日 11:46 cdrom.ko ....
新しいモジュールドライバに更新できれば、
# cd /media/disk/isolinux ; umount /tmp/loop # gzip initrd # ls -lh 合計 1.6G -rwxr-xr-x 1 kojima root 2.0K 3月 29日 10:20 boot.cat -rwxr-xr-x 1 kojima root 2.4M 3月 29日 10:20 initrd.gz ... -r-xr-xr-x 1 kojima root 1.6G 7月 10日 11:33 rootimg.squash -rwxr-xr-x 1 kojima root 464 3月 28日 11:16 sample.msg -rwxr-xr-x 1 kojima root 2.2M 7月 10日 09:00 vmlinuz
これで必要な作業は終了したのでUSBメモリをアンマウントします。
# cd / ; sync ; sync # umount /media/disk
以上の操作でP-Plamoのカーネルが更新できました。

DVDイメージファイルの再生成
書き替え可能なUSBメモリの場合、
まず、
# cp -a /cdrom/* /mnt/P-Plamo/DVD/ # ls -R /mnt/P-Plamo/DVD /mnt/P-Plamo/DVD/: ChangeLog initrd isolinux/ /mnt/P-Plamo/DVD/isolinux: boot.cat isolinux.cfg rootimg.squash vmlinuz initrd.gz plamo41.lss sample.msg vmlinuz-2.6.32.10-plamoSMP isolinux.bin pplamo.lss syslinux.cfg
このisolinux/以下のファイルを適宜修正版と差し替えます。
# cp /mnt/P-Plamo/rootimg.squash /mnt/P-Plamo/DVD/isolinux/rootimg.squash ...
ISO9660形式のファイルの作成にはmkisofsコマンドを使います。下記で利用しているオプションのうち-J、
# cd /mnt/P-Plamo # mkisofs -v -J -r -b isolinux/isolinux.bin -c isolinux/boot.cat \ -no-emul-boot -boot-load-size 4 -boot-info-table \ -V P-Plamo-custom -o P-Plamo-custom_dvd.iso DVD Setting input-charset to 'EUC-JP' from locale. 2.01.01a75 (i686-pc-linux-gnu) Scanning DVD Scanning DVD/isolinux Excluded by match: DVD/isolinux/boot.cat Writing: Initial Padblock Start Block 0 .... Done with: Ending Padblock Block(s) 150 Max brk space used 21000 817569 extents written (1596 MB) # ls -lh *.iso -rw-r--r-- 1 root root 1.6G 7月 10日 23:45 P-Plamo-custom_dvd.iso
こうして作成したファイルをcdrecordやgrowisofsでDVDメディアに書き出せば、