2012-12-28

SliTaz armhf -- LXDE



root@slitaz:~# uname -a
Linux slitaz 3.2.27-slitaz #1 PREEMPT Fri Dec 14 15:01:17 CST 2012 armv6l GNU/Linux
root@slitaz:~# dmesg | grep Machine
[ 0.000000] Machine: BCM2708
root@slitaz:~# ps | tail -23
13367 root 0:04 /usr/bin/slim -d
13373 root 1:48 /usr/bin/Xorg -nolisten tcp -auth /var/run/slim.auth vt07
13378 tux 0:05 /usr/bin/openbox --startup /usr/lib/openbox/openbox-autostart OPENBOX
13397 tux 0:00 xterm
13405 tux 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
13406 tux 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
13408 tux 0:00 sh
13414 tux 0:23 lxpanel
13416 tux 0:00 /usr/lib/menu-cache/menu-cached
13422 tux 0:06 obconf
13425 tux 0:05 leafpad /home/tux/.config/openbox/menu.xml
13427 tux 0:00 {bootlog} /bin/sh /usr/bin/bootlog box
13430 tux 0:07 yad --text-info --title=Boot Log --window-icon=text-plain --width=600 --height=400 --button=gtk-close:0
13434 tux 4:59 gtk-demo
13439 tux 0:03 mtpaint
13739 root 0:00 pure-ftpd (SERVER)
13784 tux 0:03 lxappearance
13812 root 0:00 [kworker/0:1]
13832 root 0:00 /usr/sbin/dropbear -b /etc/dropbear/banner
13855 root 0:01 /usr/sbin/dropbear -b /etc/dropbear/banner
13856 root 0:00 -sh
13887 root 0:00 ps
13888 root 0:00 tail -23
root@slitaz:~#

2012-12-23

SliTaz armhf -- Xorg


root@slitaz:~# uname -a
Linux slitaz 3.2.27-slitaz #1 PREEMPT Fri Dec 14 15:01:17 CST 2012 armv6l GNU/Linux

root@slitaz:~# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 433.0M 83.7M 326.9M 20% /
tmpfs 92.3M 136.0K 92.2M 0% /run
devtmpfs 92.2M 0 92.2M 0% /dev
tmpfs 92.3M 0 92.3M 0% /dev/shm

root@slitaz:~# X -version

X.Org X Server 1.12.1
Release Date: 2012-04-13
X Protocol Version 11, Revision 0
Build Operating System: SliTaz-ARM GNU/Linux
Current Operating System: Linux slitaz 3.2.27-slitaz #1 PREEMPT Fri Dec 14 15:01:17 CST 2012 armv6l
Kernel command line: dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1680 bcm2708_fb.fbheight=1050 bcm2708.boardrev=0x2 bcm2708.serial=0x7b32f4ce smsc95xx.macaddr=B8:27:EB:32:F4:CE sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0xc000000 vc_mem.mem_size=0x10000000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait devtmpfs.mount=0
Build Date: 19 December 2012 10:40:53AM

Current version of pixman: 0.26.0
Before reporting problems, check http://www.slitaz.org/
to make sure that you have the latest version.

root@slitaz:~# ps | tail -25
124 root 0:00 [bcm2708_spi.0]
179 root 0:00 udevd --daemon
215 root 0:00 [kworker/0:2]
221 root 0:00 /sbin/udhcpc -b -T 1 -A 12 -i eth0 -p /var/run/udhcpc.eth0.pid
231 messageb 0:00 /usr/bin/dbus-daemon --system
244 haldaemo 0:00 /usr/sbin/hald --daemon=yes
245 root 0:00 hald-runner
249 root 0:00 {hald-addon-inpu} hald-addon-input: Listening on /dev/input/event1 /dev/input/event0
269 root 0:03 /usr/bin/slim -d
276 root 0:01 /usr/bin/Xorg -nolisten tcp -auth /var/run/slim.auth vt07
285 root 0:00 /usr/sbin/dropbear -b /etc/dropbear/banner
297 root 0:00 -sh
298 root 0:00 /sbin/getty 38400 tty2
299 root 0:00 /sbin/getty 38400 tty3
300 tux 0:00 /usr/bin/openbox --startup /usr/lib/openbox/openbox-autostart OPENBOX
316 tux 0:00 xterm
334 tux 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
335 tux 0:00 /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session
338 tux 0:00 sh
363 root 0:00 [kworker/0:0]
374 root 0:00 udevd --daemon
375 root 0:00 /usr/sbin/dropbear -b /etc/dropbear/banner
376 root 0:00 -sh
392 root 0:00 ps
393 root 0:00 tail -25
root@slitaz:~#

2012-12-15

SliTaz armhf -- 20121214


slitaz-armhf-mini-2012-12-14.zip 46M

Changelog
2012-12-14
- update kernel-3.2.27
- update firmware-2012-10-25 17c8799375
- adding support for the 512MB Model B

SliTaz armhf: 46MB Linux Distribution for Raspberry Pi

root@slitaz:~# zcat /proc/config.gz | grep TMPFS
CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y
CONFIG_TMPFS=y
CONFIG_TMPFS_POSIX_ACL=y
CONFIG_TMPFS_XATTR=y
root@slitaz:~# cat /proc/cmdline
dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1680 bcm2708_fb.fbheight=1050 bcm2708.boardrev=0x2 bcm2708.serial=0x7b32f4ce smsc95xx.macaddr=B8:27:EB:32:F4:CE sdhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0xf000000 vc_mem.mem_size=0x10000000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait devtmpfs.mount=0

root@slitaz:~# tail -5 /boot/config.txt
# Amount of memory to use for the GPU
gpu_mem=32

# for more options see http://elinux.org/RPi_config.txt


2012-12-04

SliTaz armhf







Update 20121214
slitaz-armhf-mini-2012-12-14.zip 46M

SliTaz armhf

SliTaz armhf is based on SliTaz Linux, which uses the hard-float ABI for the Raspberry Pi.

Given the preponderance of hardfp performance over its register ignorant peers,
this will be useful in eking every last drop of performance out of the hardware. -- QtonPi wiki

Default login Username: root Password: root


RPi_Easy_SD_Card_Setup
===============================================================================
Manually resizing the SD card partitions (Optional)
http://elinux.org/RPi_Easy_SD_Card_Setup


/etc/init.d/README for SliTaz init boot scripts.
===============================================================================
SliTaz doesn't use runlevels; inittab starts /etc/init.d/rcS, which uses the
config file /etc/rcS.conf to run all scripts specified with $RUN_SCRIPTS, and
then starts all daemons specified with $RUN_DAEMONS. The idea is to centralize
the main system boot initialization in one configuration file. Init scripts can
use the rc.functions file (part of the base-files) to call for the status
function. Daemons can use /etc/daemons.conf to call for default options; in
this way users/admins don't need to edit the daemon init script located
in the /etc/init.d directory.
===============================================================================
http://www.slitaz.org/


# /etc/network.conf: SliTaz system wide networking configuration.
# Config file used by: /etc/init.d/network.sh
#


Tazpkg - Tiny autonomous zone packages manager.
===============================================================================
#!/bin/sh
# Tazpkg - Tiny autonomous zone packages manager.
#
# This is a lightwight packages manager for *.tazpkg files written in
# SHell script. It works well with Busybox ash shell and bash. Tazpkg lets you
# list, install, remove, download or get information about a package. You can
# use 'tazpkg usage' to get a list of commands with short descriptions. Tazpkg
# also resolves dependencies and can upgrade packages from a mirror. I18n is
# done using gettext and eval_gettext, ex:
# gettext "displayed text"; echo
# eval_gettext "display \$VARIABLE"; echo
#
# (C) 2007-2012 SliTaz - GNU General Public License v3.
#
# Authors : See AUTHORS files


Mirror

This site provides SliTaz GNU/Linux official and community documentation.

Raspberry Pi wiki


2012-11-19

Raspi -- hardfloat - 4

Boot Raspberry Pi
Broadcom BCM2835 ARMv6

# spk-add mc
Midnight Commander - ncurses based file manager.


1.
root@slitaz:~# uname -a
Linux slitaz 3.2.14-slitaz #1 PREEMPT Wed Oct 31 14:55:53 CST 2012 armv6l GNU/Linux

2.
root@slitaz:~# dmesg | head -5
Initializing cgroup subsys cpu
Linux version 3.2.14-slitaz (root@slitaz) (gcc version 4.6.3 (SliTaz) ) #1 PREEMPT Wed Oct 31 14:55:53 CST 2012
CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: BCM2708


3.
root@slitaz:~# spk info

Spk info
================================================================================
Architecture : arm
Database : /var/lib/tazpkg/installed
Cache info : 4.0K /var/cache/tazpkg
Mirror URL : http://192.168.1.37/cross/armhf/packages/
Extra mirrors : 0
Installed : 17
================================================================================

root@slitaz:~#


4.
root@slitaz:~# spk-add mc

Using official mirror: mc-4.8.3-armhf.tazpkg
Connecting to 192.168.1.37 (192.168.1.37:80)
mc-4.8.3-armhf.tazpk 100% |*******************************| 683k 0:00:00 ETA
Missing: glib
Missing: e2fsprogs
Missing dependencies: 2

Using official mirror: glib-2.32.1-armhf.tazpkg
Connecting to 192.168.1.37 (192.168.1.37:80)
glib-2.32.1-armhf.ta 100% |*******************************| 388k 0:00:00 ETA
Missing: pcre
Missing: libffi
Missing: libxml2
Missing: elfutils
Missing dependencies: 4

Using official mirror: pcre-8.30-armhf.tazpkg
Connecting to 192.168.1.37 (192.168.1.37:80)
pcre-8.30-armhf.tazp 100% |*******************************| 79044 0:00:00 ETA
Missing dependencies: 0

Adding pcre
================================================================================
Copying package... [ Done ]
Extracting archive: 80.0K [ Done ]
Installing files: 9 [ Done ]
================================================================================
pcre 8.30 is installed

Using official mirror: libffi-3.0.11-armhf.tazpkg
Connecting to 192.168.1.37 (192.168.1.37:80)
libffi-3.0.11-armhf. 100% |*******************************| 12316 0:00:00 ETA
Missing dependencies: 0

Adding libffi
================================================================================
Copying package... [ Done ]
Extracting archive: 16.0K [ Done ]
Installing files: 3 [ Done ]
================================================================================
libffi 3.0.11 is installed


Using official mirror: libxml2-2.8.0-armhf.tazpkg
Connecting to 192.168.1.37 (192.168.1.37:80)
libxml2-2.8.0-armhf. 100% |*******************************| 385k 0:00:00 ETA
Missing dependencies: 0

Adding libxml2
================================================================================
Copying package... [ Done ]
Extracting archive: 388.0K [ Done ]
Installing files: 3 [ Done ]
================================================================================
libxml2 2.8.0 is installed


Using official mirror: elfutils-0.153-armhf.tazpkg
Connecting to 192.168.1.37 (192.168.1.37:80)
elfutils-0.153-armhf 100% |*******************************| 174k 0:00:00 ETA
Missing dependencies: 0

Adding elfutils
================================================================================
Copying package... [ Done ]
Extracting archive: 176.0K [ Done ]
Installing files: 32 [ Done ]
================================================================================
elfutils 0.153 is installed

Adding glib
================================================================================
Copying package... [ Done ]
Extracting archive: 392.0K [ Done ]
Installing files: 21 [ Done ]
================================================================================
glib 2.32.1 is installed

Adding e2fsprogs
================================================================================
Copying package... [ Done ]
Extracting archive: 292.0K [ Done ]
Modified package: busybox
Overwriting file: /sbin/tune2fs
Modified package: busybox
Overwriting file: /sbin/findfs
Installing files: 34 [ Done ]
================================================================================
e2fsprogs 1.42.3 is installed

Adding mc
================================================================================
Copying package... [ Done ]
Extracting archive: 684.0K [ Done ]
Installing files: 182 [ Done ]
================================================================================
mc 4.8.3 is installed


5.
root@slitaz:~# mc -V
GNU Midnight Commander 4.8.3
Built with GLib 2.32.4
Using the ncurses library
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With internationalization support
With multiple codepages support
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
Data types: char: 8; int: 32; long: 32; void *: 32; size_t: 32; off_t: 64;
root@slitaz:~#


6.
root@slitaz:~# readelf -A /usr/bin/mc
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_DIV_use: Not allowed
root@slitaz:~#


7.
root@slitaz:~# slitaz

SliTaz GNU/Linux
================================================================================
Release : cooking
Architecture : arm
Kernel : 3.2.14-slitaz
Boot options : dma.dmachans=0x3c bcm2708_fb.fbwidth=644 bcm2708_fb.fbheight=448 bcm2708.boardrev=0x2 bcm2708.serial=0x7b32f4ce smsc95xx.macaddr=B8:27:EB:32:F4:CE dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Home path : /home/slitaz
Configs : /etc/slitaz
Log files : /var/log/slitaz
Packages DB : /var/lib/tazpkg
Installed : 27 packages
Mirror : http://192.168.1.37/cross/armhf/packages/
================================================================================
Config file: /etc/slitaz/slitaz.conf
.

2012-11-18

Avoiding libtool minefields when cross-compiling


Avoiding libtool minefields when cross-compiling
http://www.metastatic.org/text/libtool.html

If you've ever tried to cross-compile a free software project for a different architecture on GNU/Linux, you may well have run into the situation where you compile a library with your cross toolchain, install it in a “staging” directory that will hold your root filesystem (for example, you compile the library to go into /usr/lib, but you install it in /tmp/rootfs/usr/lib, because that's where you're building your new root filesystem. You do this correctly: specify your --prefix=/usr when you configure, but provide DESTDIR=/tmp/rootfs when you make install), and you try to compile another library that links against that library. Everything goes fine (the author of the program may have even written his configure script properly, so you can configure it to use the correct toolchain), but at the link step, you get this:

/bin/sh libtool --mode=link target-gcc -c -O2 -o libbar.so ... -lfoo
target-gcc -c -O2 -o libbar.so ... /usr/lib/libfoo.so
/usr/lib/libfoo.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

Now, why is the command trying to link against /usr/lib/libfoo.so, which is your system's version of libfoo, and not /tmp/rootfs/usr/lib/libfoo.so? You might play with compiler and linker flags, try to hack and understand the libtool shell script (best of luck if you can decipher it), and end up cursing the ancestors of those who ever came up with such a dumb system.

The problem turns out to be that libfoo and libbar in this example both use libtool, and that the prefix happens to conflict with the system's library locations; when libtool installs a library, you'll see it installs libfoo.la.

What's with that file? You may, reasonably, expect to see one or two different kinds of library file: libfoo.a, which is just an archive of object files, and which you can statically link into your program; and libfoo.so, a dynamically loadable, sharable library. What's a .la? Just cat one, and you'll see:

$ cat /usr/lib/libesd.la
# libesd.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.95 2004/04/11 05:50:42) Debian: 224 $
#
# Please DO NOT delete this file!
# It is necessary for linking the library.

# The name that we can dlopen(3).
dlname='libesd.so.0'

# Names of this library.
library_names='libesd.so.0.2.36 libesd.so.0 libesd.so'

# The name of the static archive.
old_library='libesd.a'

# Libraries that this one depends upon.
dependency_libs=' -L/usr/lib /usr/lib/libaudiofile.la -lm'

# Version information for libesd.
current=2
age=2
revision=36

# Is this an already installed library?
installed=yes

# Should we warn about portability when linking against -modules?
shouldnotlink=no

# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''

# Directory that this library needs to be installed in:
libdir='/usr/lib'

Notice the last line? It says that libesd is installed in /usr/lib, so when libtool finds your libfoo.la in your temporary root filesystem tree, that file tells it to go look in /usr/lib. So, you have to prevent the libtool file from confusing the libtool script at link time.

You can probably just remove the libtool library file, and rely on your linker to figure out what you mean by -lfoo (even though the .la strongly admonishes you not to delete it), but perhaps better is to just update libdir in this file to point to where your library is temporarily installed. Using GNU sed you can do this:

sed -i~ -e "s;/usr;/tmp/rootfs/usr;" /tmp/rootfs/usr/lib/libfoo.la

I do this just after installing the cross-compiled library into my temporary root filesystem tree.

You likely won't need the libtool files any more when you install (if you're targeting an embedded Linux system), so you don't care if those files are correct once installed on the target. You'll probably just remove them from the final image, anyway.

I wrote this because I spent a long night of fighting libtool, Googling for help and finding none, and finally figuring this out. This is the second time I've even figured this out, having forgotten the solution the first time. Hopefully, this will help you out if you encounter this issue.
The wrong-gcc problem

For some packages, you seem to also run into trouble where libtool can't figure out what you're doing:

$ libtool --mode=compile target-gcc -g -O2 -c foo.c
libtool: compile: unable to infer tagged configuration
libtool: compile: specify a tag with `--tag'

OK, so it couldn't figure out that we're compiling C code. No problem, just add the tag --tag=CC. Works when we compile:

$ libtool --tag=CC --mode=compile target-gcc -g -O2 -c foo.c
target-gcc -g -O2 -c foo.c -fPIC -DPIC -o .libs/foo.o
target-gcc -g -O2 -c foo.c -o foo.o >/dev/null 2>&1

But when we link, libtool tries to call the native gcc:

$ libtool --tag=CC --mode=link target-gcc -rpath /usr/lib -o libfoo.la foo.lo
gcc -shared .libs/foo.o -Wl,-soname -Wl,libfoo.so.0 -o .libs/libfoo.so.0.0.0
/usr/bin/ld: .libs/foo.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/foo.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/foo.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/foo.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/foo.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/foo.o: Relocations in generic ELF (EM: 40)
.libs/foo.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status

One rumored workaround (I haven't tried this, since I haven't had to cross compile anything in a while) is to specify a proper rpath in LDFLAGS:

-Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,${STAGING_DIR}/usr/lib -L${STAGING_DIR}/lib -L${STAGING_DIR}/usr/lib

Thanks to Waldemar Brodkorb for this workaround. Let me know if this works for you.

Another solution to this problem is to just install a cross libtool, which you'll use in preference to your system's libtool. It's easy enough to do; go grab the distribution, unpack it, and install it with:

$ tar xzf libtool-1.5.22.tar.gz
$ cd libtool-1.5.22
libtool-1.5.22 $ ./configure --prefix=/opt/Toolchain --host=target --program-prefix=target-
configure output...
libtool-1.5.22 $ make
make output...
libtool-1.5.22 $ sudo make install

Then, you can just use target-libtool when cross compiling. That libtool (which is still just a shell script, so you needn't worry about running it on the host) will be set up properly for using your target-gcc. You usually just have to add an environment variable LIBTOOL=target-libtool when you configure your package.

Happy Hacking.

Copyright © 2007, 2009 Casey Marshall
casey dot s dot marshall at gmail dot com

This is the version of March 7, 2009.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 United States License.

2012-11-10

raspi - hardfloat-3

ArmHardFloatPort
This page gathers thoughts and ideas around a new hard-float ABI ARM port for Debian, hopefully to be released for the the first time with Wheezy (7.0).

Contents

Current Status
Rationale
Supported devices
Background information
VFP
ARM EABI
GCC floating-point options
ld.so hwcaps
Endianess, architecture level, CPU, VFP level
Name of the port
Triplet
Performance improvements and benchmarks
NEON
Hardware
Task List
Partial reference of SoC and supported ISAs
Port naming debate notes
Compiler
Minimum CPU & FPU
Summary of Benefits

[..]
Background information

This section provides some background information on FPUs, ARM EABI, GCC floating-point ABIs, hwcaps...

Raspbian Benchmarking – armel vs armhf
Softfp and Hardfp

For ARM there are two different ABIs (Application Binary Interfaces), soft/softfp and hard. ‘soft’ doesn’t use the FPU at all and uses gcc maths replacement functions to emulate floating point arithmetic. ‘softfp’ uses the FPU but arguments to functions are passed through the integer registers and then passed to the floating point unit. ‘hard’ is using the FPU directly with data passed directly to the floating point unit registers. While soft/softfp are forwards compatible, ie. a ‘soft’ app can run on a softfp system, but not vice-versa, a ‘hardfloat’ application can run on neither of those systems. This means that in order to use hardfloat the system has to be completely recompiled for the hardfloat ABI, down to the last library and program.


Ref:
http://alanyih.blogspot.tw/2012/07/raspi-hardfloat.html
.

2012-11-07

raspi -- hardfloat / readelf

readelf -A

Tag_FP_arch: VFPv2
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers


softfloat
root@slitaz:~# readelf -A /home/slitaz-arm/distro/lib/libc-2.13.so
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_DIV_use: Not allowed
root@slitaz:~#


VS.


hardfloat
ref: http://alanyih.blogspot.tw/2012/11/slitaz-cross-testsuite.html
[CHECKING] readelf -A test.out
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_DIV_use: Not allowed

2012-11-04

Slitaz -- cross

cross

root@slitaz:/# cross info
Tools prefix : --prefix=/cross/arm/tools
Target sysroot : --with-sysroot=/cross/arm/sysroot

Cross Toolchain information
================================================================================
Target arch : arm
C Compiler : arm-slitaz-linux-gnueabi-gcc
Build directory : /cross/arm
Tools prefix : /cross/arm/tools/bin
Arch sysroot : /cross/arm/sysroot
================================================================================

GCC version
================================================================================
Using built-in specs.
COLLECT_GCC=arm-slitaz-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/lto-wrapper
Target: arm-slitaz-linux-gnueabi
Configured with: ../gcc-4.6.3/configure --prefix=/cross/arm/tools --libexec=/cross/arm/tools/lib --target=arm-slitaz-linux-gnueabi --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit --with-system-zlib --enable-plugin --disable-multilib --disable-libssp --disable-checking --disable-werror --with-pkgversion=SliTaz --with-bugurl=https://bugs.slitaz.org/ --with-sysroot=/cross/arm/sysroot --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-languages=c,c++
Thread model: posix
gcc version 4.6.3 (SliTaz)
================================================================================

root@slitaz:/#

Slitaz -- cross testsuite

cross testsuite

[CHECKING] file test.out
test.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped


root@slitaz:/# cross testsuite
Tools prefix : --prefix=/cross/arm/tools
Target sysroot : --with-sysroot=/cross/arm/sysroot
[COMPILING] arm-slitaz-linux-gnueabi-gcc -v -Wall -o test.out test.c
Using built-in specs.
COLLECT_GCC=arm-slitaz-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/lto-wrapper
Target: arm-slitaz-linux-gnueabi
Configured with: ../gcc-4.6.3/configure --prefix=/cross/arm/tools --libexec=/cross/arm/tools/lib --target=arm-slitaz-linux-gnueabi --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit --with-system-zlib --enable-plugin --disable-multilib --disable-libssp --disable-checking --disable-werror --with-pkgversion=SliTaz --with-bugurl=https://bugs.slitaz.org/ --with-sysroot=/cross/arm/sysroot --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-languages=c,c++
Thread model: posix
gcc version 4.6.3 (SliTaz)
COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'test.out' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp'
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/cc1 -quiet -v test.c -quiet -dumpbase test.c -march=armv6 -mfloat-abi=hard -mfpu=vfp -auxbase test -Wall -version -o /tmp/ccDffF34.s
GNU C (SliTaz) version 4.6.3 (arm-slitaz-linux-gnueabi)
compiled by GNU C version 4.6.3, GMP version 5.0.4, MPFR version 3.1.0-p4, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=65536
ignoring nonexistent directory "/cross/arm/sysroot/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/include
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/include-fixed
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/include
/cross/arm/sysroot/usr/include
End of search list.
GNU C (SliTaz) version 4.6.3 (arm-slitaz-linux-gnueabi)
compiled by GNU C version 4.6.3, GMP version 5.0.4, MPFR version 3.1.0-p4, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=65536
Compiler executable checksum: c79421fa632f9d876a099c488d2165db
COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'test.out' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp'
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/bin/as -march=armv6 -mfloat-abi=hard -mfpu=vfp -meabi=5 -o /tmp/cctOLj6s.o /tmp/ccDffF34.s
COMPILER_PATH=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/bin/
LIBRARY_PATH=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/lib/:/cross/arm/sysroot/lib/:/cross/arm/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'test.out' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp'
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/collect2 --sysroot=/cross/arm/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-linux.so.3 -X -m armelf_linux_eabi -o test.out /cross/arm/sysroot/usr/lib/crt1.o /cross/arm/sysroot/usr/lib/crti.o /cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/crtbegin.o -L/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3 -L/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/lib -L/cross/arm/sysroot/lib -L/cross/arm/sysroot/usr/lib /tmp/cctOLj6s.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/crtend.o /cross/arm/sysroot/usr/lib/crtn.o

[CHECKING] file test.out
test.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped

[CHECKING] readelf -A test.out
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_FP_arch: VFPv2
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_ABI_HardFP_use: SP and DP
Tag_ABI_VFP_args: VFP registers
Tag_DIV_use: Not allowed
root@slitaz:/#

2012-10-31

Slitaz -- chroot arm



root@slitaz:~# tazdev -c --arch=arm

Mounting virtual filesystems... [ Done ]
Chrooting to: /home/slitaz/cooking/arm/chroot


1.
root@slitaz:~# slitaz

SliTaz GNU/Linux
================================================================================
Release :
Architecture : i486
Kernel : 2.6.37-slitaz
Boot options : root=/dev/sda7 autologin acpi=off
Home path :
Configs :
Log files :
Packages DB : /var/lib/tazpkg
Installed : 481 packages
Mirror : http://mirror.slitaz.org/packages/4.0/
/media/mirror/slitaz/packages/4.0/
================================================================================
Config file: /etc/slitaz/slitaz.conf

root@slitaz:~# tazdev -c --arch=arm

Mounting virtual filesystems... [ Done ]
Chrooting to: /home/slitaz/cooking/arm/chroot

root@slitaz:/# slitaz

SliTaz GNU/Linux
================================================================================
Release : cooking
Architecture : i486
Kernel : 2.6.37-slitaz
Boot options : root=/dev/sda7 autologin acpi=off
Home path : /home/slitaz
Configs : /etc/slitaz
Log files : /var/log/slitaz
Packages DB : /var/lib/tazpkg
Installed : 149 packages
Mirror : http://mirror.slitaz.org/packages/cooking/
================================================================================
Config file: /etc/slitaz/slitaz.conf

root@slitaz:/#


2.
tux@slitaz:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i486-slitaz-linux/4.5.2/lto-wrapper
Target: i486-slitaz-linux
Configured with: /home/slitaz/wok/gcc/source/gcc-4.5.2/configure --libexecdir=/usr/lib --enable-nls --enable-languages=c,c++,objc,fortran --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-lto --enable-threads=posix --disable-bootstrap --with-pkgversion=SliTaz --with-tune=i486 --build=i486-slitaz-linux --host=i486-slitaz-linux
Thread model: posix
gcc version 4.5.2 (SliTaz)
tux@slitaz:~$ sudo tazdev -c --arch=arm

Mounting virtual filesystems... [ Done ]
Chrooting to: /home/slitaz/cooking/arm/chroot

root@slitaz:/# arm-slitaz-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-slitaz-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/lto-wrapper
Target: arm-slitaz-linux-gnueabi
Configured with: ../gcc-4.6.3/configure --prefix=/cross/arm/tools --libexec=/cross/arm/tools/lib --target=arm-slitaz-linux-gnueabi --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit --with-system-zlib --enable-plugin --disable-multilib --disable-libssp --disable-checking --disable-werror --with-pkgversion=SliTaz --with-bugurl=https://bugs.slitaz.org/ --with-sysroot=/cross/arm/sysroot --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-languages=c,c++
Thread model: posix
gcc version 4.6.3 (SliTaz)
root@slitaz:/#

2012-10-29

Slitaz -- mtpaint-grab

Grab screenshot

tux@slitaz:~$ cat /usr/share/applications/mtpaint-grab.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Grab screenshot
Name[fr]=Capture d'écran
Name[pt]=Captura de Screenshots
Exec=mtpaint -s
Icon=camera-photo
Type=Application
Terminal=false
Categories=Application;Graphics;


tux@slitaz:~$ tazpkg info mtpaint

Tazpkg information
================================================================================
Package : mtpaint
Version : 3.40
Category : graphics
Short desc : Light paint programm and image manipulation.
Maintainer : pankso@slitaz.org
Depends : gtk+ libpng lcms
Build deps : gtk+-dev libpng-dev lcms-dev
Web site : http://mtpaint.sourceforge.net/
================================================================================
.

Slitaz -- mtpaint


8. Layers

For some types of painting and image manipulation it is convenient to use multiple layers of images rather than a single image. For example you may want to overlay text or drawings over a photograph and then be able to move or edit each layer independently.

8.1 Creating

To start using layers with mtPaint you must first load the image you want to be the background. This is the most important step as all the other layers sit on top of this image (also, the size of the background image determines the size of the final composite image). Next you must create a new layer by using the Layers window ('L' key or View menu). You can then edit, manipulate, load to, or save this new layer just like any other image. The only difference is that this image can have a transparent colour which will show the pixels used on the background image (or lower layers if there are any).


Ctrl-N Create new image
Ctrl-O Open Image
Ctrl-S Save Image
Ctrl-Shift-S Save layers file
Ctrl-Q Quit program

Ctrl-A Select whole image
Escape Select nothing, cancel paste box
J Lasso selection

Ctrl-C Copy selection to clipboard
Ctrl-X Copy selection to clipboard, and then paint current pattern to selection area
Ctrl-V Paste clipboard to centre of current view
Ctrl-K Paste clipboard to location it was copied from
Ctrl-Shift-V Paste clipboard to new layer
Enter/Return Commit paste to canvas
Shift+Enter/Return Commit paste and swap canvas into the clipboard

Arrow keys Paint Mode - Move the mouse pointer
Arrow keys Selection Mode - Nudge selection box or paste box by one pixel
Shift+Arrow keys Nudge mouse pointer, selection box or paste box by x pixels - x is defined by the Preferences window
Ctrl+Arrows Move layer or resize selection box
Ctrl+Shift+Arrows Move layer or resize selection box by x pixels

Enter/Return Paint Mode - Simulate left click
Backspace Paint Mode - Simulate right click

2012-10-25

Slitaz -- pv


Linux dd Command Show Progress Copy Bar With Status


1.
root@slitaz:~# pv -tpreb /media/raspbian/raspi/2012-08-16-wheezy-raspbian.img | dd of=/dev/sdb
1.81GB 0:08:30 [3.62MB/s] [=================================>] 100%           
3788800+0 records in
3788800+0 records out


2.
root@slitaz:~# tazpkg info pv

Tazpkg information
================================================================================
Package    : pv
Version    : 1.1.4
Category   : misc
Short desc : pipe viewer for monitoring data through a pipeline
Maintainer : allan316@gmail.com
Web site   : http://www.ivarch.com/programs/pv.shtml
================================================================================


3.
root@slitaz:~# pv --help | head
Usage: pv [OPTION] [FILE]...
Concatenate FILE(s), or standard input, to standard output,
with monitoring.

  -p, --progress           show progress bar
  -t, --timer              show elapsed time
  -e, --eta                show estimated time of arrival (completion)
  -r, --rate               show data transfer rate counter
  -b, --bytes              show number of bytes transferred
  -f, --force              output even if standard error is not a terminal


4.
root@slitaz:~# ls -lh /media/raspbian/raspi/2012-08-16-wheezy-raspbian.img
-rw-r--r--    1 tux      tux         1.8G Aug 27 22:56 /media/raspbian/raspi/2012-08-16-wheezy-raspbian.img
root@slitaz:~#

raspi -- GPU


Open Source ARM userland


Source code for ARM side libraries for interfacing to Raspberry Pi GPU.

README.md

This repository contains the source code for the ARM side libraries used on Raspberry Pi. These typically are installed in /opt/vc/lib and includes source for the ARM side code to interface to: EGL, mmal, GLESv2, vcos, openmaxil, vchiq_arm, bcm_host, WFC, OpenVG.

Use buildme to build. It requires cmake to be installed and an arm cross compiler.

2012-10-24

Slitaz -- alsamixer


[Mixer] No hardware mixing, inserting volume filter.

menu -->  Multimedia --> Alsamixer Volume mixer


Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)
==========================================================================
ID_VIDEO_CODEC=ffmpeg2
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 256.0 kbit/16.67% (ratio: 32000->192000)
ID_AUDIO_BITRATE=256000
ID_AUDIO_RATE=48000
ID_AUDIO_NCH=2
Selected audio codec: [ffac3] afm: ffmpeg (FFmpeg AC-3)
==========================================================================
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
ID_AUDIO_CODEC=ffac3
[Mixer] No hardware mixing, inserting volume filter.
Starting playback...
[ac3 @ 0x861db5c]frame sync error
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
ID_VIDEO_ASPECT=1.3333
[swscaler @ 0x86bc940]BICUBIC scaler, from yuv420p to rgb24 using C
VO: [x11] 720x480 => 720x540 Planar YV12  [zoom]
[swscaler @ 0x86bc940]No accelerated colorspace conversion found from yuv420p to bgra.

Slitaz -- git-gui



git-gui.desktop

fix
Exec=/usr/lib/git/git-core/git-gui
to
Exec=/usr/lib/git-core/git-gui


1.
tux@slitaz:~$ tazpkg info git-gui

Tazpkg information
================================================================================
Package    : git-gui
Version    : 0.13.0
Category   : development
Short desc : Graphical interface for the Git dRCS.
Maintainer : ben@seawolfsanctuary.com
Depends    : tk git
Build deps : tk git
Web site   : http://www.kernel.org/pub/software/scm/git/docs/git-gui.html
================================================================================


2.
tux@slitaz:~$ cat /usr/share/applications/git-gui.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Git GUI
Exec=/usr/lib/git/git-core/git-gui
Icon=git-gui
Type=Application
Categories=Development;


3.
tux@slitaz:~$ ls -l /usr/lib/git/git-core/git-gui
ls: /usr/lib/git/git-core/git-gui: No such file or directory
tux@slitaz:~$ ls -l /usr/lib/git
ls: /usr/lib/git: No such file or directory


4.
tux@slitaz:~$ tazpkg list-files git-gui | head

Installed files with: git-gui
================================================================================
/usr/bin/git-citool
/usr/bin/git-gui
/usr/bin/git-gui--askpass
/usr/lib/git-core/git-citool
/usr/lib/git-core/git-gui
/usr/lib/git-core/git-gui--askpass
/usr/share/applications/git-gui.desktop
tux@slitaz:~$



 Git權威指南第3章
http://product.china-pub.com/194010

2012-10-16

raspi -- openwrt



openwrt-brcm2708-sdcard-vfat-ext4_240.img.7z   5.5 MB

Description:    
OpenWrt 12.09 Beta running on a Rpi with 240 Mbyte of free memory.

Linux kernel: 3.3.8
Added kernel patches up until (24 Sept. 2012).
Updated Rpi firmware to 25 sept. 2012 version.


1.
BusyBox v1.19.4 (2012-09-12 11:44:04 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 ATTITUDE ADJUSTMENT (Bleeding Edge, r33369)
 -----------------------------------------------------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------


2.
root@OpenWrt:~# uname -a
Linux OpenWrt 3.3.8 #1 PREEMPT Wed Sep 26 10:49:42 CEST 2012 armv6l GNU/Linux


3.
root@OpenWrt:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr B8:27:EB:32:F4:CE 
          inet addr:192.168.1.30  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:133 errors:0 dropped:0 overruns:0 frame:0
          TX packets:138 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10347 (10.1 KiB)  TX bytes:13166 (12.8 KiB)

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5138 (5.0 KiB)  TX bytes:5138 (5.0 KiB)


4.
root@OpenWrt:~# nslookup www.slitaz.org
Server:    127.0.0.1
Address 1: 127.0.0.1 localhost.lan

Name:      www.slitaz.org
Address 1: 94.23.61.29 pangolin.pimentvert.com


5.
root@OpenWrt:~# dmesg | head
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Linux version 3.3.8 (nathan@maya) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #1 PREEMPT Wed Sep 26 10:49:42 CEST 2012
[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
[    0.000000] Machine: BCM2708
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 61440
[    0.000000] free_area_init_node: node 0, pgdat c039059c, node_mem_map c03db000
[    0.000000]   Normal zone: 480 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
.

2012-10-15

mk802 -- tinycore - ssh



1.
root@slitaz:~# ssh tc@192.168.1.31

Secure login powered by Dropbear SSH server on a10Core.

tc@192.168.1.31's password:
(�-
//\ Core is distributed with ABSOLUTELY NO WARRANTY.
v_/_ www.tinycorelinux.com


2.
tc@box:~$ uname -a
Linux box 3.0.42-slitaz #1 PREEMPT Tue Oct 9 19:22:19 UTC 2012 armv7l GNU/Linux


3.
tc@box:~$ dmesg | head -5
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 3.0.42-slitaz (root@slitaz) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #1 PREEMPT Tue Oct 9 19:22:19 UTC 2012
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: sun4i


4.
tc@box:~$ ps | tail
738 root /usr/bin/dropbear -b /etc/dropbear/banner -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rss_host_key
747 root /bin/bterm -f /usr/share/fonts/bterm.bogl /sbin/autologin
748 root /sbin/getty 38400 tty2
750 root /sbin/getty 38400 tty3
751 tc -sh
798 root /sbin/udhcpc -b -i eth1 -x hostname box -p /var/run/udhcpc.eth1.pid
1066 root /usr/bin/dropbear -b /etc/dropbear/banner -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rss_host_key
1067 tc -sh
1099 tc ps
1100 tc tail
tc@box:~$


5.
tc@box:~$ cat /var/log/tc-config
Booting Core 4.6.2
Running Linux Kernel 3.0.42-slitaz.
Checking boot options...Done.
Starting udev daemon for hotplug support...Done.
swapon: /dev/zram0: Invalid argument
Scanning hard disk partitions to create /etc/fstab
Setting Language to C Done.
Possible swap partition(s) enabled.
Checking for extensions...Done.
Setting keymap to us Done.
Setting hostname to box Done.
Starting SSH server: Dropbear...
.



mk802 -- tinycore


Towards Microcore on Allwinner A10

a10Core-20120928.img.gz    6.2M

This brings the image up to 4.6.2 base and also changes provides from cgi to zsync'ed local database.


1.
tc@box:~$ cat /etc/init.d/rcS
#!/bin/sh
exec /etc/init.d/tc-config > /var/log/tc-config 2>&1

tc@box:~$ head /etc/init.d/tc-config
#!/bin/sh
# RC Script for Tiny Core Linux
# (c) Robert Shingledecker 2004-2012
# Several modifications for speed by Curaga
. /etc/init.d/tc-functions

USER="tc"
TCEDIR="/tmp/tce"
TCLOOP="/tmp/tcloop"
TCEINSTALLED="/usr/local/tce.installed"
tc@box:~$


2.
tc@box:~$ cat /etc/inittab
# /etc/inittab: init configuration for busybox init.
# Boot-time system configuration/initialization script.
#
::sysinit:/etc/init.d/rcS

# /sbin/getty respawn shell invocations for selected ttys.
tty1::respawn:/sbin/getty -nl /sbin/Autologin 38400 tty1
#tty2::respawn:/sbin/getty 38400 tty2
#tty3::respawn:/sbin/getty 38400 tty3
#tty4::askfirst:/sbin/getty 38400 tty4
#tty5::askfirst:/sbin/getty 38400 tty5
#tty6::askfirst:/sbin/getty 38400 tty6

# Stuff to do when restarting the init
# process, or before rebooting.
::restart:/etc/init.d/rc.shutdown
::restart:/sbin/init
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown


3.
tc@box:~$ cat /sbin/Autologin
#!/bin/sh
exec /bin/Bterm /sbin/autologin

tc@box:~$ cat /sbin/autologin
#!/bin/sh
cat /etc/issue
if [ -f /var/log/autologin ] ; then
    exec login
else
    touch /var/log/autologin
    exec login -f root
fi


4.
tc@box:~$ cat /init
#!/bin/sh
mount proc
grep -qw multivt /proc/cmdline && sed -i s/^#tty/tty/ /etc/inittab
if ! grep -qw noembed /proc/cmdline; then
  mount / -o remount,size=90%
  umount proc
  exec /sbin/init
fi
umount proc
if mount -t tmpfs -o size=90% tmpfs /mnt; then
  if tar -C / --exclude=mnt -cf - . | tar -C /mnt/ -xf - ; then
    mkdir /mnt/mnt
    exec /sbin/switch_root mnt /sbin/init
  fi
fi
exec /sbin/init


tc@box:~$ ls -l /sbin/init
lrwxrwxrwx    1 root     root            14 Oct  8 00:12 /sbin/init -> ../bin/busybox
.

2012-10-03

mk802 -- boot.scr

U-boot for Allwinner explained

The boot.scr file is basically a file consisting of u-boot commands and can be used to change the default parameters.


1.
root@slitaz:/tmp# dd bs=1 skip=72 if=/tmp/boot.scr of=/tmp/boot.script
772+0 records in
772+0 records out

2.
root@slitaz:/tmp# cat boot.script
setenv boot.scr 'if fatload mmc 0 0x44000000 boot.scr || ext2load mmc 0 0x44000000 boot.scr || ext2load mmc 0 0x44000000 boot/boot.scr; then source 0x44000000; fi; true'
setenv boot_mmc 'fatload mmc 0 0x43000000 script.bin; fatload mmc 0 0x48000000 ${kernel}; if fatload mmc 0 0x43100000 uInitrd; then bootm 0x48000000 0x43100000; else bootm 0x48000000; fi'
setenv bootcmd 'run boot.scr setargs boot_mmc'
setenv bootdelay '3'
setenv console 'ttyS0,115200'
setenv extraargs 'rootwait mem=928M'
setenv kernel 'uImage'
setenv loglevel '8'
setenv panicarg 'panic=10'
setenv root '/dev/mmcblk0p2'
setenv setargs 'setenv bootargs console=${console} root=${root} loglevel=${loglevel} ${panicarg} ${extraargs}'
setenv stderr 'serial'
setenv stdin 'serial'
setenv stdout 'serial'

3.
root@slitaz:/tmp# mkimage -A arm -T script -C none -n "Run uImage" -d /tmp/boot.script  /tmp/boot.scr
Image Name:   Run uImage
Created:      Wed Oct  3 23:34:06 2012
Image Type:   ARM Linux Script (uncompressed)
Data Size:    780 Bytes = 0.76 kB = 0.00 MB
Load Address: 00000000
Entry Point:  00000000
Contents:
   Image 0: 772 Bytes = 0.75 kB = 0.00 MB
.

mk802 -- script.bin


Editing AllWinner A10 Board Configuration Files (script.bin)

AllWinner A10 based devices all have board configuration files in binary format, sometimes refereed to as script.bin, evb.bin, sys_config.{product_nane}.bin store in the FAT partition with the kernel.

fexc - (de)comp­iler
source

binary
bin2fex.tar.gz  Size: 18,85 Kb

Crane_Fex_Guide v0.4 (EN).pdf    595K   


1.
root@slitaz:/tmp# bin2fex script.bin script.fex
fexc-bin: script.bin: version: 0.1.2
fexc-bin: script.bin: size: 42048 (74 sections)

2.
root@slitaz:/tmp# head script.fex
[product]
version = "1.0"
machine = "MK802"

[target]
boot_clock = 1008
dcdc2_vol = 1400
dcdc3_vol = 1250
ldo2_vol = 3000
ldo3_vol = 2800

3.
root@slitaz:/tmp# ls -l script*
-rwx------    1 root     root         42048 Sep 10 10:55 script.bin
-rw-r--r--    1 root     root         22320 Oct  3 22:16 script.fex

4.
root@slitaz:/tmp# fex2bin script.fex script-2.bin

5.
root@slitaz:/tmp# ls -l script*
-rw-r--r--    1 root     root         42048 Oct  3 22:20 script-2.bin
-rwx------    1 root     root         42048 Sep 10 10:55 script.bin
-rw-r--r--    1 root     root         22320 Oct  3 22:16 script.fex

2012-09-28

mk802 -- insserv

How to add a service when using dependency-based booting

In Debian releases prior to 6.0, a service could be added with update-rc.d:

update-rc.d mydaemon defaults

Starting with Debian 6.0, the insserv command is used instead, if dependency-based booting is enabled:

insserv mydaemon

Where mydaemon is an executable init script placed in /etc/init.d. insserv will produce no output if everything went OK. Examine the error code in $? if you want to be sure.

Both the old and the new way requires an init script to be present in /etc/init.d. For dependency-based booting, the script needs to be an LSB init script.


1.
root@arm:~# ls -l /etc/init.d/ssh*
-rwxr-xr-x    1 root     root          2451 Sep 14 09:12 ssh
-rwxr-xr-x    1 root     root          3881 Feb 24  2012 ssh-bv1al

2.
root@arm:~# head /etc/init.d/ssh
#! /bin/sh

### BEGIN INIT INFO
# Provides:             sshd
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Default-Start:        2 3 4 5
# Default-Stop:
# Short-Description:    OpenBSD Secure Shell server
### END INIT INFO

3.
root@arm:~# ls /etc/rc2.d /etc/rc3.d
/etc/rc2.d:
README       S01rsyslog  S03board_tweaks.sh  S03loadcpufreq   S05rc.local
S01bootlogs  S01sudo     S03cron             S03rsync         S05rmnologin
S01motd      S02apache2  S03dbus             S04cpufrequtils

/etc/rc3.d:
README       S01rsyslog  S03board_tweaks.sh  S03loadcpufreq   S05rc.local
S01bootlogs  S01sudo     S03cron             S03rsync         S05rmnologin
S01motd      S02apache2  S03dbus             S04cpufrequtils


4.
root@arm:~# insserv ssh
insserv: warning: script 'K01board_tweaks.sh' missing LSB tags and overrides
insserv: warning: script 'board_tweaks.sh' missing LSB tags and overrides
insserv: warning: script 'ssh-bv1al' missing LSB tags and overrides

5.
root@arm:~# ls /etc/rc2.d /etc/rc3.d
/etc/rc2.d:
README       S01rsyslog  S03board_tweaks.sh  S03loadcpufreq  S04cpufrequtils
S01bootlogs  S01sudo     S03cron             S03rsync        S05rc.local
S01motd      S02apache2  S03dbus             S03ssh          S05rmnologin

/etc/rc3.d:
README       S01rsyslog  S03board_tweaks.sh  S03loadcpufreq  S04cpufrequtils
S01bootlogs  S01sudo     S03cron             S03rsync        S05rc.local
S01motd      S02apache2  S03dbus             S03ssh          S05rmnologin
root@arm:~#

MK802 -- autologin

agetty -- autologin

1:2345:respawn:/sbin/agetty -a debian -8 -s 38400 tty1


1.
root@arm:~# dpkg -S agetty
util-linux: /usr/share/man/man8/agetty.8.gz
util-linux: /sbin/agetty
util-linux: /usr/share/doc/util-linux/README.modems-with-agetty

2.
root@arm:~# agetty --help | head

Usage:
 agetty [options] line baud_rate,... [termtype]
 agetty [options] baud_rate,... line [termtype]

Options:
 -8, --8bits                assume 8-bit tty
 -a, --autologin <user>     login the specified user automatically
 -c, --noreset              do not reset control mode
 -f, --issue-file <file>    display issue file
 -s, --keep-baud            try to keep baud rate after break


3.
root@arm:~# nano /etc/inittab
root@arm:~# cat /etc/inittab | grep respawn
z6:6:respawn:/sbin/sulogin
# 1:2345:respawn:/sbin/getty 38400 tty1
1:2345:respawn:/sbin/agetty -a debian -8 -s 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
T2:23:respawn:/sbin/getty -L ttyO2 115200 vt102

Mk802 -- uImage

changyongid.blog.chinaunix.net

Extract an uImage

According to the U-Boot header definition an uImage begins with the hex byte sequence 27 05 19 56 and the header is 64 bytes long.

dd if=uImage of=zImage ibs=64 skip=1


1.
root@arm:~# uname -a
Linux arm 3.0.42-slitaz #2 PREEMPT Thu Sep 27 18:30:18 UTC 2012 armv7l GNU/Linux


2.
# tazpkg install u-boot-tools-2012.04.01-2.tazpkg

3.
root@slitaz:/usr/src/linux# time make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j4 uImage
[..]
  OBJCOPY arch/arm/boot/zImage
  Kernel: arch/arm/boot/zImage is ready
  UIMAGE  arch/arm/boot/uImage
Image Name:   Linux-3.0.42-slitaz
Created:      Thu Sep 27 18:30:24 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    3906268 Bytes = 3814.71 kB = 3.73 MB
Load Address: 40008000
Entry Point:  40008000
  Image arch/arm/boot/uImage is ready

real    5m53.737s
user    10m26.467s
sys     0m47.126s


4.
root@slitaz:/usr/src/linux# ls -l arch/arm/boot/*mage
-rwxr-xr-x    1 root     root       8171044 Sep 27 18:30 arch/arm/boot/Image
-rw-r--r--    1 root     root       3906332 Sep 27 18:30 arch/arm/boot/uImage
-rwxr-xr-x    1 root     root       3906268 Sep 27 18:30 arch/arm/boot/zImage


5.
root@slitaz:/usr/src/linux# calc 3906332-3906268
64


Ref:
Building

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- sun4i_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j4 uImage modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- INSTALL_MOD_PATH=output modules_install
.

2012-09-27

MK802 -- AX88772A

ASIX AX88772A USB Ethernet

1.
root@arm:~# ifconfig eth1
eth1      Link encap:Ethernet  HWaddr 00:80:8e:FF:FF:FF 
          inet addr:192.168.1.31  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3638 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3220 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:240618 (234.9 KiB)  TX bytes:456143 (445.4 KiB)

2.
root@arm:~# lsusb | grep ASIX
Bus 002 Device 003: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast Ethernet

3.
root@arm:~# grep 'net/usb' /lib/modules/3.0.42-slitaz/modules.builtin
kernel/drivers/net/usb/asix.ko
kernel/drivers/net/usb/usbnet.ko

4.
root@arm:~# hwinfo | grep -i -e asix -e eth1
process 2830: arguments to dbus_move_error() were incorrect, assertion "(dest) == NULL || !dbus_error_is_set ((dest))" failed in file ../../dbus/dbus-errors.c line 282.
This is normally a bug in some application using the D-Bus library.
libhal.c 3483 : Error unsubscribing to signals, error=The name org.freedesktop.Hal was not provided by any .service files
            asix: /devices/platform/sw-ehci.1/usb2/2-1/2-1.4/2-1.4:1.0
    manufacturer = "ASIX Elec. Corp."
  net interface: name = eth1, path = /class/net/eth1
    net driver: name = asix, path = /bus/usb/drivers/asix
eth1: Sending PADI packet
eth1: Sending PADI packet
  E: DRIVER=asix
  P: /devices/platform/sw-ehci.1/usb2/2-1/2-1.4/2-1.4:1.0/net/eth1
  E: DEVPATH=/devices/platform/sw-ehci.1/usb2/2-1/2-1.4/2-1.4:1.0/net/eth1
  E: ID_SERIAL=ASIX_Elec._Corp._AX88x72A_000002
  E: ID_USB_DRIVER=asix
  E: ID_VENDOR=ASIX_Elec._Corp.
  E: ID_VENDOR_ENC=ASIX\x20Elec.\x20Corp.
  E: ID_VENDOR_FROM_DATABASE=ASIX Electronics Corp.
  E: INTERFACE=eth1
/devices/platform/sw-ehci.1/usb2/2-1/2-1.4/2-1.4:1.0/net/eth1
  Model: "ASIX Electronics AX88x72A"
  Vendor: usb 0x0b95 "ASIX Electronics Corp."
  Driver: "asix"
  Device File: eth1
  SysFS ID: /class/net/eth1
  Driver: "asix"
  Device File: eth1

MK802 -- OTG -2

Debian wheezy for MK802

HOST:USB-2.0 4-Port HUB
1.ASIX AX88772A USB Ethernet
2.Prolific USB Flash
3.JMTek    USB Flash
4.Silicon Motion USB Flash

OTG:Ritek USB Flash


1.
root@arm:~# lsusb
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Bus 002 Device 003: ID 0b95:772a ASIX Electronics Corp. AX88772A Fast Ethernet
Bus 001 Device 002: ID 0b27:0165 Ritek Corp.
Bus 002 Device 004: ID 067b:2528 Prolific Technology, Inc.
Bus 002 Device 005: ID 0c76:1783 JMTek, LLC.
Bus 002 Device 006: ID 090c:1000 Silicon Motion, Inc. - Taiwan (formerly Feiya Technology Corp.) 64MB QDI U2 DISK

2.
root@arm:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
rootfs          1.8G  654M  1.1G  38% /
/dev/root       1.8G  654M  1.1G  38% /
devtmpfs        392M     0  392M   0% /dev
tmpfs            79M  236K   79M   1% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           157M     0  157M   0% /run/shm
/dev/mmcblk0p1   16M  7.6M  8.4M  48% /boot/uboot
/dev/sda        7.6G  4.4G  3.2G  58% /mnt/sda
/dev/sdb1       3.8G  2.6G  1.2G  69% /mnt/sdb
/dev/sdc1       125M  111M   15M  89% /mnt/sdc
/dev/sdd1       1.9G  1.7G  105M  95% /mnt/sdd

3.
root@arm:~# hwinfo
[..]
18: SCSI 400.0: 10600 Disk
  [Created at block.243]
  Unique ID: ADDn.aLBrhpBBCV3
  SysFS ID: /class/block/sda
  SysFS BusID: 4:0:0:0
  SysFS Device Link: /devices/platform/sw_hcd_host0/usb1/1-1/1-1:1.0/host4/target4:0:0/4:0:0:0
  Hardware Class: disk
  Model: "Ut165 USB2FlashStorage"
  Vendor: usb 0x0b27 "Ut165"
  Device: usb 0x0165 "USB2FlashStorage"
  Revision: "0.00"
  Serial ID: "0000000000497C"
  Driver: "usb-storage", "sd"
  Driver Modules: "usb_storage"
  Device File: /dev/sda
  Device Files: /dev/sda, /dev/disk/by-id/usb-Ut165_USB2FlashStorage_0000000000497C-0:0, /dev/disk/by-path/platform-sw_hcd_host0-usb-0:1:1.0-scsi-0:0:0:0, /dev/disk/by-uuid/5C7F-463E
  Device Number: block 8:0-8:15
  Geometry (Logical): CHS 1023/249/62
  Size: 15794176 sectors a 512 bytes
  Speed: 480 Mbps
  Module Alias: "usb:v0B27p0165d0100dc00dsc00dp00ic08isc06ip50"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

19: SCSI 100.0: 10600 Disk
  [Created at block.243]
  Unique ID: JPTW.Z6WUkzP5uw7
  SysFS ID: /class/block/sdb
  SysFS BusID: 1:0:0:0
  SysFS Device Link: /devices/platform/sw-ehci.1/usb2/2-1/2-1.3/2-1.3:1.0/host1/target1:0:0/1:0:0:0
  Hardware Class: disk
  Model: "USB 2.0 Flash Disk"
  Vendor: usb 0x067b "USB 2.0"
  Device: usb 0x2528 "Flash Disk"
  Revision: "1.00"
  Serial ID: "000703085AE8BB21720C"
  Driver: "usb-storage", "sd"
  Driver Modules: "usb_storage"
  Device File: /dev/sdb
  Device Files: /dev/sdb, /dev/disk/by-id/usb-USB_2.0_Flash_Disk_000703085AE8BB21720C-0:0, /dev/disk/by-path/platform-sw-ehci.1-usb-0:1.3:1.0-scsi-0:0:0:0
  Device Number: block 8:16-8:31
  Geometry (Logical): CHS 1023/125/62
  Size: 7929856 sectors a 512 bytes
  Speed: 480 Mbps
  Module Alias: "usb:v067Bp2528d0100dc00dsc00dp00ic08isc06ip50"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

20: None 00.0: 11300 Partition
  [Created at block.412]
  Unique ID: h4pj.SE1wIdpsiiC
  Parent ID: JPTW.Z6WUkzP5uw7
  SysFS ID: /class/block/sdb/sdb1
  Hardware Class: partition
  Model: "Partition"
  Device File: /dev/sdb1
  Device Files: /dev/sdb1, /dev/disk/by-id/usb-USB_2.0_Flash_Disk_000703085AE8BB21720C-0:0-part1, /dev/disk/by-label/TazUSB, /dev/disk/by-path/platform-sw-ehci.1-usb-0:1.3:1.0-scsi-0:0:0:0-part1, /dev/disk/by-uuid/4D7A-8A9D
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #19 (Disk)

21: SCSI 200.0: 10600 Disk
  [Created at block.243]
  Unique ID: tGrL.9Jtc5PpHw63
  SysFS ID: /class/block/sdc
  SysFS BusID: 2:0:0:0
  SysFS Device Link: /devices/platform/sw-ehci.1/usb2/2-1/2-1.2/2-1.2:1.0/host2/target2:0:0/2:0:0:0
  Hardware Class: disk
  Model: "GENERIC USB Mass Storage"
  Vendor: usb 0x0c76 "GENERIC"
  Device: usb 0x1783 "USB Mass Storage"
  Revision: "1.00"
  Driver: "usb-storage", "sd"
  Driver Modules: "usb_storage"
  Device File: /dev/sdc
  Device Files: /dev/sdc, /dev/disk/by-id/usb-GENERIC_USB_Mass_Storage-0:0, /dev/disk/by-path/platform-sw-ehci.1-usb-0:1.2:1.0-scsi-0:0:0:0
  Device Number: block 8:32-8:47
  Geometry (Logical): CHS 225/18/63
  Size: 256000 sectors a 512 bytes
  Speed: 12 Mbps
  Module Alias: "usb:v0C76p1783d0100dc00dsc00dp00ic08isc06ip50"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

22: None 00.0: 11300 Partition
  [Created at block.412]
  Unique ID: mX79.SE1wIdpsiiC
  Parent ID: tGrL.9Jtc5PpHw63
  SysFS ID: /class/block/sdc/sdc1
  Hardware Class: partition
  Model: "Partition"
  Device File: /dev/sdc1
  Device Files: /dev/sdc1, /dev/disk/by-id/usb-GENERIC_USB_Mass_Storage-0:0-part1, /dev/disk/by-path/platform-sw-ehci.1-usb-0:1.2:1.0-scsi-0:0:0:0-part1, /dev/disk/by-uuid/43F5-394B
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #21 (Disk)

23: SCSI 300.0: 10600 Disk
  [Created at block.243]
  Unique ID: R8DB.nkmrNZsXMc8
  SysFS ID: /class/block/sdd
  SysFS BusID: 3:0:0:0
  SysFS Device Link: /devices/platform/sw-ehci.1/usb2/2-1/2-1.1/2-1.1:1.0/host3/target3:0:0/3:0:0:0
  Hardware Class: disk
  Model: "USB 2.0 Flash Disk"
  Vendor: usb 0x090c "USB 2.0"
  Device: usb 0x1000 "Flash Disk"
  Revision: "1100"
  Serial ID: "�"
  Driver: "usb-storage", "sd"
  Driver Modules: "usb_storage"
  Device File: /dev/sdd
  Device Files: /dev/sdd, /dev/disk/by-id/usb-USB_2.0_Flash_Disk_AA30000000000046-0:0, /dev/disk/by-path/platform-sw-ehci.1-usb-0:1.1:1.0-scsi-0:0:0:0
  Device Number: block 8:48-8:63
  Geometry (Logical): CHS 1014/63/62
  Size: 3963904 sectors a 512 bytes
  Speed: 480 Mbps
  Module Alias: "usb:v090Cp1000d1100dc00dsc00dp00ic08isc06ip50"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

24: None 00.0: 11300 Partition
  [Created at block.412]
  Unique ID: r_Ra.SE1wIdpsiiC
  Parent ID: R8DB.nkmrNZsXMc8
  SysFS ID: /class/block/sdd/sdd1
  Hardware Class: partition
  Model: "Partition"
  Device File: /dev/sdd1
  Device Files: /dev/sdd1, /dev/disk/by-id/usb-USB_2.0_Flash_Disk_AA30000000000046-0:0-part1, /dev/disk/by-path/platform-sw-ehci.1-usb-0:1.1:1.0-scsi-0:0:0:0-part1, /dev/disk/by-uuid/aadfb522-a40d-439c-a923-4a916ba9e926
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #23 (Disk)
.

MK802 II -- OTG


USB On-The-Go, often abbreviated USB OTG, is a specification that allows USB devices such as digital audio players or mobile phones to act as a host, allowing other USB devices like a USB flash drive, mouse, or keyboard to be attached to them.

Standard USB uses a master/slave architecture.

1.
# diff .config-bv1 .config
--- .config-bv1
+++ .config
[..]
@@ -1640,11 +1666,13 @@
 #
 # Miscellaneous USB options
 #
-# CONFIG_USB_DEVICEFS is not set
+CONFIG_USB_DEVICEFS=y
 CONFIG_USB_DEVICE_CLASS=y
 # CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_MON is not set
+CONFIG_USB_SUSPEND=y
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+CONFIG_USB_MON=m
 # CONFIG_USB_WUSB_CBAF is not set

 #
@@ -1823,8 +1851,9 @@
 #
 # OTG and related infrastructure
 #
+CONFIG_USB_OTG_UTILS=y
 # CONFIG_USB_ULPI is not set
-# CONFIG_NOP_USB_XCEIV is not set
+CONFIG_NOP_USB_XCEIV=y
 CONFIG_USB_SW_SUN4I_USB=y
 CONFIG_USB_SW_SUN4I_USB_MANAGER=y
 # CONFIG_USB_SW_SUN4I_USB0_NULL is not set


2.
root@slitaz:~# cat /usr/src/linux/drivers/usb/otg/modules.builtin
kernel/drivers/usb/otg/nop-usb-xceiv.ko

or

root@arm:~# grep otg /lib/modules/3.0.42-slitaz/modules.builtin
kernel/drivers/usb/otg/nop-usb-xceiv.ko


3.
NOP USB Transceiver Driver (NOP_USB_XCEIV)

CONFIG_NOP_USB_XCEIV:

this driver is to be used by all the usb transceiver which are either
built-in with usb ip or which are autonomous and doesn't require any
phy programming such as ISP1x04 etc.

Symbol: NOP_USB_XCEIV [=y]
Type : tristate
Prompt: NOP USB Transceiver Driver
Defined at drivers/usb/otg/Kconfig:89
Depends on: USB_SUPPORT [=y] && (USB [=y] || USB_GADGET [=y])
Location:
-> Device Drivers
-> USB support (USB_SUPPORT [=y])
Selects: USB_OTG_UTILS [=y]
Selected by: USB_MUSB_HDRC [=n] && USB_SUPPORT [=y] && (USB [=y] || USB_GADGET [=y]) && (ARM [=y] || BF54x && !BF544 || BF52x && !BF522 && !BF523) && (ARCH_DAVINCI [=n] || MACH_OMAP3EVM [=n] || BLACKFIN)
.

2012-09-23

mk802 -- wifi

RTL8188CUS 802.11n WLAN Adapter

1.
root@arm:~# lsusb | grep RTL
Bus 003 Device 002: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter

2.
root@arm:~# lsmod
Module                  Size  Used by
cpufreq_powersave       1076  0
pegasus                20639  0
fbcon                  36269  70
font                    7715  1 fbcon
bitblit                 4179  1 fbcon
softcursor              1131  1 bitblit
8192cu                515490  0

3.
root@arm:~# modinfo 8192cu | head
filename:       /lib/modules/3.0.42-bv1/kernel/drivers/net/wireless/rtl8192cu/8192cu.ko
version:        v3.3.2_3192.20120103
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     BB2AE8E045935F430768E1D
alias:          usb:v0BDAp8186d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0E66p0019d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0846p9021d*dc*dsc*dp*ic*isc*ip*
alias:          usb:v0B05p17ABd*dc*dsc*dp*ic*isc*ip*

4.
root@arm:~# cat /etc/network/interfaces
auto lo
iface lo inet loopback

# The primary network interface
auto eth1
iface eth1 inet dhcp
# Example to keep MAC address between reboots
#hwaddress ether DE:AD:BE:EF:CA:FE

# WiFi Example
auto wlan0
iface wlan0 inet dhcp
    wpa-ssid "your ssid"
    wpa-psk  "your passwd"

5.
root@arm:~# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 48:02:2a:xx:xx:xx
          inet addr:192.168.1.31  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27321 errors:0 dropped:575330 overruns:0 frame:0
          TX packets:1527 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:49721241 (47.4 MiB)  TX bytes:2125537 (2.0 MiB)
.