Showing posts with label chroot. Show all posts
Showing posts with label chroot. Show all posts

2023-02-16

slitaz64 - LIBRARY_PATH

 

LIBRARY_PATH
configure: error: C compiler cannot create executables

checking for x86_64-slitaz-linux-gcc... no
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/slitaz/wok/xorg-xf86-video-amdgpu/source/xorg-xf86-video-amdgpu-22.0.0':
configure: error: C compiler cannot create executables
See `config.log' for more details  -  Attachments  config.log  12.2 KB

slitaz-toolchain - isl version none

GNU C17 (SliTaz) version 8.2.0 (i486-slitaz-linux)
compiled by GNU C version 8.2.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none

$ echo 'int main() { return 0; }' > test.c

$ gcc -v -o test.o test.c

https://forum.slitaz.org/topic/slitaz-next-41485/page/2#post-49031

https://forum.slitaz.org/topic/update-kernel-1/page/3#post-48139 


1.
root@slitaz:~# gcc -v

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-slitaz-linux-gnu
Configured with: /home/slitaz/wok/gcc/source/gcc-12.2.0/configure --libexecdir=/usr/lib --disable-multilib --disable-bootstrap --with-system-zlib --enable-nls --enable-languages=c,c++,objc,fortran --enable-shared --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-lto --enable-threads=posix --with-pkgversion=SliTaz --build=x86_64-slitaz-linux-gnu --target=x86_64-slitaz-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (SliTaz)

2.
root@slitaz:~# echo 'int main() { return 0; }' > test.c

root@slitaz:~# gcc -v -o test.o test.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-slitaz-linux-gnu
Configured with: /home/slitaz/wok/gcc/source/gcc-12.2.0/configure --libexecdir=/usr/lib --disable-multilib --disable-bootstrap --with-system-zlib --enable-nls --enable-languages=c,c++,objc,fortran --enable-shared --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-lto --enable-threads=posix --with-pkgversion=SliTaz --build=x86_64-slitaz-linux-gnu --target=x86_64-slitaz-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (SliTaz)
COLLECT_GCC_OPTIONS='-v' '-o' 'test.o' '-mtune=generic' '-march=x86-64' '-dumpdir' 'test.o-'
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/cc1 -quiet -v test.c -quiet -dumpdir test.o- -dumpbase test.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccMbr0oH.s
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/cc1: error while loading shared libraries: libisl.so.23: cannot open shared object file: No such file or directory

3.
root@slitaz:~# tazpkg -gi isl

root@slitaz:~# gcc -v -o test.o test.c
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-slitaz-linux-gnu

[..]

COLLECT_GCC_OPTIONS='-v' '-o' 'test.o' '-mtune=generic' '-march=x86-64' '-dumpdir' 'test.o.'
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/collect2 -plugin /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cc74BPIu.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test.o crt1.o crti.o /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/crtbegin.o -L/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0 -L/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../.. /tmp/ccvjJ66F.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/crtend.o crtn.o
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status

4.
root@slitaz:~# find /usr/ -name crt?.o

/usr/lib64/crt1.o
/usr/lib64/crti.o
/usr/lib64/crtn.o

root@slitaz:~# ln -s /usr/lib64/crt1.o /usr/lib/.
root@slitaz:~# ln -s /usr/lib64/crtl.o /usr/lib/.
root@slitaz:~# ln -s /usr/lib64/crti.o /usr/lib/.

root@slitaz:~# tazpkg -sp crt1.o

Search result for package "crt1.o"
===============================================================
glibc-dev
musl-libc-dev
===============================================================
2 packages

5.
root@slitaz:~# gcc -v -o test.o test.c

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/lto-wrapper
Target: x86_64-slitaz-linux-gnu
Configured with: /home/slitaz/wok/gcc/source/gcc-12.2.0/configure --libexecdir=/usr/lib --disable-multilib --disable-bootstrap --with-system-zlib --enable-nls --enable-languages=c,c++,objc,fortran --enable-shared --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-lto --enable-threads=posix --with-pkgversion=SliTaz --build=x86_64-slitaz-linux-gnu --target=x86_64-slitaz-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (SliTaz)
COLLECT_GCC_OPTIONS='-v' '-o' 'test.o' '-mtune=generic' '-march=x86-64' '-dumpdir' 'test.o-'
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/cc1 -quiet -v test.c -quiet -dumpdir test.o- -dumpbase test.c -dumpbase-ext .c -mtune=generic -march=x86-64 -version -o /tmp/ccr2oPU8.s
GNU C17 (SliTaz) version 12.2.0 (x86_64-slitaz-linux-gnu)
compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=65536
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../x86_64-slitaz-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/include
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/include-fixed
/usr/include
End of search list.
GNU C17 (SliTaz) version 12.2.0 (x86_64-slitaz-linux-gnu)
compiled by GNU C version 12.2.0, GMP version 6.2.1, MPFR version 4.1.0, MPC version 1.2.1, isl version isl-0.24-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=65536
Compiler executable checksum: 3a8d01156457c23734b0a8c87475536a
COLLECT_GCC_OPTIONS='-v' '-o' 'test.o' '-mtune=generic' '-march=x86-64' '-dumpdir' 'test.o-'
as -v --64 -o /tmp/cc1rbU3x.o /tmp/ccr2oPU8.s
GNU assembler version 2.39 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.39
COMPILER_PATH=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/:/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/:/usr/lib/gcc/x86_64-slitaz-linux-gnu/:/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/:/usr/lib/gcc/x86_64-slitaz-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/:/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'test.o' '-mtune=generic' '-march=x86-64' '-dumpdir' 'test.o.'
/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/collect2 -plugin /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccqlrHHN.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test.o /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../lib/crt1.o /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../lib/crti.o /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/crtbegin.o -L/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0 -L/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../.. /tmp/cc1rbU3x.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/crtend.o /usr/lib/gcc/x86_64-slitaz-linux-gnu/12.2.0/../../../../lib/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'test.o' '-mtune=generic' '-march=x86-64' '-dumpdir' 'test.o.'

6.
root@slitaz:~# file test.o

test.o: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, with debug_info, not stripped
root@slitaz:~#

Attachments

  1. config.log  12.2 KB

 

https://forum.slitaz.org/topic/slitaz-future/page/18#post-51386

 

2021-03-09

tazdev - check_mirror()

 

tazdev gen-chroot {name_env} --mirror="http://people.slitaz.org/~shann/slitaz64-stuff/repo/packages/unstable/"

Ref:

82 check_mirror() {

http://hg.slitaz.org/slitaz-dev-tools/file/3a966a7b4ac9/tazdev/tazdev#l82

20 # Main mirror to push and download (ISO, rootfs. etc).
21 MIRROR="mirror.slitaz.org"
22 MIRROR_PKGS="/var/www/slitaz/mirror/packages"
23 MIRROR_SOURCES="/var/www/slitaz/mirror/sources"

http://hg.slitaz.org/slitaz-dev-tools/file/3a966a7b4ac9/tazdev/tazdev.conf#l20

 

2014-03-01

Slitaz -- sysroot / mirror

sysroot / mirror
Checking build dependencies...
Using packages DB: /cross/arm/sysroot/var/lib/tazpkg
Installing dep (pkg/local): libxml2-dev-2.8.0-arm.tazpkg
Connecting to mirror.slitaz.org (46.105.127.17:80)
zlib-1.2.8.tazpkg 100% |*******************************| 35924 0:00:00 ETA
Connecting to mirror.slitaz.org (46.105.127.17:80)
glibc-base-2.14.1.ta 100% |*******************************| 1270k 0:00:00 ETA
Installing dep (pkg/local): libxml2-2.8.0-arm.tazpkg
setup-mirror|-sm Change the mirror url configuration.

# tazpkg setup-mirror (IN chroot)

http://cook.slitaz.org/cross/arm/packages/

Or path/to/your_arm_packages

2014-02-10

Slitaz -- armhf toolchain



cross-compile VS. native compile

1. cross-compile:
slitaz-armhf-cross-toolchain
slitaz-arm-toolchain-armhf-20120630.tar.bz2

Target: arm-slitaz-linux-gnueabi
--with-sysroot=/cross/arm/sysroot --with-arch=armv6 --with-fpu=vfp --with-float=hard

http://forum.slitaz.org/topic/chroot#post-18038
Chrooting to: /home/slitaz/cooking/arm/chroot
[..]
3.
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)
2. native compile:
http://forum.slitaz.org/topic/chroot/page/3#post-26286
Compiling with qemu-arm-static chroot
Target: arm-slitaz-linux-gnueabi
--build=arm-slitaz-linux-gnueabi --host=arm-slitaz-linux-gnueabi
[..]
3.
root@slitaz:/# gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/lto-wrapper
Target: arm-slitaz-linux-gnueabi
Configured with: /home/slitaz/wok/gcc/source/gcc-4.6.3/configure --prefix=/usr --libexecdir=/usr/lib --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit --with-system-zlib --enable-plugin --disable-multilib --disable-libssp --disable-checking --disable-werror --disable-bootstrap --enable-clocale=gnu --enable-lto --enable-threads=posix --with-arch=armv6 --with-fpu=vfp --with-float=hard --with-pkgversion=SliTaz --build=arm-slitaz-linux-gnueabi --host=arm-slitaz-linux-gnueabi
Thread model: posix
gcc version 4.6.3 (SliTaz)

2013-12-27

Slitaz -- core64 / cross toolchain

Cross Toolchain

Target host : x86_64
C Compiler  : x86_64-slitaz-linux-gcc
CFLAGS      : 
Packages log: gcc-final gcc-static glibc-headers glibc linux-headers

testsuite.log

[COMPILING] x86_64-slitaz-linux-gcc -v -Wall -o test.out test.c
Using built-in specs.
COLLECT_GCC=x86_64-slitaz-linux-gcc
COLLECT_LTO_WRAPPER=/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/lto-wrapper
Target: x86_64-slitaz-linux
Configured with: ../gcc-4.6.3/configure --prefix=/cross/x86_64/tools --libexec=/cross/x86_64/tools/lib --target=x86_64-slitaz-linux --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/x86_64/sysroot --enable-languages=c,c++ --disable-multilib
Thread model: posix
gcc version 4.6.3 (SliTaz) 
COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'test.out' '-mtune=generic' '-march=x86-64'
 /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/cc1 -quiet -v test.c -quiet -dumpbase test.c -mtune=generic -march=x86-64 -auxbase test -Wall -version -o /tmp/cc2EcXXv.s
GNU C (SliTaz) version 4.6.3 (x86_64-slitaz-linux)
 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/x86_64/sysroot/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
 /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/include
 /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/include-fixed
 /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/include
 /cross/x86_64/sysroot/usr/include
End of search list.
GNU C (SliTaz) version 4.6.3 (x86_64-slitaz-linux)
 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: c4f5c702d252e5d1420bc4326f50e9fd
COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'test.out' '-mtune=generic' '-march=x86-64'
 /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/bin/as --64 -o /tmp/cccr7HBz.o /tmp/cc2EcXXv.s
COMPILER_PATH=/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/bin/
LIBRARY_PATH=/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/lib/../lib64/:/cross/x86_64/sysroot/lib/../lib64/:/cross/x86_64/sysroot/usr/lib/../lib64/:/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/lib/:/cross/x86_64/sysroot/lib/:/cross/x86_64/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-Wall' '-o' 'test.out' '-mtune=generic' '-march=x86-64'
 /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/collect2 --sysroot=/cross/x86_64/sysroot --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o test.out /cross/x86_64/sysroot/usr/lib/../lib64/crt1.o /cross/x86_64/sysroot/usr/lib/../lib64/crti.o /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/crtbegin.o -L/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3 -L/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/lib/../lib64 -L/cross/x86_64/sysroot/lib/../lib64 -L/cross/x86_64/sysroot/usr/lib/../lib64 -L/cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/../../../../x86_64-slitaz-linux/lib -L/cross/x86_64/sysroot/lib -L/cross/x86_64/sysroot/usr/lib /tmp/cccr7HBz.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /cross/x86_64/tools/lib/gcc/x86_64-slitaz-linux/4.6.3/crtend.o /cross/x86_64/sysroot/usr/lib/../lib64/crtn.o

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

[CHECKING] readelf -h test.out
ELF Header:
  Magic:   7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF64
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Advanced Micro Devices X86-64
  Version:                           0x1
  Entry point address:               0x400370
  Start of program headers:          64 (bytes into file)
  Start of section headers:          4304 (bytes into file)
  Flags:                             0x0
  Size of this header:               64 (bytes)
  Size of program headers:           56 (bytes)
  Number of program headers:         8
  Size of section headers:           64 (bytes)
  Number of section headers:         36
  Section header string table index: 33

compile.log

 

2013-12-21

Slitaz -- backports / cook

wok-backports: cook error
  • grep: /home/slitaz/wok/aufs/receipt: No such file or directory
  • cp: can't stat '/home/slitaz/wok/linux/stuff/aufs3-base.patch': No such file or directory
  • cp: can't stat '/usr/share/boot/initrd': No such file or directory
  • cp: can't stat '/home/slitaz/wok/linux/install/linux64/lib/modules/3.2-slitaz/kernel/drivers/char/toshiba.ko.xz': No such file or directory


1. Aufs packages
patching file virt/kvm/kvm_main.c
Checking for Aufs packages...
grep: /home/slitaz/wok/aufs/receipt: No such file or directory

grep: /home/slitaz/wok/aufs/receipt: No such file or directory
/usr/bin/cook: .: line 1223: can't open '/home/slitaz/wok/aufs/receipt'
tar: can't open '/home/slitaz/src/aufs-.tar.bz2': No such file or directory


2. aufs3-*.patch
Apply linux-CVE-2013-2929.u
patching file arch/ia64/include/asm/processor.h
patching file include/linux/binfmts.h
patching file include/linux/sched.h
patching file kernel/ptrace.c
cp: can't stat '/home/slitaz/wok/linux/stuff/aufs3-base.patch': No such file or directory
Apply aufs3-base.patch
/usr/bin/cook: line 364: can't open /home/slitaz/wok/linux/source/slitaz/aufs3-base.patch: no such file

http://hg.slitaz.org/wok-backports/file/b3f60b195d7a/linux/receipt
[..]
132 touch done.$patch_file
133 done <<EOT
134 $PACKAGE-diff.u
135 $PACKAGE-header.u
136 $PACKAGE-freeinitrd.u
137 $PACKAGE-subroot.u
138 $PACKAGE-CVE-2013-2929.u
139 aufs3-base.patch
140 aufs3-standalone.patch
141 aufs3-loopback.patch
142 aufs3-proc_map.patch
143 channel-negative-one-maxim.patch
144 mac80211.compat08082009.wl_frag+ack_v1.patch
145 EOT

http://hg.slitaz.org/wok-backports/file/b3f60b195d7a/linux/stuff
file aufs2-base.patch     2726     -rw-r--r--
file aufs2-kbuild.patch     976     -rw-r--r--
file aufs2-standalone.patch     7680     -rw-r--r--
file bootloader.sh     9086     -rwxr-xr-x
file channel-negative-one-maxim.patch     1021     -rw-r--r--
file check_modules.sh     1857     -rwxr-xr-x
file gztazmod.sh     1359     -rwxr-xr-x
file linux-CVE-2013-2929.u     1882     -rw-r--r--
file linux-diff.u     1399     -rw-r--r--
file linux-freeinitrd.u     3649     -rw-r--r--
file linux-header.u     13582     -rw-r--r--
file linux-slitaz.config     115966     -rw-r--r--
file linux-slitaz.config64     109832     -rw-r--r--
file linux-subroot.u     1690     -rw-r--r--
file list_modules.sh     1154     -rwxr-xr-x
file mac80211.compat08082009.wl_frag+ack_v1.patch     1049     -rw-r--r--
file modules.list     9922     -rw-r--r--


3. linux-uml

patching file virt/kvm/kvm_main.c
cp: can't stat '/usr/share/boot/initrd': No such file or directory
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o

wok-backports changeset 1:87efcf9eac62
http://hg.slitaz.org/wok-backports/rev/87efcf9eac62
linux: fix compile_rules
author    Pascal Bellard <pascal.bellard@slitaz.org>
date    Wed Dec 18 17:26:22 2013 +0000 (2 days ago ago)
parents    0cfab50066bc
children    0692b2aafabb
files    linux/receipt
   line diff
     1.1 --- a/linux/receipt    Wed Dec 18 15:14:49 2013 +0000
     1.2 +++ b/linux/receipt    Wed Dec 18 17:26:22 2013 +0000
     1.3 @@ -47,7 +47,6 @@
     1.4  compile_rules()
     1.5  {
     1.6      cd $src
     1.7 -    cp /usr/share/boot/initrd initrd.cpio
     1.8 
     1.9      if [ "$KBASEVER" != "$VERSION" ]; then
    1.10          [ -s $SRC/$(basename $PATCH) ] ||


4. linux64-toshiba
Pack: linux64-toshiba 3.2.53
================================================================================
Executing: genpkg_rules
cp: can't stat '/home/slitaz/wok/linux/install/linux64/lib/modules/3.2-slitaz/kernel/drivers/char/toshiba.ko.xz': No such file or directory

Debug information
================================================================================
Cook date: 2013-12-20 21:26
ERROR: genpkg_rules failed
cp: can't stat '/home/slitaz/wok/linux/install/linux64/lib/modules/3.2-slitaz/kernel/drivers/char/toshiba.ko.xz': No such file or directory
================================================================================

Slitaz -- backports



slitaz-backports

The slitaz-backports repository is there for those who wish to remain on a stable version of SliTaz while having updated packages.
slitaz-backports does not replace the work that is underway on the next version of SliTaz.
 tux@slitaz:~$ uname -a
Linux slitaz 3.2-slitaz #4 SMP Fri Dec 20 20:11:27 UTC 2013 i686 GNU/Linux

tux@slitaz:~$ head /var/log/dmesg.log
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 3.2-slitaz (root@slitaz) (gcc version 4.5.2 (SliTaz) ) #4 SMP Fri Dec 20 20:11:27 UTC 2013
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000003bffe000 (usable)
 BIOS-e820: 000000003bffe000 - 000000003c000000 (reserved)
 BIOS-e820: 00000000feffc000 - 00000000ff000000 (reserved)

tux@slitaz:~$ ls /lib/modules/3.2.53-slitaz/
kernel               modules.dep.bin      modules.pcimap
modules.alias        modules.devname      modules.seriomap
modules.alias.bin    modules.ieee1394map  modules.softdep
modules.builtin      modules.inputmap     modules.symbols
modules.builtin.bin  modules.isapnpmap    modules.symbols.bin
modules.ccwmap       modules.ofmap        modules.usbmap
modules.dep          modules.order
tux@slitaz:~$

2013-11-01

Slitaz -- lxc / templates

lxc-busybox
....
install_busybox()

1.
root@slitaz:/home/tux# ls /usr/lib/lxc/templates
lxc-busybox   lxc-fedora    lxc-lucid     lxc-natty
lxc-debian    lxc-lenny     lxc-maverick  lxc-sshd


2.
root@slitaz:/home/tux# ls /var/lib/lxc/slitaz-lxc/rootfs
bin      etc      lib      mnt      root     selinux  usr
dev      home     lib64    proc     sbin     tmp      var

    rootfs=$1
    name=$2
    res=0
    tree="\
$rootfs/selinux \
$rootfs/dev \
$rootfs/home \
$rootfs/root \
$rootfs/etc \
$rootfs/etc/init.d \
$rootfs/bin \
$rootfs/sbin \
$rootfs/proc \
$rootfs/mnt \
$rootfs/tmp \
$rootfs/var/log \
$rootfs/usr/share/udhcpc \
$rootfs/dev/pts \
$rootfs/dev/shm \
$rootfs/lib \
$rootfs/usr/lib \
$rootfs/lib64 \
$rootfs/usr/lib64"

    mkdir -p $tree || return 1
    chmod 755 $tree || return 1


3.
root@slitaz:/home/tux# ls -l /var/lib/lxc/slitaz-lxc/rootfs/dev
total 8
crw-rw-rw-    1 root     root        5,   1 Nov  1 12:47 console
crw-rw-rw-    1 root     root        1,   3 Nov  1 12:47 null
lrwxrwxrwx    1 root     root            13 Nov  1 13:12 ptmx -> /dev/pts/ptmx
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 pts
brw-------    1 root     root        1,   0 Nov  1 12:47 ram0
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 shm
crw-rw-rw-    1 root     root        5,   0 Nov  1 12:47 tty
crw-rw-rw-    1 root     root        4,   0 Nov  1 12:47 tty0
crw-r--r--    1 root     root        4,   0 Nov  1 12:47 tty1
crw-r--r--    1 root     root        4,   0 Nov  1 12:47 tty5

    # minimal devices needed for busybox
    mknod tty c 5 0       || res=1
    mknod console c 5 1   || res=1
    chmod 666 tty console || res=1
    mknod tty0 c 4 0      || res=1
    mknod tty1 c 4 0      || res=1
    mknod tty5 c 4 0      || res=1
    chmod 666 tty0        || res=1
    mknod ram0 b 1 0      || res=1
    chmod 600 ram0        || res=1
    mknod null c 1 3      || res=1
    chmod 666 null        || res=1


4.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/passwd
root:x:0:0:root:/root:/bin/sh

    # root user defined
    cat <<EOF >> $rootfs/etc/passwd
root:x:0:0:root:/root:/bin/sh
EOF


5.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/group
root:x:0:root

    cat <<EOF >> $rootfs/etc/group
root:x:0:root
EOF


6.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/init.d/rcS
#!/bin/sh
/bin/syslogd
/bin/mount -a
/bin/udhcpc

    cat <<EOF >> $rootfs/etc/init.d/rcS
#!/bin/sh
/bin/syslogd
/bin/mount -a
/bin/udhcpc
EOF


7.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/fstab
proc  /proc      proc    defaults     0      0
shm   /dev/shm   tmpfs   defaults     0      0

    # mount points
    cat <<EOF >> $rootfs/etc/fstab
proc  /proc      proc    defaults     0      0
shm   /dev/shm   tmpfs   defaults     0      0
EOF


8.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/etc/inittab
::sysinit:/etc/init.d/rcS
tty1::respawn:/bin/getty -L tty1 115200 vt100
console::askfirst:/bin/sh

    cat <<EOF >> $rootfs/etc/inittab
::sysinit:/etc/init.d/rcS
tty1::respawn:/bin/getty -L tty1 115200 vt100
console::askfirst:/bin/sh
EOF


9.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/rootfs/usr/share/udhcpc/default.script
#!/bin/sh

case "$1" in
    deconfig)
        ip addr flush dev $interface
                ;;

    renew|bound)

                # flush all the routes
        if [ -n "$router" ]; then
                        ip route del default 2> /dev/null
        fi

                # check broadcast
                if [ -n "$broadcast" ]; then
                        broadcast="broadcast $broadcast"
                fi

                # add a new ip address
        ip addr add $ip/$mask $broadcast dev $interface

        if [ -n "$router" ]; then
                        ip route add default via $router dev $interface
                fi

        [ -n "$domain" ] && echo search $domain > /etc/resolv.conf
        for i in $dns ; do
            echo nameserver $i >> /etc/resolv.conf
        done
        ;;
esac
exit 0

----

    cat <<EOF >> $rootfs/usr/share/udhcpc/default.script
#!/bin/sh

case "\$1" in
    deconfig)
        ip addr flush dev \$interface
                ;;

    renew|bound)

                # flush all the routes
        if [ -n "\$router" ]; then
                        ip route del default 2> /dev/null
        fi

                # check broadcast
                if [ -n "\$broadcast" ]; then
                        broadcast="broadcast \$broadcast"
                fi

                # add a new ip address
        ip addr add \$ip/\$mask \$broadcast dev \$interface

        if [ -n "\$router" ]; then
                        ip route add default via \$router dev \$interface
                fi

        [ -n "\$domain" ] && echo search \$domain > /etc/resolv.conf
        for i in \$dns ; do
            echo nameserver \$i >> /etc/resolv.conf
        done
        ;;
esac
exit 0
EOF


Slitaz -- lxc / HOST

HOST :

1.
root@slitaz:/home/tux# mount | grep cgroup
cgroup on /sys/fs/cgroup type cgroup (rw,relatime,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,ns,cpuset)


2.
root@slitaz:/home/tux# lxc-info -n slitaz-lxc
'slitaz-lxc' is RUNNING


3.
root@slitaz:/home/tux# ps ax | tail -9
 1624 pts/3    S+     0:00 lxc-start -n slitaz-lxc
 1625 ?        Ss     0:00 init     
 1628 ?        Ss     0:00 /bin/syslogd
 1630 pts/4    Ss+    0:00 /bin/getty -L tty1 115200 vt100
 1631 pts/5    Ss+    0:00 /bin/sh
 1632 pts/1    S      0:00 sudo -s
 1633 pts/1    S      0:00 /bin/sh
 1662 pts/1    R+     0:00 ps ax
 1663 pts/1    S+     0:00 tail -9

root@slitaz:/home/tux# lxc-ps -n slitaz-lxc
CONTAINER    PID TTY          TIME CMD
            1632 pts/1    00:00:00 sudo
            1633 pts/1    00:00:00 sh
            1667 pts/1    00:00:00 lxc-ps
            1668 pts/1    00:00:00 ps


4.
root@slitaz:/home/tux# ls /sys/fs/cgroup
blkio.io_merged                  cpuset.memory_spread_slab
blkio.io_queued                  cpuset.mems
blkio.io_service_bytes           cpuset.sched_load_balance
blkio.io_serviced                cpuset.sched_relax_domain_level
blkio.io_service_time            cpu.shares
blkio.io_wait_time               devices.allow
blkio.reset_stats                devices.deny
blkio.sectors                    devices.list
blkio.time                       memory.failcnt
blkio.weight                     memory.force_empty
blkio.weight_device              memory.limit_in_bytes
cgroup.clone_children            memory.max_usage_in_bytes
cgroup.event_control             memory.memsw.failcnt
cgroup.procs                     memory.memsw.limit_in_bytes
cpuacct.stat                     memory.memsw.max_usage_in_bytes
cpuacct.usage                    memory.memsw.usage_in_bytes
cpuacct.usage_percpu             memory.move_charge_at_immigrate
cpu.rt_period_us                 memory.oom_control
cpu.rt_runtime_us                memory.soft_limit_in_bytes
cpuset.cpu_exclusive             memory.stat
cpuset.cpus                      memory.swappiness
cpuset.mem_exclusive             memory.usage_in_bytes
cpuset.mem_hardwall              memory.use_hierarchy
cpuset.memory_migrate            net_cls.classid
cpuset.memory_pressure           notify_on_release
cpuset.memory_pressure_enabled   release_agent
cpuset.memory_spread_page        tasks


5.
root@slitaz:/home/tux# cat /sys/fs/cgroup/memory.stat
cache 1361383424
rss 484990976
mapped_file 41578496
pgpgin 18986980
pgpgout 18536205
swap 0
inactive_anon 54640640
active_anon 485179392
inactive_file 937705472
active_file 368799744
unevictable 0
hierarchical_memory_limit 9223372036854775807
hierarchical_memsw_limit 9223372036854775807
total_cache 1361383424
total_rss 484990976
total_mapped_file 41578496
total_pgpgin 18986980
total_pgpgout 18536205
total_swap 0
total_inactive_anon 54640640
total_active_anon 485179392
total_inactive_file 937705472
total_active_file 368799744
total_unevictable 0
root@slitaz:/home/tux#

Slitaz -- lxc / rm

rm: unrecognized option '--preserve-root'

Fix: coreutils-operations dont remove cp/rm in post_install, we need them to install


1.
root@slitaz:/home/tux# lxc-create -n slitaz-lxc -t busybox
rm: unrecognized option '--preserve-root'   

Command line: rm -rf --preserve-root /var/lib/lxc/slitaz-lxc

BusyBox v1.18.4 (2012-03-14 03:32:25 CET) multi-call binary.

Usage: rm [-irf] FILE...

Remove (unlink) FILEs

Options:
    -i    Always prompt before removing
    -f    Never prompt
    -R,-r    Recurse


2.
root@slitaz:/home/tux# ls -l /bin/rm /usr/bin/rm
lrwxrwxrwx    1 root     root            12 Nov  1 23:37 /bin/rm -> /bin/busybox
-rwxr-xr-x    1 root     root         55487 Nov  1 11:08 /usr/bin/rm


3.
root@slitaz:/home/tux# which rm
/usr/bin/rm


4.
root@slitaz:/home/tux# echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/sbin:/usr/local/bin


5.
root@slitaz:/home/tux# rm --version
rm (GNU coreutils) 8.12
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie, Richard M. Stallman,
and Jim Meyering.


6.
root@slitaz:/home/tux# rm --help | grep root
      --no-preserve-root  do not treat `/' specially
      --preserve-root   do not remove `/' (default)


7.
Receipt for: coreutils-operations
http://cook.slitaz.org/cooker.cgi?receipt=coreutils-operations

# SliTaz package receipt.

PACKAGE="coreutils-operations"
VERSION="8.12"
CATEGORY="system-tools"
SHORT_DESC="GNU utilities that perform basic operations."
MAINTAINER="rcx@zoominternet.net"
LICENSE="GPL3"
WEB_SITE="http://www.gnu.org/software/coreutils/"
WANTED="coreutils"

DEPENDS="glibc-base acl"

# Rules to gen a SliTaz package suitable for Tazpkg.
#
# This is a special package for installed system or developer. We only take
# a few things, as Busybox provides all the basic utilities, but not for compiling.
# But DO NOT erase a Busybox applet, remove it before with pre_install rules.
#
genpkg_rules()
{
    mkdir -p $fs/bin
    #cp -a $install/usr/bin/cp $fs/bin
    cp -a $install/usr/bin/dd $fs/bin
    cp -a $install/usr/bin/mv $fs/bin
    cp -a $install/usr/bin/ln $fs/bin
    #cp -a $install/usr/bin/rm $fs/bin

    mkdir -p $fs/usr/bin
    cp -a $install/usr/bin/install $fs/usr/bin
    cp -a $install/usr/bin/shred $fs/usr/bin
}

# Pre and post install commands for Tazpkg.
# We must remove all Busybox symlink before installing.
#
pre_install()
{
    local root
    root=$1
    echo "Processing pre-install commands..."
    echo -n "Removing all Busybox replaced utils... "
    rm -f $root/bin/dd $root/bin/mv $root/bin/ln
    rm -f $root/usr/bin/install $root/usr/bin/shred
    # Dont remove cp/rm or the installation will fail because tazpkg use
    # cp and rm during the process.
    #
    #rm -f $root/bin/cp $root/bin/rm
    status
}

post_remove()
{
    # use busybox ln applet directly since /bin/ln
    # in this package is remove already
    /bin/busybox ln -s /bin/busybox $1/bin/cp
    /bin/busybox ln -s /bin/busybox $1/bin/dd
    /bin/busybox ln -s /bin/busybox $1/bin/mv
    /bin/busybox ln -s /bin/busybox $1/bin/ln
    /bin/busybox ln -s /bin/busybox $1/bin/rm
    /bin/busybox ln -s /bin/busybox $1/usr/bin/install
    /bin/busybox ln -s /bin/busybox $1/usr/bin/shred
}


8.
Fix: coreutils-operations dont remove cp/rm in post_install, we need them to install
http://hg.slitaz.org/wok/raw-rev/59b766d69633

# HG changeset patchs
# User Christophe Lincoln <pankso@slitaz.org>
# Date 1253559865 -7200
# Node ID 59b766d69633316bc1a1b70fe1d8e2a30c43d279
# Parent  6ef3727f527d032a1515dd96bece7bea625c3b8a
Fix: coreutils-operations dont remove cp/rm in post_install, we need them to install

diff -r 6ef3727f527d -r 59b766d69633 coreutils-operations/receipt
--- a/coreutils-operations/receipt    Mon Sep 21 13:37:43 2009 +0200
+++ b/coreutils-operations/receipt    Mon Sep 21 21:04:25 2009 +0200
@@ -18,10 +18,10 @@
 genpkg_rules()
 {
     mkdir -p $fs/bin
-    cp -a $_pkg/usr/bin/cp $fs/bin
+    #cp -a $_pkg/usr/bin/cp $fs/bin
     cp -a $_pkg/usr/bin/dd $fs/bin
     cp -a $_pkg/usr/bin/mv $fs/bin
-    cp -a $_pkg/usr/bin/rm $fs/bin
+    #cp -a $_pkg/usr/bin/rm $fs/bin

     mkdir -p $fs/usr/bin
     cp -a $_pkg/usr/bin/install $fs/usr/bin
@@ -37,8 +37,12 @@
     root=$1
     echo "Processing pre-install commands..."
     echo -n "Removing all Busybox replaced utils... "
-    rm -f $root/bin/cp $root/bin/dd $root/bin/mv $root/bin/rm
+    rm -f $root/bin/dd $root/bin/mv
     rm -f $root/usr/bin/install $root/usr/bin/shred
+    # Dont remove cp/rm or the installation will fail because tazpkg use
+    # cp and rm during the process.
+    #
+    #rm -f $root/bin/cp $root/bin/rm
     status
 }


Slitaz -- lxc-2

1.
root@slitaz:/home/tux# lxc-start -n slitaz-lxc

Please press Enter to activate this console.


2.
root@slitaz-lxc:/# echo 'nameserver 168.95.1.1' > /etc/resolv.conf

root@slitaz-lxc:/# ping -c4 www.yahoo.com
ping -c4 www.yahoo.com
PING www.yahoo.com (203.84.197.9): 56 data bytes
64 bytes from 203.84.197.9: seq=0 ttl=55 time=21.430 ms
64 bytes from 203.84.197.9: seq=1 ttl=55 time=24.953 ms
64 bytes from 203.84.197.9: seq=2 ttl=55 time=22.802 ms
64 bytes from 203.84.197.9: seq=3 ttl=55 time=21.091 ms

--- www.yahoo.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 21.091/22.569/24.953 ms


3.
root@slitaz-lxc:/# ls -R /etc
ls -R /etc
/etc:
fstab        init.d       passwd       shadow
group        inittab      resolv.conf

/etc/init.d:
rcS


4.
root@slitaz-lxc:/# cat /etc/inittab
cat /etc/inittab
::sysinit:/etc/init.d/rcS
tty1::respawn:/bin/getty -L tty1 115200 vt100
console::askfirst:/bin/sh


5.
root@slitaz-lxc:/# cat /etc/init.d/rcS
cat /etc/init.d/rcS
#!/bin/sh
/bin/syslogd
/bin/mount -a
#/bin/udhcpc


6.
root@slitaz-lxc:/# mount
mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw,relatime,barrier=1,data=ordered)
/dev/root on /lib type ext2 (ro,relatime,barrier=1,data=ordered)
/dev/root on /usr/lib type ext2 (ro,relatime,barrier=1,data=ordered)
devpts on /dev/console type devpts (rw,relatime,mode=600,ptmxmode=000)
devpts on /dev/tty1 type devpts (rw,relatime,mode=600,ptmxmode=000)
devpts on /dev/pts type devpts (rw,relatime,mode=600,ptmxmode=666)
devpts on /dev/pts/ptmx type devpts (rw,relatime,mode=600,ptmxmode=666)
proc on /proc type proc (rw,relatime)
shm on /dev/shm type tmpfs (rw,relatime)


7.
root@slitaz-lxc:/# ps
ps
PID   USER     TIME   COMMAND
    1 root       0:00 init
    4 root       0:00 /bin/syslogd
    6 root       0:00 /bin/getty -L tty1 115200 vt100
    7 root       0:00 /bin/sh
   13 root       0:00 ps


8.
root@slitaz-lxc:/# cat /var/log/messages
cat /var/log/messages
Nov  1 05:12:00 slitaz-lxc syslog.info syslogd started: BusyBox v1.18.4
Nov  1 05:12:00 slitaz-lxc daemon.info init: starting pid 7, tty '/dev/tty1': '/bin/getty -L tty1 115200 vt100'
Nov  1 05:12:23 slitaz-lxc daemon.info init: starting pid 8, tty '/dev/console': '/bin/sh'

Slitaz -- lxc / kernel

Kernel Setup

CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CPUSETS=y
CONFIG_PROC_PID_CPUSET=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_MM_OWNER=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_NET_CLS_CGROUP=y
CONFIG_SECURITY_FILE_CAPABILITIES=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y

1.
root@slitaz:/home/tux# zcat /proc/config.gz | grep CGROUP
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
CONFIG_CGROUP_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y
CONFIG_CGROUP_SCHED=y
CONFIG_BLK_CGROUP=y
# CONFIG_DEBUG_BLK_CGROUP is not set
CONFIG_NET_CLS_CGROUP=y


2.
root@slitaz:/home/tux# mount cgroup -t cgroup /sys/fs/cgroup

root@slitaz:/home/tux# mount | grep cgroup
cgroup on /sys/fs/cgroup type cgroup (rw,relatime,blkio,net_cls,freezer,devices,memory,cpuacct,cpu,ns,cpuset)


3.
root@slitaz:/home/tux# tazpkg -gi lxc

root@slitaz:/home/tux# lxc-create -n slitaz-lxc -t busybox

Warning:
-------
Usually the template option is called with a configuration
file option too, mostly to configure the network.
eg. lxc-create -n foo -f lxc.conf -t debian
The configuration file is often:

lxc.network.type=macvlan
lxc.network.link=eth0
lxc.network.flags=up

or alternatively:

lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up

For more information look at lxc.conf (5)

At this point, I assume you know what you do.
Press <enter> to continue ...

warning : busybox is not statically linked.
warning : The template script may not correctly
warning : setup the container environment.
chroot: failed to run command `/bin/passwd': No such file or directory
No password for 'root', please change !
'busybox' template installed
'slitaz-lxc' created

root@slitaz:/home/tux# which passwd
/usr/bin/passwd


4.
root@slitaz:/home/tux# ls -l /var/lib/lxc/slitaz-lxc/rootfs
total 64
drwxr-xr-x    2 root     root         12288 Nov  1 12:47 bin
drwxr-xr-x    4 root     root          4096 Nov  1 12:47 dev
drwxr-xr-x    3 root     root          4096 Nov  1 12:47 etc
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 home
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 lib
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 lib64
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 mnt
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 proc
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 root
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 sbin
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 selinux
drwxr-xr-x    2 root     root          4096 Nov  1 12:47 tmp
drwxr-xr-x    5 root     root          4096 Nov  1 12:47 usr
drwxr-xr-x    3 root     root          4096 Nov  1 12:47 var

root@slitaz:/home/tux# du -sh /var/lib/lxc/slitaz-lxc/rootfs/
748.0K    /var/lib/lxc/slitaz-lxc/rootfs/


5.
root@slitaz:/home/tux# cat /var/lib/lxc/slitaz-lxc/config
lxc.utsname = slitaz-lxc
lxc.tty = 1
lxc.pts = 1
lxc.rootfs = /var/lib/lxc/slitaz-lxc/rootfs
lxc.mount.entry=/lib /var/lib/lxc/slitaz-lxc/rootfs/lib none ro,bind 0 0
lxc.mount.entry=/usr/lib /var/lib/lxc/slitaz-lxc/rootfs/usr/lib none ro,bind 0 0


Ref:
1. Control Groups
=================

1.1 What are cgroups ?
----------------------

Control Groups provide a mechanism for aggregating/partitioning sets of tasks, and all their future children, into hierarchical groups with specialized behaviour.


                      =============
                      CFS Scheduler
                      =============

1.  OVERVIEW

CFS stands for "Completely Fair Scheduler," and is the new "desktop" process scheduler implemented by Ingo Molnar and merged in Linux 2.6.23.  It is the replacement for the previous vanilla scheduler's SCHED_OTHER interactivity code.

Slitaz -- lxc


Linux Containers

Linux Containers (LXC) are an operating system-level virtualization method for running multiple isolated server installs (containers) on a single control host. LXC does not provide a virtual machine, but rather provides a virtual environment that has its own process and network space. It is similar to a chroot, but offers much more isolation.

1.
root@slitaz:/home/tux# lxc-checkconfig
--- Namespaces ---
Namespaces: enabled
Utsname namespace: enabled
Ipc namespace: enabled
Pid namespace: enabled
User namespace: enabled
Network namespace: enabled
Multiple /dev/pts instances: enabled

--- Control groups ---
Cgroup: enabled
Cgroup namespace: enabled
Cgroup device: enabled
Cgroup sched: enabled
Cgroup cpu account: enabled
Cgroup memory controller: enabled
Cgroup cpuset: enabled

--- Misc ---
Veth pair device: enabled
Macvlan: enabled
Vlan: enabled
File capabilities: enabled

Note : Before booting a new kernel, you can check its configuration
usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig


2.
root@slitaz:/home/tux# lxc-start -n slitaz-lxc

Please press Enter to activate this console.

3.
root@slitaz-lxc:/# ls /dev
ls /dev
console  null     pts      shm      tty0     tty5
log      ptmx     ram0     tty      tty1

4.
root@slitaz-lxc:/# nslookup cook.slitaz.org
nslookup cook.slitaz.org
Server:    168.95.1.1
Address 1: 168.95.1.1 dns.hinet.net

Name:      cook.slitaz.org
Address 1: 37.187.4.13 ks3367256.kimsufi.com
root@slitaz-lxc:/#

2013-07-05

Slitaz -- meld


Visual diff and merge tool for GNOME.

root@slitaz:~# tazpkg info meld

Tazpkg information
================================================================================
Package : meld
Version : 1.4.0
Category : development
Short desc : Visual diff and merge tool for GNOME.
Maintainer : slaxemulator@gmail.com
Depends : pygtk rarian
Build deps : pygtk-dev rarian-dev gnome-doc-utils intltool pkg-config util-linux-ng-getopt
Web site : http://meld.sourceforge.net/
================================================================================

root@slitaz:~#

2013-06-22

Slitaz -- Compiling with qemu-arm-static chroot

Compiling with qemu-arm-static chroot

Target: arm-slitaz-linux-gnueabi

--with-arch=armv6 --with-fpu=vfp --with-float=hard --with-pkgversion=SliTaz
--build=arm-slitaz-linux-gnueabi --host=arm-slitaz-linux-gnueabi

1.
root@slitaz:~# uname -a
Linux slitaz 2.6.37-slitaz #1 SMP Fri May 10 17:42:01 CST 2013 i686 GNU/Linux

2.
root@slitaz:~# tazdev -c /opt/rootfs-armhf

Mounting virtual filesystems...                                    [ Done ]
Chrooting to: /opt/rootfs-armhf

3.
root@slitaz:/# gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/lto-wrapper
Target: arm-slitaz-linux-gnueabi
Configured with: /home/slitaz/wok/gcc/source/gcc-4.6.3/configure --prefix=/usr --libexecdir=/usr/lib --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit --with-system-zlib --enable-plugin --disable-multilib --disable-libssp --disable-checking --disable-werror --disable-bootstrap --enable-clocale=gnu --enable-lto --enable-threads=posix --with-arch=armv6 --with-fpu=vfp --with-float=hard --with-pkgversion=SliTaz --build=arm-slitaz-linux-gnueabi --host=arm-slitaz-linux-gnueabi
Thread model: posix
gcc version 4.6.3 (SliTaz)

4.
root@slitaz:/# echo 'int main() { return 0; }' > test.c

root@slitaz:/# gcc -o test.o test.c

root@slitaz:/# ls -l test*
-rw-r--r--    1 root     root            25 Jun  9 13:59 test.c
-rwxr-xr-x    1 root     root          6790 Jun  9 13:59 test.o

5.
root@slitaz:/# file test.o
test.o: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped

root@slitaz:/# readelf -A test.o
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:/#

Slitaz -- glibc / eglibc

GNU C Library (EGLIBC) stable release version 2.13,

GNU C Library stable release version 2.13,

root@slitaz:~# file /opt/rootfs-armhf/lib/libc-2.13.so
/opt/rootfs-armhf/lib/libc-2.13.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped

1. slitaz-armhf: eglibc-2.13
root@slitaz:/# file /lib/libc-2.13.so
/lib/libc-2.13.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
root@slitaz:/#

root@slitaz:/# /lib/libc-2.13.so
GNU C Library (EGLIBC) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.6.3.
Compiled on a Linux 3.2.14 system on 2012-06-30.
Available extensions:
    crypt add-on version 2.1 by Michael Glad and others
    GNU Libidn by Simon Josefsson
    Native POSIX Threads Library by Ulrich Drepper et al
    Support for some architectures added on, not maintained in glibc core.
    BIND-8.2.3-T5B
libc ABIs: UNIQUE
For bug reporting instructions, please see:
<http://www.eglibc.org/issues/>.

2.
root@slitaz:/# exit

Unmounting virtual filesystems...                                  [ Done ]

3. slitaz-4.0: glibc-2.13
root@slitaz:~# uname -a
Linux slitaz 2.6.37-slitaz #1 SMP Fri May 10 17:42:01 CST 2013 i686 GNU/Linux

root@slitaz:~# file /lib/libc-2.13.so
/lib/libc-2.13.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.30, stripped

root@slitaz:~# /lib/libc-2.13.so
GNU C Library stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.37 system on 2012-03-13.
Available extensions:
    crypt add-on version 2.1 by Michael Glad and others
    GNU Libidn by Simon Josefsson
    Native POSIX Threads Library by Ulrich Drepper et al
    BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

root@slitaz:~#

2013-06-20

Slitaz -- qemu-arm-static chroot-2

Chrooting to: /opt/rootfs-armhf/

root@slitaz:~# ls -l /opt/rootfs-armhf

1. download qemu-arm-static-1.1.2.tazpkg
http://tiny.cc/rh7wyw
# tazpkg -i qemu-arm-static-1.1.2.tazpkg

2. copy qemu-arm-static to rootfs-armhf
# cp /usr/bin/qemu-arm-static /opt/rootfs-armhf/usr/bin


3. Mount the binfmt_misc handler
# modprobe binfmt_misc
# mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc


4. register our format with the kernel via the procfs
root@slitaz:~# echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\x00\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' > /proc/sys/fs/binfmt_misc/register


5. check register
root@slitaz:~# cat /proc/sys/fs/binfmt_misc/arm
enabled
interpreter /usr/bin/qemu-arm-static
flags:
offset 0
magic 7f454c4601010100000000000000000002002800
mask ffffffffffffff00ffffffffffff00fffeffffff


6. chroot rootfs-armhf
root@slitaz:~# tazdev -c /opt/rootfs-armhf/

Mounting virtual filesystems...                                    [ Done ]
Chrooting to: /opt/rootfs-armhf/

7.
root@slitaz:/# uname -m
armv6l


8.
root@slitaz:/# echo -e 'nameserver 8.8.8.8\n' > /etc/resolv.conf
root@slitaz:/# nslookup www.slitaz.org
Server:    8.8.8.8
Address 1: 8.8.8.8 google-public-dns-a.google.com

Name:      www.slitaz.org
Address 1: 94.23.61.29 pangolin.pimentvert.com
Address 2: 91.121.171.224 ks362096.kimsufi.com
root@slitaz:/#

Slitaz -- rootfs-armhf

rootfs-armhf

1.
# wget http://mirror.slitaz.org/packages/cooking/util-linux-mount-2.21.1.tazpkg
# tazpkg -i util-linux-mount-2.21.1.tazpkg

download slitaz-armhf-mini-2012-12-14.zip and extract it
# wget http://arm.balinor.net/slitaz/armhf/slitaz-armhf-mini-2012-12-14.zip
# unzip slitaz-armhf-mini-2012-12-14.zip

2.
root@slitaz:~# file slitaz-armhf-mini-2012-12-14.img
slitaz-armhf-mini-2012-12-14.img: x86 boot sector; partition 1: ID=0x6, starthead 1, startsector 63, 48132 sectors; partition 2: ID=0x83, starthead 0, startsector 48195, 915705 sectors, code offset 0xb8

root@slitaz:~# fdisk -lu slitaz-armhf-mini-2012-12-14.img

Disk slitaz-armhf-mini-2012-12-14.img: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 cylinders, total 1048576 sectors
Units = sectors of 1 * 512 = 512 bytes

                           Device Boot      Start         End      Blocks  Id System
slitaz-armhf-mini-2012-12-14.img1              63       48194       24066   6 FAT16
slitaz-armhf-mini-2012-12-14.img2           48195      963899      457852+ 83 Linux
root@slitaz:~#

3.
root@slitaz:~# mount -o,offset=$((48195*512)) slitaz-armhf-mini-2012-12-14.img /mnt/raspi

4.
root@slitaz:~# cp -a /mnt/raspi /opt/rootfs-armhf

5.
root@slitaz:~# ls -l /opt/rootfs-armhf
total 68
drwxr-xr-x    2 root     root          4096 Dec  3  2012 bin
drwxr-xr-x    2 root     root          4096 Dec 14  2012 boot
drwxr-xr-x    8 root     root          4096 Dec  3  2012 dev
drwxr-xr-x    7 root     root          4096 Dec 14  2012 etc
drwxr-xr-x    2 root     root          4096 Dec  3  2012 home
lrwxrwxrwx    1 root     root            12 Jun 19 20:03 init -> /bin/busybox
drwxr-xr-x    2 root     root          4096 Dec  3  2012 lib
drwx------    2 root     root          4096 Dec  3  2012 lost+found
drwxr-xr-x    5 root     root          4096 Dec  3  2012 media
drwxr-xr-x    2 root     root          4096 Dec  3  2012 mnt
drwxr-xr-x    2 root     root          4096 Dec  3  2012 proc
drwxr-x---    2 root     root          4096 Dec  3  2012 root
drwxr-xr-x    2 root     root          4096 Dec  3  2012 run
drwxr-xr-x    2 root     root          4096 Dec  3  2012 sbin
drwxr-xr-x    2 root     root          4096 Dec  3  2012 sys
drwxrwxrwt    2 root     root          4096 Dec  3  2012 tmp
drwxr-xr-x    8 root     root          4096 Dec 14  2012 usr
drwxr-xr-x   11 root     root          4096 Dec  3  2012 var

root@slitaz:~# file /opt/rootfs-armhf/lib/libc-2.13.so
/opt/rootfs-armhf/lib/libc-2.13.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped

root@slitaz:~# du -sh /opt/rootfs-armhf
9.2M    /opt/rootfs-armhf
root@slitaz:~#

2013-06-19

Slitaz -- qemu user mode and binfmt_misc

qemu user mode and binfmt_misc

User mode emulation. In this mode, QEMU can launch processes compiled for one CPU on another CPU.

Kernel Support for miscellaneous (your favourite) Binary Formats



1.1 Features
http://qemu.weilnetz.de/qemu-doc.html#Introduction

QEMU is a FAST! processor emulator using dynamic translation to achieve good emulation speed.

QEMU has two operating modes:

    Full system emulation. In this mode, QEMU emulates a full system (for example a PC), including one or several processors and various peripherals. It can be used to launch different Operating Systems without rebooting the PC or to debug system code.
   
   User mode emulation. In this mode, QEMU can launch processes compiled for one CPU on another CPU. It can be used to launch the Wine Windows API emulator (http://www.winehq.org) or to ease cross-compilation and cross-debugging.


Kernel Support for miscellaneous (your favourite) Binary Formats v1.1  ==========================================
https://www.kernel.org/doc/Documentation/binfmt_misc.txt

This Kernel feature allows you to invoke almost (for restrictions see below)
every program by simply typing its name in the shell.
This includes for example compiled Java(TM), Python or Emacs programs.

To achieve this you must tell binfmt_misc which interpreter has to be invoked
with which binary. Binfmt_misc recognises the binary-type by matching some bytes
at the beginning of the file with a magic byte sequence (masking out specified
bits) you have supplied. Binfmt_misc can also recognise a filename extension
aka '.com' or '.exe'.

First you must mount binfmt_misc:
    mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc


Ref:
https://wiki.edubuntu.org/UbuntuDevelopment/Ports

Slitaz -- qemu-arm-static chroot


qemu-arm-static chroot


1.
root@slitaz:~# uname -a
Linux slitaz 2.6.37-slitaz #1 SMP Fri May 10 17:42:01 CST 2013 i686 GNU/Linux

2.
root@slitaz:~# tazdev -c /opt/rootfs-armhf/

Mounting virtual filesystems...                                    [ Done ]
Chrooting to: /opt/rootfs-armhf/

3.
root@slitaz:/# uname -m
armv6l

4.
root@slitaz:/# readelf -A /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_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

5.
root@slitaz:/# head -5 /var/lib/tazpkg/installed.md5
bbb30be1a2c704154f58e2df501e35fd  busybox-1.20.2-armhf.tazpkg
a82e5ffd86838571addf3eee3f418c7b  dropbear-2012.55-armhf.tazpkg
7015c541e061e277c07f023073faad92  gcc-lib-base-4.6.3-armhf.tazpkg
d165510417ebc3d1e6bf37c96b9db8d8  gettext-base-0.18.1.1-armhf.tazpkg
2f4a5d282889c6fbd228a974822bd0d9  glibc-base-2.13-armhf.tazpkg

6.
root@slitaz:/# tazpkg list | tail -2
18 packages installed

7.
root@slitaz:/# du -sh /
13.4M    /
root@slitaz:/#