2009年10月16日 星期五

Tips for setup the android-x86 build system

Of course , you will find the [Android-x86 : Get Source] site useful..
On a newly install Debian Lenny machine, we may encounter the following situations:.

1. where is my "repo"?
Ans: the `repo' is not a Debian package, this [Android download] teach us how to download/setup the `repo' script.

2.  I want to built-in a module, how to do it ?
Ans: Take DM9601 network card as an example.
First copy my_defconfig under {android-x86}/kernel/arch/x86/configs/android-x86_defconfig, then
modify my_deconfig:
CONFIG_DM9601=y

Finally following the [customized kernel] to build android-x86:
#>make iso_img TARGET_PRODUCT=eeepc TARGET_KERNEL_CONFIG=my_defconfig

3. I want to use user account instead of root to build the source, how to do it without problem ?
Ans: During the build, there are 2 commands `e2fsck' `tune2fs' needs root privilege,
now let you user_account can also use them.
under the root:
#> link -s  /sbin/e2fsck  /usr/bin/e2fsck
#> link -s  /sbin/tune2fs  /usr/bin/tune2fs
#> visudo
let user `tom' to use these 2 commands
Cmnd_Alias FS=/sbin/tune2fs,\
       /sbin/e2fsck
tom     ALL=NOPASSWD: FS

4. During the build, compiler complain about the java , what happened?
Ans: This is probably caused by using the incorrect java compiler...
Please note that Android-1.6 can accept the java-6-sun as its compile environment, use
#>update-java-alternatives -s java-6-sun
to select the compiler environment provided by sun java.

That's all.Technorati 標籤: ,

2009年10月15日 星期四

The T.38 and open source

Abstracted from:

http://www.voxgratia.net/blog/archives/2005/08/fax_facts.html

1.T.38 should not be confused with the similar-sounding T.37 which uses a totally different approach. Whereas T.38 is intended for realtime fax transmision using an encapsulated T.30 data stream, T.37 is intended for "store and forward" applications. It requires the fax data to be converted into TIFF format and then encoded using base64 into a text message and then transmitted using SMTP.


2.T.38 solves most of the problems with sending fax over an IP network. A T.38 fax call uses 20% of the bandwidth than the modulated audio approach because it is now a stream of bits at an average speed of 14400 bps rather than a stream of audio samples at 64000 bps.


3. Asterisk supports T.38 fax pass-through, origination and termination. It does

not support gateway operation.


4.Asterisk 1.6 support G.711 and T.38 FAX origination and termination. T.38 gateway features are still in development.


5 more of T.38 open source informations:

http://www.voip-info.org/wiki/view/T.38


6.more of Asterisk T.38:

http://www.voip-info.org/tiki-index.php?page=Asterisk%20T.38


7.What is T38modem ?

  • It is not a modem.

  • From a FAX application's view point (e.g. HylaFAX) T38modem looks like a class 1 FAX modem pool.

  • From an IP network view point it's a H.323 endpoint with T.38 FAX support. Recent versions also support SIP.

  • From your view point it's a gateway between a fax application and an IP network.

8.Open source components:

  • t38modem : as the modem pool of Hylafax, t38modem serves as the T.38 gateway for the T.38 machine

  • asterisk : (Fax) machine with T.38 capability, currently, the T.38 gateway feature is under development

Technorati 標籤: ,

珍貴的 quirk check script

裝了新機器後,發現需要調校休眠的部份!
驚!平日所依賴的網站[HAL Sleep Quirks]不見了,在舊機器上找到了以前下載過的 script ,乾脆貼出來,以後可以用...

#!/bin/sh
##!/bin/sh
#
# SuspendQuirks, copyright Richard Hughes 2007
# created  : 29-07-2007
# modified : 29-07-2007

# updated: 2007-08-04 Thomas Perl <thp at perli.net>
# Added support for Debian distro, fix for xorg.conf commented-out drivers

supported_distro=""
unload_modules=""
quirks=""
arch="`uname -i`"

abort ()
{
    echo "CRITICAL ERROR: $1"
    exit 1
}

warn ()
{
    echo "WARNING: $1"
}

add_quirk ()
{
    quirks="$quirks\npm-suspend $1"
}

add_module ()
{
    if [ -z "$unload_modules" ]; then
        unload_modules="$1"
    else
        unload_modules="$1 $unload_modules"
    fi
}


echo -e "Checking your system...\n"

#find distro
if [ -e /etc/redhat-release ]; then
    supported_distro="redhat"
fi
if [ -e /etc/mandriva-release ]; then
    supported_distro="mandriva"
fi
if [ -e /etc/debian_version ]; then
        supported_distro="debian"
fi

#check distro
if [ -z "$supported_distro" ]; then
    abort "No supported distro"
fi

#check quirks are installed
if [ -z "`lshal | grep quirk`" ]; then
    warn "You have no quirks!"
    #IBM
    if [ "`hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.vendor`" = "IBM" ]; then
        add_quirk "--quirk-s3-bios --quirk-s3-mode"
    fi
    #LENOVO
    if [ "`hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.vendor`" = "LENOVO" ]; then
        add_quirk "--quirk-s3-bios --quirk-s3-mode"
    fi
    #Intel
    if [ -n "`cat /etc/X11/xorg.conf | grep intel`" ]; then
        add_quirk "--quirk-vbemode-restore"
        add_quirk "--quirk-vbe-post"
    fi
fi

#check kernel capabilities
if [ -n "`uname -r | grep 3194`" ]; then
    abort "Do not use the default Fedora 7 GOLD kernel. It's broken. Use a kernel from updates!"
fi
if [ -n "`uname -r | grep xen`" ]; then
    abort "Do not use a XEN kernel. It will not suspend!"
fi

#check kernel capabilities
if [ -z "`cat /sys/power/state | grep mem`" ]; then
    abort "Kernel does not support suspend!"
fi
if [ -z "`cat /sys/power/state | grep disk`" ]; then
    warn "Kernel does not support hibernate!"
fi

#check pm-utils is correct arch
if [ $arch = "i386" ]; then
    if [ -n "`rpm -q pm-utils | grep athlon`" ]; then
        abort "pm-utils is the wrong arch!"
    fi
fi

#check HAL has got the right value
if [ "hal-get-property --udi /org/freedesktop/Hal/devices/computer --key power_management.can_suspend" = "false" ]; then
    abort "HAL does not detect suspend!"
fi

#check for no consolekit in GNOME
if [ -n "`ps aux | grep gnome-session | grep -v grep`" ]; then
    if [ -z "`ps aux | grep console-kit-daemon | grep -v grep`" ];then
        abort "ConsoleKit is not running. Suggest 'chkconfig ConsoleKit on' and reboot"
    fi
fi

#check for nvidia binary graphics
if [ -n "`cat /etc/X11/xorg.conf | grep '^\s*[^#]*nvidia'`" ]; then
    abort "Using nvidia binary driver. This is not supported!"
fi

#check for ati binary graphics
if [ -n "`cat /etc/X11/xorg.conf | grep '^\s*[^#]*fglrx'`" ]; then
    abort "Using ATI binary driver. This is not supported!"
fi

#check for old intel graphics
if [ -n "`cat /etc/X11/xorg.conf | grep '^\s*[^#]*i810'`" ]; then
    abort "Using old 'i810' non-modesetting intel driver. Try using 'intel' driver!"
fi

#check for broadcom networking
if [ -n "`/sbin/lsmod | grep b44`" ]; then
    add_module "b44"
    warn "Using broadcom network driver."
fi

#check for ndiswrapper
if [ -n "`/sbin/lsmod | grep ndiswrapper`" ]; then
    add_module "ndiswrapper"
    warn "Using ndiswrapper network driver."
fi

#check for 915resolution
if [ -e /usr/bin/915resolution ]; then
    warn "Do not use 915resolution with the new intel driver!"
fi

#check for suspend
if [ -e /usr/bin/suspend ]; then
    abort "Do not use suspend2, it's unsupported!"
fi

#check for old intel networking
if [ -n "`ps aux | grep ipw3945 | grep -v grep`" ]; then
    abort "Use the mac80211 based iwl3945 driver instead. ipw3945d is closed source sometimes hangs on resume."
fi

#check for iwl3945
if [ -n "`/sbin/lsmod | grep iwl3945`" ]; then
    add_module "iwl3945"
    warn "iwl3945 is usually okay for suspend - but it might be worth trying unloading it."
fi

#check for kvm
if [ -n "`/sbin/lsmod | grep kvm`" ]; then
    add_module "kvm"
    warn "KVM will not suspend in kernels less than 2.6.23, but should work okay in later kernels."
fi
if [ -n "`/sbin/lsmod | grep kvm_intel`" ]; then
    add_module "kvm_intel"
fi
if [ -n "`/sbin/lsmod | grep kvm_athlon`" ]; then
    add_module "kvm_athlon"
fi

echo

if [ -z "$unload_modules" ] && [ -z "$quirks" ]; then
    echo "Suspend should work!"
else
    echo "Suggestions:"
    echo
    if [ -n "$unload_modules" ]; then
        echo -e "Add 'SUSPEND_MODULES=\"$unload_modules\"' to /etc/pm/config.d/unload_modules!\n"
    fi
    if [ -n "$quirks" ]; then
        echo -n "You might want to try the following pm-suspend entries:"
        echo -e $quirks
    fi
fi

echo

exit 0


# SuspendQuirks, copyright Richard Hughes 2007
# created  : 29-07-2007
# modified : 29-07-2007

# updated: 2007-08-04 Thomas Perl <thp at perli.net>
# Added support for Debian distro, fix for xorg.conf commented-out drivers

supported_distro=""
unload_modules=""
quirks=""
arch="`uname -i`"

abort ()
{
    echo "CRITICAL ERROR: $1"
    exit 1
}

warn ()
{
    echo "WARNING: $1"
}

add_quirk ()
{
    quirks="$quirks\npm-suspend $1"
}

add_module ()
{
    if [ -z "$unload_modules" ]; then
        unload_modules="$1"
    else
        unload_modules="$1 $unload_modules"
    fi
}


echo -e "Checking your system...\n"

#find distro
if [ -e /etc/redhat-release ]; then
    supported_distro="redhat"
fi
if [ -e /etc/mandriva-release ]; then
    supported_distro="mandriva"
fi
if [ -e /etc/debian_version ]; then
        supported_distro="debian"
fi

#check distro
if [ -z "$supported_distro" ]; then
    abort "No supported distro"
fi

#check quirks are installed
if [ -z "`lshal | grep quirk`" ]; then
    warn "You have no quirks!"
    #IBM
    if [ "`hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.vendor`" = "IBM" ]; then
        add_quirk "--quirk-s3-bios --quirk-s3-mode"
    fi
    #LENOVO
    if [ "`hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.vendor`" = "LENOVO" ]; then
        add_quirk "--quirk-s3-bios --quirk-s3-mode"
    fi
    #Intel
    if [ -n "`cat /etc/X11/xorg.conf | grep intel`" ]; then
        add_quirk "--quirk-vbemode-restore"
        add_quirk "--quirk-vbe-post"
    fi
fi

#check kernel capabilities
if [ -n "`uname -r | grep 3194`" ]; then
    abort "Do not use the default Fedora 7 GOLD kernel. It's broken. Use a kernel from updates!"
fi
if [ -n "`uname -r | grep xen`" ]; then
    abort "Do not use a XEN kernel. It will not suspend!"
fi

#check kernel capabilities
if [ -z "`cat /sys/power/state | grep mem`" ]; then
    abort "Kernel does not support suspend!"
fi
if [ -z "`cat /sys/power/state | grep disk`" ]; then
    warn "Kernel does not support hibernate!"
fi

#check pm-utils is correct arch
if [ $arch = "i386" ]; then
    if [ -n "`rpm -q pm-utils | grep athlon`" ]; then
        abort "pm-utils is the wrong arch!"
    fi
fi

#check HAL has got the right value
if [ "hal-get-property --udi /org/freedesktop/Hal/devices/computer --key power_management.can_suspend" = "false" ]; then
    abort "HAL does not detect suspend!"
fi

#check for no consolekit in GNOME
if [ -n "`ps aux | grep gnome-session | grep -v grep`" ]; then
    if [ -z "`ps aux | grep console-kit-daemon | grep -v grep`" ];then
        abort "ConsoleKit is not running. Suggest 'chkconfig ConsoleKit on' and reboot"
    fi
fi

#check for nvidia binary graphics
if [ -n "`cat /etc/X11/xorg.conf | grep '^\s*[^#]*nvidia'`" ]; then
    abort "Using nvidia binary driver. This is not supported!"
fi

#check for ati binary graphics
if [ -n "`cat /etc/X11/xorg.conf | grep '^\s*[^#]*fglrx'`" ]; then
    abort "Using ATI binary driver. This is not supported!"
fi

#check for old intel graphics
if [ -n "`cat /etc/X11/xorg.conf | grep '^\s*[^#]*i810'`" ]; then
    abort "Using old 'i810' non-modesetting intel driver. Try using 'intel' driver!"
fi

#check for broadcom networking
if [ -n "`/sbin/lsmod | grep b44`" ]; then
    add_module "b44"
    warn "Using broadcom network driver."
fi

#check for ndiswrapper
if [ -n "`/sbin/lsmod | grep ndiswrapper`" ]; then
    add_module "ndiswrapper"
    warn "Using ndiswrapper network driver."
fi

#check for 915resolution
if [ -e /usr/bin/915resolution ]; then
    warn "Do not use 915resolution with the new intel driver!"
fi

#check for suspend
if [ -e /usr/bin/suspend ]; then
    abort "Do not use suspend2, it's unsupported!"
fi

#check for old intel networking
if [ -n "`ps aux | grep ipw3945 | grep -v grep`" ]; then
    abort "Use the mac80211 based iwl3945 driver instead. ipw3945d is closed source sometimes hangs on resume."
fi

#check for iwl3945
if [ -n "`/sbin/lsmod | grep iwl3945`" ]; then
    add_module "iwl3945"
    warn "iwl3945 is usually okay for suspend - but it might be worth trying unloading it."
fi

#check for kvm
if [ -n "`/sbin/lsmod | grep kvm`" ]; then
    add_module "kvm"
    warn "KVM will not suspend in kernels less than 2.6.23, but should work okay in later kernels."
fi
if [ -n "`/sbin/lsmod | grep kvm_intel`" ]; then
    add_module "kvm_intel"
fi
if [ -n "`/sbin/lsmod | grep kvm_athlon`" ]; then
    add_module "kvm_athlon"
fi

echo

if [ -z "$unload_modules" ] && [ -z "$quirks" ]; then
    echo "Suspend should work!"
else
    echo "Suggestions:"
    echo
    if [ -n "$unload_modules" ]; then
        echo -e "Add 'SUSPEND_MODULES=\"$unload_modules\"' to /etc/pm/config.d/unload_modules!\n"
    fi
    if [ -n "$quirks" ]; then
        echo -n "You might want to try the following pm-suspend entries:"
        echo -e $quirks
    fi
fi

echo

exit 0

這是個都不確定的年代,保留著的這份 script 彌足珍貴
標籤: , , ,