月度归档:2010年02月

Installing Transmission on LS1 (PowerPC)

Debian下安装transmission很简单,直接apt-get install transmission即可。

安装完毕后找不到哪个是主程序,查找了一下,结果一堆:

LSPPC-Lenny:~# find / -name transmission*
/var/lib/dpkg/info/transmission-common.md5sums
/var/lib/dpkg/info/transmission-common.list
/var/lib/dpkg/info/transmission-cli.md5sums
/var/lib/dpkg/info/transmission-cli.list
/var/lib/dpkg/info/transmission-gtk.postinst
/var/lib/dpkg/info/transmission-gtk.list
/var/lib/dpkg/info/transmission-gtk.postrm
/var/lib/dpkg/info/transmission-gtk.md5sums
/var/lib/dpkg/info/transmission.list
/var/cache/apt/archives/transmission-common_1.22-1+lenny2_all.deb
/var/cache/apt/archives/transmission-cli_1.22-1+lenny2_powerpc.deb
/var/cache/apt/archives/transmission-gtk_1.22-1+lenny2_powerpc.deb
/var/cache/apt/archives/transmission_1.22-1+lenny2_all.deb
/usr/share/doc/transmission-common
/usr/share/doc/transmission-cli
/usr/share/doc/transmission-gtk
/usr/share/doc/transmission
/usr/share/man/man1/transmission-proxy.1.gz
/usr/share/man/man1/transmission-remote.1.gz
/usr/share/man/man1/transmissioncli.1.gz
/usr/share/man/man1/transmission-daemon.1.gz
/usr/share/man/man1/transmission.1.gz
/usr/share/locale/sv/LC_MESSAGES/transmission.mo
/usr/share/locale/bg/LC_MESSAGES/transmission.mo
/usr/share/locale/ca/LC_MESSAGES/transmission.mo
/usr/share/locale/cs/LC_MESSAGES/transmission.mo
/usr/share/locale/da/LC_MESSAGES/transmission.mo
/usr/share/locale/de/LC_MESSAGES/transmission.mo
/usr/share/locale/el/LC_MESSAGES/transmission.mo
/usr/share/locale/es/LC_MESSAGES/transmission.mo
/usr/share/locale/fi/LC_MESSAGES/transmission.mo
/usr/share/locale/fr/LC_MESSAGES/transmission.mo
/usr/share/locale/ga/LC_MESSAGES/transmission.mo
/usr/share/locale/gl/LC_MESSAGES/transmission.mo
/usr/share/locale/hu/LC_MESSAGES/transmission.mo
/usr/share/locale/it/LC_MESSAGES/transmission.mo
/usr/share/locale/ja/LC_MESSAGES/transmission.mo
/usr/share/locale/nb/LC_MESSAGES/transmission.mo
/usr/share/locale/nl/LC_MESSAGES/transmission.mo
/usr/share/locale/pl/LC_MESSAGES/transmission.mo
/usr/share/locale/pt/LC_MESSAGES/transmission.mo
/usr/share/locale/pt_BR/LC_MESSAGES/transmission.mo
/usr/share/locale/ru/LC_MESSAGES/transmission.mo
/usr/share/locale/sk/LC_MESSAGES/transmission.mo
/usr/share/locale/sl/LC_MESSAGES/transmission.mo
/usr/share/locale/tr/LC_MESSAGES/transmission.mo
/usr/share/locale/zh_CN/LC_MESSAGES/transmission.mo
/usr/share/locale/zh_TW/LC_MESSAGES/transmission.mo
/usr/share/locale/ro/LC_MESSAGES/transmission.mo
/usr/share/locale/nn/LC_MESSAGES/transmission.mo
/usr/share/locale/he/LC_MESSAGES/transmission.mo
/usr/share/locale/ar/LC_MESSAGES/transmission.mo
/usr/share/locale/sr/LC_MESSAGES/transmission.mo
/usr/share/locale/lt/LC_MESSAGES/transmission.mo
/usr/share/locale/mk/LC_MESSAGES/transmission.mo
/usr/share/locale/te/LC_MESSAGES/transmission.mo
/usr/share/locale/fa/LC_MESSAGES/transmission.mo
/usr/share/locale/lv/LC_MESSAGES/transmission.mo
/usr/share/locale/ml/LC_MESSAGES/transmission.mo
/usr/share/locale/ka/LC_MESSAGES/transmission.mo
/usr/share/locale/mt/LC_MESSAGES/transmission.mo
/usr/share/menu/transmission-gtk
/usr/share/pixmaps/transmission.png
/usr/share/pixmaps/transmission.xpm
/usr/share/applications/transmission.desktop
/usr/share/icons/hicolor/16×16/apps/transmission.png
/usr/share/icons/hicolor/22×22/apps/transmission.png
/usr/share/icons/hicolor/24×24/apps/transmission.png
/usr/share/icons/hicolor/32×32/apps/transmission.png
/usr/share/icons/hicolor/48×48/apps/transmission.png
/usr/share/icons/hicolor/scalable/apps/transmission.svg
/usr/bin/transmissioncli
/usr/bin/transmission-daemon
/usr/bin/transmission-proxy
/usr/bin/transmission-remote
/usr/bin/transmission
/usr/lib/mime/packages/transmission-gtk
貌似/usr/bin/transmission-daemo就是主程序了,直接运行一下,没有任何提示,后来发现配置文件在root目录下面,但是里面找不到配置文件,那个抓狂啊。

继续研究,transmission-daemo -h查看下帮助:LSPPC-Lenny:~# transmission-daemon -h
usage: transmission-daemon [-dfh] [-p file] [-s file]

Transmission 1.22 (6191) http://www.transmissionbt.com/
A fast and easy BitTorrent client

-d –debug Print data send and received, implies -f
-f –foreground Run in the foreground and log to stderr
-g –config-dir <path> Where to look for configuration files
-h –help Display this message and exit
-p –pidfile <path> Save the process id in a file at <path>
-s –socket <path> Place the socket file at <path>

To add torrents or set options, use the transmission-remote program.
貌似加-g参数是指定配置文件目录的,我就让它保持默认目录就好;

试试加了-f参数,还是不行!

将transmission以及依赖的包全部删除,将cache里下载的deb包全部清理掉,换了source.list,重新安装,问题依旧。

试了下挂载openlink的系统然后用optware的ipkg安装是OK的,可以正常运行,但是在debian里偶无法安装这个ipk包,只好尝试编译一个。

东查西找,好容易把编译所需的包凑齐了, ./configure提示还缺libcurl,晕死

试了一下在LS2上安装transmission,发现版本是1.22,和PowerPC上的版本一样,都是lenny的源,运行同样不能生成配置文件,进程里只有两个taransmission的PID,正常情况下应该是3个才对。

无奈了,看来只能装最新版本的transmission了

Debian apt-get 用法

经常忘记,总是man,索性就把要用到的都给整了出来.需要用到sudo,”packgeame”和”string”替换成你想要安装或者查找的程序

apt-get update —— 在修改/etc/apt/sources.list或者/etc/apt/preferences之後运行该命令。此外您需要定期运行这一命令以确保您的软件包列表是最新的。
apt-get install packagename——安装一个新软件包(参见下文的aptitude)
apt-get remove packagename —— 卸载一个已安装的软件包(保留配置文件)
apt-get –purge remove packagename —— 卸载一个已安装的软件包(删除配置文件)
dpkg –force-all –purge packagename —— 有些软件很难卸载,而且还阻止了别的软件的应用,就可以用这个,不过有点冒险。
apt-get autoclean apt —— 会把已装或已卸的软件都备份在硬盘上,所以如果需要空间的话,可以让这个命令来删除你已经删掉的软件
apt-get clean —— 这个命令会把安装的软件的备份也删除,不过这样不会影响软件的使用的。
apt-get upgrade —— 更新所有已安装的软件包
apt-get dist-upgrade —— 将系统升级到新版本
apt-cache search string —— 在软件包列表中搜索字符串
dpkg -l package-name-pattern —— 列出所有与模式相匹配的软件包。如果您不知道软件包的全名,您可以使用“*package-name-pattern*”。
aptitude —— 详细查看已安装或可用的软件包。与apt-get类似,aptitude可以通过命令行方式调用,但仅限于某些命令——最常见的有安装和卸载命令。由于aptitude比apt-get —— 了解更多信息,可以说它更适合用来进行安装和卸载。
apt-cache showpkg pkgs —— 显示软件包信息。
apt-cache dumpavail —— 打印可用软件包列表。
apt-cache show pkgs —— 显示软件包记录,类似于dpkg –print-avail。
apt-cache pkgnames —— 打印软件包列表中所有软件包的名称。
dpkg -S file —— 这个文件属于哪个已安装软件包。
dpkg -L package —— 列出软件包中的所有文件。
apt-file search filename —— 查找包含特定文件的软件包(不一定是已安装的),这些文件的文件名中含有指定的字符串。apt-file是一个独立的软件包。您必须 先使用apt-get install来安装它,然後运行apt-file update。如果apt-file search filename输出的内容太多,您可以尝试使用apt-file search filename | grep -w filename(只显示指定字符串作为完整的单词出现在其中的那些文件名)或者类似方法,例如:apt-file search filename | grep /bin/(只显示位于诸如/bin或/usr/bin这些文件夹中的文件,如果您要查找的是某个特定的执行文件的话,这样做是有帮助的)。

* apt-get autoclean——定期运行这个命令来清除那些已经卸载的软件包的.deb文件。通过这种方式,您可以释放大量的磁盘空间。如果您的需求十分迫切,可 以使用apt-get clean以释放更多空间。这个命令会将已安装软件包裹的.deb文件一并删除。大多数情况下您不会再用到这些.debs文件,因此如果您为磁盘空间不足 而感到焦头烂额,这个办法也许值得一试。
典型应用

我是个赛车发烧友,想装个赛车类游戏玩玩。有哪些赛车类游戏可供选择呢?
apt-cache search racing game

出来了一大堆结果。看看有没有更多关于torcs这个游戏的信息。
apt-cache show torcs

看上去不错。这个游戏是不是已经安装了?最新版本是多少?它属于哪一类软件,universe还是main?
apt-cache policy torcs

好吧,现在我要来安装它!
apt-get install torcs

在控制台下我应该调用什么命令来运行这个游戏呢?在这个例子中,直接用torcs就行了,但并不是每次都这么简单。我们可一通过查找哪些文件被安装 到了“/usr/bin”文件夹下来确定二进制文件名。对于游戏软件,这些二进制文件将被安装到“/usr/games”下面。对于系统管理工具相应的文 件夹是“/usr/sbin”。
dpkg -L torcs|grep /usr/games/

这个命令的前面一部分显示软件包“torcs”安装的所有文件(您自己试试看)。通过命令的第二部分,我们告诉系统只显示前一部分的输出结果中含有“/usr/games”的那些行。

这个游戏很酷哦。说不定还有其他赛道可玩的?
apt-cache search torcs

我的磁盘空间不够用了。我得把apt的缓存空间清空才行。
apt-get clean

哦不,老妈叫我把机器上的所有游戏都删掉。但是我想把配置文件保留下来,这样下次我想玩的时候只要重装一下就可以了。
apt-get remove torcs

如果我想连配置文件一块删除:
apt-get remove –purge torcs

额外的软件包

deborphan和debfoster工具可以找出已经安装在系统上的不会被用到的软件包。

提高命令行方式下的工作效率

您可以通过定义别名(alias)来提高这些命令的输入速度。例如,您可以在您的*~/.bashrc*文件中添加下列内容
alias acs=’apt-cache search’
alias agu=’sudo apt-get update’
alias agg=’sudo apt-get upgrade’
alias agd=’sudo apt-get dist-upgrade’
alias agi=’sudo apt-get install’
alias agr=’sudo apt-get remove’

或者使用前面介绍的aptitude命令,如“alias agi=’sudo aptitude install’”。

为apt-get设置http代理

可以通过三种方法为apt-get设置http代理

方法一

这是一种临时的手段,如果您仅仅是暂时需要通过http代理使用apt-get,您可以使用这种方式。

在使用apt-get之前,在终端中输入以下命令(根据您的实际情况替换yourproxyaddress和proxyport)。
export http_proxy=http://yourproxyaddress:proxyport

方法二

这种方法要用到/etc/apt/文件夹下的apt.conf文件。如果您希望apt-get(而不是其他应用程序)一直使用http代理,您可以使用这种方式。

注意: 某些情况下,系统安装过程中没有建立apt配置文件。下面的操作将视情况修改现有的配置文件或者新建配置文件。
sudo gedit /etc/apt/apt.conf

在您的apt.conf文件中加入下面这行(根据你的实际情况替换yourproxyaddress和proxyport)。
Acquire::http::Proxy “http://yourproxyaddress:proxyport”;

保存apt.conf文件。

方法三

>

这种方法会在您的主目录下的.bashrc文件中添加两行。如果您希望apt-get和其他应用程序如wget等都使用http代理,您可以使用这种方式。
gedit ~/.bashrc

在您的.bashrc文件末尾添加如下内容(根据你的实际情况替换yourproxyaddress和proxyport)。
http_proxy=http://yourproxyaddress:proxyport
export http_proxy

保存文件。关闭当前终端,然後打开另一个终端。

使用apt-get update或者任何您想用的网络工具测试代理。我使用firestarter查看活动的网络连接。

如果您为了纠正错误而再次修改了配置文件,记得关闭终端并重新打开,否自新的设置不会生效。

FooNAS_EM_kernel的启动过程

U-Boot 1.1.4 LiSt V2 (mips) 1.0.1 (Sep 20 2007 – 00:42:23)
stdin : nc
stdout: nc
stderr: nc
IDE: Bus 0: not available Bus 1: not available
Boot in 01 seconds (’s’ to stop)… 【此时可以手工停止启动进程】
Loading 0:1:boot/vmlinuz【默认启动硬盘第一分区/boot/目录下的vmlinuz,貌似vmlinuz.gz也是可以地】
** Bad partition 1 **【没有装硬盘,所以检测不到分区】
## Booting image at bfc40000 …【flash分为三个mtd块,mtd1为uboot,mtd2为kernel,mtd3为configure;kernel的起始地址为bfc40000】
Found gzip-ed image at 0xbfc40000. Uncompressing …done【找到kernel的压缩文件,解压】
Loading .text @ 0×80100000 (1979552 bytes)
Loading __ex_table @ 0×802e34a0 (6248 bytes)
Loading .rodata @ 0×802e5000 (121152 bytes)
Loading .pci_fixup @ 0×80302940 (1368 bytes)
Loading __ksymtab @ 0×80302e98 (15200 bytes)
Loading __ksymtab_gpl @ 0×803069f8 (3936 bytes)
Loading __ksymtab_strings @ 0×80307958 (44004 bytes)
Loading __param @ 0×8031253c (340 bytes)
Loading .data @ 0×80314000 (74656 bytes)
Loading .data.cacheline_aligned @ 0×80327000 (192 bytes)
Loading .init.text @ 0×80328000 (119316 bytes)
Loading .init.data @ 0×80345218 (6248 bytes)
Loading .init.setup @ 0×80346a80 (732 bytes)
Loading .initcall.init @ 0×80346d5c (392 bytes)
Loading .exit.text @ 0×80346ee4 (2116 bytes)
Loading .init.ramfs @ 0×80348000 (2200231 bytes)
Clearing .bss @ 0×80562000 (97312 bytes)

Starting kernel @ 0×80328000…【至此kernel成功启动,不过需要等待一两分钟才可以连上去】

以下是uboot的一些指令:

=> help
help
? – alias for ‘help’
base – print or set address offset
bdinfo – print Board Info structure
boot – boot default, i.e., run ‘bootcmd’
bootd – boot default, i.e., run ‘bootcmd’
bootelf – Boot from an ELF image in memory
bootm – boot application image from memory
bootp – boot image via network using BootP/TFTP protocol
bootvx – Boot vxWorks from an ELF image
cmp – memory compare
coninfo – print console devices and information
cp – memory copy
crc32 – checksum calculation
dhcp – invoke DHCP client to obtain IP/boot params
diskboot- boot from IDE device
echo – echo args to console
erase – erase FLASH memory
ext2load- load binary file from a Ext2 filesystem
ext2ls – list files in a directory (default /)
flinfo – print FLASH memory information
go – start application at address ‘addr’
help – print online help
ide – IDE sub-system
loadb – load binary file over serial line (kermit mode)
loads – load S-Record file over serial line
loop – infinite loop on address range
md – memory display
mm – memory modify (auto-incrementing)
mtest – simple RAM test
mw – memory write (fill)
nfs – boot image via network using NFS protocol
nm – memory modify (constant address)
pci – list and access PCI Configuration Space
ping – send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect – enable or disable FLASH write protection
rarpboot- boot image via network using RARP/TFTP protocol
reset – Perform RESET of the CPU
run – run commands in an environment variable
saveenv – save environment variables to persistent storage
setenv – set environment variables
tftpboot- boot image via network using TFTP protocol
version – print monitor version

Installing U-Boot+FooNAS_EM_kernel+lenny_Debian on LinkStation V2 (mips)

LS2到手,立即开始着手改造uboot。这个机器的CPU是MIPS 400MHZ,64MB 内存,dmesg看了下bogomips的值为399,应该比LS1的性能要强悍许多,后来发现我错了,解压文件时这个400MHZ的CPU表现估计只有200MHZ powerpc架构CPU的80%左右。

看了下foones的帮助,发现有两种方式刷uboot,Flashing U-Boot from U-Boot和Flashing U-Boot from Linux;偶还是喜欢用最简单的方法解决问题,首选Flashing U-Boot from Linux。

telnet进去,运行

cd /mnt/hda/share/u-boot
wget  http://buffalo.nas-central.org/download/LS2_MIPSel/Bootloader/Uboot/Precompiled/u-boot-1.1.4-list-v2-1.0.1.tar.gz
tar xzvf u-boot-1.1.4-list-v2-1.0.1.tar.gz

dd if=u-boot-v2-mips.flash.bin of=/dev/mtd0 bs=1k
 然后报错,提示 dd input/output error ,重新运行命令,依旧报错! 怕怕,不敢重启机器了,生怕flash刷坏,重启就变砖了;赶紧执行第二套方案,Flashing U-Boot from U-Boot。
cp u-boot-v2-mips.ram.bin /mnt/hda/share/;cp uloader.o /mnt/hda/share/;cp u-boot-load.sh /mnt/hda/share/
 

然后下载windows下面的NC,
http://joncraton.org/files/nc111nt.zip

 设置电脑的ip地址为192.168.11.149;
然后开一个cmd窗口 运行 nc -u -p 6666 -v -v 192.168.11.150 6666
然后在ls2上 cd /mnt/hda/share;./u-boot-load.sh
等待片刻,windows上的cmd会显示U-boot的启动过程,在倒数10s到0s的时候输入s 回车停止启动
然后运行run upgrade
=> run upgrade
Loading 0:3:share/u-boot/u-boot-v2-mips.flash.bin

164732tes read
Un-Protected 3 sectors

Flash erase: first = 0 @ 0xbfc00000
last = 2 @ 0xbfc20000
Flash erase: Done
Erased 3 sectors
Copy to Flash… done
Total of 164732tes were the same
=>

终于搞定Uboot。

点击查看原图

下一步要刷FooNAS的EM kernel,这个东东很不错,它自带WEB ,FTP,telnet控制界面,这样的话无论是系统挂了还是换新硬盘都方便多了,除了换新硬盘,基本不需要拆机了。下载地址http://downloads.foonas.org/foonas-em/0.1.0-r2/lsmipsel/vmlinuz.gz


  1. 准备好foonas-EM的ROM,我放在hda3的 /share/vmlinuz.gz ;
  2. 重启LS2,用NC进入U-BOOT界面。
  3.  Flash FooNAS_EM_kernel:

ext2load ide 0:3 ${ldaddr} share/vmlinuz.gz
protect off bfc40000 bfffffff

era bfc40000 bfffffff (注意,如果是ST的flash,必须分两次擦写,era bfc40000 bfdfffff,era bfe00000 bfffffff ,否则变砖可别怪我没提醒哦)

cp.b ${ldaddr} bfc40000 ${filesize}

cmp.b ${ldaddr} bfc40000 ${filesize} <–检查并确认memory和flash里的FOONAS-EM ROM大小

到这里kernel已经刷写完毕!

如果怕uboot被刷坏,可以检查一下:

ext2load ide 0:1 ${ldaddr} share/u-boot/u-boot-v2-mips.flash.bin

cmp.b ${ldaddr} bfc00000 ${filesize} <–确认大小一致,如果不一致的话可以重刷 (也可以用run upgrade来代替,前提是你刷u-boot时的ROM还在原来的位置)

一切OK,运行reset指令重启。用户名/密码:root/hydr0g3n

PS:以uboot从tftp启动EM_Kernel时,系统的加载运行似乎比较慢,最好等待几分钟,刚刚加载完是无法连上去的,ping也不通。

 点击查看原图

点击查看原图

装lenny_Debian就很简单了,启动系统进入EM模式下,telnet进去,先给硬盘分区,hda1是系统分区,hda2是SWAP,hda3是将来储存文件的地方。然后把ls2_lenny_k23_20081122.tgz用FTP传到hda1里,解压就可以了;重启即可进入debian系统。

安装完成后红灯应该会一直闪,是因为默认配置文件里的磁盘定义成了SATA,改回来即可。

nano /etc/default/avr_evtd

查找ROOT=sda1,WORK=sda3 这2个地方,将其改成ROOT=hda1,WORK=hda3
重启即可


点击查看原图

PS:正常情况下进入EM模式有两种方法:

1.boot from TFTP

点击查看原图

点击查看原图

2. boot from flash

点击查看原图

还有种方法是boot EM from localdisk,这个偶没有尝试过,就不写了。

 

swapon: /dev/hda2: Invalid argument

/dev/hda1的默认空间只有365MB,装了系统基本上就剩下没多少空间了,打算重新把硬盘分区,给系统多一点空间。可是问题来了,/dev/hda3里面还有N多下载的电影没有看完,重新分区的话里面的数据就要挂了,想来想去还是从其他地方打打主意。

发现/dev/hda2是swap分区,居然分了512MB的空间,简直是胡搞,RAM才64M,搞这么大的SWAP空间怎么用的完,把SWAP缩减一些,多出的空间先分给系统分区救救急。

重启系统,开机按power键进入EM模式,分区完毕的状态如下:

Disk /dev/hda: 255 heads, 63 sectors, 19457 cylinders
Units = cylinders of 16065 * 512 bytes


Device Boot Begin Start End Blocks Id System
/dev/hda1 1 1 94 755023+ 83 Linux native
/dev/hda2 95 95 114 160650 82 Linux swap
/dev/hda3 115 115 19449155300356 83 Linux native
/dev/hda4 18432 19449 19457 72291+ 83 Linux native
解压之前备份的系统文件到/dev/hda1,然后reboot


重启发现没有加载SWAP分区,手工加载SWAP出现错误提示:

LinkStation:~# swapon -a
swapon: /dev/hda2: Invalid argument


重新用pmac-fdisk删除并新建SWAP无效,还是同样的错误提示。

放狗狂搜,终于找到解决办法:mkswap /dev/hda2,然后再swapon /dev/hda2即可;

LinkStation:~# mkswap /dev/hda2
Setting up swapspace version 1, size = 164499 kB
no label, UUID=1e58a55f-16bc-4455-8564-d089d25da499
LinkStation:~# swapon -a
LinkStation:~# free
total used free shared buffers cached
Mem: 61092 52912 8180 0 736 35184
-/+ buffers/cache: 16992 44100
Swap: 160640 0 160640
终于成功加载SWAP分区!


点击查看原图


fdisk用法

[root@localhost beinan]# fdisk /dev/sda
Command (m for help): 在这里按m ,就会输出帮助;
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition 注:这是删除一个分区的动作;
l list known partition types 注:l是列出分区类型,以供我们设置相应分区的类型;
m print this menu 注:m 是列出帮助信息;
n add a new partition 注:添加一个分区;
o create a new empty DOS partition table
p print the partition table 注:p列出分区表;
q quit without saving changes 注:不保存退出;
s create a new empty Sun disklabel
t change a partition’s system id 注:t 改变分区类型;
u change display/entry units
v verify the partition table
w write table to disk and exit 注:把分区表写入硬盘并退出;
x extra functionality (experts only) 注:扩展应用,专家功能;



  警告:删除分区时要小心,请看好分区的序号,如果您删除了扩展分区,扩展分区之下的逻辑分区都会删除;所以操作时一定要小心;如果知道自己操作错了,请不要惊慌,用q不保存退出;切记切记!!!!在分区操作错了之时,千万不要输入w保存退出!!!

 

PS:在PowerPC的平台下面是没有fdisk这个安装包的,它的名字叫pmac-fdisk,安装后用法跟fdisk一样,只是运行的话命令为pmac-fdisk,习惯fdisk的话可以把/sbin下的pmac-fdisk重命名即可。

附查询debian软件包的网址:http://packages.ubuntu.com/


终于把LS1折腾的近乎完美

安装了uboot,刷了kernel,升级kernel到linux2.6,解决了debian下更新时出现的内核不兼容的问题,终于把LS1折腾的近乎完美。

点击查看原图
 

发现/dev/hda1的近400MB空间已经几乎耗尽,下一步又得折腾文件系统了,有两条路可走,一个是增大分区容量,一个是把文件系统转移到/dev/hda3里面,用ln做链接。

折腾起来的话最容易把系统搞坏,当务之急需要保住已经得到的胜利果实,立即备份自然是上上之策。

reboot系统,然后手动切换power键使之启动到EM模式,telnet进去,mount_disk。

tar -czvpf /mnt/hda3/ls1.tar.gz /mnt/hda1/*

报错,tar: Removing leading `/’ from member names

搞了半天,发现原因是加了z参数,貌似是flash里面的kernel没有集成zlib,改成tar -cvPf /mnt/hda3/ls1.tar.gz /mnt/hda1/*解决。

下载下来一看,发现根文件系统是/mnt/hda1/*,郁闷,忘记切换到要备份的文件夹下面了,cd /mnt/hda1,然后tar -cvPf /mnt/hda3/ls1.tar.gz * 搞定。

Freelink+UBoot+kernel2.6 on LS1(PPC)【二】

昨天已经成功刷新uboot,现在可以在开机时用power键来选择进入何种模式了。 

u-boot使用Power Button和Reset Button来切换的.
Power LED灯号会闪烁(微弱光亮), 开机延迟是10秒, 要透过Power Button选择开机模式, 按一下Power Button, 会有stop booting的效果. 

* 这时Power Button按一下, DISK FULL的红色HDD LED会以固定频率闪烁约5秒钟, 表示你要用bootcmd1 hdd boot, 也就是/dev/hda1来开机.
* 再Power Button按一下, HDD LED会以固定频率快速闪烁2次约5秒钟, 表示你要用bootcmd2 fail boot, 也就是link station ROM boot来开机.
* 再Power Button按一下, HDD LED会以固定频率快速闪烁3次约5秒钟, 表示你要用bootcmd3 EM mode boot, 也就是要进入EM Mode开机, 做紧急维修.
* Reset Button按一下, HDD LED会以固定频率闪烁约5秒钟, 表示你要用serial console来监听.
* 再按Reset Button一下, HDD LED会以固定频率快速闪烁2次约5秒钟, 表示你要用net console来监听.
当选完决定开机选项后, 等待5秒HDD LED不闪烁后, Power Button再按一下, Power LED灯号会以很缓慢的速度闪烁, 这时就会开始开机了.

OK,我开机时选择进入EM模式来重装系统。点击查看原图

用mount_disk挂载硬盘
。# mount_disk
Mounting system (/dev/hda1) + data partition (/dev/hda3)of the internal HDD to /mnt/# cd /mnt/hda1

此时可以通过FTP来把本地文件上载到linkstation里。

FTP-Access
User: operator
Pass: operator
我把freelink的丢在/mnt/hda1下面,然后tar -zxvf freelink_powerpc-hdhlan-1.21.tgz解压到当前根目录下。

# ls
bin                               opt
boot                              proc
dev                               root
etc                               sbin
freelink_powerpc-hdhlan-1.21.tgz  srv
home                              sys
initrd                            tmp
lib                               usr
media                             var
mnt                               www

好,现在可以reboot了!

reboot后顺利进入debian界面:

点击查看原图

哼哼哈嘿,幸福ing!先来apt-get update升级一下:

root@LinkStation:/# apt-get update
Get:1 http://security.debian.org stable/updates/main Packages [353kB]
Get:2 http://mirrors.kernel.org stable/main Packages [6643kB]
Get:3 http://security.debian.org stable/updates/main Release [113B]
Get:4 http://security.debian.org stable/updates/main Packages [353kB]
11% [1 Packages gzip 0] [2 Packages 458124/6643kB 6%] [4 Packages 4905/353kB 1%]
gzip: stdin: unexpected end of file
Err http://security.debian.org stable/updates/main Packages
Sub-process gzip returned an error code (1)
Get:5 http://security.debian.org stable/updates/main Release [113B]
Get:6 http://security.debian.org stable/updates/contrib Packages [20B]
Get:7 http://security.debian.org stable/updates/contrib Release [116B]
Get:8 http://security.debian.org stable/updates/non-free Packages [20B]
Get:9 http://security.debian.org stable/updates/non-free Release [117B]
Get:10 http://security.debian.org stable/updates/main Sources [91.8kB]
Get:11 http://security.debian.org stable/updates/main Release [112B]
Get:12 http://security.debian.org stable/updates/contrib Sources [20B]
Get:13 http://security.debian.org stable/updates/contrib Release [115B]
Get:14 http://security.debian.org stable/updates/non-free Sources [20B]
Get:15 http://security.debian.org stable/updates/non-free Release [116B]
91% [2 Packages 6013044/6643kB 90%] 35.7kB/s 17s


很好很强大,不过更新速度似乎有点对不起偶的4M带宽。不过没有关系,等下再看看,速度实在上不去的话我再找其他的镜像站点来丢到source里去。

来看看kernel的版本,似乎不是2.6的,这就意味着目前用apt-get是无法安装应用程序的,待安装包下载完毕的时候系统一准会提示部分软件包不兼容2.4kernel,要求升级到2.6。既然如此,还是先升级kernel到2.6才是王道。

升级kernel至2.6的话需要去这个网站(http://hvkls.dyndns.org/downloads/documentation/README-webinstaller.html

)下载在线安装包,然后运行,它会自动从网上下载需要的module以及kernel等来完成升级。


先来检查一下变量之类的是否有问题:root@LinkStation:/# [ -e /boot/variant-uboot ] && FSTW="s" || FSTW="h"
root@LinkStation:/#
root@LinkStation:/# [ -e /boot/variant-legacy ] && FSTW="h"
root@LinkStation:/#
root@LinkStation:/# grep -E "^/.* / " /etc/fstab | grep -v "/dev/${FSTW}d" && echo "fstab WARNING"
root@LinkStation:/#

没有错误提示,很好,继续下一步了。

mkdir /boot 2>/dev/null
touch /boot/variant-uboot


wget http://hvkls.dyndns.org/downloads/latest-webinstaller.tar.gz
tar -C / -xvzf latest-webinstaller.tar.gz
/usr/local/sbin/webinstaller-kernelinst.sh


 kernel2.6 webinstaller已经运行了,现在偶能做的只有等待。

Linkstation 2.6 kernel webinstaller
http://hvkls.dyndns.org/downloads/documentation/README-webinstaller.html


–>
LS1/Kuro with FreeLink />–> Will install into /


Starting downloads (truncation warnings and timouts resulting in error 404 can be ignored safely)…

–> Getting webinstaller… 02:32:29 URL:http://downloads.buffalo.nas-central.org/Installers/Webinstaller/legacy-webinstaller.tar.gz [4185/4185] -> "legacy-webinstaller.tar.gz" [1]
02:32:30 URL:http://downloads.buffalo.nas-central.org/Installers/Webinstaller/md5sums/legacy-webinstaller.tar.gz.md5 [61/61] -> "legacy-webinstaller.tar.gz.md5" [1]


Continued download failed on this file, which conflicts with `-c’.
Refusing to truncate existing file `legacy-webinstaller.tar.gz.md5′.


–> webinstaller retrieved.
–> Getting upgradehelper… 02:32:40 URL:http://downloads.buffalo.nas-central.org/Installers/Webinstaller/legacy-upgradehelper.tar.gz [41246/41246] -> "legacy-upgradehelper.tar.gz" [1]
02:32:42 URL:http://downloads.buffalo.nas-central.org/Installers/Webinstaller/md5sums/legacy-upgradehelper.tar.gz.md5 [62/62] -> "legacy-upgradehelper.tar.gz.md5" [1]


Continued download failed on this file, which conflicts with `-c’.
Refusing to truncate existing file `legacy-upgradehelper.tar.gz.md5′.


–> upgradehelper retrieved.
–> Getting bootloader… 02:32:55 URL:http://downloads.buffalo.nas-central.org/Installers/Webinstaller/legacy-bootloader.tar.gz [264719/264719] -> "legacy-bootloader.tar.gz" [1]
02:32:57 URL:http://downloads.buffalo.nas-central.org/Installers/Webinstaller/md5sums/legacy-bootloader.tar.gz.md5 [59/59] -> "legacy-bootloader.tar.gz.md5" [1]


Continued download failed on this file, which conflicts with `-c’.
Refusing to truncate existing file `legacy-bootloader.tar.gz.md5′.


–> bootloader retrieved.
–> Getting kernel-uboot… 


漫长的等待后,终于OK了,不容易啊


FATAL: Can’t install Debian’s module-init-tools, or lm-sensors (Tera only)
–> You need to take care of that yourself:
/usr/local/sbin/fix_moduleinittools.sh
apt-get –reinstall install wget diff module-init-tools
apt-get –reinstall install lm-sensors # Tera only
–> Then re-run the webinstaller.

不管那些错误提示,偶直接reboot

开机后看看,已经是2.6kernel咯,幸福ing!
 

点击查看原图

Freelink+UBoot+kernel2.6 on LS1(PPC)【一】

LS1已经是很古老的东东了,网上能找到For LS1最新版Freelink和Openlink的kernel都是2.4.17的,无法兼容2.6核心的debian。

optware的软件包数量太少,很多要装的软件找不到,只好自己本地编译;前几天make了个mldonkey花了2个小时不止,实在抓狂,还是刷uboot上debian2.6,需要时apt-get即可,省却N多烦恼事。

OK,进入主题:
cd /mnt/

wget http://downloads.nas-central.org/LS1_PPC/Bootloader/Uboot/Precompiled/u-boot-lsppchd-flash-1.2.0-r2.bin
wget http://downloads.nas-central.org/ALL_LS_KB_PPC/Bootloader/UBoot/FirmimgBins/linux-2.4.33.3-list.mg.2-v3/firmimg.bin
wget http://downloads.nas-central.org/LS1_PPC/Distributions/Freelink/TmpImages/tmpimage-FL-1-21-LS1.tgz

下载完毕后开始刷写flash memory和boot partition:

root@HD-HLAN09A:/mnt/# dd if=u-boot-lsppchd-flash-1.2.0-r2.bin of=/dev/fl2 bs=1k
174+1 records in
174+1 records out

然后做下文件比较:
root@HD-HLAN09A:/mnt# cmp u-boot-lsppchd-flash-1.2.0-r2.bin /dev/fl2
cmp: EOF on u-boot-lsppchd-flash-1.2.0-r2.bin

OK,文件一致,继续下一步的工作,刷写kernel

root@HD-HLAN09A:/mnt# dd if=firmimg.bin of=/dev/fl1 bs=1k
2921+1 records in
2921+1 records out

同样做下文件比较:

root@HD-HLAN09A:/mnt# cmp firmimg.bin /dev/fl1
cmp: EOF on firmimg.bin

 OK,已经搞定了,暂时先到这里,安装debian2.6下次再搞点击查看原图

严重BS全一快递

临近年末了,手里有个项目马上要搞定,但是还差最后一步,修模后的样品要装机寄到客户指定的公司去测试天线性能。

对于这种情况公司是有规定的,一般要走公司的签约快递,所以非常不幸的用全一寄出了,由于一年多没有发生丢货事件,这次自然没有选择保价,结果很不幸,MTK收到样机后发现里面只有一块电池,然后我就立马打电话给全一,全一快递的投诉处理人员很干脆的告诉我:客户已签收,对于事后发现货物丢失的情况全一概不负责。

既然全一已经明确表态,这事情自然只能由我们内部处理了。弄丢了客户的手机,这种事情公司是一定要做出赔偿的,至于这笔帐会不会算到我头上,天知道。

现在的问题是,盒子里的手机为什么会不翼而飞而仅仅留下一块电池;快递是寄到MTK的,MTK自然不会黑掉手机,那么最大的可能是快递员中途拿走了快件里面的手机。

周六从上海寄出的快件,周日即可到达深圳,但是周日MTK是不上班的,所以周一快递又重新投送了一次,是不是快递员在第一次投送不成功后拿走了里面的手机呢?我是不惮以最坏的恶意,来臆断深圳南山区全一快递这位叫杨阳的快递员的,原因很简单,在深圳上班的一年多时间里,我遭遇了数起快递员对快件监守自盗的情况,幸好不是什么值钱的东东,损失不大但是给我提供了宝贵的经验,没想到临近年末,这种事情又被我遇上了。

这件事情给我的宝贵经验是,1.临近年末,最好选择信誉好的快递公司,比如EMS,顺丰次之;2.寄快递的时候最好还是保价,以避免不必要的损失。

BTW,今天刚刚又寄了三台金机到深圳,这次保价了,希望全一不要再让我失望。