2011-05-29

Slitaz -- crosstool-ng / bb-log




1.
root@slitaz:~# tazpkg info crosstool-ng

Tazpkg information
================================================================================
Package    : crosstool-ng
Version    : 1.9.1
Category   : development
Short desc : Tool to Build toolchains.
Maintainer : pascal.bellard@slitaz.org
Depends    : slitaz-toolchain
Build deps : flex cvs gawk texinfo
Web site   : http://ymorin.is-a-geek.org/projects/crosstool
================================================================================

root@slitaz:~# ls -l /home/slitaz/cooking/packages-incoming/crosstool-ng-1.9.1.tazpkg
-rw-r--r--    1 root     root       1707908 May 29 16:22 /home/slitaz/cooking/packages-incoming/crosstool-ng-1.9.1.tazpkg

2.
 root@slitaz:~# ct-ng -v
GNU Make 3.82
Built for i686-pc-linux-gnu
Copyright (C) 2010  Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


3.
#!/Bb/Log: /usr/bin/tazwok
tazwok cook crosstool-ng
日 5月 29 16:21:44 UTC 2011
Cooking crosstool-ng
Cleaning crosstool-ng
Looking for build dependencies

Installing missing packages :  cvs gawk texinfo

cvs-1.11.23 already in the cache : /var/cache/tazpkg/cooking/packages

Installation of : cvs
================================================================================
Copying cvs... [ OK ]
Extracting cvs... [ OK ]
Extracting the pseudo fs... (lzma) [ OK ]
Installing cvs... [ OK ]
Removing all tmp files... [ OK ]
================================================================================
cvs (1.11.23) is installed.

gawk-3.1.8 already in the cache : /var/cache/tazpkg/cooking/packages

Installation of : gawk
================================================================================
Copying gawk... [ OK ]
Extracting gawk... [ OK ]
Extracting the pseudo fs... (lzma) [ OK ]
Installing gawk... [ OK ]
Removing all tmp files... [ OK ]
================================================================================
gawk (3.1.8) is installed.

texinfo-4.13a already in the cache : /var/cache/tazpkg/cooking/packages

Installation of : texinfo
================================================================================
Copying texinfo... [ OK ]
Extracting texinfo... [ OK ]
Extracting the pseudo fs... (lzma) [ OK ]
Installing texinfo... [ OK ]
Removing all tmp files... [ OK ]
================================================================================

texinfo (4.13a) is installed.

Checking for source tarball: crosstool-ng

Downloading from http://ymorin.is-a-geek.org/download/crosstool-ng/crosstool-ng-1.9.1.tar.bz2...

Untaring source tarball
Repacking sources in .tar.lzma format
Executing compile_rules

Checking for 'grep'... /bin/grep
Checking whether '/bin/grep' supports -E... yes
Checking for 'sed'... /bin/sed
Checking whether '/bin/sed' supports -i and -e... yes
Checking for 'bash'... /bin/bash
Checking for 'cut'... /usr/bin/cut
Checking for 'install'... /usr/bin/install
Checking for 'make'... /usr/bin/make
Checking for 'gcc'... /usr/bin/gcc
Checking for 'awk'... /usr/bin/awk
Checking for 'bison'... /usr/bin/bison
Checking for 'flex'... /usr/bin/flex
Checking for 'makeinfo'... /usr/bin/makeinfo
Checking for 'automake'... /usr/bin/automake
Checking for 'libtool'... /usr/bin/libtool
Checking for 'stat'... /bin/stat
Checking for 'aria2c'... no
Checking for 'curl'... /usr/bin/curl
Checking for 'cvs'... /usr/bin/cvs
Checking for 'patch'... /usr/bin/patch
Checking for 'tar'... /bin/tar
Checking for 'gzip'... /usr/bin/gzip
Checking for 'bzip2'... /usr/bin/bzip2
Checking for 'lzma'... /usr/bin/lzma
Checking for 'readlink'... /usr/bin/readlink
Checking for 'objcopy'... /usr/bin/objcopy
Checking for 'objdump'... /usr/bin/objdump
Checking for 'readelf'... /usr/bin/readelf
Checking for 'patch'... /usr/bin/patch
Checking for 'ncurses/ncurses.h'... no
Checking for 'ncurses/curses.h'... no
Checking for 'ncurses.h'... yes
Checking for 'libncursesw.so'... yes
Computing version string... 1.9.1
Building up Makefile... done

crosstool-NG configured as follows:

  PREFIX='/usr'
  BINDIR='/usr/bin'
  LIBDIR='/usr/lib/ct-ng-1.9.1'
  DOCDIR='/usr/share/doc/ct-ng-1.9.1'
  MANDIR='/usr/share/man'

Now run:
  make
  make install
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  GEN    'paths.mk'
  SED    'scripts/showTuple.sh'
  SED    'docs/ct-ng.1'
  GZIP   'docs/ct-ng.1.gz'
  MKDIR   '/home/slitaz/cooking/wok/crosstool-ng/crosstool-ng-1.9.1/_pkg/usr/bin/'
  RMDIR   '/home/slitaz/cooking/wok/crosstool-ng/crosstool-ng-1.9.1/_pkg/usr/lib/ct-ng-1.9.1/'
  MKDIR   '/home/slitaz/cooking/wok/crosstool-ng/crosstool-ng-1.9.1/_pkg/usr/lib/ct-ng-1.9.1/'
  MKDIR   '/home/slitaz/cooking/wok/crosstool-ng/crosstool-ng-1.9.1/_pkg/usr/share/doc/ct-ng-1.9.1/'

  MKDIR   '/home/slitaz/cooking/wok/crosstool-ng/crosstool-ng-1.9.1/_pkg/usr/share/man/man1/'
  INST    'ct-ng'
For auto-completion, do not forget to install 'ct-ng.comp' into
your bash completion directory (usually /etc/bash_completion.d)
  INSTDIR 'config/'
  INSTDIR 'contrib/'
  INSTDIR 'kconfig/'
  INSTDIR 'patches/'
  INSTDIR 'scripts/'
  INST    'docs/*.txt'
  INST    'ct-ng.1.gz'
  INST    'steps.mk'
  INST    'paths.mk'
  INSTDIR 'samples/'

Removing sources directory
Building crosstool-ng with the receipt
Executing genpkg_rules
Executing strip on all files
Removing all .pyc and .pyo files from package ...
Copying the receipt
Creating the list of files
Creating md5sum of files
Updating receipt sizes
Creating full cpio archive
Restoring original package tree
Planning re-try a cook of reverse depends
Updating packages lists: /home/slitaz/cooking/packages-incoming

Getting datas from crosstool-ng

Sorting packages lists
Look for package(s) to upgrade
Removing previous build dependencies

Removing theses packages : cvs gawk texinfo

Removing: cvs
================================================================================
Removing all files installed...[ OK ]
Removing package receipt...[ OK ]

The following packages have been modified by gawk:
  busybox

Removing: gawk
================================================================================
Removing all files installed...[ OK ]
Removing package receipt...[ OK ]
Check /var/lib/tazpkg/installed/busybox/modifiers for reinstallation

Removing: texinfo
================================================================================
Removing all files installed...[ OK ]
Removing package receipt...[ OK ]

2011-05-16

Slitaz -- nfs / rpcinfo


root@slitaz:~# tazpkg info glibc-dev


Tazpkg information
====================================================================
Package : glibc-dev
Version : 2.13
Category : development
Short desc : The GNU C libraries devel files (Part of SliTaz toolcha
Maintainer : pankso@slitaz.org
Depends : glibc-base
Wanted src : glibc
Web site : http://www.gnu.org/software/libc/
====================================================================

root@slitaz:~# tazpkg info rpcbind

Tazpkg information
====================================================================
Package : rpcbind
Version : 0.2.0
Category : network
Short desc : RPC program numbers to universal addresses converter.
Maintainer : pascal.bellard@slitaz.org
Depends : libtirpc
Build deps : libtirpc-dev
Web site : http://rpcbind.sourceforge.net/
====================================================================

1.
root@slitaz:~# which rpcinfo
/usr/sbin/rpcinfo
root@slitaz:~# tazpkg search-file rpcinfo

Search result for file rpcinfo
======================================================================

Package glibc-dev:
/usr/sbin/rpcinfo

Package rpcbind:
/usr/bin/rpcinfo

======================================================================
2 file(s) found for: rpcinfo

2.
root@slitaz:~# ls -l /usr/bin/rpcinfo /usr/sbin/rpcinfo
-rwxr-xr-x 1 root root 21452 Feb 26 23:29 /usr/bin/rpcinfo
-rwxr-xr-x 1 root root 13736 Feb 24 04:36 /usr/sbin/rpcinfo

3.
root@slitaz:~# echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/sbin:/usr/local/bin

4.
root@slitaz:~# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100003 3 udp 2049 nfs
100003 3 tcp 2049 nfs
100005 1 udp 2049 mountd
100005 3 udp 2049 mountd
100005 1 tcp 2049 mountd
100005 3 tcp 2049 mountd
100021 1 udp 48911 nlockmgr
100021 3 udp 48911 nlockmgr
100021 4 udp 48911 nlockmgr
100021 1 tcp 35925 nlockmgr
100021 3 tcp 35925 nlockmgr
100021 4 tcp 35925 nlockmgr

root@slitaz:~# /usr/bin/rpcinfo -p
rpcinfo: can't contact portmapper: RPC: Remote system error - No sucrectory
root@slitaz:~# /usr/bin/rpcinfo -p slitaz
program vers proto port service
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100003 3 udp 2049 nfs
100003 3 tcp 2049 nfs
100005 1 udp 2049 mountd
100005 3 udp 2049 mountd
100005 1 tcp 2049 mountd
100005 3 tcp 2049 mountd
100021 1 udp 48911 nlockmgr
100021 3 udp 48911 nlockmgr
100021 4 udp 48911 nlockmgr
100021 1 tcp 35925 nlockmgr
100021 3 tcp 35925 nlockmgr
100021 4 tcp 35925 nlockmgr

5.
root@slitaz:~# rpcinfo --help
Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]
rpcinfo [ -n portnum ] -t host prognum [ versnum ]
rpcinfo -p [ host ]
rpcinfo -b prognum versnum
rpcinfo -d prognum versnum

For bug reporting instructions, please see:
.

root@slitaz:~# /usr/bin/rpcinfo --help
/usr/bin/rpcinfo: invalid option -- '-'
/usr/bin/rpcinfo: invalid option -- 'h'
/usr/bin/rpcinfo: invalid option -- 'e'
Usage: rpcinfo [-m | -s] [host]
rpcinfo -p [host]
rpcinfo -T netid host prognum [versnum]
rpcinfo -l host prognum versnum
rpcinfo [-n portnum] -u | -t host prognum [versnum]
rpcinfo -a serv_address -T netid prognum [version]
rpcinfo -b prognum versnum
rpcinfo -d [-T netid] prognum versnum

6.
root@slitaz:~# cat /var/run/portmap_mapping
100000 2 6 111 1
100000 2 17 111 1
100003 3 17 2049 1
100003 3 6 2049 1
100005 1 17 2049 1
100005 3 17 2049 1
100005 1 6 2049 1
100005 3 6 2049 1
100021 1 17 48911 1
100021 3 17 48911 1
100021 4 17 48911 1
100021 1 6 35925 1
100021 3 6 35925 1
100021 4 6 35925 1

7.
root@slitaz:~# netstat -nltu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:35925 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
netstat: /proc/net/tcp6: No such file or directory
udp 0 0 0.0.0.0:2049 0.0.0.0:*
udp 0 0 0.0.0.0:111 0.0.0.0:*
udp 0 0 0.0.0.0:48911 0.0.0.0:*
netstat: /proc/net/udp6: No such file or directory
root@slitaz:~# netstat -ltu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:nfs 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:sunrpc 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:35925 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
netstat: /proc/net/tcp6: No such file or directory
udp 0 0 0.0.0.0:nfs 0.0.0.0:*
udp 0 0 0.0.0.0:sunrpc 0.0.0.0:*
udp 0 0 0.0.0.0:48911 0.0.0.0:*
netstat: /proc/net/udp6: No such file or directory

8.
root@slitaz:~# cat /etc/rpc | head -25
#ident "@(#)rpc 1.11 95/07/14 SMI" /* SVr4.0 1.2 */
#
# rpc
#
portmapper 100000 portmap sunrpc rpcbind
rstatd 100001 rstat rup perfmeter rstat_svc
rusersd 100002 rusers
nfs 100003 nfsprog
ypserv 100004 ypprog
mountd 100005 mount showmount
ypbind 100007
walld 100008 rwall shutdown
yppasswdd 100009 yppasswd
etherstatd 100010 etherstat
rquotad 100011 rquotaprog quota rquota
sprayd 100012 spray
3270_mapper 100013
rje_mapper 100014
selection_svc 100015 selnsvc
database_svc 100016
rexd 100017 rex
alis 100018
sched 100019
llockmgr 100020
nlockmgr 100021
root@slitaz:~#

2011-05-04

Slitaz -- qemu / qcow2 / nbd


Mounting qcow2 images

modprobe nbd max_part=63
qemu-nbd -c /dev/nbd0 image.img
mount /dev/nbd0p1 /mnt/qemu

1.
root@slitaz:/usr/src/linux-2.6.37# zcat /proc/config.gz | grep -i nbd
# CONFIG_BLK_DEV_NBD is not set

2.
root@slitaz:/usr/src/linux-2.6.37# make xconfig
root@slitaz:/usr/src/linux-2.6.37# grep -i nbd .config
CONFIG_BLK_DEV_NBD=m
root@slitaz:/usr/src/linux-2.6.37# make drivers/block/
root@slitaz:/usr/src/linux-2.6.37# make drivers/block/nbd.ko

3.
root@slitaz:/usr/src/linux-2.6.37# cp drivers/block/nbd.ko /lib/modules/`uname -r`/kernel/drivers/block
root@slitaz:/usr/src/linux-2.6.37# depmod -a

4.
root@slitaz:/usr/src/linux-2.6.37# modprobe nbd max_part=63

5.
root@slitaz:/usr/src/linux-2.6.37# qemu-nbd -c /dev/nbd0 /home/tux/0000/debian_squeeze_armel_desktop.qcow2
6.
root@slitaz:/usr/src/linux-2.6.37# mount /dev/nbd0p1 /mnt/image
root@slitaz:/usr/src/linux-2.6.37# ls -l /mnt/image/boot
total 4648
-rw-r--r--    1 root     root         69764 Jan 12 23:35 config-2.6.32-5-versatile
lrwxrwxrwx    1 root     root            29 Feb 28 05:15 initrd.img -> initrd.img-2.6.32-5-versatile
-rw-r--r--    1 root     root       2485829 Feb 28 06:19 initrd.img-2.6.32-5-versatile
-rw-r--r--    1 root     root        934684 Jan 12 23:35 System.map-2.6.32-5-versatile
lrwxrwxrwx    1 root     root            26 Feb 28 05:15 vmlinuz -> vmlinuz-2.6.32-5-versatile
-rw-r--r--    1 root     root       1243652 Jan 12 23:34 vmlinuz-2.6.32-5-versatile
root@slitaz:/usr/src/linux-2.6.37#

7. checklist
root@slitaz:/usr/src/linux-2.6.37# file /home/tux/0000/debian_squeeze_armel_desktop.qcow2 
/home/tux/0000/debian_squeeze_armel_desktop.qcow2: QEMU QCOW Image (v2), 17179869184 bytes

root@slitaz:/usr/src/linux-2.6.37# ls drivers/block/*.ko
drivers/block/cryptoloop.ko  drivers/block/nbd.ko
drivers/block/floppy.ko      drivers/block/virtio_blk.ko

root@slitaz:/usr/src/linux-2.6.37# lsmod | head -2
Module                  Size  Used by    Not tainted
nbd                     6665  2 

root@slitaz:/usr/src/linux-2.6.37# modinfo nbd
filename:       /lib/modules/2.6.37-slitaz/kernel/drivers/block/nbd.ko
description:    Network Block Device
license:        GPL
vermagic:       2.6.37-slitaz SMP mod_unload 486 
parm:           debugflags:flags for controlling debug output
parm:           max_part:number of partitions per device (default: 0)
parm:           nbds_max:number of network block devices to initialize (default: 16)

root@slitaz:/usr/src/linux-2.6.37# ls /dev/nbd*
/dev/nbd0    /dev/nbd1    /dev/nbd13   /dev/nbd3    /dev/nbd7
/dev/nbd0p1  /dev/nbd10   /dev/nbd14   /dev/nbd4    /dev/nbd8
/dev/nbd0p2  /dev/nbd11   /dev/nbd15   /dev/nbd5    /dev/nbd9
/dev/nbd0p5  /dev/nbd12   /dev/nbd2    /dev/nbd6

root@slitaz:/usr/src/linux-2.6.37# dmesg | grep nbd
nbd: registered device at major 43
nbd0: p1 p2 < p5 >
EXT4-fs (nbd0p1): mounted filesystem with ordered data mode. Opts: (null)

root@slitaz:/usr/src/linux-2.6.37# fdisk -l /dev/nbd0

Disk /dev/nbd0: 17.1 GB, 17179869184 bytes
255 heads, 63 sectors/track, 2088 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks  Id System
/dev/nbd0p1   *           1        2027    16275456  83 Linux
/dev/nbd0p2            2027        2089      498689   5 Extended
/dev/nbd0p5            2027        2089      498688  82 Linux swap
root@slitaz:/usr/src/linux-2.6.37#

read more....
Network Block Device (TCP version)