2014年12月2日星期二

Add Board in U-Boot

1) Create Directory: /board/{VENDOR}/{BRDNAME}

2) Check similar driver? GPIO?

2a) For example, if we want to modify GPIO, create the C src file in /driver/gpio/{MARCH}_gpio.c

2b) In the /drivers/gpio/Makefile, add:
COBJS-$(CONFIG_{MARCH}_GPIO) += {BRDNAME}_gpio.o

2c) Create file: include/configs/{BRDNAME}.h
add #define CONFIG_{BRDNAME}_GPIO

3) CPU

3a) Create configs/{BRDNAME}_defconfig in the /configs directory
CONFIG_{ARCH}=y
CONFIG_TARGET_{BRDNAME}=y


3b) In arch/{ARCH}/Kconfig, add:
config TARGET_{BRDNAME}
    bool "Support {BRDNAME}"
    select CPU_{MARCH}


3c) In arch/{ARCH}/Kconfig, add:
source "board/{VENDOR}/{BRDNAME}/Kconfig"

4) Place relevant src files in
/board/{VENDOR}/{BRDNAME}

5) Add your Device in boards.cfg

6) Add Kconfig file:
if TARGET_{BRDNAME}

config SYS_BOARD
    default "{BRDNAME}"

config SYS_VENDOR
    default "{VENDOR}"

config SYS_SOC
    default "{ARCH}"

config SYS_CONFIG_NAME
    default "{BRDNAME}"

endif


2014年11月30日星期日

Communicate thru crossover network cable in Windows

Hints: Some network cards support auto crossover, do not need crossover cable actually.

Computer A:
manual set IP: static, 192.168.2.1
subnet mask: 255.255.255.0
manual set Gateway: 192.168.2.2
preferred DNS Server: 192.168.2.2


Computer B:
manual set IP: static, 192.168.2.2
subnet mask: 255.255.255.0
manual set Gateway: 192.168.2.1
preferred DNS Server: 192.168.2.1



Support exFAT in debian

Install relevant applications:
  sudo apt-get install exfat-fuse exfat-utils

List the disk
  fdisk -l 

Format:

  mkfs.exfat -n LABEL /dev/sdXn
Check file system command:
  fsck.exfat /dev/sdXn

Install flash plugin

apt-get install flashplugin-nonfree

2014年3月31日星期一

My conkyrc file (~/.conkyrc)

background yes
use_xft yes
xftfont Sans:size=8
xftalpha 1
update_interval 1.0
total_run_times 0
own_window yes
own_window_transparent yes
own_window_type desktop
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
minimum_size 100 100
maximum_width 300
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders yes
default_color white
default_shade_color black
default_outline_color white
alignment top_right
gap_x 12
gap_y 80
no_buffers yes
uppercase no
cpu_avg_samples 2
override_utf8_locale no

TEXT
${color FFFFFF}${font sans-serif:bold:size=8:}SYSTEM${hr 2}
${color FFFFFF}${font sans-serif:normal:size=8}$sysname $kernel $alignr $machine
Host:$alignr$nodename
Uptime:$alignr$uptime

${font sans-serif:bold:size=8}${color FFFFFF}PROCESSORS ${hr 2}${font sans-serif:normal:size=8}${color
FFFFFF}
CPU: ${cpu cpu0}% ${cpubar cpu0}

${font sans-serif:bold:size=8}${color FFFFFF}MEMORY ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}RAM $alignc $mem / $memmax $alignr $memperc%
$membar

${font sans-serif:bold:size=8}${color FFFFFF}DISKS ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}/ $alignc ${fs_used /} / ${fs_size /} $alignr${fs_used_perc /}%
${fs_bar /}
Home $alignc ${fs_used /home/yip} / ${fs_size /home/yip} $alignr ${fs_used_perc /home/yip}%
${fs_bar /home/yip}

${font sans-serif:bold:size=8}${color FFFFFF}TOP PROCESSES ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}
${top_mem name 1}${alignr}${top mem 1} %
${top_mem name 2}${alignr}${top mem 2} %
${top_mem name 3}${alignr}${top mem 3} %
${top_mem name 4}${alignr}${top mem 4} %
${top_mem name 5}${alignr}${top mem 5} %

${font sans-serif:bold:size=8}${color FFFFFF}NETWORK ${hr 2}
${font sans-serif:normal:size=8}${color FFFFFF}IP address: $alignr ${addr enp2s0}

$alignr Download
${downspeedgraph enp2s0}
${downspeed enp2s0}/s $alignr ${totaldown enp2s0}

$alignr Upload
${upspeedgraph enp2s0}
${upspeed enp2s0}/s $alignr ${totalup enp2s0}

${color #FFFFFF}Inbound Connection ${alignr} Local Service/Port$color
 ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
 ${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
 ${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
 ${tcp_portmon 1 32767 rhost 3} ${alignr} ${tcp_portmon 1 32767 lservice 3}
 ${tcp_portmon 1 32767 rhost 4} ${alignr} ${tcp_portmon 1 32767 lservice 4}
${color #FFFFFF}Outbound Connection ${alignr} Remote Service/Port$color
 ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
 ${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
 ${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
 ${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
 ${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
 ${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
 ${tcp_portmon 32768 61000 rhost 6} ${alignr} ${tcp_portmon 32768 61000 rservice 6}
 ${tcp_portmon 32768 61000 rhost 7} ${alignr} ${tcp_portmon 32768 61000 rservice 7}
 ${tcp_portmon 32768 61000 rhost 8} ${alignr} ${tcp_portmon 32768 61000 rservice 8}
 ${tcp_portmon 32768 61000 rhost 9} ${alignr} ${tcp_portmon 32768 61000 rservice 9}

install acrobat reader using makepkg

install acrobat reader using makepkg

$wget https://aur.archlinux.org/packages/ac/acroread/acroread.tar.gz
$tar -xvzf acroread.tar.gz
$cd acroread
$makepkg -s
$sudo pacman -U *.pkg.tar.xz

if dependence not found - lib32-gtk2..etc...
enable the multilab section in /etc/pacman.cong
------------------------------------------------------------------------------------------------------

To use the multilib repository, uncomment the [multilib] section in /etc/pacman.conf:
[multilib]
Include = /etc/pacman.d/mirrorlist
You will then need to update the package list by running pacman with the -Sy switch.

Note:
  • If the system has the base-devel package group installed, users must replace the [extra] versions with the [mutlilib] versions as shown below.
  • gcc-multilib is capable of building 32-bit and 64-bit code. You can safely install multilib-devel to replace the packages shown below, but you still need base-devel for the other packages it includes. See https://bbs.archlinux.org/viewtopic.php?id=102828 for more information.
# pacman -S gcc-multilib
resolving dependencies...
warning: dependency cycle detected:
warning: lib32-gcc-libs will be installed before its gcc-libs-multilib dependency
looking for inter-conflicts...
:: gcc-libs-multilib and gcc-libs are in conflict. Remove gcc-libs? [y/N] y
:: binutils-multilib and binutils are in conflict. Remove binutils? [y/N] y
:: gcc-multilib and gcc are in conflict. Remove gcc? [y/N] y
:: libtool-multilib and libtool are in conflict. Remove libtool? [y/N] y

Remove (4): gcc-libs-4.6.1-1  binutils-2.21.1-1  gcc-4.6.1-1  libtool-2.4-4

Total Removed Size:   87.65 MB

Targets (7): lib32-glibc-2.14-4  lib32-gcc-libs-4.6.1-1  gcc-libs-multilib-4.6.1-1  binutils-multilib-2.21.1-1
             gcc-multilib-4.6.1-1  lib32-libtool-2.4-2  libtool-multilib-2.4-2

Total Download Size:    25.04 MB
Total Installed Size:   108.27 MB

Proceed with installation? [Y/n]
Reference: https://wiki.archlinux.org/index.php/makepkg

Important:
Even I do the above operation,
I still miss the lib32-pangox-compat dependency,
I manually build above library (extract, config, make, make install) and then delete the  pangox-compat dependency in the PKGBUILD flag,
and it can normally run now... :(