Showing posts with label HOWTO. Show all posts
Showing posts with label HOWTO. Show all posts

Monday, May 5, 2025

How to Install OpenOCD on Ubuntu 22.04.5 LTS


$ sudo apt-get install build-essential pkg-config autoconf automake libtool libusb-dev libusb-1.0-0-dev libhidapi-dev
$ sudo apt-get install libtool libsysfs-dev
$ sudo apt-get install libjim-dev

$ git clone https://git.code.sf.net/p/openocd/code openocd-code

Configure and Build OpenOCD

$ cd openocd-code
$ ./bootstrap
$ ./configure

Install OpenOCD

$ sudo make install

Configuration files

/usr/local/share/openocd/scripts/board/xxx.cfg
/usr/local/share/openocd/scripts/target/xxx_soc.cfg
/usr/local/share/openocd/scripts/interface/ftdi/xxx_sdp.cfg


Tuesday, June 20, 2017

HOWTO: Creating a Local Yum Repository Using an ISO Image on CentOS 7.0


  1. Create a mount point, for example /mnt/CentOS

  2.  [ ]# mount -o loop CentOS-7-x86_64-Everything-1611.iso/mnt/CentOS

  3. In the /etc/yum.repos.d directory, add and edit the repository files, such as CentOS-ISO.repo
  4. [c7-iso]
    name=CentOS-$releasever - ISO
    baseurl=file:///mnt/CentOS/
    gpgcheck=0
    enabled=1

  5. Clean up the yum cache

  6.  [ ]# sudo yum clean all

  7. Install RPM package

  8.  [ ]# sudo yum --disablerepo=\* --enablerepo=c7-iso install "package name"
    Install the 32-bit C library:
     [ ]# sudo yum --disablerepo=\* --enablerepo=c7-iso install glibc.i686

Saturday, August 22, 2015

HOWTO compile Android in Ubuntu 14.04.1 LTS


http://nathanpfry.com/how-to-prepare-ubuntu-14-04-lts-trusty-tahr-to-compile-android-roms/

Wednesday, October 1, 2014

HOWTO mount an airport extreme attached disk


[ ]# sudo mount.cifs //IP_ADDRESS/Data -o password=PASSWORD,sec=ntlm,uid=LOCAL_USERNAME /media/airport

[ ]# sudo mount -t cifs //10.0.1.1/DATA -o username=USERNAME,password=PASSWORD /media/airport

Saturday, July 26, 2014

How to disable start up sound in MacBook Air

It has puzzled me for a long time, especially at midnight.

$ sudo nvram --help
nvram: (usage: no such option as --)
nvram [-x] [-p] [-f filename] [-d name] [-c] name[=value] ...
-x                       use XML format for printing or reading variables
                          (must appear before -p or -f)
-p                       print all firmware variables
-f                        set firmware variables from a text file
-d                       delete the named variable
-c                       delete all variables
name=value      set named variable
name                 print variable
Note that arguments and options are executed in order.

$ sudo nvram SystemAudioVolume=%80
$ sudo nvram -p | grep SystemAudioVolume

SystemAudioVolume %80

Wednesday, June 4, 2014

HOWTO Install Codescape Debugger for MIPS on Fedora

The procedure is actually quite simple, but one patch is needed for the license manager.

1. Install Codescape
[ ]# chmod +x Codescape-Debugger-8.0.2.2.CentOS-5.x86.py
[ ]# ./Codescape-Debugger-8.0.2.2.CentOS-5.x86.py

2. Create the LSB linker/loader shared library for the License Manager
[ ]# sudo ln -s /lib/ld-linux.so.2 /lib/ld-lsb.so.3

The License Manager may fail when LSB 3 is not met
Starting the license manager issues the error:
   bash: /opt/imgtec/Codescape-Debugger-8.0/get_img_host_id: /lib/ld-lsb.so.3: bad ELF interpreter: No such file or directory

3. Register
[ ]# /opt/imgtec/Codescape-Debugger-8.0/Codescape-Debugger-Registration

4. That's it. We are done.

Without step 2, the registration failed with the following Error. 


The license manager will call following command to get the "Host ID".
[ ]# /opt/imgtec/Codescape-Debugger-8.0/get_img_host_id

Friday, April 25, 2014

MIPS Qemu

Install Qemu
[ ]$ wget http://wiki.qemu-project.org/download/qemu-2.0.0.tar.bz2
[ ]$ tar jxvf qemu-2.0.0.tar.bz2
[ ]$ cd qemu-2.0.0

Compile Qemu
[ ]$ ./configure --target-list=mipsel-softmmu
[ ]$ make
[ ]$ sudo make install

Compile U-boot
[ ]$ CROSS_COMPILE=mips-linux-gnu- make -C u-boot-2014.01 qemu_mipsel

Run Qemu/U-boot
[ ]$ dd of=flash bs=1k count=4k if=/dev/zero
[ ]$ dd of=flash bs=1k conv=notrunc if=u-boot.bin

[ ]$ qemu-system-mipsel -M mips -m 128 -pflash flash -monitor null -nographic

U-Boot 2014.01 (Apr 24 2014 - 10:20:11)

Board: Qemu -M mips CPU: 24Kf proc_id=0x19300
DRAM:  128 MiB
Flash: 4 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   NE2000
Hit any key to stop autoboot:  0

qemu-mipsel # version

U-Boot 2014.01 (Apr 24 2014 - 10:20:11)
mips-linux-gnu-gcc (Sourcery CodeBench Lite 2013.11-36) 4.8.1
GNU ld (Sourcery CodeBench Lite 2013.11-36) 2.23.52.20130912

qemu-mipsel #

Friday, January 11, 2013

HOWTO: recover deleted files from an ext3 or ext4 partition

extundelete

extundelete is a utility that can recover deleted files from an ext3 or ext4 partition. extundelete uses information stored in the partition's journal to attempt to recover a file that has been deleted from the partition.

But, there is no guarantee that the deleted file will be able to be undeleted!

For example:
[ ]# extundelete /dev/sdc1 --restore-all

extundelete will restore any files it finds to a subdirectory of the current directory named “RECOVERED_FILES”.

Tuesday, June 14, 2011

ARM Qemu

Qemu

Qemu
[ ]# mkdir /home/qemu
[ ]# cd /home/qemu/
[ ]# git clone git://git.qemu.org/qemu.git qemu-git
[ ]# cd qemu-git/
[ ]# ./configure --target-list="arm-softmmu"
[ ]# make
[ ]# cp arm-softmmu/qemu-system-arm /usr/bin/

Or
http://download.savannah.gnu.org/releases/qemu/qemu-0.14.1.tar.gz

U-boot
[ ]# cd /home/qemu/
[ ]# wget http://ftp.denx.de/pub/u-boot/u-boot-2010.03.tar.bz2
[ ]# cd u-boot-2010.03
[ ]# make versatilepb_config ARCH=arm CROSS_COMPILE=arm-linux-
[ ]# make all ARCH=arm CROSS_COMPILE=arm-linux-
[ ]# qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot.bin

U-Boot 2010.03 (Jun 15 2011 - 14:38:26)

DRAM: 0 kB
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
Flash: 0 kB
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: SMC91111-0
VersatilePB # print
bootargs=root=/dev/nfs mem=128M ip=dhcp netdev=25,0,0xf1010000,0xf1010010,eth0
bootdelay=2
baudrate=38400
bootfile="/tftpboot/uImage"
stdin=serial
stdout=serial
stderr=serial
verify=n
ethact=SMC91111-0

Environment size: 202/8188 bytes
VersatilePB #

Simple "Hello World!" Root File System
[ ]# cd /home/qemu/
[ ]# echo "#include " > test.c
[ ]# echo "int main() {" >> test.c
[ ]# echo -e '\tprintf("Hello World!\\n");' >> test.c
[ ]# echo -e "return 0;" >> test.c
[ ]# echo "}" >> test.c

[ ]# arm-linux-gcc -static test.c -o test
[ ]# echo test | cpio -o --format=newc > rootfs

ARM Linux Versatile (ARMv5)
[ ]# cd /home/qemu/
[ ]# wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.12.tar.bz2
[ ]# tar jxvf linux-2.6.35.12.tar.bz2
[ ]# cd linux-2.6.35.12
[ ]# make ARCH=arm versatile_defconfig
[ ]# make ARCH=arm menuconfig

Enabling EABI support in the kernel. (CONFIG_AEABI=y, CONFIG_OABI_COMPAT=y)

[ ]# make ARCH=arm CROSS_COMPILE=arm-linux- all
[ ]# qemu-system-arm -M versatilepb -m 128M -kernel arch/arm/boot/zImage -initrd rootfs -serial stdio -append "console=ttyAMA0 root=/dev/ram rdinit=/test"

You can use “-nographic” instead of “-serial stdio” to launch QEMU without opening another window, but then to close it you have to type Ctrl-A and then “x”.

How to install Qemu in Linux for Versatile Express platform
Processor: Cortex A9

COREMU

Thursday, June 9, 2011

OProfile on ARM Linux

How to compile OProfile

binutils
[ ]#./configure \
     --target=arm-linux \
     --host=arm-linux \
     --build=i686-pc-linux-gnu \
     --enable-shared \
     --prefix=/home/oprofile/binutils-stable_bin \
     --disable-nls --disable-poison-system-directories

[ ]#make
[ ]#make install

oprofile-0.9.6
[ ]#./configure --with-linux=/home/linux-2.6.35.12-cavm1 \
     --with-kernel-support \
     --disable-optimization \
     --disable-werror \
     --target=arm-linux \
     --host=arm-linux \
     --build=i686-pc-linux-gnu \
     --enable-static \
     --with-binutils=/home/oprofile/binutils-stable_bin \
     --prefix=/home/oprofile/oprofile-0.9.6_bin

[ ]#make

How to use OProfile on ARM platform
Default: timer mode, $ modprobe oprofile timer=1
$ opcontrol --reset
$ opcontrol --init
$ opcontrol --start --vmlinux=/tmp/vmlinux --session-dir=/tmp/linux
$ opcontrol --start-daemon

$ opcontrol --dump
$ opcontrol --save=output
$ opreport --session-dir=/tmp/linux session:output -l image:/tmp/vmlinux

Sample Rate = HZ

OProfile with performance counter
$ opcontrol --callgraph=8 --separate=kernel --vmlinux=/boot/vmlinux
$ opcontrol --event=CPU_CYCLES:100000:0:1:1 \
                  --event=L1D_CACHE:100000:0:1:1 \
                  --event=L2D_CACHE:10000:0:1:1 \
                  --event=BUS_ACCESS:100000:0:1:1 \
                  --event=BUS_CYCLES:100000:0:1:1 \
                  --event=UNALIGNED_LDST_RETIRED:10000:0:1:1
$ opcontrol --init
$ opcontrol --reset
$ opcontrol --start-daemon
$ opcontrol --status
$ opcontrol --start

$ opcontrol --dump
$ opreport

Sample Rate = (CPU frequency in MHz) / (CPU_CYCLES count) / 64.
      The default value of CPU_CYCLES = 100000. The CPU_CYCLES can be changed as following               example “--event=CPU_CYCLES:125000".

      If CPU is running in 800MHz, the sample rate is 800MHz / 100000 / 64 = 125 samples per second.
   

Reference:
http://friendalways.blogspot.com/2009/11/oprofile-on-arm-linux.html

Friday, March 18, 2011

HOWTO install OpenOCD in Fedora 14

Compile OpenOCD
[ ]# mkdir /home/OpenOCD
[ ]# cd /home/OpenOCD

Download FT2xxx USB-UART drivers from FTDI Ltd
[ ]# wget http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.16.tar.gz
[ ]# tar zxvf libftd2xx0.4.16.tar.gz
[ ]# cd libftd2xx0.4.16
[ ]# cp ftd2xx.h WinTypes.h /usr/include/
[ ]# cp libftd2xx.so.0.4.16 /usr/lib/libftd2xx.so.0.4.16
[ ]# ln -sf /usr/lib/libftd2xx.so.0.4.16 /usr/lib/libftd2xx.so.0.4
[ ]# ln -sf /usr/lib/libftd2xx.so.0.4.16 /usr/lib/libftd2xx.so.0
[ ]# ln -sf /usr/lib/libftd2xx.so.0.4.16 /usr/lib/libftd2xx.so

Download/Compile latest OpenOCD from GIT:
[ ]# cd /home/OpenOCD
[ ]# git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
[ ]# cd openocd
[ ]# ./bootstrap
[ ]# ./configure --enable-maintainer-mode --enable-ft2232_ftd2xx
[ ]# make
[ ]# make install

Or Download/Compile OpenOCD 4.0 tarball
[ ]# wget http://download.berlios.de/openocd/openocd-0.4.0.tar.bz2
[ ]# tar jxvf openocd-0.4.0.tar.bz2
[ ]# cd openocd-0.4.0
[ ]# ./configure --enable-maintainer-mode --enable-ft2232_ftd2xx
[ ]# make
[ ]# make install

What OpenOCD can do for a developer
1. Read/Write register on your target
2. Read/Write memory on your target
3. Program flash chips
4. GDB
5. more...

How to use OpenOCD
Running OpenOCD on Cavium Networks CNS3000/CNW5000 Platform
[ ]# ./openocd -f openocd-cnx.cfg
Open On-Chip Debugger 0.4.0 (2011-03-22-03:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.berlios.de/doc/doxygen/bugs.html
6000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
jtag_ntrst_delay: 100
jtag_nsrst_delay: 100
Info : device: 4 "2232C"
Info : deviceID: 341266712
Info : SerialNumber:
Info : Description: USB<=>JTAG&RS232 A
Info : clock speed 6000 kHz
Info : JTAG tap: arm11.cpu tap/device found: 0x07b37477 (mfg: 0x23b, part: 0x7b37, ver: 0x0)
Info : JTAG tap: arm11.cpu tap/device found: 0x07b37477 (mfg: 0x23b, part: 0x7b37, ver: 0x0)
Warn : JTAG tap: arm11.cpu UNEXPECTED: 0x07b37477 (mfg: 0x23b, part: 0x7b37, ver: 0x0)
Error: JTAG tap: arm11.cpu expected 1 of 1: 0xffffffff (mfg: 0x7ff, part: 0xffff, ver: 0xf)
Error: Trying to use configured scan chain anyway...
Warn : Bypassing JTAG setup events due to errors
Info : found ARM11 MPCore
Info : arm11.cpu: hardware has 6 breakpoints, 2 watchpoints
Info : accepting 'telnet' connection from 0

TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* arm11.cpu arm11 little arm11.cpu halted 

Recover u-boot
[ ]# telnet localhost 4444
> halt
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x600001d3 pc: 0x000146c4
> flash probe 0
Flash Manufacturer/Device: 0x0001 0x227e
configuration specifies 0x800000 size, but a 0x1000000 size flash was found
flash 'cfi' found at 0x10000000
> flash list
{name cfi base 268435456 size 8388608 bus_width 2 chip_width 2}
> flash info 0
#0 : cfi at 0x10000000, size 0x00800000, buswidth 2, chipwidth 2
# 0: 0x00000000 (0x20000 128kB) protection state unknown
# 1: 0x00020000 (0x20000 128kB) protection state unknown
# 2: 0x00040000 (0x20000 128kB) protection state unknown
. . .
#125: 0x00fa0000 (0x20000 128kB) protection state unknown
#126: 0x00fc0000 (0x20000 128kB) protection state unknown
#127: 0x00fe0000 (0x20000 128kB) protection state unknown

cfi information:
mfr: 0x0001, id:0x227e
qry: 'QRY', pri_id: 0x0002, pri_addr: 0x0040, alt_id: 0x0000, alt_addr: 0x0000
Vcc min: 2.7, Vcc max: 3.6, Vpp min: 0.0, Vpp max: 0.0
typ. word write timeout: 64, typ. buf write timeout: 64, typ. block erase timeout: 512, typ. chip erase timeout: 524288
max. word write timeout: 512, max. buf write timeout: 2048, max. block erase timeout: 4096, max. chip erase timeout: 2097152
size: 0x1000000, interface desc: 2, max buffer write size: 40

Spansion primary algorithm extend information:
pri: 'PRI', version: 1.3
Silicon Rev.: 0x5, Address Sensitive unlock: 0x0
Erase Suspend: 0x2, Sector Protect: 0x1
VppMin: 11.5, VppMax: 12.5

> flash erase_address 0x10000000 0x40000
erased address 0x10000000 (length 262144) in 1.737926s (147.302 kb/s)
> flash write_bank 0 /tftpboot/u-boot.bin 0
No working memory available. Specify -work-area-phys to target.
Programming at 10000000, count 000295d8 bytes remaining
Programming at 10000100, count 000294d8 bytes remaining
. . .
Programming at 10029300, count 000002d8 bytes remaining
Programming at 10029400, count 000001d8 bytes remaining
Programming at 10029500, count 000000d8 bytes remaining
wrote 169432 bytes from file /tftpboot/u-boot.bin to flash bank 0 at offset 0x00000000 in 810.315613s (0.204 kb/s)
> reset
Disassemble u-boot
[ ]# telnet localhost 4444
> halt
> arm disassemble 0x10000000
core state: ARM
0x00989680 0xfdfefbfd LDC2L p11, c15, [r14, #244]!
0x10000000 0xea000013 B 0x10000054
0x10000004 0xe59ff014 LDR r15, [r15, #0x14]
0x10000008 0xe59ff014 LDR r15, [r15, #0x14]
0x10000000 0xea000013 B 0x10000054
0x10000004 0xe59ff014 LDR r15, [r15, #0x14]
0x10000008 0xe59ff014 LDR r15, [r15, #0x14]
0x1000000c 0xe59ff014 LDR r15, [r15, #0x14]
0x10000010 0xe59ff014 LDR r15, [r15, #0x14]
0x10000014 0xe59ff014 LDR r15, [r15, #0x14]
0x10000018 0xe59ff014 LDR r15, [r15, #0x14]
0x1000001c 0xe59ff014 LDR r15, [r15, #0x14]
0x10000020 0x00000120 ANDEQ r0, r0, r0, LSR #0x2
0x10000024 0x00000180 ANDEQ r0, r0, r0, LSL #0x3
0x10000028 0x000001e0 ANDEQ r0, r0, r0, ROR #0x3
0x1000002c 0x00000240 ANDEQ r0, r0, r0, ASR #0x4
0x10000030 0x000002a0 ANDEQ r0, r0, r0, LSR #0x5
0x10000034 0x00000300 ANDEQ r0, r0, r0, LSL #0x6
0x10000038 0x00000360 ANDEQ r0, r0, r0, ROR #0x6
0x1000003c 0xdeadbeef CDPLE p14, 0x0a, c11, c13, c15, 0x07
0x10000040 0x00000000 ANDEQ r0, r0, r0
0x10000044 0x00000000 ANDEQ r0, r0, r0
0x10000048 0x08000000 STMDAEQ r0, i??i??i}
0x1000004c 0x000295d8 LDREQD r9, [r2], -r8
0x10000050 0x00071600 ANDEQ r1, r7, r0, LSL #0xc
0x10000054 0xe10f0000 MRS r0, CPSR
0x10000058 0xe3c0001f BIC r0, r0, #0x1f
0x1000005c 0xe38000d3 ORR r0, r0, #0xd3
...


Here is what I used to try -- [$800 NT, $30 USD]
OpenJTAG ARM JTAG USB

The man page for ARM11 CPU
(Download)

Thursday, April 15, 2010

HOWTO Build ARM Cross-Compiler (crosstool-NG)

[ ]# mkdir /home/crosstool-ng
[ ]# cd /home/crosstool-ng
[ ]# wget http://ymorin.is-a-geek.org/download/crosstool-ng/crosstool-ng-1.6.1.tar.bz2
[ ]# tar jxvf crosstool-ng-1.6.1.tar.bz2
[ ]# cd crosstool-ng-1.6.1
[ ]# ./configure --prefix=/opt/crosstool-ng
[ ]# make
[ ]# make install

[ ]# mkdir -p /home/crosstool-ng/crosstool-ng-build
[ ]# cd /home/crosstool-ng/crosstool-ng-build
[ }# cp /opt/crosstool-ng/lib/ct-ng-1.6.1/samples/armeb-unknown-linux-uclibcgnueabi/* .
[ ]# mv crosstool.config .config

[ ]# export PATH=/opt/crosstool-ng/bin:$PATH

[ ]# ct-ng menuconfig
[ ]# ct-ng build.4

[INFO ] Performing some trivial sanity checks
[INFO ] Build started 20100415.195352
[INFO ] Building environment variables
[WARN ] Directory '/root/src' does not exist.
[WARN ] Will not save downloaded tarballs to local storage.
[EXTRA] Preparing working directories
[WARN ] You did not specify the build system. That's OK, I can guess...
[EXTRA] Installing user-supplied crosstool-NG configuration
[EXTRA] =================================================================
[EXTRA] Dumping internal crosstool-NG configuration
[EXTRA] Building a toolchain for:
[EXTRA] build = i386-redhat-linux
[EXTRA] host = i386-redhat-linux
[EXTRA] target = armeb-unknown-linux-uclibcgnueabi
[EXTRA] Dumping internal crosstool-NG configuration: done in 0.06s (at 00:01)
[INFO ] =================================================================
[INFO ] Retrieving needed toolchain components' tarballs
[EXTRA] Retrieving 'linux-2.6.31.12'
[EXTRA] Retrieving 'gmp-4.3.1'
[EXTRA] Retrieving 'mpfr-2.4.2'
[EXTRA] Retrieving 'ppl-0.10.2'
[EXTRA] Retrieving 'cloog-ppl-0.15.7'
[EXTRA] Retrieving 'mpc-0.8.1'
[EXTRA] Retrieving 'binutils-2.20'
[EXTRA] Retrieving 'gcc-4.4.2'
[EXTRA] Retrieving 'uClibc-0.9.30.2'
[EXTRA] Retrieving 'libelf-0.8.12'
[EXTRA] Retrieving 'sstrip'
[EXTRA] Retrieving 'dmalloc-5.5.2'
[EXTRA] Retrieving 'duma_2_5_15'
[EXTRA] Retrieving 'gdb-6.8'
[EXTRA] Retrieving 'ncurses-5.7'
[EXTRA] Retrieving 'ltrace_0.5.3.orig'
[EXTRA] Retrieving 'strace-4.5.19'
[INFO ] Retrieving needed toolchain components' tarballs: done in 4518.57s (at 75:20)
[INFO ] =================================================================
[INFO ] Extracting and patching toolchain components
[EXTRA] Extracting 'linux-2.6.31.12'
[EXTRA] Patching 'linux-2.6.31.12'
[EXTRA] Extracting 'gmp-4.3.1'
[EXTRA] Patching 'gmp-4.3.1'
[EXTRA] Extracting 'mpfr-2.4.2'
[EXTRA] Patching 'mpfr-2.4.2'
[EXTRA] Extracting 'ppl-0.10.2'
[EXTRA] Patching 'ppl-0.10.2'
[EXTRA] Extracting 'cloog-ppl-0.15.7'
[EXTRA] Patching 'cloog-ppl-0.15.7'
[EXTRA] Extracting 'mpc-0.8.1'
[EXTRA] Patching 'mpc-0.8.1'
[EXTRA] Extracting 'binutils-2.20'
[EXTRA] Patching 'binutils-2.20'
[EXTRA] Extracting 'gcc-4.4.2'
[EXTRA] Patching 'gcc-4.4.2'
[EXTRA] Extracting 'uClibc-0.9.30.2'
[EXTRA] Patching 'uClibc-0.9.30.2'
[EXTRA] Extracting 'libelf-0.8.12'
[EXTRA] Patching 'libelf-0.8.12'
[EXTRA] Extracting 'dmalloc-5.5.2'
[EXTRA] Patching 'dmalloc-5.5.2'
[EXTRA] Extracting 'duma_2_5_15'
[EXTRA] Patching 'duma-2_5_15'
[EXTRA] Extracting 'gdb-6.8'
[EXTRA] Patching 'gdb-6.8'
[EXTRA] Extracting 'ncurses-5.7'
[EXTRA] Patching 'ncurses-5.7'
[EXTRA] Extracting 'ltrace-0.5.3'
[EXTRA] Patching 'ltrace-0.5.3'
[EXTRA] Extracting 'strace-4.5.19'
[EXTRA] Patching 'strace-4.5.19'
[INFO ] Extracting and patching toolchain components: done in 300.63s (at 80:20)
[INFO ] =================================================================
[INFO ] Checking C library configuration
[EXTRA] Munging uClibc configuration
[INFO ] Checking C library configuration: done in 0.13s (at 80:21)
[INFO ] =================================================================
[INFO ] Installing kernel headers
[EXTRA] Installing kernel headers
[EXTRA] Checking installed headers
[INFO ] Installing kernel headers: done in 9.72s (at 80:30)
[INFO ] =================================================================
[INFO ] Installing GMP
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP: done in 71.62s (at 81:42)
[INFO ] =================================================================
[INFO ] Installing MPFR
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR: done in 19.64s (at 82:02)
[INFO ] =================================================================
[INFO ] Installing PPL
[EXTRA] Configuring PPL
[EXTRA] Building PPL
[EXTRA] Installing PPL
[INFO ] Installing PPL: done in 392.81s (at 88:34)
[INFO ] Installing MPC
[EXTRA] Configuring MPC
[EXTRA] Building MPC
[EXTRA] Installing MPC
[INFO ] Installing MPC: done in 7.93s (at 88:49)
[INFO ] =================================================================
[INFO ] Installing binutils
[EXTRA] Configuring binutils
[EXTRA] Building binutils
[EXTRA] Installing binutils
[INFO ] Installing binutils: done in 48.30s (at 89:37)
[INFO ] =================================================================
[INFO ] Installing C library headers
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building headers
[EXTRA] Installing headers
[INFO ] Installing C library headers: done in 14.52s (at 89:52)
[INFO ] =================================================================
[INFO ] Installing static core C compiler
[EXTRA] Configuring static core C compiler
[EXTRA] Building static core C compiler
[EXTRA] Installing static core C compiler
[INFO ] Installing static core C compiler: done in 157.37s (at 92:29)
[INFO ] =================================================================
[INFO ] Installing C library
[EXTRA] Copying sources to build dir
[EXTRA] Applying configuration
[EXTRA] Building C library
[EXTRA] Installing C library
[EXTRA] Building C library cross-ldd
[EXTRA] Installing C library cross-ldd
[INFO ] Installing C library: done in 56.79s (at 93:26)
[INFO ] =================================================================
[INFO ] Installing final compiler
[EXTRA] Configuring final compiler
[EXTRA] Building final compiler
[ERROR] checking the name lister (/home/crosstool-ng/crosstool-ng-1.6.1-build/targets/armeb-unknown-linux-uclibcgnueabi/build/build-cc/./gcc/nm) interface... libtool.m4: error: problem compiling FC test program
[EXTRA] Installing final compiler
[INFO ] Installing final compiler: done in 214.53s (at 97:00)
[INFO ] =================================================================
[INFO ] Installing GMP for the target
[EXTRA] Configuring GMP
[EXTRA] Building GMP
[EXTRA] Installing GMP
[INFO ] Installing GMP for the target: done in 59.09s (at 97:59)
[INFO ] Installing MPFR for the target
[EXTRA] Configuring MPFR
[EXTRA] Building MPFR
[EXTRA] Installing MPFR
[INFO ] Installing MPFR for the target: done in 21.58s (at 98:21)
[INFO ] =================================================================
[INFO ] Installing binutils for target
[EXTRA] Configuring binutils for target
[EXTRA] Building binutils' libraries (libiberty bfd) for target
[EXTRA] Installing binutils' libraries (libiberty bfd) for target
[INFO ] Installing binutils for target: done in 77.79s (at 99:39)
[INFO ] =================================================================
[INFO ] Installing libelf
[EXTRA] Configuring libelf
[EXTRA] Building libelf
[EXTRA] Installing libelf
[INFO ] Installing libelf: done in 11.39s (at 99:50)
[INFO ] =================================================================
[INFO ] Installing sstrip
[EXTRA] Building sstrip
[EXTRA] Installing sstrip
[INFO ] Installing sstrip: done in 0.17s (at 99:50)
[INFO ] =================================================================
[INFO ] Installing dmalloc
[EXTRA] Configuring dmalloc
[EXTRA] Building dmalloc
[EXTRA] Installing dmalloc
[INFO ] Installing dmalloc: done in 8.56s (at 99:59)
[INFO ] =================================================================
[INFO ] Installing D.U.M.A.
[EXTRA] Copying sources
[EXTRA] Building libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing libraries 'libduma.a libduma.so.0.0.0'
[EXTRA] Installing shared library link
[EXTRA] Installing wrapper script
[INFO ] Installing D.U.M.A.: done in 1.93s (at 100:01)
[INFO ] =================================================================
[INFO ] Installing cross-gdb
[EXTRA] Configuring cross-gdb
[EXTRA] Building cross-gdb
[EXTRA] Installing cross-gdb
[INFO ] Installing cross-gdb: done in 117.00s (at 101:58)
[INFO ] =================================================================
[INFO ] Installing native gdb
[INFO ] =================================================================
[INFO ] Installing ncurses library
[INFO ] =================================================================
[INFO ] Installing native ncurses tic
[EXTRA] Configuring ncurses tic
[EXTRA] Building ncurses tic
[EXTRA] Installing ncurses tic
[INFO ] Installing native ncurses tic: done in 27.87s (at 102:26)
[EXTRA] Configuring ncurses
[EXTRA] Building ncurses
[EXTRA] Installing ncurses
[INFO ] Installing ncurses library: done in 98.99s (at 103:37)
[EXTRA] Configuring native gdb
[EXTRA] Building native gdb
[EXTRA] Installing native gdb
[EXTRA] Cleaning up ncurses
[INFO ] Installing native gdb: done in 196.27s (at 105:14)
[INFO ] =================================================================
[INFO ] Installing gdbserver
[EXTRA] Configuring gdbserver
[EXTRA] Building gdbserver
[EXTRA] Installing gdbserver
[INFO ] Installing gdbserver: done in 7.07s (at 105:21)
[INFO ] =================================================================
[INFO ] Installing ltrace
[EXTRA] Copying sources to build dir
[EXTRA] Configuring ltrace
[EXTRA] Building ltrace
[EXTRA] Installing ltrace
[INFO ] Installing ltrace: done in 5.01s (at 105:26)
[INFO ] =================================================================
[INFO ] Installing strace
[EXTRA] Configuring strace
[EXTRA] Building strace
[EXTRA] Installing strace
[INFO ] Installing strace: done in 17.78s (at 105:44)
[INFO ] =================================================================
[INFO ] Cleaning-up the toolchain's directory
[EXTRA] Installing the populate helper
[EXTRA] Creating toolchain aliases
[EXTRA] Installing toolchain wrappers
[EXTRA] Removing access to the build system tools
[EXTRA] Removing installed documentation
[INFO ] Cleaning-up the toolchain's directory: done in 0.50s (at 105:45)
[INFO ] Build completed at 20100415.213937
[INFO ] (elapsed: 105:44.38)
[INFO ] Finishing installation (may take a few seconds)...
[105:45] /

The toolchain is in directory "/root/x-tools/" by default.

PS. buildroot version (Little-Endian) (Big-Endian)

Thursday, July 16, 2009

HOWTO Build Android Platform on Fedora Core 9

The final file structure looks like that

/home/android/
`-- mydroid
|-- bionic
|-- bootable
|-- build
|-- dalvik
|-- development
|-- external
|-- frameworks
|-- hardware
|-- packages
|-- prebuilt
`-- system


=========================================================

Download Android Source Code

[ ]# wget http://android.git.kernel.org/repo
[ ]# chmod +x repo
[ ]# mv repo /usr/bin

[ ]# mkdir -p /home/android/mydroid
[ ]# cd /home/android/mydroid
[ ]# repo init -u git://android.git.kernel.org/platform/manifest.git

gpg: keyring `/root/.repoconfig/gnupg/secring.gpg' created
gpg: keyring `/root/.repoconfig/gnupg/pubring.gpg' created
gpg: /root/.repoconfig/gnupg/trustdb.gpg: trustdb created
gpg: key 920F5C65: public key "Repo Maintainer "
imported
gpg: Total number processed: 1
gpg: imported: 1

Getting repo ...
from git://android.git.kernel.org/tools/repo.git
warning: no common commits
remote: Counting objects: 906, done.
remote: Compressing objects: 100% (404/404), done.
remote: Total 906 (delta 569), reused 785 (delta 482)
Receiving objects: 100% (906/906), 277.53 KiB | 142 KiB/s, done.
Resolving deltas: 100% (569/569), done.
From git://android.git.kernel.org/tools/repo
* [new branch] master -> origin/master
* [new branch] stable -> origin/stable
* [new tag] v1.6.8.7 -> v1.6.8.7
From git://android.git.kernel.org/tools/repo
* [new tag] v1.0 -> v1.0
* [new tag] v1.0.1 -> v1.0.1
* [new tag] v1.0.2 -> v1.0.2
* [new tag] v1.0.3 -> v1.0.3
* [new tag] v1.0.4 -> v1.0.4
* [new tag] v1.0.5 -> v1.0.5
* [new tag] v1.0.6 -> v1.0.6
* [new tag] v1.0.7 -> v1.0.7
* [new tag] v1.0.8 -> v1.0.8
* [new tag] v1.0.9 -> v1.0.9
* [new tag] v1.1 -> v1.1
* [new tag] v1.2 -> v1.2
* [new tag] v1.3 -> v1.3
* [new tag] v1.3.1 -> v1.3.1
* [new tag] v1.3.2 -> v1.3.2
* [new tag] v1.4 -> v1.4
* [new tag] v1.4.1 -> v1.4.1
* [new tag] v1.4.2 -> v1.4.2
* [new tag] v1.4.3 -> v1.4.3
* [new tag] v1.4.4 -> v1.4.4
* [new tag] v1.5 -> v1.5
* [new tag] v1.5.1 -> v1.5.1
* [new tag] v1.6 -> v1.6
* [new tag] v1.6.1 -> v1.6.1
* [new tag] v1.6.2 -> v1.6.2
* [new tag] v1.6.3 -> v1.6.3
* [new tag] v1.6.4 -> v1.6.4
* [new tag] v1.6.5 -> v1.6.5
* [new tag] v1.6.6 -> v1.6.6
* [new tag] v1.6.7 -> v1.6.7
* [new tag] v1.6.7.1 -> v1.6.7.1
* [new tag] v1.6.7.2 -> v1.6.7.2
* [new tag] v1.6.7.3 -> v1.6.7.3
* [new tag] v1.6.7.4 -> v1.6.7.4
* [new tag] v1.6.7.5 -> v1.6.7.5
* [new tag] v1.6.8 -> v1.6.8
* [new tag] v1.6.8.1 -> v1.6.8.1
* [new tag] v1.6.8.2 -> v1.6.8.2
* [new tag] v1.6.8.3 -> v1.6.8.3
* [new tag] v1.6.8.4 -> v1.6.8.4
* [new tag] v1.6.8.5 -> v1.6.8.5
* [new tag] v1.6.8.6 -> v1.6.8.6
Getting manifest ...
from git://android.git.kernel.org/platform/manifest.git
warning: no common commits
remote: Counting objects: 116, done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 116 (delta 39), reused 107 (delta 36)
Receiving objects: 100% (116/116), 29.54 KiB, done.
Resolving deltas: 100% (39/39), done.
From git://android.git.kernel.org/platform/manifest
* [new branch] android-1.5 -> origin/android-1.5
* [new branch] android-1.5r2 -> origin/android-1.5r2
* [new branch] android-sdk-1.5-pre -> origin/android-sdk-1.5-pre
* [new branch] android-sdk-1.5_r1 -> origin/android-sdk-1.5_r1
* [new branch] cdma-import -> origin/cdma-import
* [new branch] cupcake -> origin/cupcake
* [new branch] donut -> origin/donut
* [new branch] master -> origin/master
* [new branch] release-1.0 -> origin/release-1.0
* [new tag] android-1.5 -> android-1.5
* [new tag] android-1.5r2 -> android-1.5r2
* [new tag] android-sdk-1.5-pre -> android-sdk-1.5-pre
* [new tag] android-sdk-1.5_r1 -> android-sdk-1.5_r1
From git://android.git.kernel.org/platform/manifest
* [new tag] android-1.0 -> android-1.0

Your Name [ ]: scott
Your Email [ ]: scott.shu@gmail.com

Your identity is: scott
is this correct [yes/no]? yes

Testing colorized output (for 'repo diff', 'repo status'):
black red green yellow blue magenta cyan white
bold dim ul reverse
Enable color display in this user account (y/n)? y

[ ]# repo sync
... skip ...
... skip ... checkout 1.9G in 22 minutes
[ ]#

Install some tools before build "manifest"
[ ]# yum install java-1.6.0-openjdk-devel
[ ]# yum install gperf

Make it


Reference:
http://source.android.com/download/using-repo

HOWTO Install Android SDK 1.5.r2 on Fedora Core 9

The final file structure looks like that

/home/android/
|-- android-kernel
| `-- kernel
|-- android-sdk
| `-- android-sdk-linux_x86-1.5_r2

=========================================================

Download Android 1.5 SDK, Release 2
[ ]# mkdir -p /home/android/android-sdk
[ ]# cd /home/android/android-sdk
[ ]# wget http://developer.android.com/sdk/download.html?v=android-sdk-linux_x86-1.5_r2.zip
[ ]# unzip android-sdk-linux_x86-1.5_r2.zip

Linux Kernel for Android
[ ]# mkdir -p /home/android/android-kernel
[ ]# cd /home/android/android-kernel
[ ]# git clone git://android.kernel.org/kernel/common.git kernel
[ ]# cd kernel

[ ]# git branch goldfish origin/android-goldfish-2.6.27
[ ]# git checkout goldfish

[ ]# make ARCH=arm CROSS_COMPILE=arm-linux- goldfish_defconfig
[ ]# make ARCH=arm CROSS_COMPILE=arm-linux- menuconfig
[ ]# make ARCH=arm CROSS_COMPILE=arm-linux- zImage

Switched to branch "goldfish-2.6.29"
[ ]# git branch goldfish-2.6.29 origin/android-goldfish-2.6.29
[ ]# git checkout goldfish-2.6.29

To see a list of existing branches
[ ]# git branch
android-2.6.27
goldfish
* goldfish-2.6.29

Android Emulator

Create Android Virtual Device
[ ]# android-sdk/android-sdk-linux_x86-1.5_r2/tools/android create avd -n foo -t 3
Created AVD 'foo' based on Google APIs (Google Inc.)

Run the emulator
[ ]# android-sdk/android-sdk-linux_x86-1.5_r2/tools/emulator @foo -kernel android-kernel/kernel/arch/arm/boot/zImage

Delete the Android Virtual Device
[ ]# android-sdk/android-sdk-linux_x86-1.5_r2/tools/android delete avd -n foo









Friday, January 9, 2009

HOWTO compile Android Linux on Fedora Core 9

Android - An Open Handset Alliance Project

Compile Linux Kernel

[ ]# mkdir -p /home/android/kernel
[ ]# cd /home/android/kernel
[ ]# wget http://android.googlecode.com/files/linux-2.6.25-android-1.0_r1.tar.gz

[ ]# tar zxvf linux-2.6.25-android-1.0_r1.tar.gz
[ ]# cd kernel.git
[ ]# make goldfish_defconfig

[ ]# CROSS_COMPILE=arm-linux- make

Android SDK
Download from Andriod
[ ]# cd /home/android
[ ]# wget http://dl.google.com/android/android-sdk-linux_x86-1.0_r2.zip
[ ]# unzip android-sdk-linux_x86-1.0_r2.zip

Execute the Emulator
[ ]# cd /home/android
[ ]# ./android-sdk-linux_x86-1.0_r2/tools/emulator -kernel kernel/kernel.git/arch/arm/boot/zImage

Here we go....

Compile the Emulator

[ ]# mkdir -p /home/android/emulator
[ ]# cd /home/android/emulator
[ ]# wget http://android.googlecode.com/files/android-emulator-1.0_r2.tar.bz2

[ ]# tar jxvf android-emulator-1.0_r2.tar.bz2
[ ]# cd android-emulator-20081210

Reference:
1. Android - An Open Handset Alliance Project
2. Google Code

HOWTO lock screen as root on Fedora Core 9

The default screen saver, xscreensaver, does not support this feature, so we need "xlockmore".

[ ]# yum install xlockmore
[ ]# yum install xautolock

[ ]# xlock

Wednesday, January 7, 2009

HOWTO Install Kermit on Fedora Core 9

Installation
[ ]# mkdir kermit
[ ]# cd kermit
[ ]# wget ftp://kermit.columbia.edu/kermit/archives/cku211.tar.gz
[ ]# tar zxvf cku211.tar.gz
[ ]# make linux
[ ]# make install

User Manual
[ ]# kermit -l /dev/ttyS0 -b 9600 -c

Reference:
1. http://www.columbia.edu/kermit

Monday, December 29, 2008

HOWTO compile Optware on Fedora Core 9

1. Checkout source code from SVN server
[ ]# mkdir /home/NSLU2-Linux
[ ]# cd /home/NSLU2-Linux
[ ]# svn co http://svn.nslu2-linux.org/svnroot/optware/trunk optware
[ ]# cd optware

2.1 For Linksys NSLU2 platform:
[ ]# make nslu2-target
[ ]# make

2.2 For ts72xx platform:
[ ]# make ts72xx-target
[ ]# make
-- Failed

Reference:
1. http://trac.nslu2-linux.org/optware
2. http://peter.korsgaard.com/articles/debian-nslu2.php

Friday, December 26, 2008

Thursday, December 25, 2008

HOWTO compile OpenWrt (Kamikaze) on Fedora Core 9

1. Checkout Kamikaze from https://dev.openwrt.org/
Development branch:
[ ]$ mkdir /home/scott/Kamikaze
[ ]$ cd /home/scott/Kamikaze
[ ]$ svn co https://svn.openwrt.org/openwrt/trunk/
[ ]$ cd trunk

2. Checkout more packages (for Xorg...)

[ ]$ make package/symlinks

3. Enter menuconfig-style menu, enable X.

4. Install some RPMs
[ ]$ rpm -ivh eet-1.0.1-1.fc9.i386.rpm
[ ]$ rpm -ivh evas-0.9.9.043-2.fc9.i386.rpm
[ ]$ rpm -ivh ecore-0.9.9.043-1.fc9.i386.rpm
[ ]$ rpm -ivh embryo-0.9.9.043-1.fc9.i386.rpm
[ ]$ rpm -ivh edje-0.9.9.043-1.fc9.i386.rpm

5. Compile OpenWrt!
[ ]$ make
or
[ ]$ make V=99

6. That's it.