
由於之前的KuroBox/HG是跑在kernel 2.4的kernel,並且有許多package在升級的時候都有一堆奇怪的Error。所以重新安裝KuroBox,並且升級到2008五月由genbako release的kernel 2.6.25.1。沒想到同事Max也遇到一樣的問題,所以整理一下之前的筆記~提供參考。
1. 設定進入 EM 模式,重開機※debian 2.4 的核心
#echo -n "NGNG" > /dev/fl3
#reboot
※debian 2.6 的核心
# echo -n "NGNG" > /dev/mtdblock2
# reboot
2. 準備相關檔案請由
http://www.genbako.com/ 下載下面這些已經做好給KuroBox用的檔案
debian-sarge-2.6.17.3-kuroHG-20060702.tgz
kernelimage-2.6.25.1-kuroHG.tgz
modules-2.6.25.1-kuroHG.tgz
3. 安裝 Debian sarge用telnet 進入EM Mode下的KuroBox,用root/kuroadmin登入
如果是全新的HD,要做硬碟分割
# /sbin/mfdisk -e /dev/hda
# sh /sbin/mkfilesystem.sh
已經分割好了之後,將之前的OS所在的分割區清空(在這個分割區的資料會全部不見喔)
# mke2fs -j /dev/hda1
掛載分割區
# mount /dev/hda1 /mnt
# mount /dev/hda3 /mnt2
用FTP指令將下列檔案傳到 /mnt2/source 的目錄下
debian-sarge-2.6.17.3-kuroHG-20060702.tgz
kernelimage-2.6.25.1-kuroHG.tgz
modules-2.6.25.1-kuroHG.tgz
傳完之後解壓
# cd /mnt
# tar zxvf /mnt2/source/debian-sarge-2.6.17.3-kuroHG-20060702.tgz
解壓之後修改相關檔案
/mnt/etc/hostname
/mnt/etc/hosts
/mnt/etc/resolv.conf
/mnt/etc/hosts.allow
/mnt/etc/network/interfaces
改完之後,進入正常模式重新啟動
# /usr/bin/write_ok
argv: /usr/bin/write_ok
# reboot
正常模式telnet登入帳號
先以tmp-kun/tmp-kun登入後在切換為root/root
# su - root
4. 升級kernel and modules將kernel升級到2.6.25.1之後重開機
# cd /boot
# tar zxvf /mnt/source/kernelimage-2.6.25.1-kuroHG.tgz
# reboot
重開機後,更新modules
# cd /lib/modules
# tar zxvf /mnt/source/modules-2.6.25.1-kuroHG.tgz
# depmod -a
5. 線上更新 Debian sarge#vi /etc/apt/sources.list
deb http://security.debian.org/ stable/updates main contrib non-free
deb ftp://opensource.nchc.org.tw/debian/ stable main contrib non-free
deb ftp://debian.linux.org.tw/debian/ stable main contrib non-free
deb-src ftp://opensource.nchc.org.tw/debian/ stable main contrib non-free
deb-src ftp://debian.linux.org.tw/debian/ stable main contrib non-free
# apt-get update
# apt-get upgrade
6. 將Debian 由 sarge 升級到 etch#vi /etc/apt/sources.list
deb http://security.debian.org/ etch/updates main
deb ftp://opensource.nchc.org.tw/debian/ etch main
deb ftp://debian.linux.org.tw/debian/ etch main
deb-src ftp://opensource.nchc.org.tw/debian/ etch main
deb-src ftp://debian.linux.org.tw/debian/ etch main
# apt-get update
# apt-get -u dist-upgrade
#reboot
7. 其他變更root的密碼
# passwd
新增使用者
# adduser user_name
將內建的tmp-kun使用者移除
# deluser tmp-kun
# rm -R /home/tmp-kun
線上系統升級
# apt-get update
# aptitude update
# aptitude upgrade
8. 參考資料
http://www.dyg.jp/category/kurobox/index.asp
http://blog.goo.ne.jp/g_armani/e/89aba8514fa6ad16bf5272100d3a5c09