源起
開發 linux 應用需要,利用 VMware Player 來撥放 SLAX Popcorn 作業系統方便測試。

更新紀錄 changelog
- 200 6-0929 新增 smb 說明
建立一個 vmx 檔
一開始需要建立一個檔案,告訴 vmplayer 建立一個具有硬蝶可用的 SLAX PE VM 環境。要準備兩種東西, slax popcorn iso 檔以及自己編的 slax.vmx 檔,當然 vmplayer 要先裝好。
- wget slax-popcorn-5.1.8rc.iso
- mkdir slax-popcorn-vmx
- cp 500MB.vmdk for hd
- modify slax.vmx
- vmplayer slax.vmx
- root/toor
- startx
為了加上硬碟檔,需要改一下 slax.vmx 部份設定。
# hd info
ide0:0.present = "TRUE"
ide0:0.fileName = "500MB.vmdk"
# CDROM Info
ide1:0.present = "TRUE"
ide1:0.fileName = "slax-popcorn-5.1.8rc.iso"
ide1:0.deviceType = "cdrom-image"
按兩下 slax.vmx 應該就有 linux 可以用了。
網路連結 network access
不能上網等於廢物,所以需要檢視一下網路存取的部份。
- ifconfig
- netstat -at
- chmod +x /etc/rc.d/rc.sshd
- /etc/rc.d/rc.sshd start
- netstat -at
建議直接用舊的或是其他的 vmx 檔來改,vmplayer 會有個 DHCP 一直跑,當你的 vmx 按下後,就會找這 DHCP 要一個 IP,同時會替每一個新加入的 NAT 實體的地址加一,例如之前 dsl-n 會自動被指到 192.168.213.130,這次就變成 192.168.213.131。
如果需要互傳東西,最方便的還是 ssh/scp,預設關起來,打開就好。
ssh server on slax standard
mount hd
預設只有掛一個目錄,並查看是否抓到 hda。
root@slax:~# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 225M 112M 113M 50% /
root@slax:~# dmesg | grep hd
ide0: BM-DMA at 0x1050-0x1057, BIOS settings: hda:DMA, hdb:pio
ide1: BM-DMA at 0x1058-0x105f, BIOS settings: hdc:DMA, hdd:pio
hda: VMware Virtual IDE Hard Drive, ATA DISK drive
hdc: VMware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive
hda: max request size: 128KiB
hda: 1024000 sectors (524 MB) w/32KiB Cache, CHS=1015/16/63, UDMA(33)
hda: unknown partition table
hdc: ATAPI 1X CD-ROM drive, 32kB Cache, UDMA(33)
開始規劃硬碟,並測試。
- fdisk /dev/hda
- n p 1 enter enter w
- mke2fs /dev/hda1
- mkdir /mnt/hda1
- mount /dev/hda1 /mnt/hda1
- scp something to /mnt/hda1/
- power off
重新開機後一定趕快按住 F2 來改 CDROM 開機,這個動作第一次重開才要做,之後 vmplayer 會記起來。
另外 SLAX 會自動幫忙掛上 /dev/hda1,直接可以用。
create ttf-arphic-uming-0.1.mo
中文字型很多,這裡採用自由散佈版權的字形。
How to modify existing SLAX module
何處可以找到適用GNU/Linux的字型
基本上這個版只要將字形放到 /etc/fonts/fonts.conf 指定的目錄就可以抓到,firefox 會正常秀出中文網頁,這是第一步。
- mount /mnt/hda1
- cd /mnt/hda1
- wget ttf-arphic-uming_0.1.xxx.tar.gz
from http://freedesktop.org/wiki/Software_2fCJKUnifonts
- tar zxvf ttf-arphic-uming_0.1.20060903.orig.tar.gz
- mv ttf-arphic-uming-0.1.20060903 uming
- mkdir -p work/ttf-arphic-uming/usr/share/fonts/zh_TW/TrueType
- mv uming work/ttf-arphic-uming/usr/share/fonts/zh_TW/TrueType/
- cd /mnt/hda1/work
- dir2mo ttf-arphic-uming ttf-arphic-uming-0.1.mo
- fc-list
- uselivemod ttf-arphic-uming-0.1.mo
- fc-list
- firefox to http://www.google.com.tw
問題有兩個,一是網頁字體模糊,一是 firefox 秀 html/title 標題列的地方出現亂碼。先解決字太小會糊的問題,加入網路上的建議。
vi /etc/fonts/local.conf
<match target="font">
<test name="family"><string>AR PL ShanHeiSun Uni</string></test>
<edit name="antialias"><bool>false</bool></edit>
<edit name="hinting"><bool>true</bool></edit>
<edit name="autohint"><bool>false</bool></edit>
</match>
<match target="font">
<test name="family"><string>AR PL ShanHeiSun Uni</string></test>
<test name="pixelsize" compare="more_eq"><int>17</int></test>
<edit name="antialias" mode="assign"><bool>true</bool></edit>
<edit name="hinting" mode="assign"><bool>true</bool></edit>
</match>
反覆測到好,就可以準備重建 mo 檔。至於標題列亂碼議題再登出 X 之後重新 startx 就可以看到了,所以只要在 startx 之前,先 uselivemod 這個字型即可,正常來說,最終這個 mo 放到 CD 中,會在 login 之前載入。
recreate mo with new local.conf
依照上面改好的 local.conf 放到 mo 中,才會一起載入。
- cd /mnt/hda1/work
- mkdir -p ttf-arphic-uming/etc/fonts
- cp /etc/fonts/local.conf ttf-arphic-uming/etc/fonts/
- dir2mo ttf-arphic-uming ttf-arphic-uming-0.1.mo
- reboot
- uselivemod /mnt/hda1/work/ttf-arphic-uming-0.1.mo
- startx
- firefox www.google.com.tw
change to firefox-1.5.0.6.mo (zh_TW)
Firefox 中文版
如何知道載入的 mo 有哪些 ? 需要參考 CD 資料。
root@slax:~# ls /mnt/live/mnt/hdc/base
01_kernel.mo 03_xwindow.mo 09_slax.mo
02_core.mo 04_xap_libs.mo 12_popcorn.mo
root@slax:~# mkdir /mnt/popcorn
root@slax:~# mount -t squashfs -o loop /mnt/live/mnt/hdc/base/12_popcorn.mo /mnt/popcorn/
root@slax:~# ls /mnt/popcorn
etc/ root/ usr/ var/
root@slax:~# ls /mnt/popcorn/var/log/packages/
abiword-2.2.9-i486-1 gaim-1.5.0-i486-2 mozilla-firefox-1.5.0.4-i686-1
bmp-0.9.7-i486-2 gucharmap-1.4.1-i486-2 xfce-4.2.3.2-i486-1
root@slax:~# which firefox
/usr/bin/firefox
root@slax:/# ls -al /usr/bin/firefox
lrwxrwxrwx 1 root root 32 Aug 21 17:45 /usr/bin/firefox -> /usr/lib/firefox-1.5.0.4/firefox*
可以看到這個 mozilla-firefox-1.5.0.4 被包在 popcorn 的 mo 中,用 installpkg -root 方式裝上去的,這種做法讓 firefox 很難單獨更換。
所以採移花接木方式,裝到 /usr/lib/firefox-1.5.0.6-zh_TW 目錄,再將 /usr/bin/firefox 轉連。
這個做法好處是沒裝之前,舊的 firefox 還是可以跑。缺點是沒有在 popcorn 中移除這個套件等於是多餘的,會佔去空間。
如果自製一個 popcorn-firefox 版,是否以後每次改版都要自己來一次 ? 還是另外做一個。
- cd /mnt/hda1
- wget firefox zh_tw version
- tar zxvf firefox-1.5.0.6.tar.gz
- mv firefox firefox-1.5.0.6-zh_TW
- cd /mnt/hda1/work
- mkdir -p firefox/usr/lib/
- cd /mnt/hda1
- mv firefox-1.5.0.6-zh_TW work/firefox/usr/lib/
- cd work/firefox/usr
- mkdir bin
- cd bin
- ln -s ../lib/firefox-1.5.0.6-zh_TW/firefox firefox
- cd /mnt/hda1/work
- dir2mo firefox firefox-1.5.0.6-zh_TW.mo
- uselivemod /mnt/hda1/work/firefox-1.5.0.6-zh_TW.mo
- ls -al /usr/bin/firefox
- firefox to www.google.com.tw
add flash plugin to firefox mo
沒有含 flash player 需要自己再加上。
- reboot first
- wget flash player for linux
- tar zxvf install_flash_player_7_linux.tar.gz
- cd install_flash_player_7_linux
- cp libflashplayer.so /mnt/hda1/work/firefox/usr/lib/firefox-1.5.0.6-zh_TW/plugins/
- cp flashplayer.xpt /mnt/hda1/work/firefox/usr/lib/firefox-1.5.0.6-zh_TW/components/
- cd /mnt/hda1/work
- dir2mo firefox firefox-1.5.0.6-zh_TW.mo
- uselivemod firefox-1.5.0.6-zh_TW.mo
- firefox to about:plugins
- firefox to www.google.com.tw
smb 網路芳鄰
如果要直接分享 HOST 的資料可以用網路芳鄰,需要先做一點工作。
Windows XP Host 端
- 控制台-使用者-啟用 Guest 帳戶
- 建立分享目錄 slax_thing
- 加入 guest 分享權限
Slax 端需要裝個 patch 套件才可以用。
- wget Samba Popcorn Patch for 5.0.6
- uselivemod this mo
- smbclient //host/slax_thing -U guest
- ls and check and exit
- mkdir /mnt/hda1/smb
- smbmount //hostname_or_ip/slax_thing /mnt/hda1/smb -o guest
參考 links
Create a language module for SLAX
Create SLAX modules from source code
Remaster SLAX
SLAX 5.1.7b Standard edition 中文化
SLAX Popcorn edition 初步的中文化
SLAX Popcorn Edition v5.0.8
考慮分析 XFCE 4.2.3.2 czech language module 看看要如何改。