|
在 NetFront浏览器 640x480分辨率下获得最佳浏览效果 我的 Zaurus SL-C3000 和 SL-C3100 Copyright 2006 Hd Luc (hdluc@yahoo.com)
|
|
# ipkg install ipkfile # ipkg remove ipkfile |
使用 ipkg 工具的好处是你能够用一个批处理脚本来批量的安装应用程序,例如所有你喜欢的字体,或者你的所有的安全工具。同时一旦发生错误,它也能显示详细的错误讯息,不像 qinstall 那样,只告诉你出错了,却没有任何的有用的信息反馈给你。
然而,在你选择把软件安装到 SD 卡或 CF卡上时,ipkg 工具并不会像 Qinstall(图形化的软件包安装器) 那样在安装时创建所需要的链接。你需要在使用 ipkg 在 SD 卡或 CF 卡上安装完软件后运行 ipkg-link 来为你安装的应用程序重新建立链接。不过,C3000 和 C3100 默认都没有带 ipkg-link 这个软件。我把它放在了我所提供的 ipktools 软件包里了。
默认情况下,软件包安装工具(Package Installer)和 ipkg 都会到 /hdd3/Documents/Install_Files 、/mnt/card/Documents/Install_Files 和 /mnt/cf/Documents/Install_Files 这三个目录下去找软件包。通过修改 /etc/ipkg.conf 加入类似下面的例子的内容,可以加入额外的软件包来源和 feed :
|
src zug http://www.zaurususergroup.org/feed/ |
我创建了一个名为 xipk(我的 ipktools 包的一部分)的脚本,允许你把软件包安装到你所喜欢的任何地方。这使你可以把软件安装到比主内存(C3000 是 /hdd2,C3100 是 /home)大得多的内置微硬盘的 /hdd3 分区上。不过不是所有的应用程序都能安装到 /hdd3,因为在默认的情况下,/hdd3 是被格式化成 FAT 格式的分区,而 FAT 格式的分区无法处理符号链接。如果你把这个分区重新格式化成 ext2 或 ext3 格式的话,你就不会有这个问题了(请查看后面的 /home 和 loopback 文件系统 这一章节)。
你安装的一些应用程序将会是日文版的。你可以查看 本地化 这一章节来了解如何把它转变成英文版的。你可以尝试一下 langswitch 这个工具,在大多数情况下,它都能奏效。
另外的,如果应用程序是为 Zaurus 的旧机型写的,你还需要改变应用程序的默认的显示方向。查看 显示方向 这一章节可以了解到如何来操作。
通过 USB 连接 Zaurus(先把 USB 线插入 PC,然后再插入 Zaurus)。把光盘里的终端软件的 ipk 文件 [qpe-terminal-ja_1.5.0-3_arm.ipk] 复制到 /Documents/Install_Files 目录。在 PC 上断开 USB 连接。Zaurus 会回到正常操作模式。在顶端点第三个标签,然后再点一个像小磁盘那样的图标。接着选择 Install_Files 的目录。在对话框里选择那个 ipk 文件(应该是那个目录里的唯一的文件)后安装程序会打开它。 按下安装按钮(最底下的大按钮)然后在弹出的对话框中按确认 OK(左面的那个按钮)。
如果你有一张 SD 卡或 CF 卡,以及一个读卡器的话,你只要把 ipk 文件复制到卡上,然后把卡插进 Zaurus 的扩展插槽内,就可以代替有时不能正常连接的 USB 连接方式了。
另一个更好用的终端软件 [qkonsole_0.9.3-20040205_arm.ipk] 可以从网上下载并用来替换光盘里附带的那个。
大部分定制化的工作需要通过终端软件来完成,所以你真的需要安装一个。在这篇文章中,所有写在白色方框内的文字,都被假设为是在终端窗口中输入的,而灰色方框内的文字则都是配置文件的内容片断。在这篇文章中,我假设你已经知道了如何使用 vi。对于我个人而言,我喜欢 Vim (vi improved) ,并总是用它完成大多数的工作。不过如果你觉得 vi 难以掌握的话,你可以使用 pico,它的用法和 DOS 下的 edit(查看 pico 的章节来了解如何安装它)类似,然后不管你看到指令要求你用 vi 打开或是创建一个文件,都用 pico 来完成。vi 中的 esc 键在 Zaurus 中被映射到了 cancel 键上。
C3000 和 C3100 出厂时默认是日文版的。具有讽刺意味的是, Qtopia 和绝大部分的 Linux 都是在英文环境下开发的,Sharp 把它们全部修改成了日文版,而我们又不得不把它再改回来。正因为这样,除了一些在日语环境下写的软件以外,把 Zaurus 改回英文版还算是一件比较容易的事情。有很多方法可以把系统改回纯英文的模式,甚至可以用一些脚本来自动完成转换整个过程。不过我认为有日语支持也挺有用的,所以我并不打算把日语支持给去掉。(甚至还要给旧版 Windows 系统加上了日语支持?)
打开终端,修改 /home/zaurus/Settings/locale.conf 文件,用 'en' 替换掉 'ja'。
|
[Language] Language = en [Location] Timezone = Australia/Sydney |
重起 Zaurus
本地化的目标是保留所有的日文版的功能的同时,把菜单转换成英文,条目的内容则是英文和日文混合的。日文的输入法、字体、和字典的功能将不受这个定制作业的影响,依然能够正常使用。
|
# su # cd /home/QtPalmtop/i18n/ja # mkdir .hide # mv *.qm* .hide # mv .hide/libjpn* . # cp /home/zaurus/Documents/custom/movieplayer.qmid . # chown root:qpe movieplayer.qmid # chmod 640 movieplayer.qmid # cd /home/QtPalmtop/i18n/en # cp /home/zaurus/Documents/custom/movieplayer.qmid . # cp /home/zaurus/Documents/custom/libsl.qmid . # chown root:qpe *.qmid # chmod 640 *.qmid # cd /home/QtPalmtop/bin # mv word-eucJP.rc word-eucJP.rc.hide # cd /home/QtPalmtop # tar cf apps-orig.tar apps # gzip apps-orig.tar # cp /home/zaurus/Documents/custom/apps-mod.tar . # tar xf apps-mod.tar # chown -R root:qpe apps # cd /home/QtPalmtop # tar cf etc-orig.tar etc # gzip etc-orig.tar # cp /home/zaurus/Documents/custom/etc-mod.tar . # tar xf etc-mod.tar # chown -R root:qpe apps # cd /home/zaurus # tar cf Settings-orig.tar Settings # gzip Settings-orig.tar # cp /home/Zaurus/Documents/custom/Settings-mod.tar . # tar xf Settings-mod.tar # cd Settings # chown zaurus:qpe *.conf # chmod 644 *.conf |
重起 Zaurus 后,你的系统界面将会象下面这样:
这个软件包 [c3000-custom-jaen_0.2_arm.ipk] 会自动执行上面所有的步骤。我在需要把我的 Zaurus 回复出厂设置时,就使用这个软件包来本地化。这个软件包在 C3100 和 C1000 上同样也可以使用。如果你想回到日文版的话,只要简单的卸载这个软件包就可以了。
在你本地化之后,有一些软件安装后仍然显示的是日文信息,不过,其中的大部分都是可以方便
在 F1 - F10 in are mapped to Fn + 1 to 10 respectively.
的被修改为英文版的。检查一下 /home/QtPalmtop/i18n/ja 目录,看看里面是不是多了一个以你新安装的软件命名的 qm 文件,只要把它移到 .hide 目录就行了。不过,有一些一日文开发的软件的本地化就没那么容易了。我创建了一个 [langswitch_0.2_arm.ipk] 软件包可以让你通过图形界面(需要 opie-sh 支持)来把 qm 文件移走或恢复。
帮助文件仍然是日文的。如果那令你烦恼,你需要装一个英文版的。你可以从 Cacko 的 feed 安装 helpfiles_1.23-lite-1_arm.ipk。安装完成后在 help 目录创建一个从 ja 到 en 的链接:
|
# su # cd /home/QtPalmtop/help # mv ja ja.orig # ln -s en ja |
通讯录软件可以显示英文的菜单和文本,但是通讯录的条目还是按照日文假名顺序进行排序的。如果你想要让他们按英文字母顺序排序,而不管里面的日文的话,你可以安装 [qtopia-addressbook_1.23_arm.ipk]。
如果你想让 Netfront 能够显示除了英文和日文以外的例如德文的变音记号、法文的重音记号,以及其它的特殊字符的话,修改 /home/zaurus/Applications/netfront3/prefs 文件,找到 FontFamilyJa:,添加或修改 FontFamilyEn: ,并把它设置成例如 verdana 那样的包含扩展字符集的字体。推荐你使用这个软件包:unicodefonts-verdana_1.5.0-3_arm.ipk
|
FontFamilyEn: verdana FontFamilyJa: lcfont |
* 译者注:关于 本地化 / 中文化 的信息,可以参考译者的这篇文章:汉化 Zaurus SL-C3100 的 SHARP 原厂 ROM
Zaurus 在出厂时预先安装了以下字体:
不幸的是,日文字符的编码与一些 latin 的扩展字符的编码有重叠,所以无法正确的映射这些字符相冲。在这个方面,unicode 字符会有一些帮助。不过,很多字体都没有全部的 unicode 字符,这时只能显示一个小方框来代替。实际上,确实存在一个含有所有 unicode 字符的字体,而且字符编码都是正确的,当然,这样的字体对应每一个字号都需要使用超过 1M 的内存。
下面的字体含有几乎所有的字符,不过 unifont 字体只有 16 点阵的字体。
拥有一个含有尽可能多的字符的字体文件是一个好的开始,当然这还依赖于应用程序能否使用 unicode,并且是否能够提取正确的字符并显示它们。某些字体可能忽略了屏幕翻转后产生的细节差异,这样,在屏幕旋转时,字体的显示效果就会很差。如果你发现这种情况,一定要确认你安装了屏幕翻转时与之对应的字体。
我已经加入了以下扩展字体文件:
注意:unicodefonts-verdana_1.5.0-3_arm.ipk 是在 mico-unicodefonts-verdana_1.5.0-2_arm.ipk 的基础上加入了可适应屏幕翻转的字型后重新打包生成的字体。
这些都是用于 Qtopia 和应用程序的默认字体。X/Qt 和 Pocketworkstation 使用不同的字体集合。Qtopia 的字体存储在 /opt/QtPalmtop/lib/fonts。Zaurus 的字体使用 Trolltech 的 QT Prerendered Format (QPF) 字体格式。如果你想使用其它的字体,可以用一个由 Trolltech 提供的名叫 makeqpf-arm 的工具把你的字体文件转换成 Zaurus 的字体格式。
在日文系统中(也就是说当你的 locale 被设置为 ja 的时候,ja 是 Zaurus 默认的语言选择),lcfont 是默认的系统字体。然而 Qtopia 在找不到它所需要的字体时,它会把 helvetica 作为缺省字体。
在生成字体时,你需要生成两个版本的字体,一个用于竖屏模式,另一个用于横屏模式。旋转过的 qpf 字体文件的文件名末尾会以 t10 来结尾。
下面的例子说明了把 arial.ttf 字体转换成 16 点阵 qpf 的横屏和竖屏字体所需要的步骤。在转换过程中,你的 Zaurus 看起来像是死机了,而且完成后你还需要重启你的 Zaurus。所以,在执行以下步骤之前,一定要确认你已经保存了所有已打开的文件:
|
# mkdir -p /hdd3/build/lib/fonts # cp arial.ttf /hdd3/build/lib/fonts # export QTDIR=/hdd3/build # cd $QTDIR/lib/fonts # echo "arial arial.ttf FT n 50 160 s" > fontdir # makeqpf-arm -display Transformed:Rot0 -A # makeqpf-arm -display Transformed:Rot270 -A # cd /hdd3/build # newipk arial # cp /hdd3/build/lib/fonts/*.qpf /hdd3/arial/data/opt/QtPalmtop/lib/fonts # makeipk arial # su # reboot |
在执行以上步骤之前,你应该预先从 Trolltech 下载了 amkeqpf-arm,并且把已经它解压缩到了环境变量 PATH 所包含的路径里,如 /usr/local/bin。同时,也需要你先安装好 ipktools 这个软件包。
最后,日文中把字符 ⁄ 显示成 ¥ 。不过这只是显示错误,而系统中所使用的字符是正确的,不用为此担心。
Zaurus 有一个和笔记本电脑类似的完整的 QWERTY 键盘,不过有一些特殊字符必须通过 功能键(Fn)来组合输入。大部分按键组合已经清楚地在键盘上标明了,不过,还是有一些没有标明或遗漏的。下面的一些键位映射对于大多数应用程序都是有效的,但是有一些应用程序因为编码页的关系无法辨认而忽略这些按键组合。
截屏键:
导航键:
其它有用的未标识的按键:
除此以外,还有一些其它的基本的按键需要被映射。你可以安装 keyhelper [keyhelper_1.2.2-1_arm.ipk] 然后把 keyhelper.xml 放到 /home/zaurus/Settings 目录下,最后在终端控制台重新载入键位映射表。
|
# cd /home/zaurus/Settings # cp /home/zaurus/Documents/custom/keyhelper.xml . # khctl reload |
如果你安装 keyhelper-c3000map [keyhelper-c3000map_0.4_arm.ipk] 的话,它会自动完成上面的那些步骤,同时它还会启动象下图所示的那样的 keyhelper 的菜单。
keyhelper 会提供如下的键位映射:
/home/zaurus/Settings/keyhelper.conf 文件包含了菜单项的显示和所执行的命令的定义。如果你想自定义你的键位映射,你可以安装 keyhelperconf,它可以帮助你得到你所需要的映射的正确的 XML 代码:
同样,你也可以自定义屏幕右侧以及键盘下方的的应用程序快捷键。Settings 标签下的 ApplicationKey 工具可以让你为这些应用程序快捷键指定各自被按下时要打开的程序。
我的设置是这样的:
下面是一些 Qkonsole 中非常有用的快捷键:
如果你在按下键盘下方的功能键时,在屏幕上得到 ~0, ~1, ~2, ~3 的话,把我修改过的 linux.keytab 和 vt100.keytab 复制到 /opt/QtPalmtop/etc/keytabs 就能解决问题了。
|
# su # cd /opt/QtPalmtop/etc/keytabs # cp /home/zaurus/Documents/custom/linux.keytab . # cp /home/zaurus/Documents/custom/vt100.keytab . |
下面是 NetFront 浏览器中的一些有用的快捷键:
在 Zaurus 的 vi 中 esc 键被映射到了 cancel 上。
在 midnight commander 中 F1 - F10 被分别映射到了 Fn + 1 到 10 上。
X/Qt(以及使用 X/Qt 的 Debian PocketWorkstation)由他自己的键位映射。如果你的键位映射有问题的话,下载 xmodmaprc-c3000 并把它放到 /home/zaurus 以及 /home/root 目录下,并更名成 .xmodmaprc 。
.xmodmaprc 作了如下的修正来使 X/Qt 下的键位映射和 keyhelper 类似:
Menu 键会激活 X/Qt 的控制。
Fn + m 会中止 X/Qt 的运行。
如果你的按键按下后字符都变大写了,按住 Shift 键几秒后松开再试,就会发现按键又回复到小写的状态了。
文件关联的信息被分别放在两个地方。/opt/QtPalmtop/etc/mime.types 文件存放了需要关联的 mime 类型,它会和 /opt/QtPalmtop/apps 下的 desktop 文件合并起来最终得到文件的关联信息。
存在 mime.types 文件里的信息指出了文件的后缀名和文件类型的关联。而每一个应用程序的 desktop 文件将会指明它能处理哪些类型的文件。如果有多个应用程序关联到了同一种文件类型的话,将只有一个是有效的,不过,我并不知道 Zaurus 是用哪种逻辑来决定要使用哪一个应用程序的。你可以为每一种文件类型只指定一个应用程序来获得你想要的文件关联效果。
下面以 Opera 关联 .htm 和 .html 文件作为例子,你将会看到 mime.types 文件中有如下内容
| text/html html htm |
在 opera.desktop 文件中则会有下列内容:
|
MimeType=text/html MimeTypeIcons=opera |
你还可以象上面的例子那样,给文件关联设置一个图标,多个关联可以用分号(;)来分隔。
C3000 和 C3100 有着比旧型号机器有更高的分辨率的屏幕(640x480)。旧的应用程序被设计成为适合那些默认就是直版竖屏的旧型号机器(因为那是那些机型的默认显示模式)。C3000 和 C3100 对横屏和竖屏都能支持。贝壳式的设计可以检测到屏幕是否旋转,如果旋转则能够自动调整屏幕显示的方向。不过,如果应用程序是为旧机型的竖屏设计的,系统也会自动把显示模式切换到竖屏模式。
要解决这个问题,用触笔长按应用程序的图标几秒后,在弹出的属性窗口中去掉 "Display with magnified screen" 前面的勾去掉(对每个有这种情况的应用程序都要设定一次)
或者你也可以把下面的代码加到 /opt/QtPalmtop/apps 目录下相应的 .desktop 文件中。
| Display=640x480/144dpi,480x640/144dpi |
只有在 desktop 文件中不含有 Display=640x480/144dpi,480x640/144dpi 这个信息的应用程序才会有 Display with magnified screen 这个选项,不过,如果 /home/zaurus/Settings/Launcher.conf 文件中 EnableForcedVGA 的值被设置成了 0 的话,这个选项同样也是无效的。在 /home/zaurus/Settings/display.conf 文件中,如果值为 3 则意味着应用程序将运行在 640x480 的分辨率下。
在默认情况下,应用程序是以 zaurus 身份运行的,然而,有一些应用程序必须要有 root 权限才能够正常运行。
要实现这个,用触笔在应用程序的图标上长按几秒,在弹出的属性窗口中勾选 "Execute with root priviledge"。
有些应用程序在系统启动时就被预加载了。这就意味着,在 Zaurus 启动的时候,这些应用程序就被加载到了内存中。这使得这些应用程序能够非常迅速的被打开,因为事实上它们已经被加载到内存中了。不过,正因为这样,它们同时也消耗了不少空余的内存。
你可以通过禁用这些被预加载的程序的预加载选项来阻止它们被系统预加载,从而获得更多的空余内存。要完成这个工作,只要用触笔长按应用程序的图标几秒钟,在弹出的属性窗口中去掉 "Fast load (consumes memory)" 前面的勾。
自定义开机画面是可行的。开机时显示的图象是一个 90 度旋转(480x640)的 24 位色的名为 Startup_screen.bmp 的 bmp 图像文件。你只要简单的把它复制到正确的位置,在开机的时候系统就能读取到了。
|
# su # cp /home/zaurus/Documents/custom/Startup_screen.bmp /opt/QtPalmtop/pics144 |
下次开机是,画面就会是这样:
如果你想去掉开机时的 Sharp 标志的画面,你需要关闭 Sharp Logo 选项后重新编译内核。Tetsu 的内核就是这么做的。
/root/etc/rc.d/rc.sysinit 文件决定了系统在启动时会做哪些事。它会运行在 rc.d 目录下的被请求的 runlevel 下面的所有脚本,然后再运行 rc.rofilesys 。然而,在这个文件中,通常最后一个被运行的 rc.local 文件被注释掉不被运行了。你可以取消下面这段代码的注释使它在系统启动时被运行:
cd /etc/rc.d
if [ -f "./rc.local" ];then
if [ -x "./rc.local" ];then
echo "*** Running rc.local"
./rc.local
fi
fi
|
或者,你也可以修改 /home/QtPalmtop/qpe.sh 来使它运行 /etc/rc.d/rc.local
sdisp /home/QtPalmtop/pics144/Startup_screen.bmp &
/etc/rc.d/rc.d/rc.local
cd
if [ -f /etc/restorefile ]; then
export LD_LIBRARY_PATH=/usr/QtPalmtop.rom/lib
else
export LD_LIBRARY_PATH=$QTDIR/lib
fi
qectrl -c
|
在 rc.sysinit 和 qpe.sh 中运行 rc.local 的不同之处在于,如果是在 rc.sysinit 中运行,则运行 rc.local 脚本的输出信息在系统启动时将会显示在屏幕上(如果使用 tetsu 的内核),而在 qpe.sh 中运行的话,将不会显示,因为它会被启动画面覆盖掉。
C3000 和 C3100 可以使用 png 或 jpg 图片文件作为墙纸。在默认情况下如果你在 设置(Settings)标签下使用 外观(Appearance)应用程序的话,你所选择的图像将会作为背景平铺,除非你所选择的图象正好适合你所期望的显示方向的屏幕的大小(减掉 Qtbar 的高度 640x460 或者 480x620)。不过,当你旋转屏幕时,显示的比例就不对了,图像就只能平铺在桌面上了。
如果你安装了 Plasterer [plasterer_2.1.0-1_arm.ipk] 的话就可以解决这个问题,它可让你选择是居中还是平铺你所选择的图片。然后它会生成两个图像文件:vImage.png 和 hImage.png,在你旋转屏幕时它会选择合适的图片作为背景。你可以用两张完全不同的图片来替换掉这两个文件。
我创建了以下几套横竖配套的背景图片,这样在 Zaurus 上,不管屏幕是横屏还是竖屏显示,都能取得不错的效果:
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
注意:上面的图片中,大部分取自 Cresho 的 zaurusthemes.org 网站。那里有更多的漂亮的背景图片,这里的几张只是我比较喜欢的而已。
你可能已经注意到这个应用软件是日文版的。在设置(Settings)标签下使用语言切换(Language Switcher [en])工具(如果你已经安装了 langswitch 的话)来移走 qm 文件,这样软件就变成英文版的了。
当你使用 Plasterer 生成了 hImage.png 和 vImage.png 这两个文件之后,你可以使用 bgswitch [bgswitch_0.1_arm.ipk] 来切换使用/home/zaurus/Documents/Image_Files/wallpaper 目录下的可用的背景图片。
C3000 和 C3100 的默认的屏幕保护真的很丑陋。你可以安装下面的软件包来美化屏幕保护:
另外还要安装下面的至少一个软件包:
你可能已经注意到这个应用软件是日文版的。在设置(Settings)标签下使用语言切换(Language Switcher [en])工具(如果你已经安装了 langswitch 的话)来移走 qm 文件,这样软件就变成英文版的了。
你可以使用 TabConf/TabSetting 这个工具来重新组织标签栏和应用程序。或者,你也可以通过改变 /home/QtPalmtop/apps 目录下的文件来实现,但是只有等你重起 Qtopia,重启 Zauus 或者运行 TabSetting 然后应用并保存设置时这些改动才会生效。在每个子目录下都有两个名为 .order 和 .directory 的隐藏文件,我们可以手动修改它们。
此外,你可以自定义菜单上和桌面上每个应用程序的图标,以及它们所关联的文件类型的图标。
菜单和标签兰上的图标被存放在 /opt/QtPalmtop/pics144 目录下。Qtopia 总是会优先到这个目录下查找图标。如果在这里没有找到指定名字的图标,它会继续在 /opt/QtPalmtop/pics 目录下搜索。如果两个目录下都有文件名相同的图标的话,系统会优先使用 /opt/QtPalmtop/pics144 下的图标。
C3000 出厂时默认的图标文件目录 /hdd1/usr/QtPalmtop.rom/pics144 和 /hdd1/usr/QtPalmtop.rom/pics 分别是 /opt/QtPalmtop/pics144 和 /opt/QtPalmtop/pics144 的符号链接。
类似的,在 C3100 上,默认的土表文件目录是 /usr/QtPalmtop.rom/pics144 和 /usr/QtPalmtop.rom/pics,它们分别是 /opt/QtPalmtop/pics144 和 /opt/QtPalmtop/pics144 的符号链接。
默认的文件关联的图标存放在 /opt/QtPalmtop/pics 目录下。当安装新的应用程序时,安装程序会把图标复制到 /opt/QtPalmtop/pics144 和/或 /opt/QtPalmtop/pics 目录下。通常在 /opt/QtPalmtop/pics144 目录下的图标的尺寸是 64x64 的,而 /opt/QtPalmtop/pics 目录下的则是 32x32 的。不过,有一些特别的 28x28 的小图标会放在 /opt/QtPalmtop/pics144 目录下,更小一些的 14x14 的会放在 /opt/QtPalmtop/pics 目录下。
我们可以通过替换应用程序所使用的图标文件或者添加一些新的图标文件并在 TabConf 工具中修改应用程序的图标来打到自定义图标的目的。此外,在 /opt/QtPalmtop/apps 目录下的每一个 .desktop 文件也都可以被手动修改。如果你用一个同名的图标文件替换了原来的图标的话,你需要重启系统后才能看到变化,因为 Qtopia 会使用缓存中的旧图标。
自定义开始菜单:
下面是要改变默认的 Qtopia 的外观时,需要替换的图标文件的列表。因为有些文件可能只是一个符号链接,所以,在你用一个新的文件进行替换之前,你需要先删除它们。我替换和添加了下面的这些默认图标:
设置(Settings)另外,我还添加了一些图标,下面列出其中的一些:
标签栏图标软件包 zicons-wmtux [zicons-wmtux_0.2_arm.ipk] 可以用一组漂亮的图标替换掉上面列出的所有图标,同时它也给应用程序条假了一些附加的图标。这个软件包是基于 cacko.biz 的 cool-icons 包和 zaurusthemes.org 的 z-oslinux 主题的。
在设置(Settings)标签下的外观(Appearance)工具可以用来更换主题。Crystal Blue 是我喜欢的主题之一,不过用 SLStyle 的样式、umicons 的标题栏以及 Gray 配色方案搭配在一起也能取得很棒的效果。
Zaurus 自带的 bash 是 2.05 版的。同时系统中还有 ash 和 sh ,sh 是 root 和 zaurus 用户所使用的默认 shell。当你在 Qtopia 中打开一个终端时 zaurus 会在这个终端中使用 bash。但是当你使用 telnet 连接 Zaurus 或者使用 su 命令切换到 root 用户时,你将会使用默认的 shell (/bin/sh),而并不是 bash。如果你想把 bash 作为默认的 shell,可以修改 /etc/passwd 文件,把 /bin/sh 改成 /bin/bash。
|
root:x:0:0:root:/home/root:/bin/bash zaurus:x:500:500:Zaurus User:/home/zaurus:/bin/bash |
你可以在你的用户目录中创建或编辑 .profile 或者 .bashrc (/home/zaurus/.profile 或 /home/root/.profile)来自定义你的 bash 提示符。
你可以改变环境变量 PS1 的值来改变提示符,比如改成 zaurus-:) 或者更好玩的字词或使用特别的颜色。
如果你没有 .bashrc 文件,你可以从 .profile 复制过来然后在这基础上再作修改。
zaurus 用户的 home 目录(/home/zaurus)在 /home 所在的分区(/dev/mtdblock3)上。在 C3000 上,它只有 4MB 的空间。这个空间也是在C3000 仅有的 16MB 的内部闪存中的。因为内部闪存的其他空间被用于 main rootfs(/dev/mtdblock2)、emergency rootfs(/dev/mtdblock1),所以/home 分区的空间不可能再大了。同时/home 分区还被用来存放内核模块(/home/root/modules)、系统设定(/home/zaurus/Settings and /home/etc/)以及其它的一些信息。此外,还有一些应用程序把它们的配置信息和资料也存放在 zaurus 的 home 目录中(这是 Linux 的应用程序通常的做法)。不过这在 C3000 上可变成了一个问题,因为 /home 分区会很快就被塞满。所以建议不要把大文件存放在这里,事实上,应该避免在这里存放任何东西,以保留 /home 下珍贵的空间。
如果你的空间不够用了,你可以把一些文件和目录移动到 /hdd2 或 /hdd3 分区上,然后再做上这些文件的符号链接。为了简化这个操作,我创建了一个脚本 zhomefix 来把 /home/zaurus 目录下的所有文件名以.开始的文件和目录搬到/hdd2/zaurushome目录下,并自动给他们创建链接。如果你的 /hdd2 的空间也不足的话,你可以修改 zhomefix 脚本,把资料移到 /hdd3/zaurushome 。
在 C3100 上,情况稍稍有些不同。相比起 C3000 的可怜的 16MB 来说,C3100 的内部闪存有 128MB。也许你会想 C3100 的 home 目录应该不会空间不足了吧。不幸的是,事情并不是这样的。rootfs 现在使用了 32MB 的空间,而不是像在 C3000 上那样的 4MB。还有,依旧还存在着 emergency rootfs (smf),所以,当这些空间被瓜分过后,还剩下 89MB 给了 /home 分区。你也许又在想,这并不算太坏。不过,等等,还有一个惊喜呢。在 C3000 上内部的微硬盘会被分为 /hdd1、 /hdd2 和 /hdd3 三个分区。默认的二进制文件和设置都被存放在只读的 /hdd1 分区。所有的应用程序都被安装在 /hdd2 分区,剩下的 /hdd3 则被用来存放资料。而在 C3100 上,原本 /hdd1 的内容被移到了 rootfs,而原本在 /hdd2 上的应用程序被移到了 /home 分区。在C3100上 /hdd1 和 /hdd2 两个分区现在都只有 9MB 左右的大小并且是空的,不被使用了。这样 C3100 上的 /hdd3 比 C3000 的就大了很多了。
然而,这就使得 C3100 的 /home 分区的作用相当于 C3000 上的 /hdd2 和 /home 分区了。在 C3000 上 /hdd2 分区有 400MB 左右的空间可以用来安装应用程序,而我们在 C3100 上却只有 89MB。幸运的是这个 89MB 的空间被创建成了 jffs2 文件系统,因为 jffs2 文件系统内建了压缩功能。所以如果运气好的话,我们能够存放大概 200-300MB 左右的应用程序和数据进去。 尽管这样,我们还是会碰到空间不足的状况。如果遇到这样的情况,我们可以卸载一些应用程序(例如一些 C3000 上没有的,只在 C3100 上有的附加的应用程序)或者我们可以把一些文件搬到 /hdd3。不过要注意的是,/hdd3 默认是 FAT 文件系统,它并不支持一些应用程序所需要的符号链接。你可以查看 文件系统 这一章节来研究关于在 /hdd3 上使用 cramfs 或 ext2 loopback 文件系统来扩展可以安装应用程序的空间的做法。此外你还可以把应用程序安装到 SD 或者 CF 存储卡上。不过因为一些应用程序需要安装到非FAT的文件系统上,所以你也许需要重新格式化你的存储卡。
C3000 和 C3100 都有一个被分了 /hdd1、/hdd2 和 /hdd3 三个分区的 4GB 的内置硬盘。在默认情况下,/hdd3 是被格式化成了 FAT 分区,所以在 Zaurus 作为 USB 客户端连接到 Windows PC 上时,它可以作为一个 USB 驱动器来共享文件。C3000 的第一个分区 /hdd1 是一个包含了可以使操作系统运行或者回复到出厂设置所需要的镜像和二进制文件的只读分区。在 C3100 上,这是一个只有 9MB 大小的几乎是空的分区,它上面有一个 hdimage2.tgz 文件,这里面包含了 /hdd3 的目录结构和模版文件。C3000 上的第二个分区 /hdd2 是用来安装应用程序的。C3100 上,同 /hdd1 类似,也是一个 9MB 大小的几乎是空的分区。第三个分区 /hdd3 则占据了内置的微硬盘剩下的空闲空间并被格式化成了 FAT 分区。它可以被用来存放各种形式的资料,包括超大的文件。此外,如果你稍微做一些修改,/hdd3 还能够在 /hdd2 或 /home 分区空间不足时用来安装应用程序。
因为 /hdd3 使用了 FAT 分区格式,所以,不能再上面创建符号链接,同时也无法储存用户对文件的权限和所有权信息。因此, /hdd3 使用 FAT 分区格式的话还是有很多缺点的。你可以把它重新格式化成 Linux 所使用的文件系统(ext2/ext3)或者把 /hdd3 重新分区成一个小一些的 FAT 格式的 /hdd3 和新建的 Linux 分区格式的 /hdd4。
在你重新划分 /hdd3 之前,要确认你已经备份了存放在它上面的所有的东西。/hdd3 上默认就有的字典文件(dict1 和 dict2)可以在 Zaurus 附带的前两张 CD-ROM 上找到。C3100 还有第三章 CD-ROM ,里面装的就是 Contents_Files 目录里的内容。不过 sd_map (C3100 only)在任何一张光盘上都没有找到,所以你要确认你已经把它备份好了。
/hdd3 通常是由 /dev/hda3 或 /dev/hdc3 挂载而来的,具体是哪一个设备取决于你的启动方式。如果你启动时没有插 CF 存储卡,设备名为 /dev/hda3;如果你插了 CF 卡再启动,则会是 /dev/hdc3。
把 /hdd3 划分成两个分区的步骤如下所示:
有一个名为 parted 的工具可以让你在无需删除分区的情况下改变分区的大小。这是一个非常有用的工具,但是请记住,如果你在 hdd3 上有资料需要保留的话,在改变分区大小前,一定要先备份。虽然 parted 可以在不删除资料的情况下改变分区的大小,但是却无法保证没有意外发生。在一些情况下,改变大小可能导致分区损坏,所以在做改变前先做备份是一个非常明智的选择。同样的,在改变分区大小后,可以运行 fsck 来检查分区是否被成功的改变了大小和是否产生了资料破损。
当你完成了上面的步骤之后,你需要一可读可写的模式重新挂载 / 分区,然后为 hdd4 创建一个新的挂载点,比如说 /hdd4。记住在创建完新的挂载点之后,重新把 / 分区挂载为只读模式。此外,你还需要创建一个开机运行的脚本来在系统启动时挂载 hdd4。不过要注意的是 hdd4 可能是 /dev/hda4 或 /dev/hdc4(取决于开机时是否插入了 CF 存储卡)。我的 automounter 软件包 [automounter-c3000_0.5.0_arm.ipk] 能够在检测到 hdd4 存在的情况下自动挂载它。
另一种情况是,如果你的 Zaurus 并不会做为 USB 硬盘使用,或者你的 PC 运行的是 Linux 操作系统,那么,你只要把整个 /hdd3 分区格式化成 Linux 的分区格式就好了。
你也许还需要考虑创建一个小的交换分区。交换分区的性能要比交换文件好。交换分区的大小建议在 64MB 到 256MB 之间,具体的数值取决于你的 Zaurus 的用途和你所使用的应用程序。
还需要注意的是,默认的软件包安装工具(qinstaller)并不能让你把软件安装到 /hdd3 或 /hdd4 上。ipkg 虽然可以把软件装到这两个分区,但是它却不会在安装完后做链接的动作。所以你必须使用 Sharp 原厂的 ROM 中并未包含的 ipkg-link 工具来完成这一动作。我的 ipktools 软件包中的 xipk 脚本能够让你把软件安装到 /hdd3 和/或 /hdd4,同时也会自动完成链接的动作。此外,它的安装的机制和 qinstaller 是相同的,所以你可以在 qinstaller 中删除你用 xipk 安装的软件。
如果你想在 hdd3 获得最大的可用空间,并且你并不需要日-英字典的话,你可以删除 hdd3 上的字典目录 /hdd3/dict1 和 /hdd3/dict2。如果你以后又想要使用这个字典了,可以非常方便的从附带的光盘上把它们复制回去(所以,千万不要把你的光盘丢掉)。在 C3100 上,还有一个移动地图的应用程序把一些资料放在 /hdd3/Documents/sd_map 下,你可以卸载这个软件并删除 sd_map 目录来或地更多的空间。以后,你可以从第一张光盘上重新安装移动地图软件,在 X:/Applications/MobileMapData/sd_map (MobileMapData 是用片假名写的)目录下找到 sd_map 中的内容。在 C3100 上还有一个 Contents_Files 目录,它里面存放了很多日文的书籍和阅读资料。如果你并不懂日语的话,你可能想隐藏内容(Content)标签,这个可以使用设置(Settings)标签下的外观(Appearance)工具来实现。同羊的,你也可以删除 /hdd3/Documents/Contents_Files 目录,如果你以后还想把它恢复出来,只要从第三张光盘上把它复制过来就可以了。
最后,还有一点,如果你要把系统恢复成出厂状态, /hdd3 会被清空。不果你可以关闭这一功能。要关闭这个功能,你首先要以可读可写的方式重新挂载根(/)分区,然后修改 /root/etc/rc.d/rc.rofilesys,注释掉下面这段代码:
if [ "$HDDCLEAR" = "YES" ]; then
dd if=/dev/zero of=/dev/${IDE1}3 > /dev/null 2> /dev/nulls
fi
mkfs.vfat -F 32 /dev/${IDE1}3 2> /dev/null > /dev/null
|
当然,在你恢复到出厂状态后,你必须再次修改 rc.rofilesys,以便下次恢复时系统不清空你的 hdd3。或者,你也可以更新 .home_default.tar 文件,用修改过的 rc.rofilesys 文件替换里面的那个原始的文件,这样的话,你以后再也不用为了避免 hdd3 被清空而担心了。
在 C3100 上,/hdd1 和 /hdd2 并未包含任何重要的信息,它们除了在恢复出厂状态时被用到来清空 /hdd3 以外,并没有被系统用到,这些空间是被浪费掉了。所以,你可以修改 rc.rofilesys 来不挂载它们。或者你可以修改它们的大小,把 /hdd1 做成交换分区,/hdd2 做成 Linux 格式的分区(代替 /hdd4),/hdd3 则变成一个小一些的 FAT 分区。
下面是默认的分区表:
|
Disk /dev/hda: 4095 MB, 4095737856 bytes 16 heads, 63 sectors/track, 7936 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Start End Blocks ID System /dev/hda1 1 20 10048+ 83 Linux /dev/hda2 21 40 10080 83 Linux /dev/hda3 41 7936 3979584 c Win95 FAT32 (LBA) |
下面是我修改过的分区表,/hdd1 是一个 256MB 的交换分区,/hdd2 是一个 1.2GB 的 ext3 分区,/hdd3则是 2.5GB 的 FAT 分区:
|
Disk /dev/hda: 4095 MB, 4095737856 bytes 16 heads, 63 sectors/track, 7936 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Device Boot Start End Blocks Id System /dev/hda1 1 256 128992+ 82 Linux swap /dev/hda2 257 2790 1277136 83 Linux /dev/hda3 2791 7935 2593080 c Win95 FAT32 (LBA) |
要完成这个修改动作,你需要把根(/)分区以可读可写的方式重新挂载,替换掉 /root/etc/rc.d/rc.rofilesys。你还需要在未加载的 /hdd1 和/hdd2 删除 NotAvailable 文件。
我已经成功地使用了 parted 在不破坏县有的文件的情况下动态的缩小 /hdd3 分区。但是,还是建议在做这种操作之前做一个备份。接着,我用 fdisk 以新的大小重新创建了 /hdd1 和 /hdd2 分区,并且分别用 mkswap 和 mk2fs -j 命令对它们进行了格式化的操作。
现在,当 C3100 启动的时候,系统将像以前一样自动挂载 /hdd3,但是在恢复出常设之时,不会清空 /hdd3 了。如果 /hdd2 是 ext3 分区格式的话,它同样也会自动挂载起来。此外系统还启用了 256MB 大小的交换分区(以前的 /hdd1),并且 tmpfs 也从 1MB 扩大到了 2MB。
C3000 和 C3100 都有一快内置的 4 GB CF 接口的微硬盘,通常把它当作硬盘那样来存放数据。因为 CF 闪存卡的速度一般都要比 CF 微硬盘来的快,所以如果使用一块 CF 闪存卡来替换这块微硬盘的话,Zaurus 的性能会得到提升。当微硬盘空闲一段时间后,它会停转进入省电模式,而C3000 应用程序和二进制文件都存放在微硬盘上,所以当启动程序时,会有一个小小的延迟来等待微硬盘启动起来。不过 C3100 受到的影响就没这么大了,因为可以把应用程序存放在内部闪存上,但是,如果你把一些应用程序安装在微硬盘上的话(例如使用 /hdd3 来安装像 PocketWorkstation 的应用程序和一些交换文件),同样也会遇到这样的问题。
要改善这种情况,你需要使用一张 CF 存储卡来替换掉内置的微硬盘。必须要确认的是,你的闪存卡的容量要和微硬盘差不多(4GB 不错,2GB 凑合,如果更大那就更好啦)。不过需要注意的是,你要使用的 CF 卡的存储速度一定要比 Zaurus 内置的微硬盘(Zaurus 内置了 4GB 的日立微硬盘)的速度要快,否则,岂不是得不偿失。
更换完成后,你要做的是把 4GB 的微硬盘的数据镜像复制到你的闪存卡中去。要完成这个动作,你可以把闪存卡插入 Zaurus 的 CF 插槽,然后使用 fdisk 工具按照微硬盘的分区大小对他进行分区操作。然后使用 dd 命令分别复制 hdd1、hdd2 和 hdd3 等各个分区。在复制前,要先卸载掉 hdd2 和 hdd3 分区或以只读模式加载它们。其他的分区,则是存放在内部闪存(也被称为 Nand)的。或者,你也可以使用 parted 工具复制整个分区到另一个磁盘设备。当这一切都完成之后,你可以拆开你的 Zaurus 用 CF 卡替换掉内置硬盘。不过这么做会使你的保修合同作废,所以请你一定要三思而后行,如果你损坏了 Zaurus 或它的任何,你只能自己来承担责任了。除非你在日本,否则你是很难买到替换的部件的。所以一样要小心谨慎,千万要考虑好你更换的步骤。我再重复一遍,如果你拆开了你的 Zaurus 来更换部件的话,你的保修条款就失效了。如果你在这过程中损坏了一些部件的话,你只能自己想办法来修理了,因为,没有保修了。
你应该要经常备份你的系统,因为这是你在遇到资料丢失的情况时的唯一的恢复手段。
C3000 和 C3100 都自带了一个备份恢复工具,你可以在设定(Settings)标签下找到它。使用这个工具就可以备份你的 Zaurus。它可以把你的系统(闪存,应用程序和设定)备份到 SD 或者 CF 存储卡,或者 /hdd3 上。基本上除了 /hdd3、/hdd1、/root 和 /mnt 之外的所有内容都能被这个工具备份和恢复。这意味着你还需要通过其他途经来备份 /hdd3。在你备份前,你必须确认你已经卸载了除了挂载在 /mnt 挂在点之内的其他任何挂载在系统上的 loop 回圈文件系统。否则它们也会被备份起来(你也许会觉得这非常不错),这样的话,你就没办法恢复你所备份的镜像了(因为备份了挂载的 loop 回圈文件系统上的文件之后,使得需要恢复出来的文件的大小总合超过了文件分区的容量)。如果你安装了 automounter,你可以使用如下的命令来统一卸载所有的 loop 回圈文件系统:
|
# su # automounter stop |
当你在 Zaurus 上完成了所有的备份动作之后,你可以使用下列命令重新挂载所有的 loop 回圈文件系统:
|
# su # automounter start |
由于 /hdd3 非常大,你可能需要一张大容量的 CF 卡,或者挂载一个 Samba 共享或 USB 移动存储来获得足够的空间存放你的数据。用一个 USB 移动存储是最佳的方案了(比 CF 卡便宜,又比使用普通网络的 Samba 共享速度快)。
假设你的 USB 存储设备被挂载到了 /mnt/usbdisk1,你可以像下面那样来备份 /hdd3:
|
# tar cf - /hdd3 | gzip - > /mnt/usbdisk1/hdd3-backup.tgz |
如果你还是不放心,你可以备份 /hdd1、/hdd2 和 /home:
|
# tar cf - /hdd1 | gzip - > /mnt/usbdisk1/hdd1-backup.tgz # tar cf - /hdd2 | gzip - > /mnt/usbdisk1/hdd2-backup.tgz # tar cf - /home | gzip - > /mnt/usbdisk1/home-backup.tgz # tar cf - /root | gzip - > /mnt/usbdisk1/root-backup.tgz # tar cf - /mnt | gzip - > /mnt/usbdisk1/mnt-backup.tgz |
Zaurus 的备份工具会关闭 Qtopia,所以所有被打开的文件会被关闭,然后开始把 /hdd2 和 /home 打包成备份镜像文件。这比在 Qtopia 还在运行时打包备份安全多了。然而,你还需要使用 gzip 来压缩备份镜像来节省空间。对于 /hdd1 来说,没有必要每次都对它进行备份,因为它是一个只读分区。只有在你手动修改了它的内容,或者刷了一个更新包之后才需要对它进行备份。
我写了一个名为 hdbackup 的脚本。它可以备份 /hdd3,把每一个目录分开备份并进行压缩和打上日期的标志。这样,通常的备份工作就只需要一个简单的命令就能完成了。
另外,你也可以使用 USB 数据线把 Zaurus 连接到 Windows PC 上,然后使用 Windows 的各种备份软件来备份被识别成 USB 移动硬盘的 Zaurus 上的数据。不过由于 USB PC 连接并不稳定,所以最好还是开启 Samba,通过 USB 网络来备份 /hdd3 上面的内容。
最后,不要忘记还要备份你的 SD 卡以及 CF 卡上面的数据。当上面的资料有问题时,并不会有任何的提示的,所以对它们也一样要做备份。
此外,在 Zaurus 诊断菜单(Zaurus Diagnostic Menu )中还有一个 NAND 备份的功能。这个功能可以让你完整备份整个 NAND 存储器。由于 C3000 只有 16MB 的 NAND 闪存,其他东西都在内部硬盘上,所以做一个 NAND 备份并不费力。不过在 C3100 上,除了 /hdd3 上面的资料外,几乎所有的东西都存放在 NAND 中,所以,给 C3100 做一个 NAND 备份可以给你一个可靠的系统镜像。当你的系统有问题的时候,你可以试用它来进行完整的恢复。这和 C3000 的情况是不一样的,所以,在你刷 C3000 的镜像的时候,请务必小心确认你要使用的镜像文件。
要做一个 Nand 备份,你需要一张 CF 或者 SD 存储卡来存放整个 Nand 的镜像文件。256MB 的存储卡就足够了。要完成 Nand 备份或恢复,需要做如下动作:
If you manage to corrupt your Zaurus configuration so badly that you cannot boot it anymore or things just don't work any more, then you have several options to fix it.
If you really messed up and just start over again without retaining anything, then just do a factory reset and the Zaurus will revert to its initial Japanese ROM state.
If you have a backup, you can restore your previous settings contained in your backup files. If you had to factory reset, then a restore can quickly get you to where you were before.
This is by far the most advanced option. Use this to recover files that might not have been backed up yet before doing a restore and/or factory reset.
Please refer to Trisoft's C3000 manual on how to do the above. It would be a waste of my time to provide step by step instructions since they have it pretty much covered, and they even have emergency backup images for you to use in case you dont't have a system backup.
If you have booted into the console for recovery, then you are using the /dev/mtdblock1 partition. This is the emergency partition that you usually don't see. You will need to manually mount the usual partitions if you want to access them. /home is /dev/mtdblock3 and /dev/mtdblock2 is your root partition. Don't forget to unmount the partitions after you have finished your changes or they will be rolled back and all the files remain unchanged.
For the C3000, you should update your Sharp ROM to 1.11JP if you are still on 1.01JP
There is no updated Sharp ROM for the C3100 yet.
Warning: Only flash your Zaurus with a ROM intended for your specific model and make sure you downloaded the complete files. Never ever flash your Zaurus with a ROM for another model. It will cause you many sleepless nights trying to restore it to a working condition.
There are several replacement kernels for the C3000 and C3100 which enhance the stock kernel that ships with Sharp's ROM. You can even build your own if you want (and know how to). The kernel source is available on Sharp's developer website. However, there are some smart people who already build and tested their own enhanced kernels. One of those is Tetsu's special kernel which has been build for optimised speed and also includes iptables and bluetooth modules. It also makes the battery status more accurate and it has a few bug fixes too.
Warning: The kernel is an important part of the Linux OS. A bad kernel can corrupt your Zaurus, so don't play around with it unless you know what you are doing and install the correct kernel for your model.
fsck needs to be run on the Linux filesystems from time to time to check for inconsistencies in the file systems and to fix it if there are any. fsck is similar to the chkdsk or scandisk command in DOS and Windows.
Running fsck on a mounted filesystem is not recommended so the safest way to run it on the C3000 is from the maintenance menu. Unmounting the partitions on the MicroDrive is much easier on the C3100 since it runs off the flash instead of the disk. For FAT partitions, ie /hdd3, use fsck.vfat instead of fsck.
To perform fsck via the maintenance menu do the following:
The fsck from the Maintenance Menu checks all three partitions on the MicroDrive, ie /hdd1, /hdd2 and /hdd3. It does not fsck /home or /root which is located on Flash. In fact, there is currently no known way of fscking a jffs2 filesystem which /home and /root are formatted as.
You should also regularly fsck your SD and CF card. Please unmount them before fscking them. Here is how you would fsck a FAT formatted SD card:
|
# su # umount /mnt/card # fsck.vfat /dev/mmcda1 # mount /mnt/card |
Enabling the wireless network was amazingly easy and straightforward. Just plug in the Wireless CF card and the Zaurus automatically detects it. Then run the Network config applet and enter the network info and press connect. Voila! That's it. Way too easy. This was the case using a Netgear MA701 CF Wifi card. Not all CF Wifi cards are supported so your milage may vary depending on your card.
However, you can also manually configure the network without using the Network config applet. The config files it generates are located under /home/zaurus/Applications/Network/modules and are called WLANx.conf. You will also need to edit the corresponding entry in /etc/pcmcia/wlan-ng.opts. If for any reason the applet won't let you enter a value you want (such as space in ssid), then you can edit the mentioned config files yourself.
Now this one was a bit trickier. My USB LAN adaptor came with a Linux driver, a file called rtl8150.c and all that was required was to compile it on the Zaurus (provided you got gcc to work). Anyway, I cheated and googled for rtl8150-1.o and found it :)
Next I had to install this driver which was quite easy. All that was required was to drop it into the following location: /lib/modules/2.4.20/kernel/drivers/usb/net and the hotplug mechanism in Linux would detect whenever the device was connected and enable eth0.
Now came the slightly harder part, ie the automatic configuration of the device. The network applet seems to only work for the CF based cards so it completely ignored eth0 because it came from the USB interface. After looking at how the usbdnet and wlan is configured by the hotplug mechanism, I extended the net.agent to check for eth0 as well and added net.func and net.conf to automatically configure the network once the cable was plugged in.
In addition I also wrote a script called net to change the stored network settings so I can easily switch between networks. The configuration for net are stored under /etc/sysconfig/netconf and net is invoked with the name of one of the config files as the parameter. Proxy settings for the Zaurus are stored under /home/zaurus/Applications/Network/modules/Proxies.conf which net will automatically update depending on the config being loaded.
|
# su # cp /home/zaurus/Documents/custom/rtl8150-1.o /lib/modules/2.4.20/kernel/drivers/usb/net # cp /home/zaurus/Documents/custom/net /usr/bin # cp /home/zaurus/Documents/custom/net.* /etc/hotplug # mkdir /etc/sysconfig/netconf # cp /home/zaurus/Documents/custom/*.conf /etc/sysconfig/netconf for example: # net dhcp (loads the config file dhcp.conf)# net -gui (starts with opie shell in QTopia desktop) # net -refresh (tells NetFront that its connected already) # net -resume (manually force network to resume) |
Here is a sample config file for a private network:
|
DHCPC=no IP=192.168.1.2 NETMASK=255.255.255.0 DOMAIN= GATEWAY=192.168.1.1 PROXY=0 PROXYHOST= PROXYPORT= DNS1=192.168.1.1 DNS2= |
net also has a GUI front-end using opie-sh, but in order to use the GUI, sudo needs to be configured to allow zaurus user to change the network settings, ie. ifconfig and dhcpcd. I also created a netswitch package [netswitch_0.4_arm.ipk] which will do the above steps when installed.
Some application such as NetFront insist on doing their own connection and disconnection to the network and ignore the fact that your USB network is already connected. As a workaround net has a refresh option to reset the network status whenever those programs mess with it. Simply run the following after you have launched NetFront:
|
# net refresh |
A lot of the USB network cards use either the rtl8150 chipset or are compatible with the pegasus driver. Drivers for both are included with netswitch, so installing the netswitch package should enable your USB LAN device in most cases. However, some network cards use other chipsets. You should be able to compile your own driver if you can find the driver source. See gcc section for further details.
The USB sync cable which allows you to access your Zaurus as a USB disk can also be used in TCP/IP mode which means you could use that cable to network your Zaurus and your PC.
To do this, you first need to install the USB NDIS drivers onto your PC or laptop. The Zaurus Software for the PC (Windows) does not use UniCode and hence displays garbage when run on an English version of Windows (even if you have installed the Japanese language pack and your browser can display Japanese websites without problems). To fix this, change the default Windows system locale to Japanese and restart Windows. Then run X:\PCSOFT\Setup.exe from the Zaurus CD-ROM and you will be able to read the Japanese.
Select next as appropriate and use the following as guide for the options:
(you only need the last option for the USB network)
Restart Windows when the install has finished.
The USB network driver is now installed and Zaurus Manager should had started automatically. If it has not, start it manually by running "C:\Program Files\Common Files\Sharp\SL\SSPCLINK2\ComSet.exe". You should also make a copy of C:\Program Files\Sharp Zaurus 2\drivers, best is to zip up the whole directory. This is the Zaurus USB network driver. You can use this driver to re-install the USB network or install it to another machine without having to run through the whole setup process again.
Rather than carrying a floppy, CD-ROM or another USB stick around that contains the Zaurus NDIS USB driver, you could put it on /hdd3/Documents on the Zaurus itself. When you connect your Zaurus to a computer which has not been setup with the Zaurus NDIS USB driver before, it will detect the Zaurus as a plain USB storage device and allow you to copy the driver from the Zaurus. Then once you installed the driver to the computer, it will believe that it is connected to the Zaurus via a network instead of treating the Zaurus as a dumb USB disk (provided the Zaurus is in advanced USB mode).
Now, on to the Zaurus side of the configuration. Run the PC Link tool from the Settings tab and select PC Link Setting, then select Connection USB-TCP/IP (advanced). Now just connect the USB cable (USB mini-B into Zaurus, USB A into Laptop or PC). The Windows machine should detect a new device at this point, a SL series Ver3 (NDIS 5) network adaptor, and you should be able to configure it. By default, the Zaurus would be assigned an IP address of 192.168.129.201. Assign an IP address in the same range to this new network adaptor, eg 192.168.129.101. You should now be able to ping both ways unless you have a firewall blocking it or DDE service is not enabled. If you want the Zaurus to be able to access the internet as well, you could enable internet sharing on your Windows PC (assuming it has internet connectivity and you trust Microsoft security). If you do that, Windows will reset the IP address of your Zaurus NDIS driver to 192.168.0.1 but you can change it back to whatever value you had given it before, ie 192.168.129.101
On the Zaurus side, you need to run the following commands to setup a route to your windows box:
|
# su # route add -host 192.168.129.101 usbd0 # route delete -net 192.168.129.0/24 usbd0 # route add default gw 192.168.129.101 |
Now that the route is configured, you should be able to ping servers by their IP addresses. In order to resolve the hostnames, you need to configure /etc/resolv.conf on your Zaurus with the DNS that is used on your Windows box. Assuming your DNS is 192.168.10.1, do the following:
|
# echo "nameserver 192.168.10.1" > /etc/resolv.conf |
You can also automate the above on the Zaurus by modifying /etc/hotplug/usbd.func and adding the following to the end of the usbd_net_if_up() function
if [ "$DHCPC" = "no" ]; then
GATEWAY=192.168.129.101
DNS=192.168.10.1
route add -host $GATEWAY usbd0
route delete -net `echo $GATEWAY|cut -d. -f1,2,3`.0/24 usbd0
route delete default
route add default gw $GATEWAY
echo "nameserver $DNS" > /etc/resolv.conf
fi
|
Since the Zaurus has an infra-red port (IrDA), you can use it for networking as well provided you also have an IrDA port on your PC or laptop that you can configure to use PPP over IrDA (IrCOMM or IrNet). This method of networking your Zaurus would give you the slowest network speed and you usually would not use it if the other options were available to you. But if your CF slot and USB port are tied up with other things, then using IrDA for networking might be something viable.
For this to work, you would need to first choose whether to use IrCOMM or IrNet drivers. Then you would need to make sure the chosen driver is enabled on both your Zaurus and your PC or Laptop. For IrDA connectivity, one machine has to be the host and the other the client. I will describe how to make Zaurus the host and the other PC or Laptop the client. The roles can also be easily reversed. I also did not bother with security since both machines would have to be physically in close range to each other in order for this to work.
The IrCOMM driver is by default already installed on the Zaurus and most Linux machines that have IrDA enabled. However, you would need to install a driver for Windows. On Windows 2000, for example, you will need to disable Image Transfer and install an IrCOMM driver (IrCOM2k). The following site describes how to setup IrCOMM on Windows2000: http://www.stud.uni-hannover.de/~kiszka/IrCOMM2k/English/manual.html. Once you have installed the IrCOMM driver, you can setup a new network connection (Direct Connection) using IrDA as the device and setting up Windows as the client with no password prompt.
On the Zaurus, you will need to do the following to make it start IrDA as the host:
|
# su # /etc/rc.d/init.d/irda start # pppd /dev/ircomm 9600 10.10.10.21:10.10.10.20 local noauth nodetach |
On the IrDA client, if you are running Linux (and IrCOMM is already setup), you can simply do the following:
|
# su # /etc/rc.d/init.d/irda start # pppd /dev/ircomm 9600 nodetach |
If you are running Windows (and you have setup the direct connection using IrDA as client) you can simply double click on the Direct Connection icon to connect.
Once they are paired successfully, you can ping the other box from the Zaurus as 10.10.10.20. The Zaurus would be 10.10.10.21 in this example.
To stop IrCOMM, simply press Fn + c and then run /etc/rc.d/init.d/irda stop
You will need the IrNet module on the Zaurus and your other Linux box. However, it is already installed on Windows 2000 so all you need to do on Windows is to create a new Direct Connection using IrDA interface.
To install and enable IrNet on the Zaurus, you will need to copy irnet.o to /lib/modules/2.4.20/kernel/net/irda/irnet.
|
# su # mkdir -p /lib/modules/2.4.20/kernel/net/irda/irnet # cp irnet.o /lib/modules/2.4.20/kernel/net/irda/irnet # mknod /dev/irnet c 10 187 # chown root:root /dev/irnet # chmod 644 /dev/irnet # insmod irnet # /etc/rc.d/init.d/irda start # pppd /dev/irnet 9600 10.10.10.21:10.10.10.20 local noauth nodetach |
On the IrDA client, if you are running Linux (and IrNet is already setup), you can simply do the following:
|
# su # /etc/rc.d/init.d/irda start # pppd /dev/irnet 9600 nodetach |
If you are running Windows (and you have setup the direct connection using IrDA as client) you can simply double click on the Direct Connection icon to connect.
Once they are paired successfully, you can ping the other box from the Zaurus as 10.10.10.20. The Zaurus would be 10.10.10.21 in this example.
You can also just simply install irnet_2.4.20_arm.ipk which installs and configures irnet so that it will be available even after a reboot. It also provides an opie shell script to allow you to start and stop it from the Qtopia GUI or simply run irnet start to start it from the command line and irnet stop to stop it.
If you have a CF bluetooth card or a bluetooth USB dongle, then you can set up a PAN (Personal Area Network) with other bluetooth enabled devices.
In the case you have a bluetooth enabled mobile phone with GPRS service, then you can even use bluetooth to connect to your phone using dialup networking (DUN) to use the phone's GPRS service.
However, the default Sharp ROM does not have bluetooth drivers or tools installed out of the box and you will need to setup and install those first before you can use bluetooth. See the bluetooth section for more details.
By default, a Samba service is already installed on the Zaurus. It is used when you synchronise your Zaurus with your PC while the USB cable is plugged in. You can also manually start and stop the Samba service and allow it to go over your wireless and ethernet network instead of just the USB cable. If you use the USB cable in advanced mode (with TCP/IP enabled), then you will be able to access all your devices (MicroDrive, SD card, CF card and USB disk) at the same time instead of being able to only chose one at a time in normal sync mode.
To allow Samba to be accessed via the WLAN (wlan0, wifi0) or LAN (eth0) interface, edit the following file: /usr/lib/samba/smb.conf
Find the following line: interfaces = usbd0
add your network interface after usbd0 separated by a space like this: interface = usbd0 wlan0 eth0
You might also want to add a new entry: hosts allow = 192.168.1. (whatever the IP range of your network is from which you want to connect to your Zaurus, multiple entries are separated with a space)
[global] workgroup = HOME log file = /dev/null hosts allow = 192.168.1. 192.168.129. encrypt passwords = yes coding system = utf8 client code page = 932 force create mode = 0755 strict sync = yes sync always = yes interfaces = usbd0 eth0 wlan0 #wins support = yes bind interfaces only = yes [system] comment = System Folder path = /root/samba read only = no browseable = no guest ok = yes force user = root [home] comment = for User Data path = /home/samba short preserve case = no read only = no guest ok = yes force user = zaurus |
And finally, you need to know how to start the Samba service:
|
# su # /etc/rc.d/init.d/samba start |
To stop the Samba service:
|
# su # /etc/rc.d/init.d/samba stop |
Alternatively, you can install sambacontroller [sambacontroller_0.1-0_arm.ipk] which gives you a GUI interface to do it. Remember to give it root access or else nothing will happen. Also you need to do the following to enable it to configure smb.conf (only needed for the C3000)
|
# su # mkdir -p /home/root/usr/lib/samba # cd /home/root/usr/lib/samba # ln -s /usr/lib/samba/smb.conf smb.conf |
Once you install SambaController, you can use it to start and stop samba, as well as modify smb.conf from the Configure tab.
You should also install smbpasswd [smbpasswd_0.1-1_arm.ipk] which will allow you to set the samba password.
Once you installed smbpasswd, you will need to do the following to get it working:
|
# su # ln -s /usr/local/samba/lib/codepages /usr/lib/samba/codepages # rm /usr/local/samba/lib/smb.conf # ln -s /usr/local/samba/lib/smb.conf /usr/lib/samba/smb.conf # ln -s /usr/local/samba/private/smbpasswd /etc/smbpasswd |
Note: you might need to hack the Windows registry to enable plain text password to make Windows compatible with Samba (depends on the version of Windows you are running).
This configuration forces the samba user to be the zaurus. When giving access to the samba shares, all the access rights and file permission is that of the zaurus user. This will work fine on all FAT filesystems, however, if you change some of your partitions to ext2, then you might get some permission denied errors when trying to acces, create, modify, move or delete files. If that happens, make sure the file or directory in question has sufficient access rights for the zaurus user.
In addition, if you change /hdd3 to another filesystem other than fat, then samba will stop to work for /hdd3/Documents unless you change /etc/hotplug/usbdstorage.agent and change the mount options to the appropriate filesystem type, ie change fat to someting else like ext3.
If you only want to ssh to other machines from your Zaurus, install ssh client [openssh-client_3.6.1p1_arm.ipk].
If you want your Zaurus to be accessed via ssh as well, then you need to install the following:
There already is a command line telnet client pre-installed on the Zaurus which you can use.
In order to enable the telnet daemon within inetd, uncomment the telnet entry in /etc/inetd.conf and restart inetd.
|
Make sure you use tcp wrapper as it is slightly more secure. Then enable tcp wrapper security by creating hosts.allow and hosts.deny as follows:
|
# su # echo "ALL:ALL" > /etc/hosts.deny # echo "in.telnetd: 192.168.129., 192.168.1." >> /etc/hosts.allow |
Add any IP range you want to give access to in addition to the above.
A command line ftp client is already installed, however, there are much nicer ftp clients such as ncftp [ncftp_3.1.5-1_arm.ipk] and lftp [lftp_2.6.7-1_arm.ipk]. Alternatively, there are also GUI based ftp clients such as opie-ftp [opieftp_0.9.1-20020702_arm.ipk] and jftp [jftp_0.23.1_arm.ipk].
If you want to serve as a ftp server then you need to install utftp [utftpd_0.2.4_arm.ipk] or troll-ftpd [troll-ftpd_1.28-cg2_arm.ipk]. Alternatively, you can ftp to port 4242 on the Zaurus which is a very basic ftp service.
Alternatively, you can also enable the ftp daemon within inetd. To do that, uncomment the ftp entry in /etc/inetd.conf and restart inetd.
|
Make sure you use tcp wrapper as it is slightly more secure. Then enable tcp wrapper security by creating hosts.allow and hosts.deny as follows:
|
# su # echo "ALL:ALL" > /etc/hosts.deny # echo "in.ftpd: 192.168.129., 192.168.1." >> /etc/hosts.allow |
Add any IP range you want to give access to in addition to the above.
There is a few things that need to be done before you can install Apache:
|
# su # mkdir -p /hdd2/ramfs/www # ln -sf /hdd2/ramfs /mnt/ramfs # ln -s /hdd2/ramfs/www /usr/local/apache |
Now we are ready to install apache [apache-1.3.27-php-4.2.3_0.1_arm.ipk]
When apache is installed you need to do the following:
|
# su # ln -s /usr/local/apache/bin /usr/local/apache/src |
(you can also fix apachectl to look at the right place instead of creating a link)
You can now start apache with the following command:
|
# su # cd /usr/local/apache/bin # ./apachectl start |
You can stop apache with the following command:
|
# su # cd /usr/local/apache/bin # ./apachectl stop |
I have also created a opie-sh script [apachegui_0.1_arm.ipk] which allows you to stop and start apache from the GUI. You will be required to configure sudo and add /usr/bin/apache to the allowed list for zaurus user (see sudo).
Alternatively, you can also install boa [boa_0.94.12_arm.ipk] which is a light-weight http daemon if you just want simple web server.
There are several browsers available such as NetFront, Opera, Konqueror, Firefox, Minimo, Dillo, Links, ...
keypepple [opie-keypebble_1.0.0-1_arm.ipk] can be used as a vnc client to other machines or even the local one.
fbvnc server for Qtopia
You can run a vncserver on your Zaurus to enable remote access to its desktop. However, since the available fbvnc server packages were build for other models, it does not work reliably on the C3000 and C3100.
I have build my own version of fbvncserver [fbvncserver-c3000_0.9.4-0.3_arm.ipk] which allows me to view the Zaurus desktop remotely using a vnc client such as tightvnc or using a web browser to connect to port 5800 on the Zaurus.
I also managed to get the mouse pointer working through the vnc server as well as the keyboard. However, some keys are still wrongly mapped. If you just want a read only vnc server without remote mouse and keyboard entry, then do the following to disable them:
|
# su # rm /etc/rc.d/init.d/fbvncinput # reboot |
Alternatively, you could also just restart Qtopia instead of rebooting the Zaurus. To do that instead do the following:
|
# su # /usr/local/bin/fbvncinput stop # killall qpe |
If you want to re-enable the keyboard and mouse, then just recreate the the symbolic link to fbvncinput and reboot your Zaurus:
|
# su # ln -s /usr/local/bin/fbvncinput /etc/rc.d/init.d/fbvncinput # reboot |
Alternatively, you could also just restart Qtopia instead of rebooting the Zaurus. To do that instead do the following:
|
# su # /usr/local/bin/fbvncinput start # killall qpe |
Vncserver for Debian
Vncserver is part of the Debian PocketWorkstation bundle and is intended as a loopback service to connect to the Debian instance locally. However, there is nothing preventing it from being accessed remotely as well. Vncserver listens on port 5901 and can be easily accessed through keypebble and/or tightvnc [tightvnc-1.2.9_javabin.zip]. tightvnc is a java application and can be installed on any machine that runs java. It can also be installed under a webserver such as Apache. Simply make a directory such as vnc under the document root and copy index.html and VncViewer.jar into there.
|
# mkdir -p /mnt/ramfs/www/htdocs/vnc # cp index.html /mnt/ramfs/www/htdocs/vnc # cp VncViewer.jar /mnt/ramfs/www/htdocs/vnc |
Then just point your browser at it: http://zaurus/vnc
Install the following packages:
To mount a drive type:
| # smbmount //hostname/share /mnt/smb -o username=user |
To unmount type
| # umount /mnt/smb |
Or use the smbmounter GUI interface. Make sure you give it root access (see Run as root section). The NETBIOS name needs to be an IP address or if you provide a hostname, make sure in your /etc/hosts file on your Zaurus you have given the hostname an alias in all uppercase letters. For example if you have a hostname mylaptop mapped to an IP of 192.168.1.10 then you will need the following entry:
|
192.168.1.10 mylaptop MYLAPTOP |
Once you have created an entry with a valid share name and username/password, then you can mount and unmount the share by clicking on the appropriate buttons. If the share is valid and your username/password is correct, then the smb share will be mounted under /hdd3/Documents/NetworkFolders/hostname/sharename
To mount a drive type:
| # mount /dev/sda1 /mnt/usbstorage |
To unmount type:
| # umount /mnt/usbstorage |
You can also create the following simple script to automatically mount USB drives or use the more advanced usb-storage that I've written. Here is the simple version:
|
Hint: Once a USB disk is mounted, it will appear in the Files tab as well. In addition, creating a link to the mounted drive from /home/samba will allow it to be shared as well through Samba. In general, most devices such as memory sticks, cameras, mp3 players and usb harddrives have their disk partitioned as a primary partition and can be found at /dev/sda1. However, if you have partitioned your disk as an extended partition, then it most likely would be /dev/sda5. Do a fdisk -l /dev/sda as root to check and change the above accordingly.
In addition, if you are using a USB Hub, then you will be able to attach and mount multiple devices, usually up to four disks. In such a case, the devices will be /dev/sda, /dev/sdb, /dev/sdc and /dev/sdd. I have created a more advanced script which can automatically mount up to four usb disks and also automount disks partitioned as primary or extended partitions. Place this usb-storage into /etc/hotplug/usb and remove usb-storage.off if there already is one (it will generate a new one). The script will also create mount points under /mnt and update /etc/fstab as required. Alternatively, you can simply install [automounter-c3000_0.5.0_arm.ipk].
In addition to external harddisk enclosures with USB interfaces and memory sticks, most MP3 players, cameras and some mobile phones also have an internal storage that can be mounted on the Zaurus if they have a USB interface. Most of those devices will be recognised by the Zaurus as a Mass Storage device by default, however, some newer devices are not on the Zaurus' device list and you will need to update it to let the Zaurus know about the new device (see SonyEricsson section for an example).
The automounter script only automatically mounts the first mountable partition. If you have multiple partitions, then you will need to manually mount the remaining partitions or modify the automounter script to also mount the remaining partitions.
The C3000 and C3100 can also read NTFS formatted USB disks. You will need to copy ntfs.o to /lib/modules/2.4.20/kernel/fs/ntfsfs/ or install [ntfs-zaurus_2.4.20_arm.ipk].
A useful applet that I wrote [qtopia-usbapplet_1.0.3_arm.ipk] can be used to unmount the USB disks prior to unplugging them without needing to go to the command line.
The SD and CF cards are automatically mounted when they are inserted. In addition to mounting and unmounting them, additional hooks and controls can be added to the scripts such as invoking /etc/rc.d/init.d/mntloop (automounter) to check for the presence of a swapfile and enabling it when the card is mounted and disabling it when the card is unmounted. The SD card is auto mounted by the /etc/sdcard/sd_mem_ctrl script and this is where the control hooks need to be added. The CF card is auto mounted by /etc/pcmcia/ide.
Furthermore, by default, the SD card script only attempts to mount the first partition. If you have multiple partitions, then you need to enhance the above mentioned script to automatically mount additional partitions on the CF or SD cards.
Some partitions/file systems such as / cannot be unmounted. Some are also mounted as read-only. In order to modify the files on those file systems, you need to remount them as read/write and then remount them back to read-only after you have done what you wanted.
To remount as read/write:
| # mount -o rw,remount / |
To remount as read only:
| # mount -o ro,remount / |
The following demonstrates how to configure a 128MB swap file on the C3000's harddisk. Normally a swap file is not required unless you are running many X/Qt applications and doing onboard development. Most users with X/Qt will probably only require 32MB - 64MB swapfile.
|
# su # dd if=/dev/zero of=/hdd3/swapfile bs=1048576 count=128 # mkswap /hdd3/swapfile # swapon /hdd3/swapfile # echo "/hdd3/swapfile swap defaults 0 0" >> /etc/fstab |
To enable swap:
|
# su # swapon /hdd3/swapfile |
To disable swap:
|
# su # swapoff /hdd3/swapfile |
To check swap status:
|
# cat /proc/swaps |
In addition, you can install [qtopia-memoryapplet_1.0.4_arm.ipk] which allows you to monitor both your physical memory as well as your swap. It even can manage the swapfile creation for you. This version can create a swapfile with a max. of 512MB. It also gives you the option to create the swap on the internal HDD (/hdd3), CF card and SD card. The created swap file is also called swapfile rather than .swapfile.
By default /tmp is mounted from /dev/shm as a 1MB tmpfs. This 1MB is taken from the 64MB of RAM and for most applications, 1MB of tmp is sufficient. However, some applications such as kismet or qpdf2 may require a bit more than just 1MB. Opening some large pdf files for example might be very slow or does not work at all because there is insufficient space in /tmp. Some applications can utilise /home/root/tmp instead, but not all can.
You can increase the amount of memory allocated to /tmp. But remember that memory for /tmp is taken from RAM, so increasing /tmp will decrease the amount of physical available RAM.
To do that, you need to edit /etc/fstab and /root/etc/rc.d/rc.rofilesys and replace 1m with for example 2m to increase the size of /tmp to 2MB. Remember to remount / to rw before editing rc.rofilesys and remount it back to ro once done. Finally, you need to reboot the Zaurus in order for the change to take effect.
You can use a loopback filesystem which is a mounted filesystem image to do various things such as compressing files or overlaying a filesystem with another format.
The cram filesystem is a read only compressed filesystem format. The following demonstrates how to configure cramfs to preserve some space. Only convert directories to cramfs if you are sure those directories are read-only, ie you are never going to change or add any files there. You will need either [cramfs-1.1_arm.bin.tar.gz] or [mkcramfs.tar.gz], or install gcc which also includes it. Here is an example for compressing and mounting the jre directory:
|
# su # mkcramfs /usr/lib/jdk1.3 /hdd3/jre13.cramfs # rm -r /usr/lib/jdk1.3/* # mount -t cramfs -o loop /hdd3/jre13.cramfs /usr/lib/jdk1.3 |
So far I have crammed the following:
Note that mkcramfs stores the whole image in memory before writing it to disk, so make sure you have a sufficiently sized swap file enabled before running mkcramfs.
Also, there are only 2 loop devices by default on the C3000 and C3100, but you can create more loop devices. You will need to recreate them each time you reboot, so it would be better to automate it in a start script which you can use to automatically mount the cram archives as well. Here is how you create /dev/loop2 to /dev/loop6
|
# for i in 2 3 4 5 6 > do > mknod /dev/loop$i b 7 $i > done |
You might also want to add an entry into fstab so the cramfs archives can be automatically mounted. Copy mntloop to /etc/rc.d/init.d and link it to rc5.d and rc6.d
|
# su # cp /home/zaurus/Documents/custom/mntloop /etc/rc.d/init.d # ln -s /etc/rc.d/init.d/mntloop /etc/rc.d/rc5.d/S50mnt # ln -s /etc/rc.d/init.d/mntloop /etc/rc.d/rc6.d/K50mnt # echo "/hdd3/jre13.cramfs /usr/lib/jdk1.3 cramfs loop,ro 0 0" >> /etc/fstab |
mntloop will create new loop devices and check /etc/fstab at bootup time and mount any valid entry for cramfs it finds. The Linux boot process will mount entries in /etc/fstab by default, but it can only mount 2 loop partitions because there are only that many default loop devices, so any additional entries in /etc/fstab will fail to mount. mntloop will mount any additional entries it finds after creating the extra loop devices. At system shutdown or reboot, it will cleanup and unmount anything mounted as a loop device.
The automounter package [automounter-c3000_0.5.0_arm.ipk] will install mntloop and also install the usb automounter.
Similar to the cram filesystem is the squash filesystem which is appendable, ie you can add files to it. In order to use the squash filesystem, you will need to install the squashfs module [kern-mod-squashfs_c3000-2.1-2_arm.ipk].
Alternatively, if you don't need a compressed filesystem but want a read and write access instead, then you can create an ext2 or ext3 formatted loopback filesystem. You would need to pre-allocate a chunk of space for it and the files won't be compressed at all.
For example, to create a 128MB loopback filesystem on /hdd3 called expansion.ext2 do the following:
|
# su # dd if=/dev/zero of=/hdd3/expansion.ext2 bs=1MB count=128 # echo y|/sbin/mke2fs /hdd3/expansion.ext2 # mkdir -p /home/expansion # mount -o loop -t ext2 /hdd3/expansion.ext2 /home/expansion # echo "/hdd3/expansion.ext2 /home/expansion ext2 loop,rw,noatime 0 0" >> /etc/fstab |
Alternatively, if you rather create an ext3 filesystem instead of an ext2, do the following:
|
# su # dd if=/dev/zero of=/hdd3/expansion.ext3 bs=1MB count=128 # echo y|/sbin/mke2fs -j /hdd3/expansion.ext3 # mkdir -p /home/expansion # mount -o loop -t ext3 /hdd3/expansion.ext3 /home/expansion # echo "/hdd3/expansion.ext3 /home/expansion ext3 loop,rw,noatime 0 0" >> /etc/fstab |
Now you could move all the files from /usr/local to the newly mounted loopback filesystem and then relink /usr/local to the loopback filesystem. This way, we moved some files off to hdd3 and extended the /usr/local directory to have a higher limit of 128MB. Similarly you could do something similar with /opt/QtPalmtop/share and many other directories as well. However, doing this will impact on performance a little bit. The overhead caused by the loopback filesystem and the speed of the MicroDrive are factors to consider and thus, choose files and directory that are not frequently used to be moved to the loopback filesystem.
On C3000:
|
# mkdir -p /home/expansion/usr/local # cd /usr/local # tar cvf - * | tar xvf - -C /home/expansion/usr/local # mv /hdd2/usr/local /hdd2/usr/local.bak # ln -s /home/expansion/usr/local /hdd2/usr/local |
Once you have tested that everything still works, you can remove /hdd2/usr/local.bak
On C3100:
|
# mkdir -p /home/expansion/usr/local # cd /usr/local # tar cvf - * | tar xvf - -C /home/expansion/usr/local # mv /home/root/usr/local /home/root/usr/local.bak # ln -s /home/expansion/usr/local /home/root/usr/local |
Once you have tested that everything still works, you can remove /home/root/usr/local.bak
Make sure you install the automounter package [automounter-c3000_0.5.0_arm.ipk] or else your loopback filesystem might not get automatically mounted after a reboot.
Alternatively, instead of moving files manually after they have been installed, you can also just install files to the loopback filesystem directly. The default installer won't let you do it, but my xipk install script (which is part of my ipktools package) does allow it.
By default xipk installs to /hdd3/programs, so you should mount your loopback filesystem as /hdd3/programs or change /etc/xipk.conf to contain the mount point of your loopback filesystem. Then you can do the following to install applications to hdd3:
|
# xipk ipkfile |
The default SD/MMC driver only supports SD and MMC cards of sizes up to 1GB. Using the updated driver which is taken from the C3200, it is possible to use larger SD cards. 2GB and 4GB SD cards are recognised and can be used once this updated driver is installed.
However, some applications have 1GB or 2GB (upper limit for FAT16 partitions and maximum filesize on FAT16) hardcoded as the upper limit and thus will miscalculate the amount of free space on the larger SD card. Also, this driver is not loaded during emergency boot or the NAND loader so you cannot use the larger SD card to flash your Zaurus or do NAND backup/restore.
Also, for 4GB SD cards, be very careful when ejecting the card. If you eject it while it is still mounted or while it is being written to, then you might corrupt the integrity of the device and might not be able to use it anymore. Since it is larger, it needs more time to flush the buffers and thus this problem occurs less on smaller SD cards. If this occurs, however, even a fdisk or reformatting of the SD card won't work (the smaller SD cards can be reformatted in some digital cameras but not many cameras can recognise the larger SD cards either so you cannot use them to reformat a broken SD card). To prevent this from happening in which case you need to claim a warranty replacement