2013-11-26

Slitaz -- alsamixer



alsamixer - amixer

[UPDATE 20131225 ]

Unmuting the channels
The current version of ALSA installs with all channels muted by default. You will need to unmute the channels manually.

It is easiest to use alsamixer ncurses UI to accomplish this:

$ alsamixer

Alternatively, use amixer from the command-line:

$ amixer sset Master unmute

In alsamixer, the MM label below a channel indicates that the channel is muted, and 00 indicates that it is open.

Scroll to the Master and PCM channels with the ← and → keys and unmute them by pressing the m key. Use the ↑ key to increase the volume and obtain a value of 0 dB gain. The gain can be found in the upper left next to the Item: field. Higher values of gain will produce distorted sound.


$ amixer sset 'Speaker' unmute
$ amixer sset 'Headphone' unmute

1.
tux@slitaz:~$ amixer
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 59 [92%] [-3.75dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 62 [97%] [-1.50dB] [off]
Front Right: Playback 62 [97%] [-1.50dB] [off]
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 61 [95%] [-2.25dB] [off]
Front Right: Playback 61 [95%] [-2.25dB] [off]
[..]


2.
tux@slitaz:~$ amixer sset 'Speaker' unmute
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 62 [97%] [-1.50dB] [on]
Front Right: Playback 62 [97%] [-1.50dB] [on]

3.
tux@slitaz:~$ amixer sset 'Headphone' unmute
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 62 [97%] [-1.50dB] [on]
Front Right: Playback 62 [97%] [-1.50dB] [on]
tux@slitaz:~$

4.
tux@slitaz:~$ amixer scontents
Simple mixer control 'Master',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined penum
Playback channels: Mono
Limits: Playback 0 - 64
Mono: Playback 49 [77%] [-11.25dB] [on]
Simple mixer control 'Headphone',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 52 [81%] [-9.00dB] [on]
Front Right: Playback 52 [81%] [-9.00dB] [on]
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 64
Mono:
Front Left: Playback 61 [95%] [-2.25dB] [on]
Front Right: Playback 61 [95%] [-2.25dB] [on]
Simple mixer control 'PCM',0
Capabilities: pvolume penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 243 [95%] [-2.40dB]
Front Right: Playback 243 [95%] [-2.40dB]
Simple mixer control 'Front Mic',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'Front Mic Jack Mode',0
Capabilities: enum
Items: 'Mic In' 'Line In'
Item0: 'Mic In'
Simple mixer control 'Line',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'IEC958 Default PCM',0
Capabilities: pswitch pswitch-joined penum
Playback channels: Mono
Mono: Playback [on]
Simple mixer control 'IEC958 Playback Source',0
Capabilities: enum
Items: 'Digital Playback' 'Off'
Item0: 'Digital Playback'
Simple mixer control 'IEC958 Playback Source',1
Capabilities: enum
Items: 'Digital Playback' 'Off'
Item0: 'Digital Playback'
Simple mixer control 'Aux',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'Capture',0
Capabilities: cvolume cswitch penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 0 [0%] [0.00dB] [off]
Front Right: Capture 0 [0%] [0.00dB] [off]
Simple mixer control 'Capture',1
Capabilities: cvolume cswitch penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 15
Front Left: Capture 0 [0%] [0.00dB] [off]
Front Right: Capture 0 [0%] [0.00dB] [off]
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line' 'Aux'
Item0: 'Front Mic'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Front Mic' 'Rear Mic' 'Line' 'Aux'
Item0: 'Front Mic'
Simple mixer control 'Rear Mic',0
Capabilities: cvolume penum
Capture channels: Front Left - Front Right
Limits: Capture 0 - 3
Front Left: Capture 0 [0%] [0.00dB]
Front Right: Capture 0 [0%] [0.00dB]
Simple mixer control 'Rear Mic Jack Mode',0
Capabilities: enum
Items: 'Mic In' 'Line In'
Item0: 'Mic In'
tux@slitaz:~$

2013-11-14

Slitaz -- lsof

lsof (list open files)

How to find what program or service is listening on ports

1.
root@slitaz:/home/tux# lsof -Pnl +M -i4
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dropbear 1406 0 3u IPv4 4317 0t0 TCP *:22 (LISTEN)
Xorg 1433 0 3u IPv4 4504 0t0 TCP *:6000 (LISTEN)
firefox 1539 1000 45u IPv4 32787 0t0 TCP 192.168.1.30:58613->173.194.72.189:443 (ESTABLISHED)

-P no port names
-l list UID numbers
-n no host names
-i select IPv[46] files
+|-M portMap registration (-)

2.
root@slitaz:/home/tux# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1433/Xorg
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1406/dropbear
root@slitaz:/home/tux#

Slitaz -- speedtest-cli

speedtest-cli

Command line interface for testing internet bandwidth using speedtest.net

1.
root@slitaz:/home/tux# date
Fri Nov 15 09:41:17 CST 2013

2.
root@slitaz:/home/tux# wget --no-check-certificate  https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py 
--2013-11-15 09:39:51--  https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
Resolving raw.github.com (raw.github.com)... 103.245.222.133
Connecting to raw.github.com (raw.github.com)|103.245.222.133|:443... connected.
WARNING: cannot verify raw.github.com's certificate, issued by `/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance CA-3':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 16485 (16K) [text/plain]
Saving to: `speedtest_cli.py'

100%[======================================>] 16,485      --.-K/s   in 0.07s  

2013-11-15 09:39:52 (226 KB/s) - `speedtest_cli.py' saved [16485/16485]

3.
root@slitaz:/home/tux# chmod 755 speedtest_cli.py

4.
root@slitaz:/home/tux# ./speedtest_cli.py
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (1.165.xx.xx)...
Selecting best server based on ping...
Hosted by Far EasTone Telecommunications Co., Ltd (Taoyuan) [30.61 km]: 12.398 ms
Testing download speed........................................
Download: 29.64 Mbit/s
Testing upload speed..................................................
Upload: 2.98 Mbit/s
root@slitaz:/home/tux#

root@slitaz:/home/tux# ./speedtest_cli.py
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Testing from CHTD, Chunghwa Telecom Co., Ltd. (61.224.xx.xx)...
Selecting best server based on ping...
Hosted by Taiwan Fixed Network (Taichung) [1.67 km]: 14.067 ms
Testing download speed........................................
Download: 39.70 Mbit/s
Testing upload speed..................................................
Upload: 2.90 Mbit/s
root@slitaz:/home/tux#

2013-11-06

Slitaz -- JDK


get-java6-jdk

HTTP request sent, awaiting response... 404 Not Found

Processing post install commands.../usr/bin/tazpkg: cd: line 32: can't cd to /usr/lib/firefox*/plugins


1.
http://cook.slitaz.org/cooker.cgi?download=get-java6-jdk-1.0.tazpkg

root@slitaz:/tmp# get-java6-jdk
--2013-11-06 22:52:56--  http://raphaello.univ-fcomte.fr/ftp/java/Jdk/jdk-6u13-linux-i586.bin
Resolving raphaello.univ-fcomte.fr (raphaello.univ-fcomte.fr)... 194.57.88.125
Connecting to raphaello.univ-fcomte.fr (raphaello.univ-fcomte.fr)|194.57.88.125|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-11-06 22:52:58 ERROR 404: Not Found.


2.
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin

root@slitaz:/tmp# get-java6-jdk
--2013-11-06 23:06:23--  http://download.oracle.com/otn-pub/java/jdk/6u45-b06//jdk-6u45-linux-i586.bin
Resolving download.oracle.com (download.oracle.com)... 210.61.248.41, 210.61.248.24
Connecting to download.oracle.com (download.oracle.com)|210.61.248.41|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin [following]
--2013-11-06 23:06:23--  https://edelivery.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.77.22.140
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.77.22.140|:443... connected.
WARNING: cannot verify edelivery.oracle.com's certificate, issued by `/C=US/O=GeoTrust, Inc./CN=GeoTrust SSL CA':
  Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin?AuthParam=1383750200_4cb609f881784567d740e7ca5667fe0c [following]
--2013-11-06 23:06:24--  http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin?AuthParam=1383750200_4cb609f881784567d740e7ca5667fe0c
Connecting to download.oracle.com (download.oracle.com)|210.61.248.41|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71799552 (68M) [application/octet-stream]
Saving to: `jdk-6u45-linux-i586.bin'

     0K .......... .......... .......... .......... ..........  0%  265K 4m24s
    50K .......... .......... .......... .......... ..........  0%  296K 4m10s
   100K .......... .......... .......... .......... ..........  0%  794K 3m16s
   150K .......... .......... .......... .......... ..........  0%  638K 2m54s
[..]
 70050K .......... .......... .......... .......... .......... 99% 5.49M 0s
 70100K .......... ......                                     100% 10.9M=16s

2013-11-06 23:06:41 (4.39 MB/s) - `jdk-6u45-linux-i586.bin' saved [71799552/71799552]

Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
   creating: jdk1.6.0_45/
[..]
Creating jdk1.6.0_45/jre/lib/javaws.jar
Creating jdk1.6.0_45/jre/lib/deploy.jar

Done.

Packing : java6-jdk-1.6.0_45
================================================================================
Creating the list of files...                                        [ OK ]
Creating md5sum of files...                                          [ OK ]
Compressing the fs...                                                [ OK ]
Updating receipt sizes...                                            [ OK ]
Creating full cpio archive...                                        [ OK ]
Restoring original package tree...                                   [ OK ]
================================================================================
Package java6-jdk-1.6.0_45 compressed successfully.
Size : 64.1M    java6-jdk-1.6.0_45.tazpkg


Installation of : java6-jdk
================================================================================
Copying java6-jdk...                                                 [ OK ]
Extracting java6-jdk...                                              [ OK ]
Extracting the pseudo fs... (lzma)                                   [ OK ]
Installing java6-jdk...                                              [ OK ]
Removing all tmp files...                                            [ OK ]
Processing post install commands.../usr/bin/tazpkg: cd: line 32: can't cd to /usr/lib/firefox*/plugins
                                                                     [ OK ]
================================================================================
java6-jdk (1.6.0_45) is installed.


3.
root@slitaz:/tmp# ls -l /usr/lib/mozilla/plugins/
total 0
lrwxrwxrwx    1 root     root            34 Nov  7 00:24 libflashplayer.so -> /usr/share/flash/libflashplayer.so
lrwxrwxrwx    1 root     root            50 Nov  6 23:44 libnpjp2.so -> /usr/lib/java/jdk1.6.0_45/jre/lib/i386/libnpjp2.so


4.
root@slitaz:/tmp# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)

root@slitaz:/tmp# javac -version
javac 1.6.0_45

root@slitaz:/tmp# javap -help | head -1
Usage: javap <options> <classes>...

root@slitaz:/tmp# javadoc -help | head -2
usage: javadoc [options] [packagenames] [sourcefiles] [@files]
-overview <file>          Read overview documentation from HTML file



5.
root@slitaz:/tmp# diff /usr/bin/get-java6-jdk-1.0 /usr/bin/get-java6-jdk
--- /usr/bin/get-java6-jdk-1.0
+++ /usr/bin/get-java6-jdk
@@ -6,9 +6,9 @@
 # Author : K�vin DA SILVA <dasilvakevin@hotmail.fr>

 PACKAGE="java6-jdk"
-VERSION="1.6.0_13"
-URL="http://raphaello.univ-fcomte.fr/ftp/java/Jdk"
-TARBALL="jdk-6u13-linux-i586.bin"
+VERSION="1.6.0_45"
+URL="http://download.oracle.com/otn-pub/java/jdk/6u45-b06"
+TARBALL="jdk-6u45-linux-i586.bin"
 TEMP_DIR="/tmp/$PACKAGE.$$"
 ROOT="$1"

@@ -38,7 +38,7 @@
 cd $TEMP_DIR

 # Download the file
-test -f $TARBALL || wget $URL/$TARBALL
+test -f $TARBALL || wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" $URL/$TARBALL
 if [ ! -f $TARBALL ]; then
     cd $CUR_DIR
     rm -rf $TMP_DIR
@@ -80,8 +80,8 @@
 post_install()
 {
     echo -n "Processing post install commands..."
-    cd /usr/lib/firefox*/plugins
-    ln -s /usr/lib/java/jdk\$VERSION/jre/plugin/i386/ns7/libjavaplugin_oji.so
+    [ -d /usr/lib/mozilla/plugins ] || mkdir -p /usr/lib/mozilla/plugins
+    ln -s /usr/lib/java/jdk\$VERSION/jre/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins

     #lien mit dans red5 /usr/bin/javajdk
     cd /usr/bin
@@ -94,8 +94,11 @@

 post_remove()
 {
-    rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
+    rm -f /usr/lib/mozilla/plugins/libnpjp2.so
     rm -f /usr/bin/java
+    rm -f /usr/bin/javac
+    rm -f /usr/bin/javadoc
+    rm -f /usr/bin/javap
 }
 EOT


6.
Package: get-java6-jdk
http://cook.slitaz.org/cooker.cgi?pkg=get-java6-jdk

receipt home files download
Cook summary

Summary for: get-java6-jdk 1.0
================================================================================
Produced    : 4.0K
Packed      : 32.0K
Compressed  : 4.0K
Files       : 1
Cook time   : 1s
Cook date   : 2013-09-22 13:54
Host arch   : i486
================================================================================

Slitaz -- JRE

get-java6-jre
Could not download jre.bin. Exiting.

# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin"

JDK 6u45
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin
JRE 6u45
http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin

JDK 7u25
    http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-i586.tar.gz
JRE 7u25
    http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jre-7u25-linux-i586.tar.gz
JDK 7u45
    http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-linux-i586.tar.gz


1.
# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin"

# curl -L -O -k -H "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin"

root@slitaz:/home/tux# curl -L -O -k -H "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0   286    0     0    347      0 --:--:-- --:--:-- --:--:--   347
100 68.4M  100 68.4M    0     0  3715k      0  0:00:18  0:00:18 --:--:-- 3167k
root@slitaz:/home/tux#

 -H, --header LINE   Custom header to pass to server (H)
 -k, --insecure      Allow connections to SSL sites without certs (H)
 -L, --location      Follow redirects (H)
 -o, --output FILE   Write output to <file> instead of stdout
 -O, --remote-name   Write output to a file named as the remote file
     --remote-name-all Use the remote file name for all URLs


2.
root@slitaz:/home/tux# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)


3.
http://mirror.slitaz.org/packages/cooking/get-java6-jre-1.1.0.tazpkg

root@slitaz:/home/tux# diff /usr/bin/get-java6-jre-1.1.0 /usr/bin/get-java6-jre
--- /usr/bin/get-java6-jre-1.1.0
+++ /usr/bin/get-java6-jre
@@ -6,15 +6,15 @@
 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>

 PACKAGE="java6-jre"
-WEB_SITE="http://www.java.com/"
+WEB_SITE="http://download.oracle.com/otn-pub/java/jdk/"
 SHORT_DESC="SUN Java Runtime."
 DEPENDS="xorg-libXtst"
 TARBALL="jre.bin"
 TEMP_DIR="/tmp/$PACKAGE.$$"
 ROOT="$1"

-URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
-       sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"
+# URL="$(wget -O - ${WEB_SITE}en/download/manual_v6.jsp | \
+#       sed '/self-extracting/!d;s/.*href="\([^"]*\).*/\1/;q')"

 # Check if we are root starting anything
 if test $(id -u) != 0 ; then
@@ -36,8 +36,12 @@
 test -d $TEMP_DIR || mkdir $TEMP_DIR
 cd $TEMP_DIR

+# FIXME. http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jre-6u45-linux-i586.bin
+URL="$(wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F" -O $TARBALL ${WEB_SITE}6u45-b06/jre-6u45-linux-i586.bin)"
+
 # Download the file
-test -f $TARBALL || wget $URL -O $TARBALL
+# test -f $TARBALL || wget $URL -O $TARBALL
+test -f $TARBALL || $URL
 if [ ! -f $TARBALL ]; then
     cd $CUR_DIR
     rm -rf $TEMP_DIR
root@slitaz:/home/tux#


4.
wok - Searching for 'java'
http://hg.slitaz.org/wok/log?rev=java

age     author     description
2 days ago     Dominique Corbex     get-LibreOffice: mv java from DEPS to SUGGESTED
8 weeks ago     Pascal Bellard     Add some licenses
8 weeks ago     Pascal Bellard     get-*: add license
2 months ago     Pascal Bellard     Add some GPL2 licenses
3 months ago     Pascal Bellard     *vnc*: add LICENSE
3 months ago     Eric Joseph-Alexandre     Add: tightvnc-java
10 months ago     Pascal Bellard     Update get-java6-jre (again)
10 months ago     Pascal Bellard     Update get-java6-jre (thanks ernia)
17 months ago     Richard Dunbar     get-java6-jre: fix generic with tar
17 months ago     Richard Dunbar     get-java6-jre: update tarball


Ref:
http://www.oracle.com/technetwork/java/javase/terms/license/index.html
http://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux

2013-11-05

Debian HCL




Debian HCL (Hardware Compatibility List) Web system

Debian GNU/Linux device driver check page

Boot your machine with a GNU/Linux OS (such as Debian, Knoppix, Redhat, and so on), run 'lspci -n' and paste the output into the box below, then press 'Check' button.

Notice:
  • This database uses the PCI map of Debian kernel 3.2.0-4-amd64 .
  • The result does NOT guarantee your hardware works perfectly.
  • This database only verifies the PCI devices at this time. X drivers, ISA, USB, IEEE1394 or any other devices are out of the focus. 

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:/#