Archive for November, 2010

Compiling Busybox to play around with Android & ARM

Download source code from git:

$ git clone git://busybox.net/busybox.git
$ cd busybox/

Export ARCH and CROSS_COMPILE

$ export ARCH=arm
$ export CROSS_COMPILE=/opt/gcc-4.1.2-glibc-2.5-nptl-3/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-
$ make menuconfig

In menuconfig set the following options

$ Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs)  -  Enable this option by pressing "Y"
$ Busybox Settings --> Build Options --> Cross compiler prefix  -  Set this option equal to "arm-none-linux-gnueabi-"
$ Busybox Settings --> Installation Options --> Don't use /usr  -  Enable this option by pressing "Y"
$ Linux Module Utilities --> () Default directory containing modules - Set this option to nothing
$ Linux Module Utilities --> () Default name of modules.dep - Set this option to nothing
Compile it using make
$ make
$ file busybox
busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, for GNU/Linux 2.6.14, stripped

Upload the file busybox to your device and instal it from the device console:

$./busybox --install -s

More info available at:
http://omapzoom.org/wiki/Android_Installing_Busybox_Command_Line_Tools

2 Comments

Huawei EM770W EVK working with Linux

This modem will take advantage of usbserial and option modules, both can be found at <kernel-source>/drivers/usb/serial

$ uname -a

Linux saygon 2.6.32-25-generic-pae #45-Ubuntu SMP Sat Oct 16 21:01:33 UTC 2010 i686 GNU/Linux

$ dmesg

[  149.268862] usb 1-3: USB disconnect, address 2
[  172.784026] usb 1-3: new high speed USB device using ehci_hcd and address 3
[  172.908043] hub 1-0:1.0: unable to enumerate USB device on port 3
[  204.720026] usb 1-3: new high speed USB device using ehci_hcd and address 4
[  204.784814] hub 1-0:1.0: unable to enumerate USB device on port 3
[  205.056042] usb 3-1: new full speed USB device using uhci_hcd and address 2
[  205.196242] usb 3-1: not running at top speed; connect to a high speed hub
[  205.220365] usb 3-1: configuration #1 chosen from 1 choice
[  205.285437] usbcore: registered new interface driver usbserial
[  205.285456] USB Serial support registered for generic
[  205.285765] usbcore: registered new interface driver usbserial_generic
[  205.285768] usbserial: USB Serial Driver core
[  205.289258] USB Serial support registered for GSM modem (1-port)
[  205.289306] option 3-1:1.0: GSM modem (1-port) converter detected
[  205.289458] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB0
[  205.289473] option 3-1:1.1: GSM modem (1-port) converter detected
[  205.290319] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB1
[  205.290441] option 3-1:1.2: GSM modem (1-port) converter detected
[  205.291438] usb 3-1: GSM modem (1-port) converter now attached to ttyUSB2
[  205.291462] usbcore: registered new interface driver option
[  205.291465] option: v0.7.2:USB Driver for GSM modems

$ lsusb | grep -i huawei

Bus 003 Device 002: ID 12d1:1001 Huawei Technologies Co., Ltd. E620 USB Modem

$ cat /etc/wvdial.conf

[Dialer Defaults]
Modem = /dev/ttyUSB0
ISDN = off
Modem Type = USB Modem
Baud = 7200000
Init = ATZ
Init2 = AT+CGDCONT=1,”IP”,”claro.com.br”
Init3 =
Init4 =
Init5 =
Init6 =
Init7 =
Init8 =
Init9 =
Phone = *99#
Phone1 =
Phone2 =
Phone3 =
Phone4 =
Dial Prefix =
Dial Attempts = 1
Username = claro
Password = claro
Auto Reconnect = off
Abort on Busy = off
Carrier Check = off
Check Def Route = off
Abort on No Dialtone = off
Stupid Mode = on
Idle Seconds = 0
Auto DNS = on

$ sudo wvdial

–> WvDial: Internet dialer version 1.60
–> Cannot get information for serial port.
–> Initializing modem.
–> Sending: ATZ
ATZ
OK
–> Sending: AT+CGDCONT=1,”IP”,”claro.com.br”
AT+CGDCONT=1,”IP”,”claro.com.br”
OK
–> Modem initialized.
–> Sending: ATDT*99#
–> Waiting for carrier.
CONNECT
–> Carrier detected.  Starting PPP immediately.
–> Starting pppd at Thu Nov 11 12:45:23 2010
–> Pid of pppd: 2611
–> Using interface ppp0
–> local  IP address 187.25.11.82
–> remote IP address 10.64.64.64
–> primary   DNS address 200.169.117.222
–> secondary DNS address 200.169.117.221
^CCaught signal 2:  Attempting to exit gracefully…
–> Terminating on signal 15
–> Connect time 0.1 minutes.
–> Disconnecting at Thu Nov 11 12:45:32 2010

Ps: If you face some network problems after using the modem, take a look at your DNS configuration.

1 Comment

Slackware 13 64 bits and PHP 5.2.x

Sometimes php complains about a missing mysql lib even if your mysql is perfectly installed, to solve this in slackware proceed this way:

Install the following packages:

libX11-1.3.3-x86_64-1.txz
libXau-1.0.5-x86_64-1.txz
libXdmcp-1.0.3-x86_64-1.txz
libXpm-3.5.8-x86_64-1.txz

tar xvfj php-5.x.x.tar.bz2

cd php-5.x.x

#Change the paths if you need

./configure  –with-apxs2=/usr/local/etc/httpd/bin/apxs –with-config-file-path=/usr/local/etc/httpd/conf –with-mysql=/usr/local  –with-openssl –enable-calendar –enable-ftp –with-mcrypt –enable-gd-native-ttf –with-jpeg-dir –with-gd=/usr/local –with-png-dir=/usr/local –with-zlib-dir=/usr/local –enable-mbstring –with-curl=/usr/local/bin/curl –enable-sockets –with-pdo-mysql=shared

make

make install

Done!

Leave a comment

Oracle export and import

Using exp:

To export the entire database to a single file dba.dmp in the current directory.

– Login to server

exp SYSTEM/password FULL=y FILE=dba.dmp LOG=dba.log CONSISTENT=y

or

exp SYSTEM/password PARFILE=params.dat

where params.dat contains the following information

FILE=dba.dmp
GRANTS=y
FULL=y
ROWS=y
LOG=dba.log

To dump a single schema to disk (we use the scott example schema here)

– Login to server which has an Oracle client

exp <user>/<password> FIlE=scott.dmp OWNER=scott

To export specific tables to disk:

– Login to server which has an Oracle client

exp SYSTEM/password FIlE=expdat.dmp TABLES=(scott.emp,hr.countries)

-the above command uses two users : scott and hr

exp <user>/<password> FILE=scott.dmp TABLES=(emp,dept)

the above is only for one user

Using imp:

To import the full database exported in the example above.

imp SYSTEM/password FULL=y FIlE=dba.dmp LOG=import.log

To import just the dept and emp tables from the scott schema

imp SYSTEM/password FIlE=dba.dmp FROMUSER=scott TABLES=(dept,emp)

To import tables and change the owner

imp SYSTEM/password FROMUSER=blake TOUSER=scott FILE=blake.dmp TABLES=(unit,manager)

To import just the scott schema exported in the example above

imp <user>/<password> FIlE=scott.dmp

Leave a comment