Cyber memos for my personal knowledge.

2008-12-23

Additional packages for compiling kernel on Ubuntu 8.04.1

I apt-get installed follows:

build-essential libtool makedepend libncurses5-dev linux-kernel-devel libcunit1-ncurses-dev

Of course this is for make menuconfig.

I also found some pages but I never tried their way:
http://ubuntuforums.org/showthread.php?t=56835
https://help.ubuntu.com/community/Kernel/Compile
http://www.howtoforge.com/kernel_compilation_ubuntu

This is not my first time to compile Linux kernel.
But on Ubuntu...hmm, yes it is...囧rz

Actually I like Redhat/Fedora, Mandrake more........= =|||

2008-12-19

Compiling SiS X driver on Ubuntu 8.10

In order to compile the X driver for SiS chip, I have to apt-get install following packages additionally:

build-essential
libtool
makedepend
libgl1-mesa-dev
x11proto-*
xserver-xorg-dev
libdrm-dev

Then, of course, ./configure; make.
Cd to ./src/.libs/, you can see your sis_drv.so...;-D

Now I just try to port this version to support another chip...Orz

(You want the source code for SiS X driver...hmm...I think it is not a difficult task to you, right?)

RealPlayer 11 on Linux

I try to install RealPlayer 11 on my DELL Vostro 1310 with Mandriva 2008.1, kernel 2.6.24.7-desktop. All things are fine. why this player? Hmm......somtimes I feel the .RM files are really pains in my ass and I don't have time to search for other codec or player for it. So..you know that...;-)

Download RealPlayer here. You can choose .BIN format (personally recommand) or even RPM/DEB package if you want.

Just cd to where you put the file and issue commands with root permission:
(optional step) $ chmod a+x RealPlayer11GOLD.bin
$ ./RealPlayer11GOLD.bin

Follow on-screen instruction to answer some questions. Use the default installation path is ok on my system (/opt/Real/RealPlayer).

Note that the RealPlayer is not able to start with zh_* locales so that I have worte a simple script to change my $LANGUAGE dynamically to en_US.UTF-8 (or en_US*) to launch it...;-)

Install NV driver under Ubuntu 8.10

I have also tested Ubuntu 8.10 with kernel 2.6.27-7-generic.
Basically all steps are almost the same as 8.04.1 but only this one:

For step 2, only you have to do within Ubuntu 8.10 is "S30gdm".

I use nVidia 180.11 Beta Linux X driver.
Currently official release is 177.82.

2008-12-11

DLink DI-604 and DIR-605

Two DLink broadband network IP switchies in the same place, 1st is DI-604 and second one is DIR-605:

1. Use DI-604 to connect to internet via xDSL/Cable, and connect DIR-605 "WAN port" to DI-604 LAN port. Disable DIR-605 NAT function. Just treat it as a regular "wireless" hub/switch. This is not a good idea but only workable solution...Orz...And, in this case you can NOT use MAC filter to lock up some MAC addresses you want, because the NAT of DIR-605 is disabled........

2. Use DI-604 to connect to internet via xDSL/Cable, and connect DIR-605 "LAN port" to DI-604 LAN port. Disable DIR-605 DHCP server function only and change DIR-605's IP to differ from DI-604. This is more easier and you may use MAC filter function on DIR-605!...;-)

Check it out here.

2008-12-08

Install NV driver under Ubuntu 8.04.1

The process is very similar to install it under Mandriva 2008.1.

1. Prepare driver; install "build-essential" package.
2. Use root permission to rename 2 file under /etc/rc2.d:
-a.) S20nvidia-kernel (I rename it to __S20nvidia-kernel)
-b.) S30gdm (I rename it to __S30gdm)
3. Reboot and use root permission to change to your driver's dir and run:
root# sh NVIDIA-xxxxxxx.run
4. No not use nvidia-xconfig, just manually edit /etc/X11/xorg.conf. (refer to Mandriva's process).
5. Use root permission to rename back the files /etc/rc2.d/__S20nvidia-kernel and /etc/rc2.d/__S30gdm to their original file name.
6. Reboot it and enjoy it...;-)

Install NV driver under Mandriva 2008.1

You need to download NV driver for Linux. Go to here.
Note that you should always refer to file "latest.txt" for latest released driver.
This is for 32bit system.

Setup your Mandriva 2008.1 box with a workable network.
Then you have to install additional packages for building NV driver.
I suggest that you use the Mandriva Software Manager to intall those additional packages because it will automatically select all related packages for you.

1. gcc;
2. binutils;
3. automake;
4. make;
5. makedepend;
6. gcc-c++;
7. kernel devel package according to your kernel version (uname -r);

After all done, use root permission to edit /etc/inittab.
Replace run level index from 5 to 3. Reboot.

Login and su to root, change dir to the driver package's directory.
Then issue command:
root# sh NVIDIA-xxxxxxxxx.run

Follow instructions on screen.
If you are asked to download pre-compiled interface from NV FTP site just say "NO".

If you are asked to run "nvidia-xconfig" to modify xorg.conf just say "NO".
We will do it later (for safety reason..).

After driver building finished, you should issue a reboot.
Login again and use root permission to edit /etc/inittab and switch run level index back to 5. Save it.
Use root permission to edit /etc/X11/xorg.conf, within section "Device" ="Configured video device" and add a line (or edit it):
Driver "nvidia"

Save it and reboot.
Now you should see the NV driver load up and will show you a logo screen of the NV driver...;-)

2008-11-06

Load up a customized DSDT on Ubuntu 8.04.1

I got some pains in my original DSDT so that I decide to load up a customized version of DSDT.aml.
Here is what I have to do in my Ubuntu box.

1. Backup vmlinuz and initrd images under /boot (use root permission to keep owner/group):
$ sudo cp /boot/vmlinuz-$(uname -r) ~/vmlinuz-$(uname -r)
$ sudo cp /boot/initrd.img-$(uname -r) ~/initrd.img-$(uname -r)

2. Copy your DSDT.aml to proper dir and reconfigure your initrd image (case-sensitive):
$ sudo cp DSDT.aml /etc/initramfs-tools/DSDT.aml
$ sudo dpkg-reconfigure linux-image-$(uname -r)

3. Edit GRUB boot menu (depands on your demand, optional):
$ sudo vim /boot/grub/menu.lst
- Find out the booting kernel you want, and append a parameter "acpi=force" after the line starting with kernel.

4. Save it and reboot. Use "dmesg |more" to check if there is any error happened for new DSDT.

2008-10-21

Sierra Wireless USB modem (GSM/UMTS) setup in Ubuntu 8.04.1

I am now tried to verify two 3G modules to my recent project. That is the Sierra mini card module which was attached on USB interface. Such as:


In Ubuntu w/ kernel 2.6.24-19-generic I can compile and install new driver v1.3.1b without any problem. I have tried 2 different modules MC8775 and MC8790, both of them work very good.

There are some points you may interested in it:
1. After driver installed, you can use command "modinfo sierra" to check version and it should be v1.3.1b.
2. By default, Sierra driver uses pppd to connect. And use /dev/ttyUSB* to communicate with device. If you received an error such as modem initialization failed or connect script failed, you can try to modify the string "/dev/ttyUSB0" (this is default value) in your /etc/ppp/peers/gsm script (this is default Sierra provided script path of pppd). Just try to use another ttyUSB[1..n] which you can use command "ls /dev/ttyUSB*" to know how many ttyUSB you can try.

3. If you can dial out successfully and get IP configuration but you can not surf on internet with browsers, just try to cp /etc/ppp/resolv.conf to /etc/resolv.conf.

BTW, if you use the 3G device from Acer Peripherals Inc. (now BENQ Corp.), you don't need additonal kernel driver module but only usbserial.ko. First use lsusb to check the VID:PID. In my case that is 04a5:0468, so I issue command to load up kernel driver module for this device: sudo modprobe -v usbserial product=0x0468 vendor=0x04a5. Second, you just need to wait for few "seconds" for driver to take effect and create proper device nodes for you (/dev/ttyUSB[0~2]). Then you can use pppd to dial out just like the way you do on Sierra devices. Note that this 3G module's communication port is /dev/ttyUSB1 for pppd.

2008-10-20

How to uninstall Trend Micro OfficeScan client w/o IT password


Sometimes I want to re-install Trend Micro OfficeScan client from my office PC.
But due to my IT dept.'s rule it requires a password to uninstall the client.

How can we do to "drive-around" it? ;-)

Basically, we can use a little bit trick to do so.

Use "services.msc" command to open the service list. And then find out all "OfficeScanNT*" services and STOP them. You can see the Trend Micro OfficeScan icon in the system tray will disappear.

Open your registry editor and find out HKEY_LOCAL_MACHINE\System\Current Control Set\Services, and look for following subkeys:
Ntrtscan
Tmfilter
Tmlisten
TmPreFilter
TmProxy
tmtdi
VSApiNt
TM_CFW (if you have this one)

Delete above subkeys (CAUTION! BE CAREFUL WITH THIS OPERATION!).

Find out the registry key HKEY_LOCAL_MACHINE\Software\TrendMicro, and look for following subkeys:
OfcWatchDog
NSC
Pc-cillinNTCorp
OfficeScanCorp (if you have this one)
RemoteAgent (if you have this one)

Delete above subkeys (CAUTION! BE CAREFUL WITH THIS OPERATION!).

Find out HKEY_LOCAL_MACHINE\Software\MicroSoft\WINDOWS\Current Version\Run, and look up the value: OfficScanNT Monitor,

Delete above value (CAUTION! BE CAREFUL WITH THIS OPERATION!).

Delete the entry in your "Start" -> "Programs" -> "Trend Micro OfficeScan xxx", and then issue a system reboot. After reboot delete C:\Program Files\Trend Micro\OfficeScan Client or C:\OfficeScanNT, Then also you can delete the file C:\tmuninst.ini if you have it.

Ok, now you are ready to re-install your virus scaning application ;-)

2008-10-11

Mandriva 2009.0 just released

In the early today, I just received a system notice about Mandriva 2009.0 just released (..OK, I forgot to shut it down...Orz). The major updates were: kernel 2.6.27, X.org 4.3, KDE 4.1.2 (and 3.5.10 in /contrib), Gnome 2.24, FireFox 3, and OpenOffice.org 3.

Basically, I plan to stay in my 2008.1 w/ 2.6.24 kernel for a while. Because I know the new release should be in a "POST-BETA" stage but not a very stable one. My 2008.1 just works fine with my DELL Vostro 1310 and I don't want to screw it up because I really don't have time to fix any issues that caused by the new 2009.0 release...;-)

I plan to update my system maybe 1 or 2 months later.

For details and the errata (this is very important in my opinion..) of Mandriva 2009.0, you can refer to here.

2008-10-04

Mandriva One Spring 2008.1 bugs

My DELL Vostro 1310 was installed the Mandriva One Spring 2008.1.
I don't need to install extra drivers for my unit because Mandriva Linux is a very good distro for hw supporting. And also it is very easy to use for everyone including experts and newbies.

Unfortunately, I still got some bugs with my box.

1. System memory was found only up to 884 MB (it should be 2 GB in my box).
2. Intel wifi card 4965AGN got response timeout issues that sometimes can not access to the AP.

For 1, this is a kernel issue so that I switch my default kernel build from kernel-desktop586 to kernel-desktop. You can use $ uname -r to make sure your kernel build currently on your system. And this issue was fixed by this kernel build switching. Based on the official errata, you need to also install some kernel driver modules in order to let the switching more stabler if you have those drivers for kernel-desktop586 arch.

For 2, just add a line into /etc/modprobe.conf:

options iwl4965 disable_hw_scan=1

Official errata you can refer to here.

2008-10-01

Confusing hard disk device in Debian 4.0 R4a - continued

My Debian 4.0 R4a box has another problem that, after installation of the system the resume device was changed!! Normally it was the swap file system, and it will be defined during the installation process and wrote into initramfs (/boot/initrd-img-xxx).

I think the installer of Etchnhalf is really buggy!
He recognized my hdd and odd as:
/dev/hde -> hdd
/dev/hde1 -> 1st partition, boot
/dev/hde2 -> logical
/dev/hde5 -> swap
/dev/hdg -> odd

And he wrote it into /boot/grub/menu.lst for kernel boot parameter as root=/dev/hde1. Of course the resume device in initrd-img will be /dev/hde5, the swap.

OK, now I complete installation process and reboot my Debian 4.0 R4a box. Guess what!?

I can not boot into system because the stupid installer makes a WRONG device recognation!...:-(
And now the boot device and root file system can not be found and mounted........

The actual device map of my box should be:
/dev/hdc -> hdd
/dev/hdc1 -> 1st partition, boot
/dev/hdc2 -> logical
/dev/hdc5 -> swap
/dev/hde -> odd

Now, I need to modify my /boot/grub/menu.lst and /etc/fstab to correct this stupid problem which was caused by Debian installer.
And I need to issue command $ dpkg-reconfigure uswsusp to re-generate the /boot/initrd-img-xxx........:-(

Confusing hard disk device in Debian 4.0 R4a

This is weird..= =|||

I have installed Etchnhalf many times but the HDD device file changed every time?!
Maybe this time it is /dev/hdc in istallation process, but it will be changed to /dev/sda after installation done.
Then I hit Ctrl+Alt+Del to reboot, it may be changed back to /dev/hdc or more worse /dev/hda..
I think this is related to kernel driver of ide-generic and SATA.
Maybe they are fighting to each other for controling my IDE channel...:-(

And one more weird thing is that the kernel parameter "quiet".
Basically, there will be a parameter "quiet" added in the end of kernel boot command line in modern Linux distro.
I don't like this parameter because I totally can not monitor my Linux box if it displayed some error message when booting up.

In this case I shut "the quiet" down so that I can:
1. To see error messages of the HDD device file changed.
2. To fix the ide port error when GRUB wants to load kernel up (Fucking weird! WHY??????).
Why this error is related to kernel boot parameter "quiet"??????

2008-09-23

Debian 4.0 R4a + JMB38x can not find out my MSP cards

In my Debian system (Debain 4.0 R4a w/ kernel 2.6.24-etchnhalf.1-686), I have a JMicron multimedia card reader (JMB38x which supports MMC/xD/MS). After I installed JMircon's driver I found my Debian can not auto detect the MSP cards but xD cards are OK.

The first point I checked is my udev process. I think the hotplug function is abnormal for MSP cards. Therefore I modify the following 2 file under /etc/udev: hotplug.rules and permissions.rules.

For /etc/udev/hotplug.rules just modify it as following pic w/ root permission:


For /etc/udev/permissions.rules also modify it as following pic w/ root permission:


Save them and reboot machine, now I can see my MSP cards in my system as /dev/mspblk0 and /dev/mspblk0p1 device files because the mspro_block module was successfully load-up by udev.

Of course, I need to mount it manully to access MSP cards such as $ sudo mount -t auto -o rw /dev/mspblk0p1 /media/tmpdisk.
That is OK for me 'cause I don't need auto-mount. ;-)

2008-09-15

Looking for FLV player? Check this out


Basically, there are so many flv players in the world.
I would like to recommand the following one: Wimpy Desktop FLV Player.

Why this one? Because of:
1. It is free.
2. The flv video screen size can be adjusted.

http://www.wimpyplayer.com/products/wimpy_standalone_flv_player.html

You can directly drag and drog a file to player to play. Or you can click the folder icon to open a file in your computer (flv, swf...etc). Click on the earth icon can let you connect to a file to play which was located in somewhere on this planet!

2008-09-12

Usplash sometimes caused a black screen

My Ubuntu is 8.04.1 box with kernel 2.6.24-19-lpia.
After Usplash screen sometimes I got a black screen and I can not do anything but poweroff..
This happened in MP units with Intel Poulsbo platform but not found in PVT units..it's strange!
The fail rate in production line is around 50%.

I delete the kernel parameter "splash" and everything goes fine.
End user will see the very ugly verbose text and maybe they will feel nervious with it.
But anyway, they can use this box....

I think this bug also related to Poulsbo gfx driver in Linux and X.
I have tried a patch on launchpad but doesn't worked for me.
https://bugs.launchpad.net/ubuntu/+source/usplash/+bug/81474

2008-09-07

RHAS4+PXE+DRBL+CloneZilla setup

This is a memo of my experience to setup a DRBL+CloneZilla server.
I use offline intallation method.

(A). Base OS and DRBL installation
Linux server installation (RHAS4 for example):
1. Use default installation. DISABLE SELINUX and firewall (iptable).
2. If necessary, use REISERFS, otherwise use EXT2/EXT3.
3. Don’t install office, multimedia, game, video/sound…etc.
4. Manually install some missing RPMs: perl-Digest-SHA1, dhcp, ypserv, tftp-server for RHAS4 (with root permission).

$ rpm –ivh perl-Digest-SHA1-xxx.rpm
$ rpm –ivh dhcp-xxx.rpm
$ rpm –ivh tftp-server-xxx.rpm
$ rpm –ivh ypserv-xxx-rpm

5. Setup network interface eth0:1 if necessary (IP alias if your only have 1 NIC).
Modify /etc/sysconfig/network-scripts/ifcfg-eth0:1.
Reference site: http://drbl.nchc.org.tw/one4all/desktop/ip_alias.txt
6. Setup HDD DMA=1 if necessary. (/etc/sysconfig/harddisks).

Download and make new kernel RPM:
1. Make new kernel RPM to built-in support (not module) ide-generic in our case and some NIC drivers.
2. Reference site: http://www.howtoforge.com/kernel_compilation_fedora

Download and install DRBL related RPMs (use root permission):
1. Download DRBL GPG key: http://drbl.nchc.org.tw/GPG-KEY-DRBL
2. $ rpm --import GPG-KET-DRBL
3. Download DRBL main RPM:
http://drbl.nchc.org.tw/one4all/desktop/download/stable/RPMS/drbl-current.i386.rpm
4. $ rpm –ivh drbl-current.i386.rpm
5. Download extra DRBL RPMs:
http://drbl.sourceforge.net/drbl-core/i386/RPMS.drbl-stable/
6. $ rpm –ivh xxx.rpm to install all extra RPMs (CloneZilla RPM should be the last one to install).
Before you perform next section, it is better to do a reboot.

(B). DRBL setup – OFFLINE mode (use root permission)
1. Type command: $ /opt/drbl/sbin/drblsrv-offline –k (kernel RPM) to use specified kernel RPM or $ /opt/drbl/sbin/drblsrv-offline –s `uname -r` to use same kernel as server used.
2. DRBL will check all necessary RPMs automatically. If need, press Ctrl+C to cancel DRBL setup process. Follow on-screen instruction to answer question.
3. Type command: $ /opt/drbl/sbin/drblpush –i to push settings to clients node. Follow on-screen instruction to answer question.
Reference site: http://drbl.nchc.org.tw/one4all/desktop/examples/
4. Type command: $ /opt/drbl/sbin/mknic-nbi –t initramfs –k (Kernel version that
client used)
to make initramfs boot image for clients.
5. Copy image "folder" to /home/partimag directory (default path). For example: /home/partimag/20080812-beta3-image

(C). Setup image restore option and PXE menu (use root permission):
Unicast restore:
1. Type command: $ /opt/drbl/sbin/drbl-ocs -b --nogui -s -x -r [-p command] [--run-postrun-dir] startdisk restore 20080812-beta3-image "hda"
-b: batch mode. No question aksed.
--nogui: without GUI during restore process.
-s: Don’t detect client HW.
-x: Try to enable full-duplex in UDPcast. (only work with switch, not hub.)
-r: Try to resize partition after restore process finished.
-p [reboot | poweroff | command]: Post-action after restore process finished.
--run-postrun-dir: Excute program or shell script under /opt/drbl/share/ocs/postrun after restore precess finished.
--run-prerun-dir: Excute program or shell script under /opt/drbl/share/ocs/prerun after restore precess finished.
[startdisk | startparts]: CloneZilla restoring mode.
[restore | multicast_restore | save]: CloneZilla restoring type.
20080812-beta3-image: Image "folder" under /home/partimag.
“hda”: device or partition in image to restore.

Multicast restore:
1. Type command: $ /opt/drbl/sbin/drbl-ocs -b --nogui –s -r [-p command]
--clients-to-wait 1 --time-to-wait 10 --max-time-to-wait 60 [--run-postrun-dir]
startdisk multicast_restore 20080812-beta3-image "hda"
-b: batch mode. No question aksed.
--nogui: without GUI during restore process.
-s: Don’t detect client HW.
-r: Try to resize partition after restore process finished.
-p [reboot | poweroff | command]: Post action after restore process finished.
--clients-to-wait NUM: Minimum numbers of client to wait before restore process starting.
--time-to-wait NUM: Minimum seconds to wait before restore process starting.
--max-time-to-wait NUM: Maximum seconds to wait before restore process starting (to avoid CloneZilla service time-out).
--run-postrun-dir: Excute program or shell script under /opt/drbl/share/ocs/postrun after restore precess finished.
--run-prerun-dir: Excute program or shell script under /opt/drbl/share/ocs/prerun after restore precess finished.
[startdisk | startparts]: CloneZilla restoring mode.
[restore | multicast_restore | save]: CloneZilla restoring type.
20080812-beta3-image: Image "folder" under /home/partimag.
“hda”: device or partition in image to restore.

Misc:
*** Open every shell script to read and study so that you can know every thing that DRBL+CloneZilla server does! ***

PXE boot menu is: /tftpboot/nbi_img/pxelinux.cfg/default
Postrun dir is: /opt/drbl/share/ocs/postrun
DRBL conf dir: /etc/drbl and /opt/drbl/conf
DRBL official site: http://drbl.nchc.org.tw/ or http://drbl.sourceforge.net/
FAQ: http://drbl.nchc.org.tw/faq/ or http://drbl.sourceforge.net/faq/

Ghost 11.5 little problem

Oops!
I found that using Ghost 11.5 -id to clone Linux system, partiton table may be modified in some special situations.

I got my Linux partiton table as follows:
/dev/sda1, boot flag, ID 83, Linux native
/dev/sda3, ID 82, Linux Swap

But after Ghost cloning it became to:
/dev/sda1, boot flag, ID 83, Linux native
/dev/sda2, ID 82, Linux Swap

It caused Linux can not enter S4 (hibernation) status because Linux doesn't know where is the swap file system!

I use a very stupid way to fix it: re-write MBR!
Since this problem was happened in factory production line and, any action to boot into OS to fix partition table is not allowed :-(

Simply prepare a small tool called "MBRUtilD.exe" to save / restore MBR section.
I use it to create a workable MBR w/ partiton table, and then use tftp (via PXE) to transfer to clients for restoring.

"MBRUtilD.exe /R=(MBR file name)" to restore MBR.
And option "/S=
(MBR file name)" to save MBR.
Just run it right after Ghost cloning.

It rocks of course! ;-)

2008-09-06

Use Ghost 11.5 to create / restore Linux file system image


Ghost is a very powerful tool to create / restore OS images.
But Ghost doesn't support GRUB boot loader in MBR (my experience with old Ghost) if your HDD got Linux file systems.
Usually you need to manually fix and re-install boot loader after you cloning a machine.

I just try Ghost 11.5 with option -id and this does support GRUB in MBR without any problems!
Really cool!

Option -id use sector-by-sector method to create image. So that you won't miss any data on your HDD including MBR, boot sector and so on.

I also recommend to use CloneZilla to create / restore Linux OS image. This is a great utility with open source license. Just check: http://www.clonezilla.org/