2010-06-19

Slitaz -- hibernate / STD


# echo shutdown > /sys/power/disk
# echo disk > /sys/power/state

suspend to disk (STD)
suspend to RAM (STR)

shutdown: save state in linux, then tell bios to powerdown
platform: save state in linux, then tell bios to powerdown and blink
"suspended led"

"platform" is actually right thing to do where supported, but
"shutdown" is most reliable (except on ACPI systems).

Hibernation (aka 'suspend to disk') (HIBERNATION)

Enable the suspend to disk (STD) functionality, which is usually
called "hibernation" in user interfaces. STD checkpoints the
system and powers it off; and restores that checkpoint on reboot.

You can suspend your machine with 'echo disk > /sys/power/state'
after placing resume=/dev/swappartition on the kernel command line
in your bootloader's configuration file.

Alternatively, you can use the additional userland tools available
from [http://suspend.sf.net].

In principle it does not require ACPI or APM, although for example
ACPI will be used for the final steps when it is available. One
of the reasons to use software suspend is that the firmware hooks
for suspend states like suspend-to-RAM (STR) often don't work very
well with Linux.

It creates an image which is saved in your active swap. Upon the next
boot, pass the 'resume=/dev/swappartition' argument to the kernel to
have it detect the saved image, restore memory state from it, and
continue to run as before. If you do not want the previous state to
be reloaded, then use the 'noresume' kernel command line argument.
Note, however, that fsck will be run on your filesystems and you will
need to run mkswap against the swap partition used for the suspend.

It also works with swap files to a limited extent (for details see
[file:Documentation/power/swsusp-and-swap-files.txt]).

Right now you may boot without resuming and resume later but in the
meantime you cannot use the swap partition(s)/file(s) involved in
suspending. Also in this case you must not use the filesystems
that were mounted before the suspend. In particular, you MUST NOT
MOUNT any journaled filesystems mounted before the suspend or they
will get corrupted in a nasty way.

For more information take a look at [file:Documentation/power/swsusp.txt].


/usr/src/linux-2.6.30.6-slitaz/Documentation/power/basic-pm-debugging.txt

basic-pm-debugging.txt

Debugging hibernation and suspend
(C) 2007 Rafael J. Wysocki , GPL

1. Testing hibernation (aka suspend to disk or STD)

To check if hibernation works, you can try to hibernate in the "reboot" mode:

# echo reboot > /sys/power/disk
# echo disk > /sys/power/state

and the system should create a hibernation image, reboot, resume and get back to
the command prompt where you have started the transition. If that happens,
hibernation is most likely to work correctly. Still, you need to repeat the
test at least a couple of times in a row for confidence. [This is necessary,
because some problems only show up on a second attempt at suspending and
resuming the system.] Moreover, hibernating in the "reboot" and "shutdown"
modes causes the PM core to skip some platform-related callbacks which on ACPI
systems might be necessary to make hibernation work. Thus, if you machine fails
to hibernate or resume in the "reboot" mode, you should try the "platform" mode:

# echo platform > /sys/power/disk
# echo disk > /sys/power/state

which is the default and recommended mode of hibernation.

Unfortunately, the "platform" mode of hibernation does not work on some systems
with broken BIOSes. In such cases the "shutdown" mode of hibernation might
work:

# echo shutdown > /sys/power/disk
# echo disk > /sys/power/state

(it is similar to the "reboot" mode, but it requires you to press the power
button to make the system resume).

If neither "platform" nor "shutdown" hibernation mode works, you will need to
identify what goes wrong.

a) Test modes of hibernation

To find out why hibernation fails on your system, you can use a special testing
facility available if the kernel is compiled with CONFIG_PM_DEBUG set. Then,
there is the file /sys/power/pm_test that can be used to make the hibernation
core run in a test mode. There are 5 test modes available:

freezer
- test the freezing of processes

devices
- test the freezing of processes and suspending of devices

platform
- test the freezing of processes, suspending of devices and platform
global control methods(*)

processors
- test the freezing of processes, suspending of devices, platform
global control methods(*) and the disabling of nonboot CPUs

core
- test the freezing of processes, suspending of devices, platform global
control methods(*), the disabling of nonboot CPUs and suspending of
platform/system devices

(*) the platform global control methods are only available on ACPI systems
and are only tested if the hibernation mode is set to "platform"

To use one of them it is necessary to write the corresponding string to
/sys/power/pm_test (eg. "devices" to test the freezing of processes and
suspending devices) and issue the standard hibernation commands. For example,
to use the "devices" test mode along with the "platform" mode of hibernation,
you should do the following:

# echo devices > /sys/power/pm_test
# echo platform > /sys/power/disk
# echo disk > /sys/power/state

Then, the kernel will try to freeze processes, suspend devices, wait 5 seconds,
resume devices and thaw processes. If "platform" is written to
/sys/power/pm_test , then after suspending devices the kernel will additionally
invoke the global control methods (eg. ACPI global control methods) used to
prepare the platform firmware for hibernation. Next, it will wait 5 seconds and
invoke the platform (eg. ACPI) global methods used to cancel hibernation etc.

Writing "none" to /sys/power/pm_test causes the kernel to switch to the normal
hibernation/suspend operations. Also, when open for reading, /sys/power/pm_test
contains a space-separated list of all available tests (including "none" that
represents the normal functionality) in which the current test level is
indicated by square brackets.

Generally, as you can see, each test level is more "invasive" than the previous
one and the "core" level tests the hardware and drivers as deeply as possible
without creating a hibernation image. Obviously, if the "devices" test fails,
the "platform" test will fail as well and so on. Thus, as a rule of thumb, you
should try the test modes starting from "freezer", through "devices", "platform"
and "processors" up to "core" (repeat the test on each level a couple of times
to make sure that any random factors are avoided).

If the "freezer" test fails, there is a task that cannot be frozen (in that case
it usually is possible to identify the offending task by analysing the output of
dmesg obtained after the failing test). Failure at this level usually means
that there is a problem with the tasks freezer subsystem that should be
reported.

If the "devices" test fails, most likely there is a driver that cannot suspend
or resume its device (in the latter case the system may hang or become unstable
after the test, so please take that into consideration). To find this driver,
you can carry out a binary search according to the rules:
- if the test fails, unload a half of the drivers currently loaded and repeat
(that would probably involve rebooting the system, so always note what drivers
have been loaded before the test),
- if the test succeeds, load a half of the drivers you have unloaded most
recently and repeat.

Once you have found the failing driver (there can be more than just one of
them), you have to unload it every time before hibernation. In that case please
make sure to report the problem with the driver.

It is also possible that the "devices" test will still fail after you have
unloaded all modules. In that case, you may want to look in your kernel
configuration for the drivers that can be compiled as modules (and test again
with these drivers compiled as modules). You may also try to use some special
kernel command line options such as "noapic", "noacpi" or even "acpi=off".

If the "platform" test fails, there is a problem with the handling of the
platform (eg. ACPI) firmware on your system. In that case the "platform" mode
of hibernation is not likely to work. You can try the "shutdown" mode, but that
is rather a poor man's workaround.

If the "processors" test fails, the disabling/enabling of nonboot CPUs does not
work (of course, this only may be an issue on SMP systems) and the problem
should be reported. In that case you can also try to switch the nonboot CPUs
off and on using the /sys/devices/system/cpu/cpu*/online sysfs attributes and
see if that works.

If the "core" test fails, which means that suspending of the system/platform
devices has failed (these devices are suspended on one CPU with interrupts off),
the problem is most probably hardware-related and serious, so it should be
reported.

A failure of any of the "platform", "processors" or "core" tests may cause your
system to hang or become unstable, so please beware. Such a failure usually
indicates a serious problem that very well may be related to the hardware, but
please report it anyway.

b) Testing minimal configuration

If all of the hibernation test modes work, you can boot the system with the
"init=/bin/bash" command line parameter and attempt to hibernate in the
"reboot", "shutdown" and "platform" modes. If that does not work, there
probably is a problem with a driver statically compiled into the kernel and you
can try to compile more drivers as modules, so that they can be tested
individually. Otherwise, there is a problem with a modular driver and you can
find it by loading a half of the modules you normally use and binary searching
in accordance with the algorithm:
- if there are n modules loaded and the attempt to suspend and resume fails,
unload n/2 of the modules and try again (that would probably involve rebooting
the system),
- if there are n modules loaded and the attempt to suspend and resume succeeds,
load n/2 modules more and try again.

Again, if you find the offending module(s), it(they) must be unloaded every time
before hibernation, and please report the problem with it(them).

c) Advanced debugging

In case that hibernation does not work on your system even in the minimal
configuration and compiling more drivers as modules is not practical or some
modules cannot be unloaded, you can use one of the more advanced debugging
techniques to find the problem. First, if there is a serial port in your box,
you can boot the kernel with the 'no_console_suspend' parameter and try to log
kernel messages using the serial console. This may provide you with some
information about the reasons of the suspend (resume) failure. Alternatively,
it may be possible to use a FireWire port for debugging with firescope
(ftp://ftp.firstfloor.org/pub/ak/firescope/). On x86 it is also possible to
use the PM_TRACE mechanism documented in Documentation/s2ram.txt .

2. Testing suspend to RAM (STR)

To verify that the STR works, it is generally more convenient to use the s2ram
tool available from http://suspend.sf.net and documented at
http://en.opensuse.org/s2ram . However, before doing that it is recommended to
carry out STR testing using the facility described in section 1.

Namely, after writing "freezer", "devices", "platform", "processors", or "core"
into /sys/power/pm_test (available if the kernel is compiled with
CONFIG_PM_DEBUG set) the suspend code will work in the test mode corresponding
to given string. The STR test modes are defined in the same way as for
hibernation, so please refer to Section 1 for more information about them. In
particular, the "core" test allows you to test everything except for the actual
invocation of the platform firmware in order to put the system into the sleep
state.

Among other things, the testing with the help of /sys/power/pm_test may allow
you to identify drivers that fail to suspend or resume their devices. They
should be unloaded every time before an STR transition.

Next, you can follow the instructions at http://en.opensuse.org/s2ram to test
the system, but if it does not work "out of the box", you may need to boot it
with "init=/bin/bash" and test s2ram in the minimal configuration. In that
case, you may be able to search for failing drivers by following the procedure
analogous to the one described in section 1. If you find some failing drivers,
you will have to unload them every time before an STR transition (ie. before
you run s2ram), and please report the problems with them.


/usr/src/linux-2.6.30.6-slitaz/Documentation/power/swsusp.txt
[..]
You need to append resume=/dev/your_swap_partition to kernel command
line. Then you suspend by

echo shutdown > /sys/power/disk; echo disk > /sys/power/state

. If you feel ACPI works pretty well on your system, you might try

echo platform > /sys/power/disk; echo disk > /sys/power/state

. If you have SATA disks, you'll need recent kernels with SATA suspend
support. For suspend and resume to work, make sure your disk drivers
are built into kernel -- not modules. [There's way to make
suspend/resume with modular disk drivers, see FAQ, but you probably
should not do that.]

If you want to limit the suspend image size to N bytes, do

echo N > /sys/power/image_size

before suspend (it is limited to 500 MB by default).
[..]
Q: What is the difference between "platform" and "shutdown"?

A:

shutdown: save state in linux, then tell bios to powerdown

platform: save state in linux, then tell bios to powerdown and blink
"suspended led"

"platform" is actually right thing to do where supported, but
"shutdown" is most reliable (except on ACPI systems).

[..]

2010-06-18

Slitaz -- hibernate

Env:
slitaz-3.0.iso in HD
pm-utils

五 6月 18 19:06:43 CST 2010: performing hibernate
六 6月 19 09:42:24 CST 2010: Awake.
六 6月 19 09:42:24 CST 2010: Running hooks for thaw

root@slitaz:~# tazpkg info pm-utils

Tazpkg information
================================================================================
Package : pm-utils
Version : 1.2.5
Category : system-tools
Short desc : scripts that handle suspend and resume on behalf of HAL.
Maintainer : domcox@users.sourceforge.net
Depends : hal-info
Web site : http://pm-utils.freedesktop.org/
================================================================================

root@slitaz:~# cat /proc/cmdline
root=/dev/sda7 acpi=off resume=/dev/sda6
root@slitaz:~# grep sda6 /proc/partitions
8 6 10450251 sda6
root@slitaz:~# ls -l /sys/power
-rw-r--r-- 1 root root 4096 Jun 18 08:26 disk
-rw-r--r-- 1 root root 4096 Jun 18 08:27 image_size
-rw-r--r-- 1 root root 4096 Jun 18 08:27 resume
-rw-r--r-- 1 root root 4096 Jun 18 19:06 state
root@slitaz:~# cat /sys/power/*
test testproc [shutdown] reboot
524288000
8:6
disk
root@slitaz:~#

root@slitaz:~# cat /var/log/pm-suspend.log
Initial commandline parameters:
五 6月 18 19:06:43 CST 2010: Running hooks for hibernate.
/usr/lib/pm-utils/sleep.d/00auto-quirk hibernate hibernate: Adding quirks from HAL: --quirk-dpms-on --quirk-dpms-suspend --quirk-vbe-post --quirk-vbemode-restore --quirk-vbestate-restore --quirk-vga-mode-3
success.
/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: Linux slitaz 2.6.30.6-slitaz #1 SMP Sun Mar 28 16:39:51 CEST 2010 i686 unknown

Module Size Used by Not tainted
rtc 9136 0
vboxnetadp 6444 0
vboxnetflt 14688 0
vboxdrv 156152 2 vboxnetadp,vboxnetflt
tg3 93600 0
libphy 16236 1 tg3
snd_hda_codec_realtek 179412 1
snd_hda_intel 22020 1
snd_hda_codec 49928 2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 5988 1 snd_hda_codec
snd_pcm 51780 2 snd_hda_intel,snd_hda_codec
snd_timer 16344 1 snd_pcm
snd 43584 8 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore 5180 1 snd
snd_page_alloc 7256 2 snd_hda_intel,snd_pcm
total used free shared buffers
Mem: 2039472 584508 1454964 0 109332
Swap: 10450240 0 10450240
Total: 12489712 584508 11905204
success.
/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: not executable.
/usr/lib/pm-utils/sleep.d/01grub hibernate hibernate: not executable.
/usr/lib/pm-utils/sleep.d/49bluetooth hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate: success.
/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.
/usr/lib/pm-utils/sleep.d/95led hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: /usr/lib/pm-utils/sleep.d/99video: line 219: fgconsole: not found
success.
五 6月 18 19:06:43 CST 2010: performing hibernate
六 6月 19 09:42:24 CST 2010: Awake.
六 6月 19 09:42:24 CST 2010: Running hooks for thaw
/usr/lib/pm-utils/sleep.d/99video thaw hibernate: BusyBox v1.12.0 (2010-03-12 18:25:03 CET) multi-call binary

Usage: chvt N

Change the foreground virtual terminal to /dev/ttyN

deallocvt: VT_DISALLOCATE: Device or resource busy
Returned exit code 1.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/95led thaw hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/90clock thaw hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/75modules thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/55NetworkManager thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/49bluetooth thaw hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/01grub thaw hibernate: not executable.
/usr/lib/pm-utils/sleep.d/00powersave thaw hibernate: not executable.
/usr/lib/pm-utils/sleep.d/00logging thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/00auto-quirk thaw hibernate: success.
root@slitaz:~#

2010-06-16

Slitaz -- gcin / help

gcin 使用手冊 (README.html)

root@slitaz:~# ls -l /usr/share/doc/gcin-1.4.9
-rw-r--r-- 1 root root 79789 Jun 17 00:58 Changelog.html
-rw-r--r-- 1 root root 56213 Jun 17 00:58 README.html
root@slitaz:~# cat /usr/share/gcin/script/html-browser
#!/bin/bash

#for i in firefox mozilla-firefox mozilla konqueror
for i in firefox mozilla-firefox mozilla konqueror midori opera
do
which $i >& /dev/null
if [ $? = 0 ]; then
UTF8ED=$i
break
fi
done

export LC_CTYPE=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

$UTF8ED $1
root@slitaz:~# cat /usr/share/gcin/script/utf8-edit
#!/bin/bash

PATH=$PATH:/opt/gnome/bin:/usr/local/bin

for i in madedit gedit leafpad kedit kate gvim
do
which $i >& /dev/null
if [ $? = 0 ]; then
UTF8ED=$i
break
fi
done

export LC_CTYPE=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

if [ $UTF8ED = 'gvim' ]; then
UTF8ED='gvim -f'
fi

$UTF8ED $1
root@slitaz:~#
.

Slitaz -- gcin-1.4.9


# mkdir -p /usr/lib/qt4/bin
# ln -fs /usr/bin/moc /usr/lib/qt4/bin/.

root@slitaz:~# tazpkg info gcin

Tazpkg information
================================================================================
Package : gcin
Version : 1.4.9
Category : utilities
Short desc : a GTK+ based input method platform for Chinese users
Maintainer : alanyih
Depends : xorg-libXtst bash
Build deps : bash gtk+-dev xorg-xextproto xorg-inputproto Qt4-dev
Web site : http://cle.linux.org.tw/trac
================================================================================

root@slitaz:~#


[..]
Building gcin with the receipt...
================================================================================

Executing strip on all files... [ OK ]
Copying the receipt... [ OK ]
Creating the list of files... [ OK ]
Creating md5sum of files... [ OK ]
Compressing the fs...
LZMA 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
11782 blocks
[ OK ]
Updating receipt sizes... [ OK ]
Creating full cpio archive... 2867 blocks
[ OK ]
Restoring original package tree... 11782 blocks
================================================================================
Package gcin (1.4.9) generated.
Size : 1.4M /home/slitaz/packages/gcin-1.4.9.tazpkg

root@slitaz:/home/slitaz/wok#
.

2010-06-15

Slitaz -- smplayer / vob


root@slitaz:~# tazpkg info smplayer

Tazpkg information
================================================================================
Package : smplayer
Version : 0.6.8
Category : multimedia
Short desc : QT-based front-end for MPlayer
Maintainer : jozee@slitaz.org
Depends : mplayer-svn libQtCore libQtGui libQtXml gcc-lib-base
Build deps : mplayer-svn Qt4-dev qmake libQtCore libQtGui libQtXml libQtNetwork
Web site : http://smplayer.sourceforge.net/
================================================================================

root@slitaz:~# head -6 ~/.config/smplayer/smplayer.ini
[%General]
mplayer_bin=mplayer
driver\vo=x11
driver\ao=alsa
use_screenshot=true
screenshot_directory=/root/.config/smplayer/screenshots
root@slitaz:~#
.

2010-06-11

Slitaz -- virtualbox-3.2.0 / slitaz-vbox.iso

tazlito emu-iso ( default -m 256 )

Qemu -m 512

tazlito emu-iso ( -m 512 )

slitaz-vbox.iso: based on slitaz-3.0.iso + virtualbox-3.2.0 + guestadditions + wenquanyi_10pt.pcf

# sed -i "s/-m 256/-m 512/" /etc/tazlito/tazlito.conf

root@slitaz:/home/slitaz/distro# ls -l
drwxr-xr-x 4 root root 4096 Jun 10 12:37 rootcd
drwxr-xr-x 16 root root 4096 Jun 10 12:37 rootfs
root@slitaz:/home/slitaz/distro# time tazlito gen-initiso

0 bytes saved in duplicate files.
Generating lzma'ed initramfs...
LZMA 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06

Filesystem size: 78.1M 486033 blocks
78.9M

Computing md5... [ OK ]

Generating ISO image
================================================================================
Generating slitaz-201006111311.iso
Size of boot image is 4 sectors -> No emulation
12.00% done, estimate finish Fri Jun 11 13:14:45 2010
24.02% done, estimate finish Fri Jun 11 13:14:45 2010
36.00% done, estimate finish Fri Jun 11 13:14:45 2010
48.01% done, estimate finish Fri Jun 11 13:14:45 2010
59.99% done, estimate finish Fri Jun 11 13:14:45 2010
72.01% done, estimate finish Fri Jun 11 13:14:45 2010
83.98% done, estimate finish Fri Jun 11 13:14:45 2010
96.00% done, estimate finish Fri Jun 11 13:14:45 2010
Total translation table size: 2048
Total rockridge attributes bytes: 5420
Total directory bytes: 12288
Path table size(bytes): 64
Max brk space used 21000
41678 extents written (81 MB)
Creating hybrid ISO... [ OK ]
Creating the ISO md5sum... [ OK ]
================================================================================

Distro statistics (/home/slitaz/distro)
================================================================================
Build date : 20100611 at 13:14:45
Packages : 212
Rootfs size : 257.5M
Initramfs size : 78.9M
ISO image size : 82.1M
================================================================================
Image is ready: slitaz-201006111311.iso

real 3m 3.44s
user 2m 56.55s
sys 0m 4.66s
root@slitaz:/home/slitaz/distro# ls -l
drwxr-xr-x 4 root root 4096 Jun 10 12:37 rootcd
drwxr-xr-x 16 root root 4096 Jun 10 12:37 rootfs
-rw-r--r-- 1 root root 85983232 Jun 11 13:14 slitaz-201006111311.iso
-rw-r--r-- 1 root root 58 Jun 11 13:14 slitaz-201006111311.md5
root@slitaz:/home/slitaz/distro# tazlito emu-iso slitaz-201006111311.iso &
root@slitaz:/home/slitaz/distro#
Starting Qemu emulator:

qemu -m 256 slitaz-201006111311.iso


root@slitaz:/home/slitaz/distro# qemu -m 512 -cdrom slitaz-201006111311.iso &
root@slitaz:/home/slitaz/distro#
root@slitaz:/home/slitaz/distro# tail -2 /etc/tazlito/tazlito.conf
# Qemu emulator options for command: emu-iso
QEMU_OPTS="-m 256"
root@slitaz:/home/slitaz/distro# sed -i "s/-m 256/-m 512/" /etc/tazlito/tazlito.conf
root@slitaz:/home/slitaz/distro# tail -2 /etc/tazlito/tazlito.conf
# Qemu emulator options for command: emu-iso
QEMU_OPTS="-m 512"
root@slitaz:/home/slitaz/distro# tazlito
SliTaz Live Tool - Version: 3.0

Usage: tazlito [command] [list|iso|flavor|compression] [dir|iso]
Commands:

usage Print this short usage.
stats View Tazlito and distro configuration statistics.
gen-config Generate a new configuration file for a distro.
configure Configure the main config file or a specific tazlito.conf.
gen-iso Generate a new ISO from a distro tree.
gen-initiso Generate a new initramfs and ISO from the distro tree.
list-flavors List all available package lists on the mirror.
gen-flavor Generate a new live-CD description.
gen-liveflavor Generate a live-CD description from current system.
show-flavor Show live-CD description.
get-flavor Get a flavor's list of packages.
upgrade-flavor Update package list to the latest available versions.
extract-flavor Extract a (*.flavor) flavor into /home/slitaz/flavors.
pack-flavor Pack (and update) a flavor from /home/slitaz/flavors.
check-list Check a distro-packages.list for updates.
extract-distro Extract an ISO to a directory and rebuild LiveCD tree.
gen-distro Generate a Live distro and ISO from a list of packages.
clean-distro Remove all files generated by gen-distro.
check-distro Help to check if distro is ready to release.
writeiso Use running system to generate a bootable ISO (with /home).
merge Merge multiple rootfs into one iso.
repack Recompress rootfs into iso with maximum ratio.
build-loram Generate a live-CD for low ram systems.
frugal-install Frugal install in /boot/frugal from a distro or ISO.
emu-iso Emulate an ISO image with Qemu.
burn-iso Burn ISO image to a cdrom using Wodim.

root@slitaz:/home/slitaz/distro#

2010-06-08

Slitaz -- review / youtube



http://www.youtube.com/watch?v=y1a8_J8KDEU
OSGUIShow — April 13, 2010 — Review style Screencast about SliTaz GNU/Linux 3.0 a small fast 30MB Free Operating System. The OS has the Openbox with Joe's Window Manager GUI and I created the demonstration inside VirtualBox where I play with the environment and its software.
Original video production by the http://www.OSGUI.com Tech Show.

Fast Video Download (with SearchMenu) 3.0.8
by Bill Dettering
Download video files from popular sites like YouTube, Dailymotion, Break.com and more. 100% Free! In addition, our new SearchMenu feature makes it easier than ever to find popular videos and other information about any text you select.
https://addons.mozilla.org/en-US/firefox/addon/3590/

root@slitaz:~# cat /usr/share/applications/watchvideo.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Watch Video
Icon=applications-multimedia
Exec=default-app gmplayer --install "mplayer-svn get-flash-plugin gecko-mediaplayer"
Type=Application
Categories=Multimedia;AudioVideo;Audio;Player;
root@slitaz:~#

2010-06-04

Slitaz -- vboxadd-3.2.0 / seamless



seamless

Env:
HOST: slitaz-3.0.iso
GUEST: slitaz-3.0.iso
VirtualBox / GuestAdditions : 3.2.0

root@slitaz:~# mount.vboxsf 320 /mnt/share
root@slitaz:~# ls -l /mnt/share/install
-rwxrwxrwx 1 root root 2684 May 18 18:05 deffiles
-rwxrwxrwx 1 root root 9828 May 18 18:08 install.sh
-rwxrwxrwx 1 root root 19399 May 18 18:05 orig-routines.sh
-rwxrwxrwx 1 root root 13432 May 18 18:05 orig-vboxadd
-rwxrwxrwx 1 root root 5467 May 18 18:05 orig-vboxadd-service
-rwxrwxrwx 1 root root 21022 May 18 18:05 orig-vboxadd-x11
-rwxrwxrwx 1 root root 20725 May 30 19:03 routines.sh
-rwxrwxrwx 1 root root 4607 May 31 22:31 routines.u
-rwxrwxrwx 1 root root 13899 May 31 22:46 vboxadd
-rwxrwxrwx 1 root root 5796 May 31 22:46 vboxadd-service
-rwxrwxrwx 1 root root 765 May 31 22:50 vboxadd-service.u
-rwxrwxrwx 1 root root 1572 May 31 22:50 vboxadd.u
-rwxrwxrwx 1 root root 21319 May 31 22:25 vboxadd-x11
-rwxrwxrwx 1 root root 835 May 31 22:33 vboxadd-x11.u
-rwxrwxrwx 1 root root 2733958 May 18 18:08 VBoxGuestAdditions.tar.bz2
root@slitaz:~# mount
rootfs on / type rootfs (rw)
tmpfs on / type tmpfs (rw,relatime,size=579592k)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
tmpfs on /dev/shm type tmpfs (rw,relatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
none on /mnt/share type vboxsf (rw,nodev,relatime)
root@slitaz:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 566.0M 125.9M 440.1M 22% /
tmpfs 566.0M 125.9M 440.1M 22% /
tmpfs 314.4M 0 314.4M 0% /dev/shm
none 248.1G 213.1G 35.0G 86% /mnt/share
root@slitaz:~# du -sh /
201.1M
root@slitaz:~# umount /mnt/share
root@slitaz:~# du -sh /
Filesystem Size Used Available Use% Mounted on
rootfs 566.0M 123.0M 443.0M 22% /
tmpfs 566.0M 123.0M 443.0M 22% /
tmpfs 314.4M 0 314.4M 0% /dev/shm
root@slitaz:~# du -sh /
123.0M
root@slitaz:~#
root@slitaz:~# tail -21 ~/.VirtualBox/Machines/slitaz/Logs/VBox.log
00:38:34.091 SharedFolders host service: adding host mapping.
00:38:34.091 Host path /media/Audio1/slitaz/3.0/vbox/320, map name 320, writable 1
00:38:34.092 SharedFolders host service: add mapping result VINF_SUCCESS
00:39:22.241 SharedFolders host service: request to map folder vbox32
00:39:22.241 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
00:39:22.241 SharedFolders host service: request to map folder vbox32
00:39:22.241 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
00:39:22.241 SharedFolders host service: request to map folder vbox32
00:39:22.241 SharedFolders host service: map operation result VERR_FILE_NOT_FOUND.
00:39:48.786 SharedFolders host service: request to map folder 320
00:39:48.786 SharedFolders host service: map operation result VINF_SUCCESS.
00:39:48.786 Mapped to handle 0.
00:45:32.557 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=aad4d000 w=1104 h=851 bpp=32 cbLine=0x1140
00:45:32.703 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=aad4d000 w=1104 h=851 bpp=32 cbLine=0x1140
00:45:32.773 VMMDev::SetVideoModeHint: got a video mode hint (1280x1000x0) at 0
00:45:32.784 VBVA: Disabled.
00:45:32.787 Display::handleDisplayResize(): uScreenId = 0, pvVRAM=aad4d000 w=1280 h=1000 bpp=32 cbLine=0x1400
00:45:32.787 VBVA: Enabled.
00:45:32.787 Guest Additions capability report: (0x5) seamless: yes, hostWindowMapping: no, graphics: yes
00:45:32.787 VBVA: Disabled.
00:45:32.789 VBVA: Enabled.

2010-06-02

Slitaz -- vboxadd-3.2.0 / mouse integration



mouse integration

Env:
HOST: winxp
GUEST: slitaz-3.0.iso
VirtualBox: 3.2.0

root@slitaz:~# tazpkg info vboxadd

Tazpkg information
================================================================================
Package : vboxadd
Version : 3.2.0_2.6.30.6
Category : non-free
Short desc : x86 VBoxLinuxAdditions.
Maintainer :
Depends : linux-drm mesa-dri xorg-xf86-input-evdev
Web site : http://www.virtualbox.org/
================================================================================

root@slitaz:~# tail -7 /var/log/Xorg.0.log
(II) config/hal: Adding input device VirtualBox USB Tablet
(**) VirtualBox USB Tablet: always reports core events
(**) VirtualBox USB Tablet: Device: "/dev/event3"
(II) VirtualBox USB Tablet: Found x and y absolute axes
(II) VirtualBox USB Tablet: Found mouse buttons
(II) VirtualBox USB Tablet: Configuring as mouse
(II) XINPUT: Adding extended input device "VirtualBox USB Tablet" (type: MOUSE)
root@slitaz:~# dmesg | tail
PCI: setting IRQ 9 as level-triggered
pci 0000:00:04.0: PCI INT A -> Link[LNKD] -> GSI 9 (level, low) -> IRQ 9
vboxguest: major 0, IRQ 9, I/O port d040, MMIO at 00000000f0400000 (size 0x400000)
vboxguest: Successfully loaded version 3.2.0 (interface 0x00010004)
vboxsf: Successfully loaded version 3.2.0 (interface 0x00010004)
Linux agpgart interface v0.103
[drm] Initialized drm 1.1.0 20060810
pci 0000:00:02.0: PCI INT A -> Link[LNKB] -> GSI 11 (level, low) -> IRQ 11
pci 0000:00:02.0: setting latency timer to 64
[drm] Initialized vboxvideo 1.0.0 20090303 for 0000:00:02.0 on minor 0
root@slitaz:~#
root@slitaz:~# cat /var/log/tazpkg.log
2010-06-02 06:14:57 - Installed - linux-drm (2.6.30.6) - 62ba26c458a1823ccee1f87d33ad619b
2010-06-02 06:14:58 - Installed - mesa-dri (7.4.4) - 2f1a8d7ccc8f8f357266052580fb1df8
2010-06-02 06:14:59 - Installed - xorg-xf86-input-evdev (2.0.4) - 2536931075fe9b19b51c2229740938ec
2010-06-02 06:15:03 - Installed - vboxadd (3.2.0_2.6.30.6) - 206b87986616423c7a6cafc3bf82d6f3
root@slitaz:~# ls -l /lib/modules/`uname -r`/misc
-rw-rw-r-- 1 root root 136865 Jun 1 17:51 vboxguest.ko
-rw-rw-r-- 1 root root 36391 Jun 1 17:51 vboxsf.ko
-rw-rw-r-- 1 root root 3475 Jun 1 17:51 vboxvideo.ko
root@slitaz:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 851.8M 119.9M 731.9M 14% /
tmpfs 851.8M 119.9M 731.9M 14% /
tmpfs 473.2M 0 473.2M 0% /dev/shm

root@slitaz:~# du -sh /
119.9M
root@slitaz:~#


User Manual
Version 3.2.0 Edition
[..]
Chapter 3. Configuring virtual machines
3.4. System settings
3.4.1. "Motherboard" tab
[..]

Enable absolute pointing device
If enabled, VirtualBox reports to the virtual machine that a USB tablet device is present and communicates mouse events to the virtual machine through this device. If disabled, mouse events are communicated through a traditional PS/2 virtual mouse device.

Using the virtual USB tablet has the advantage that movements are reported in absolute coordinates (instead of as relative position changes), which allows VirtualBox to translate mouse events over the VM window into tablet events without having to "capture" the mouse in the guest as described in Section 1.7.1.1, “Capturing and releasing keyboard and mouse”. This makes using the VM less tedious even if Guest Additions are not installed.[8]
[..]

Chapter 4. Guest Additions
4.1. Introduction
[..]
The Guest Additions offer the following features:

Mouse pointer integration
To overcome the limitations for mouse support that were described in Section 1.7.1.1, “Capturing and releasing keyboard and mouse”, this provides you with seamless mouse support. You will only have one mouse pointer and pressing the Host key is no longer required to "free" the mouse from being captured by the guest OS. To make this work, a special mouse driver is installed in the guest that communicates with the "real" mouse driver on your host and moves the guest mouse pointer accordingly.
[..]

Reprinted:
http://www.virtualbox.org/wiki/News
News

May 18, 2010. The VirtualBox team today released a significant new version of Oracle VM VirtualBox(TM), its high performance, cross-platform virtualization software. VirtualBox 3.2, the first Oracle branded release since the acquisition of Sun Microsystems, Inc by Oracle Corp. earlier this year, contains many innovative new features which deliver further significant improvements in performance, power and supported guest operating system platforms.

Performance

* New Latest Intel hardware support – Harnessing the latest in chip-level support for virtualization, VirtualBox 3.2 supports new Intel Core i5 and i7 processor and Intel Xeon processor 5600 Series support for Unrestricted Guest Execution bringing faster boot times for everything from Windows to Solaris guests;
* New Large Page support – Reducing the size and overhead of key system resources, Large Page support delivers increased performance by enabling faster lookups and shorter table creation times.
* New In-hypervisor Networking – Significant optimization of the networking subsystem has reduced context switching between guests and host, increasing network throughput by up to 25%.
* New New Storage I/O subsystem – VirtualBox 3.2 offers a completely re-worked virtual disk subsystem which utilizes asynchronous I/O to achieve high-performance whilst maintaining high data integrity;
* New Remote Video Acceleration – The unique built-in VirtualBox Remote Display Protocol (VRDP), which is primarily used in virtual desktop infrastructure deployments, has been enhanced to deliver video acceleration. This delivers a rich user experience coupled with reduced computational expense, which is vital when servers are running hundreds of virtual machines;

Power

* New Page Fusion – Traditional Page Sharing techniques have suffered from long and expensive cache construction as pages are scrutinized as candidates for de-duplication. Taking a smarter approach, VirtualBox Page Fusion uses intelligence in the guest virtual machine to determine much more rapidly and accurately those pages which can be eliminated thereby increasing the capacity or vm density of the system;
* New Memory Ballooning – Ballooning provides another method to increase vm density by allowing the memory of one guest to be recouped and made available to others;
* New Multiple Virtual Monitors – VirtualBox 3.2 now supports multi-headed virtual machines with up to 8 virtual monitors attached to a guest. Each virtual monitor can be a host window, or be mapped to the hosts physical monitors;
* New Hot-plug CPU's – Modern operating systems such Windows Server 2008 x64 Data Center Edition or the latest Linux server platforms allow CPUs to be dynamically inserted into a system to provide incremental computing power while the system is running. Version 3.2 introduces support for Hot-plug vCPUs, allowing VirtualBox virtual machines to be given more power, with zero-downtime of the guest;
* New Virtual SAS Controller – VirtualBox 3.2 now offers a virtual Serial Attached SCSI (SAS) controller, enabling it to run the most demanding of high-end guests;
* New Online Snapshot Merging – Snapshots are powerful but can eat up disk space and need to be pruned from time to time. Historically, machines have needed to be turned off to delete or merge snapshots but with VirtualBox 3.2 this operation can be done whilst the machines are running. This allows sophisticated system management with minimal interruption of operations;
* New OVF Enhancements – VirtualBox has supported the OVF standard for virtual machine portability for some time. Now with 3.2, VirtualBox specific configuration data is also stored in the standard allowing richer virtual machine definitions without compromising portability;
* New Guest Automation – The Guest Automation APIs allow host-based logic to drive operations in the guest;

Platforms

* New USB Keyboard and Mouse – Support more guests that require USB input devices;
* New Oracle Enterprise Linux 5.5 – Support for the latest version of Oracle's flagship Linux platform;
* New Ubuntu 10.04 (「Lucid Lynx」) – Support for both the desktop and server version of the popular Ubuntu Linux distribution;
* New Mac OS X Server – On Apple hardware only, support for creating virtual machines running Mac OS X Server.

A key component of Oracle's industry-leading desktop-to-datacenter virtualization portfolio, VirtualBox is open source software and hugely popular: surpassing 26 million downloads worldwide since October 2007, with in excess of 40,000 downloads a day. A relatively small download, VirtualBox software is incredibly compact and efficient and installs in just a few minutes.

Pricing and Availability
To download the freely available Oracle VM VirtualBox software, visit the VirtualBox Downloads page. VirtualBox software is free of charge for personal use. For wider deployments within an organization, enterprise licenses are also available, starting at $50 (USD) per user. For partners wishing to redistribute the VirtualBox technology as part of their own solution, Oracle offers a comprehensive OEM licensing program.
.

2010-05-28

Slitaz -- vboxadd / folder sharing


folder sharing

Env:
HOST: winxp (with Ext2fsd)
GUEST: slitaz-3.0.iso in HD (vdi)
VirtualBox: 3.1.8

root@slitaz:~# lsmod | grep vboxsf
vboxsf 29528 1
vboxguest 113576 2 vboxsf
root@slitaz:/home/slitaz# mount.vboxsf slitaz3 /mnt/share
root@slitaz:/home/slitaz# ls -l /mnt/share
drwxrwxrwx 1 root root 0 Apr 26 15:25 bin
drwxrwxrwx 1 root root 0 May 15 22:55 boot
drwxrwxrwx 1 root root 0 May 27 10:13 dev
drwxrwxrwx 1 root root 0 May 27 09:07 etc
drwxrwxrwx 1 root root 0 May 27 09:13 home
-rwxrwxrwx 1 root root 3162 Mar 12 17:26 init
drwxrwxrwx 1 root root 0 May 15 23:45 lib
drwxrwxrwx 1 root root 0 Mar 7 01:08 lost+found
drwxrwxrwx 1 root root 0 May 27 10:16 media
drwxrwxrwx 1 root root 0 Apr 23 14:42 mnt
drwxrwxrwx 1 root root 0 May 19 15:32 opt
drwxrwxrwx 1 root root 0 May 15 23:58 opt-backup
drwxrwxrwx 1 root root 0 Mar 7 01:08 proc
drwxrwxrwx 1 root root 0 May 27 19:44 root
drwxrwxrwx 1 root root 0 May 19 14:24 sbin
drwxrwxrwx 1 root root 0 Mar 7 01:08 sys
drwxrwxrwx 1 root root 0 May 27 19:44 tmp
drwxrwxrwx 1 root root 0 May 27 17:37 usr
drwxrwxrwx 1 root root 0 May 2 01:28 var
root@slitaz:/home/slitaz# ls -l /mnt/share/home/slitaz/distro
drwxrwxrwx 1 root root 0 May 27 10:30 rootcd
drwxrwxrwx 1 root root 0 May 27 10:30 rootfs
-rwxrwxrwx 1 root root 31457280 May 27 11:54 slitaz-1.iso
-rwxrwxrwx 1 root root 45 May 27 11:54 slitaz-1.md5
-rwxrwxrwx 1 root root 81788928 May 27 13:08 slitaz-201005271305.iso
-rwxrwxrwx 1 root root 58 May 27 13:08 slitaz-201005271305.md5
-rwxrwxrwx 1 root root 108003328 May 27 15:23 slitaz-201005271522.iso
-rwxrwxrwx 1 root root 58 May 27 15:23 slitaz-201005271522.md5
-rwxrwxrwx 1 root root 81788928 May 27 12:13 slitaz-2.iso
-rwxrwxrwx 1 root root 45 May 27 12:13 slitaz-2.md5
root@slitaz:/home/slitaz# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,relatime,errors=continue,data=writeback)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
tmpfs on /dev/shm type tmpfs (rw,relatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
none on /mnt/share type vboxsf (rw,nodev,relatime)
root@slitaz:/home/slitaz#

root@slitaz:~# mount.vboxsf -help
Usage: mount.vboxsf [OPTIONS] NAME MOUNTPOINT
Mount the VirtualBox shared folder NAME from the host system to MOUNTPOINT.

-w mount the shared folder writably (the default)
-r mount the shared folder read-only
-n do not create an mtab entry
-o OPTION[,OPTION...] use the mount options specified

Available mount options are:
rw mount writably (the default)
ro mount read only
uid=UID set the default file owner user id to UID
gid=GID set the default file owner group id to GID
ttl=TTL set the "time to live" to TID for the dentry
dmode=MODE override the mode of all directories to (octal) MODE
fmode=MODE override the mode of all regular files to (octal) MODE
umask=UMASK set the umask to (octal) UMASK
dmask=UMASK set the umask applied to directories only
fmask=UMASK set the umask applied to regular files only
iocharset CHARSET use the character set CHARSET for I/O operations
(default set is utf8)
convertcp CHARSET convert the folder name from CHARSET to utf8

Less common used options:
noexec,exec,nodev,dev,nosuid,suid
root@slitaz:~#

2010-05-27

Slitaz -- chroot / tazlito

Qemu & zh

Qemu

Boot from slitaz-vbox.iso

Boot from slitaz-vbox.iso & GuestAdditions

slitaz-vbox.iso: based on slitaz-3.0.iso + virtualbox-3.1.8 + guestadditions + wenquanyi_10pt.pcf

Qemu

root@slitaz:~# df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 251.1M 0 251.1M 0% /dev/shm
root@slitaz:~# du -sh /
247.9M
root@slitaz:~# free
total used free shared buffers
Mem: 514340 297692 216648 0 0
Swap: 0 0 0
Total: 514340 297692 216648
[..]
root@slitaz:~# fc-list :lang=zh
WenQuanYi Bitmap Song:style=Regular
root@slitaz:~# ls -l /home/slitaz
-rwxrwxrwx 1 root root 1197684 May 26 15:51 vboxadd-3.1.8_2.6.30.6.tazpkg
root@slitaz:~# cat /etc/slitaz-release
3.0
root@slitaz:~#
====

Boot from slitaz-vbox.iso
root@slitaz:~# df -h
Filesystem Size Used Available Use% Mounted on
rootfs 1.7G 250.0M 1.4G 15% /
tmpfs 1.7G 250.0M 1.4G 15% /
tmpfs 944.7M 0 944.7M 0% /dev/shm
root@slitaz:~# du -sh /
250.0M
root@slitaz:~# free
total used free shared buffers
Mem: 1934820 312836 1621984 0 0
Swap: 0 0 0
Total: 1934820 312836 1621984
root@slitaz:/home/tux# cat /var/log/tazpkg.log
2010-05-27 11:24:08 - Installed - libsdl (1.2.13) - c490ce417515b7f73d840474f29f7301
2010-05-27 11:24:09 - Installed - openssl (0.9.8l) - 43929be1cb7bd473cc24d1fbfd3e401e
2010-05-27 11:24:09 - Installed - libdb (4.7.25) - 88b3fb91256dd36f1b8bd7d3aef73989
2010-05-27 11:24:09 - Installed - xorg-libXss (1.1.2) - fdc154d798c077d27802290d1845e95f
2010-05-27 11:24:09 - Installed - gdbm (1.8.3) - db31351e035c988201ab6a4f54582e96
2010-05-27 11:24:10 - Installed - tcl (8.5.5) - 25ecf5dc353ffdcd1eb63aac551f45b8
2010-05-27 11:24:10 - Installed - tk (8.5.5) - f3456e5e6b37cafe227b8530693607fb
2010-05-27 11:24:12 - Installed - python (2.5.1) - 2260d614c6c89b99eb5ad807f24a2b96
2010-05-27 11:24:13 - Installed - libglu-mesa (7.4.4) - 80f321321678b85dc3ac5bf704159b0c
2010-05-27 11:24:22 - Installed - virtualbox (3.1.8-61349_2.6.30.6) - fe2806b3323f51fb663dd739b9404865
root@slitaz:~# ls -l /home/slitaz
-rwxrwxrwx 1 root root 1197684 May 26 15:51 vboxadd-3.1.8_2.6.30.6.tazpkg
root@slitaz:~# ls /lib/modules/`uname -r`/misc
vboxdrv.ko vboxnetadp.ko vboxnetflt.ko
root@slitaz:~# fc-list :lang=zh
WenQuanYi Bitmap Song:style=Regular
root@slitaz:~# cat /proc/cmdline
root=/dev/null screen=1280x1024x24 lang=en kmap=us acpi=off
root@slitaz:~# VBoxManage --help | head -3
Sun VirtualBox Command Line Management Interface Version 3.1.8
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.
root@slitaz:~#

----
root@slitaz:~# ps ax | grep -i vbox
1108 root /usr/bin/VBoxClient --clipboard
1119 root /usr/bin/VBoxClient --display
1125 root /usr/bin/VBoxClient --seamless
1221 root grep -i vbox
root@slitaz:~# lsmod | grep vbox
vboxvideo 1908 1
drm 121736 2 vboxvideo
vboxsf 29528 1
vboxguest 113576 5 vboxsf
root@slitaz:~# mount | tail -3
tmpfs on /dev/shm type tmpfs (rw,relatime)
usbfs on /proc/bus/usb type usbfs (rw,relatime)
none on /mnt/share type vboxsf (rw,nodev,relatime)
root@slitaz:~# ls -lh /mnt/share/iso/slitaz-vbox*
-rwxrwxrwx 1 root root 103.0M May 15 11:26 /mnt/share/iso/slitaz-vbox-0515.iso
-rwxrwxrwx 1 root root 45 May 15 11:26 /mnt/share/iso/slitaz-vbox-0515.md5
-rwxrwxrwx 1 root root 103.0M May 27 15:23 /mnt/share/iso/slitaz-vbox.iso
-rwxrwxrwx 1 root root 58 May 27 15:23 /mnt/share/iso/slitaz-vbox.md5
root@slitaz:~#

2010-05-26

Slitaz -- chroot / xephyr



Env:
HOST: slitaz-3.0 in HD
CHROOT: slitaz-3.0.iso extract to /home/slitaz/distro
package: xorg-server-Xephyr, packages-3.0.iso

nested X server

Xephyr is an X server that can be run inside another X server, much like Xnest. It is based on the kdrive X server, and as a result it supports newer extensions than Xnest, including render and composite.

HOST:
root@slitaz:~# Xephyr -pn -ac :1.0 2>/dev/null &

CHROOT:
root@slitaz:/# DISPLAY=:1.0 openbox-session 2>/dev/null &

root@slitaz:~# tazpkg info xorg-server-Xephyr

Tazpkg information
================================================================================
Package : xorg-server-Xephyr
Version : 1.5.3
Category : x-window
Short desc : Xephyr server used to creat chrooted X env.
Maintainer : pankso@slitaz.org
Depends : freetype xorg-libXau xorg-libfontenc xorg-libXdmcp xorg-libXfont xorg-libXext xorg-libX11 zlib pixman hal libcrypto xorg-libXv
Wanted src : xorg-server-tinyX
Web site : http://www.x.org/
================================================================================

root@slitaz:~#

root@slitaz:/home/slitaz# ls -l
-rwxr-xr-x 1 root root 617 May 25 11:59 chroot_env.sh
-rwxrwxrwx 1 root root 31457280 Apr 15 13:25 slitaz-3.0.iso
lrwxrwxrwx 1 root root 23 May 21 17:18 wok -> /media/packages-3.0/wok
root@slitaz:/home/slitaz# tazlito extract-distro slitaz-3.0.iso

Tazlito extracting : slitaz-3.0.iso
================================================================================

Mounting ISO image...
Copying the Linux kernel... [ OK ]
Copying isolinux files... [ OK ]
Copying GRUB files... [ OK ]
Copying the rootfs... [ OK ]
Extracting the rootfs...
================================================================================
Extracted : slitaz-3.0.iso (30.0M)
Distro tree : /home/slitaz/distro
Rootfs size : 101.1M rootfs
Rootcd size : 29.2M rootcd
================================================================================

root@slitaz:/home/slitaz# ls /home/slitaz/distro
rootcd rootfs
root@slitaz:/home/slitaz# ls /home/slitaz/distro/rootfs
bin etc init media proc sbin tmp var
dev home lib mnt root sys usr
root@slitaz:/home/slitaz# du -sh /home/slitaz/distro/rootfs
101.1M /home/slitaz/distro/rootfs
root@slitaz:/home/slitaz#
root@slitaz:/home/slitaz# sh ./chroot_env.sh
Chrooting into /home/slitaz/distro/rootfs...
root@slitaz:/#

*** HOST:***
root@slitaz:~# Xephyr -pn -ac :1.0 2>/dev/null &

***CHROOT***
root@slitaz:/# DISPLAY=:1.0 openbox-session &
/usr/bin/openbox-session: /etc/xdg/openbox/autostart.sh: line 8: ivman: not found
sed: /root/.config/lxpanel/default/panels/panel: No such file or directory
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-MBFterGVIx,guid=bc8c8da4d912d167a5a10b804bfbe2d4
DBUS_SESSION_BUS_PID=4013
.

Slitaz -- vboxadd-3.1.8




root@slitaz:~# tazpkg info vboxadd

Tazpkg information
=======================================================================
Package : vboxadd
Version : 3.1.8_2.6.30.6
Category : non-free
Short desc : x86 VBoxLinuxAdditions.
Maintainer :
Depends : linux-drm mesa-dri xorg-xf86-input-evdev
Web site : http://www.virtualbox.org/
=======================================================================

root@slitaz:~# df -h

Filesystem Size Used Available Use% Mounted on
rootfs 348.5M 120.8M 227.7M 35% /
tmpfs 348.5M 120.8M 227.7M 35% /
tmpfs 193.6M 0 193.6M 0% /dev/shm
root@slitaz:~# du -sh /
120.8M
root@slitaz:~# dmesg | tail -12
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 9
PCI: setting IRQ 9 as level-triggered
pci 0000:00:04.0: PCI INT A -> Link[LNKD] -> GSI 9 (level, low) -> IRQ 9
vboxguest: major 0, IRQ 9, I/O port d040, MMIO at 00000000f0400000 (size 0x400000)
vboxguest: Successfully loaded version 3.1.8 (interface 0x00010004)
vboxsf: Successfully loaded version 3.1.8 (interface 0x00010004)
Linux agpgart interface v0.103
[drm] Initialized drm 1.1.0 20060810
pci 0000:00:02.0: PCI INT A -> Link[LNKB] -> GSI 11 (level, low) -> IRQ 11
pci 0000:00:02.0: setting latency timer to 64
[drm] Initialized vboxvideo 1.0.0 20090303 for 0000:00:02.0 on minor 0
mtrr: no MTRR for e0000000,2000000 found
root@slitaz:~#
root@slitaz:~# cat /var/log/tazpkg.log
2010-05-26 14:53:55 - Installed - linux-drm (2.6.30.6) - 62ba26c458a1823ccee1f87d33ad619b
2010-05-26 14:53:56 - Installed - mesa-dri (7.4.4) - 2f1a8d7ccc8f8f357266052580fb1df8
2010-05-26 14:53:56 - Installed - xorg-xf86-input-evdev (2.0.4) - 2536931075fe9b19b51c2229740938ec
2010-05-26 14:53:59 - Installed - vboxadd (3.1.8_2.6.30.6) - c30174c6df5395cb57e218832532897a
root@slitaz:~# ls -l /dev/dri
crw-rw---- 1 root root 226, 0 May 26 14:59 card0
root@slitaz:~#
root@slitaz:~# ls -l /dev/vbox*
crw-rw---- 1 vboxadd vboxadd 10, 60 May 26 14:54 /dev/vboxguest
crw-rw-rw- 1 vboxadd root 10, 59 May 26 14:54 /dev/vboxuser
root@slitaz:~#
root@slitaz:~# tail -3 .config/openbox/autostart.sh
# Background color with xsetroot.
#xsetroot -solid "#222222" &
VBoxClietn-all &
root@slitaz:~#
root@slitaz:~# tail -5 /etc/group
tty:x:7:
video:x:8:tux
haldaemon:x:26:
tux:x:1000:
vboxadd:x:1001:
root@slitaz:~#
root@slitaz:~# ps ax | grep -i vbox
2045 root /usr/bin/VBoxClient --clipboard
2056 root /usr/bin/VBoxClient --display
2062 root /usr/bin/VBoxClient --seamless
2886 root grep -i vbox
root@slitaz:~#
root@slitaz:~# lsmod | grep vbox
vboxvideo 1908 1
drm 121736 2 vboxvideo
vboxsf 29528 0
vboxguest 113576 5 vboxsf
root@slitaz:~#

http://doc.slitaz.org/en:guides:xorg-xvesa
[..]
DRI / DRM Problem

DRI / DRM - SliTaz 3.0 has a file in a wrong place - /dev/dri should be a directory and not a file. And to get DRI working: we have to add tux to the group video:

# tazpkg get-install linux-drm
# tazpkg get-install mesa-demos (for glxinfo and glxgears)
# rm /dev/dri
# mkdir /dev/dri/
# addgroup tux video
The module drm is not loaded by tazhw, you have to do it manually:

# modprobe drm
[..]

====
Reprinted:

http://doc.slitaz.org/en:guides:xorg-xvesa

Xorg - Xvesa

The # sign means that you do this command as root on your console.

The default Slitaz-3.0.iso uses xorg 7.4 with the xorg-xf86-video-vesa 2.0.0 driver. This xvesa-driver can cause quite a few problems - it can result in a very low resolution or X does not start at all (falls back to slim or to the console). There are however some more possibilities:

*
check first, if you have enough Ram to run the default.iso - if not use the lowram.iso
*
you use the slitaz-3.0-xvesa.iso (TinyX)
*
you install the xorg video driver for your card
*
you can try to change your xorg.conf

Note: In Xorg versions up to 7.3, the Ctrl+Alt+Backspace key combination could be used to quit the X server. To enable it in version 7.4 and later, you can type the following command from any X terminal emulator:

setxkbmap -option terminate:ctrl_alt_bksp

Good introductions to Xorg Configuration: The FreeBSD Handbook and X Configuration from Ubuntu
slitaz-xvesa.iso with tinyX Server

You can download the slitaz-3.0-xvesa.iso here: SliTaz-3.0-xvesa.iso

It boots on nearly all computers and laptops, but you can only display a 4:3 resolution. To find out which resolutions are possible with your card, type:

Xvesa -listmodes

Here's a selection of resolutions for my Intel Atom Board:

VBE version 3.0 (Intel(r) 82945GM Chipset Family Graphics Chip Accelerated VGA BIOS)
DAC is switchable, controller is VGA compatible, RAMDAC causes snow
Total memory: 7872 kilobytes
0x015A: 1600x1200x24 TrueColor [8:8:8:8]
0x011B: 1280x1024x24 TrueColor [8:8:8:8]
0x0118: 1024x768x24 TrueColor [8:8:8:8]
0x0112: 640x480x24 TrueColor [8:8:8:8]
0x0115: 800x600x24 TrueColor [8:8:8:8]

So widescreen resolutions cannot be displayed with the slitaz-3.0-xvesa.iso.

If X does not start with the default SliTaz.iso (falls back to slim), you could use the xvesa.iso to install your default xorg driver. Because when you are asked for your resolution at boot, you can scroll down the window and find the possibility to install your xorg.driver before X is started. But don't use 「tazx」 and 「tazhw setup ati or nv」 on the xvesa.iso to install your xorg driver, because you will end up with a black screen.
Xorg Video Driver

When you are using SliTaz as your daily OS, it's recommended to setup your default xorg video driver. You will get a much better picture than using the xvesa driver or tinyX.

If you have a AGP-Videocard

Check with 「lspci」 - if you find AGP, you should do this first:

# tazpkg get-install linux-agp

Then load the modules:

# tazhw detect-pci

Then normally, you just run as root:

# tazx

And install your video driver from the list.

- but sometimes this is not enough.

DRI / DRM Problem

DRI / DRM - SliTaz 3.0 has a file in a wrong place - /dev/dri should be a directory and not a file. And to get DRI working: we have to add tux to the group video:

# tazpkg get-install linux-drm
# tazpkg get-install mesa-demos (for glxinfo and glxgears)
# rm /dev/dri
# mkdir /dev/dri/
# addgroup tux video

The module drm is not loaded by tazhw, you have to do it manually:

# modprobe drm

Load modules persistently

Please note that all modules, which are loaded by tazhw and yourself to make your changes permanent, have to be added to the SliTaz Control Box under Initialization in 「Load modules」.

Change your xorg.conf

Normally X will start, but perhaps not with the correct resolution. See the tips at the end of this page or sometimes search the net for the xorg.conf for your card and your monitor - or use another LiveCD and copy the working conf file to SliTaz.

Restart X

Use the normal shutdown button and select on SliTaz Desktop logout the button Logout X session.

Check the /var/log/Xorg.0.log to see if you get any essential (WW)- warnings or (EE) - errors. When you installed mesa-demos you can test if rendering is working:

glxinfo | grep render

intel-video cards

The xorg-xf86-video-vesa 2.0.0 driver has a lot of trouble with intel chips - e.g. on my 82945GM Chipset it does not display 1280×1024 and 1024×768, but 1600×1200 is not a problem.

Use 「tazx」 to select the intel driver, then 「tazhw detect-pci」, solve the dri problem and load drm and restart X - normally that's it (perhaps you must change your xorg.conf).

Some users may need to add the 「intel_agp」 module to the xorg.conf file:

Section "Module"
...
Load "intel_agp"
EndSection

for the driver to work.
trident-video cards

Use 「tazx」 to select the trident driver, install mesa-dri-trident

# tazpkg get-install mesa-dri-trident

and restart X
nvidia cards

Slitaz provides automatic configuration for nvidia cards. For free nvidia drivers, do:

# tazhw setup nvidia

For non-free nvidia drivers (supplied by NVIDIA), do:

# tazhw setup nvidia --non-free

To setup non-free nvidia manually:

First download: mesa mesa-demos linux-agp nvidia

# tazpkg get-install nvidia
# tazpkg get-install mesa
# tazpkg get-install mesa-demos
# tazpkg get-install linux-agp

Load modules

# tazhw detect-pci

To configure nvidia automatically

# nvidia-xconfig

To test if rendering is working

glxinfo | grep render

To change nvidia settings

# nvidia-settings

For no logo at bootup, add the following to xorg.conf

Option "NoLogo" "True"

To setup free nvidia manually:

First download: mesa mesa-demos linux-agp xorg-xf86-video-nv

# tazpkg get-install xorg-xf86-video-nv
# tazpkg get-install mesa
# tazpkg get-install mesa-demos
# tazpkg get-install linux-agp

Load modules

# tazhw detect-pci

Replace vesa with nv

# sed -i 's/vesa/nv/' /etc/X11/xorg.conf

ati cards

For free ati drivers (preferred), do:

tazpkg get-install linux-agp
tazpkg get-install linux-drm
tazhw setup ati

- but perhaps this is not enough - check /var/log/Xorg.0.log to see if other modules must be loaded: See DRI / DRM Problem

For non-free ati catalyst drivers (known to be not so good), do:

tazhw setup ati --non-free

To setup free ati manually:

First download: xorg-xf86-video-ati mesa-dri-ati mesa-demos linux-agp

# tazpkg get-install xorg-xf86-video-ati
# tazpkg get-install mesa-dri-ati
# tazpkg get-install mesa-demos
# tazpkg get-install linux-agp
# tazpkg get-install linux-drm

Load modules

# tazhw detect-pci

The free ati driver is called radeon, replace vesa with radeon

# sed -i 's/vesa/radeon/' /etc/X11/xorg.conf

Edit Xorg.conf manually

This is how we can get a 1024×768 resolution: if your display is stuck at a low resolution, say 800×600, just add edit 「Modes」 in step 2b below.

I edited the following sections in xorg.conf (/etc/X11/xorg.conf):

1) Include HorizSync and VertRefresh in section 「Monitor」

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
HorizSync 28-64
VertRefresh 60
EndSection

2a) In Section 「Screen」; added Default Depth

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
DefaultDepth 24

2b) In Sub-section Display: added 「Modes」

SubSection "Display"
Viewport 0 0
Depth 24
Modes "1024x768" "800x600"
EndSubSection

3) Also, added default Slitaz Font path in Section Files

Section "Files"
ModulePath "/usr/lib/X11/modules"
FontPath "/usr/share/fonts/X11/misc/"
FontPath "/usr/share/fonts/X11/TTF/"
FontPath "/usr/share/fonts/X11/OTF"
FontPath "/usr/share/fonts/X11/Type1/"
FontPath "/usr/share/fonts/X11/100dpi/"
FontPath "/usr/share/fonts/X11/75dpi/"
FontPath "/usr/share/fonts/truetype/ttf-dejavu"
EndSection

You can use xrandr to identify your monitor(s) Debian RandR 1.2 Wiki

# tazpkg get-install xorg-xrandr


Page Review Section
Quality Good
Review Minor Updates
Priority Medium
Problems add a forum post link
OR add a lab issue tracker link
How to Improve How about other xorg-cards?
More details or references on Xorg.conf


en/guides/xorg-xvesa.txt · Last modified: 2010/05/25 21:46 by linea

2010-05-19

Slitaz -- virtualbox-3.1.8

Add Slitaz support to VirtualBox installer

root@slitaz:~# head -12 /home/slitaz/wok/get-virtualbox/stuff/installer.u
--- stuff/get-virtualbox Thu Jan 7 14:12:34 2010
+++ get-virtualbox Fri Jan 15 11:39:10 2010
@@ -57,6 +57,159 @@
cd install
[ -d /usr/share/VirtualBox ] && ./uninstall.sh
find /usr /etc /lib > ../before
+
+
+# Add Slitaz support to VirtualBox installer.
patch -p1 <<'EOT'
+--- install-ori/routines.sh Thu Dec 17 14:37:35 2009
++++ install/routines.sh Thu Dec 24 13:33:02 2009
root@slitaz:~#
root@slitaz:~# tazpkg info virtualbox

Tazpkg information
================================================================================
Package : virtualbox
Version : 3.1.8-61349_2.6.30.6
Category : non-free
Short desc : x86 virtualization.
Maintainer :
Depends : libsdl fontconfig gcc-lib-base glib libpng python udev libglu-mesa
Web site : http://www.virtualbox.org/
================================================================================

root@slitaz:~#
root@slitaz:~# tazpkg list | grep virtual
get-virtualbox 1.01 non-free
virtualbox 3.1.8-61349_2.6.3 non-free
root@slitaz:~# ps ax | grep Virtu
3962 root /usr/share/VirtualBox/VirtualBox
3988 root /usr/share/VirtualBox/VBoxXPCOMIPCD
4001 root /usr/share/VirtualBox/VBoxSVC --pipe 8 --auto-shutdown
4025 root /usr/share/VirtualBox/VirtualBox --comment slitaz --startvm d80162f7-9736-4e1b-99c1-b361431eb7e5
4993 root grep Virtu
root@slitaz:~# lsmod | grep vbox
vboxdrv 138232 1
root@slitaz:~# VirtualBox --help | head -6
Sun VirtualBox Graphical User Interface 3.1.8 (C) 2005-2010 Sun Microsystems, Inc. All rights reserved.
Usage: --startvm start a VM by specifying its UUID or name
root@slitaz:~#

root@slitaz:~# cat /var/lib/tazpkg/installed/virtualbox/receipt
# SliTaz package receipt.

PACKED_SIZE="40.4M"
UNPACKED_SIZE="103.2M"
PACKAGE="virtualbox"
VERSION="3.1.8-61349"
EXTRAVERSION=_2.6.30.6
CATEGORY="non-free"
SHORT_DESC="x86 virtualization."
WEB_SITE="http://www.virtualbox.org/"
DEPENDS="libsdl fontconfig gcc-lib-base glib libpng python udev libglu-mesa"

post_install()
{
udevadm trigger --subsystem-match=usb > /dev/null 2>&1
udevtrigger --subsystem-match=usb > /dev/null 2>&1
udevtrigger --subsystem-match=usb_device > /dev/null 2>&1
udevplug -Busb > /dev/null 2>&1
chroot "$1/" depmod -a 2.6.30.6-slitaz

# Add vboxusers group
if (! grep -q ^vboxusers /etc/group); then
addgroup vboxusers
fi
}
root@slitaz:~#
root@slitaz:~# cat /usr/bin/get-virtualbox
#!/bin/sh -e

ROOT="$1"
PACKAGE=${0#*get-}

if test $(id -u) != 0 ; then
echo -e "\nYou must be root to run `basename $0`."
echo -e "Please type 'su' and root password to become super-user.\n"
exit 0
fi

if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
[ -n "$ROOT" ] && exit 1
tazpkg remove $PACKAGE
[ -d /var/lib/tazpkg/installed/$PACKAGE ] && exit 1
fi
[ -d $ROOT/usr/share/$PACKAGE ] && rm -rf $ROOT/usr/share/$PACKAGE

WEB_SITE=http://www.virtualbox.org/
SHORT_DESC="x86 virtualization."
dl_url()
{
wget -O - ${WEB_SITE}wiki/Linux_Downloads 2> /dev/null | \
grep Linux_x86.run | sed 's|.*href="\(.*Linux_x86.run\).*|\1|'
}

TMP_DIR=/tmp/get-$PACKAGE-$$-$RANDOM
CUR_DIR=$(pwd)
mkdir -p $TMP_DIR && cd $TMP_DIR

url=$(dl_url)
TARBALL=$(basename $url)
wget $url

if [ ! -f "$TARBALL" ]; then
cd $CUR_DIR
rm -rf $TMP_DIR
echo "Could not download $TARBALL. Exiting."
exit 1
fi

VERSION=${TARBALL%-Linux_x86.run*}
VERSION=${VERSION#VirtualBox-}

sed -i 's/df -kP/df -k/' $TARBALL

# Extract
sh $TARBALL --noexec --keep

BUILD_DEPENDS="slitaz-toolchain bzip2 linux-source python python-dev"
for i in $BUILD_DEPENDS; do
[ -d /var/lib/tazpkg/installed/$i ] && continue
yes y | tazpkg get-install $i
done

# Install files
cd install
[ -d /usr/share/VirtualBox ] && ./uninstall.sh
find /usr /etc /lib > ../before


# Add Slitaz support to VirtualBox installer.
+patch -p1 <<'EOT'
--- install-ori/routines.sh Thu Dec 17 14:37:35 2009
+++ install/routines.sh Thu Dec 24 13:33:02 2009
@@ -207,6 +207,10 @@
ro_SYS_TYPE=unknown
ro_INIT_TYPE=bsd
ro_RC_LOCAL=/etc/rc.local
+ elif [ -f /etc/slitaz-release ]; then
+ ro_SYS_TYPE=slitaz
+ ro_INIT_TYPE=slitaz
+ ro_RC_LOCAL=/etc/rcS.conf
elif [ -d /etc/init.d ]; then
ro_SYS_TYPE=unknown
ro_INIT_TYPE=sysv
@@ -252,6 +256,9 @@
cp "$script" "/usr/sbin/$name" 2> /dev/null
chmod 755 "/usr/sbin/$name" 2> /dev/null
hav register $name System.Service $pardus_script
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ cp "$script" "/etc/init.d/$name" 2> /dev/null
+ chmod 755 "/etc/init.d/$name" 2> /dev/null
else
log "install_init_script: error: unknown init type"
return 1
@@ -279,6 +286,8 @@
elif [ "$ro_INIT_TYPE" = "pardus" ]; then
hav remove $name
rm -f "/usr/sbin/$name" > /dev/null 2>&1
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ rm -f "/etc/init.d/$name" > /dev/null 2>&1
else
log "remove_init_script: error: unknown init type"
return 1
@@ -303,6 +312,8 @@
"/etc/rc.d/rc.$name" start >> $ro_LOG_FILE 2>&1
elif [ "$ro_INIT_TYPE" = "lfs" ]; then
"/etc/rc.d/init.d/$name" start >> $ro_LOG_FILE 2>&1
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ "/etc/init.d/$name" start >> $ro_LOG_FILE 2>&1
elif [ "$ro_INIT_TYPE" = "pardus" ]; then
service $name on
else
@@ -328,6 +339,8 @@
"/etc/rc.d/rc.$name" stop >> $ro_LOG_FILE 2>&1
elif [ "$ro_INIT_TYPE" = "lfs" ]; then
"/etc/rc.d/init.d/$name" stop >> $ro_LOG_FILE 2>&1
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ "/etc/init.d/$name" stop >> $ro_LOG_FILE 2>&1
elif [ "$ro_INIT_TYPE" = "pardus" ]; then
service $name off
else
@@ -425,6 +438,12 @@
echo "fi" >> $ro_RC_LOCAL
echo "" >> $ro_RC_LOCAL
fi
+ # Slitaz GNU/Linux use /etc/rcS.conf to start services.
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ if ! grep $1 $ro_RC_LOCAL
+ then
+ sed -i -e "s/RUN_DAEMONS=\"\(.*\)\"/RUN_DAEMONS=\"\1 $1\"/" $ro_RC_LOCAL
+ fi
# Probably most unknown Linux systems will be sysv type ones. These can theoretically
# be handled automatically if people give us information about them.
elif [ "$ro_INIT_TYPE" = "sysv" ]; then
@@ -484,6 +503,12 @@
rm "/etc/rc4.d/S??$1" > /dev/null 2>&1
rm "/etc/rc5.d/S??$1" > /dev/null 2>&1
rm "/etc/rc6.d/K??$1" > /dev/null 2>&1
+ # Slitaz GNU/Linux
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ if grep $1 $ro_RC_LOCAL
+ then
+ sed -i -e "s/$1//" $ro_RC_LOCAL
+ fi
# Unknown sysv-type system
elif [ "$ro_INIT_TYPE" = "sysv" ]; then
echo 1>&2 "Please remove remove references to the initialization script"
@@ -515,6 +540,8 @@
scriptname="/etc/rc.d/init.d/$name"
elif [ "$ro_INIT_TYPE" = "pardus" ]; then
scriptname="/usr/sbin/$name"
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ scriptname="/etc/init.d/$name"
else
log "$self: error: unknown init type"
return 1
@@ -563,6 +590,8 @@
scriptname="/etc/rc.d/init.d/$name"
elif [ "$ro_INIT_TYPE" = "pardus" ]; then
scriptname="/usr/sbin/$name"
+ elif [ "$ro_INIT_TYPE" = "slitaz" ]; then
+ scriptname="/etc/rc.d/init.d/$name"
else
log "$self: error: unknown init type"
return 1
--- install-ori/vboxdrv.sh Thu Dec 17 14:37:35 2009
+++ install/vboxdrv.sh Thu Dec 24 11:49:30 2009
@@ -63,6 +63,8 @@
system=suse
elif [ -f /etc/gentoo-release ]; then
system=gentoo
+ elif [ -f /etc/slitaz-release ]; then
+ system=slitaz
fi
fi

@@ -123,6 +125,19 @@
if [ "`which $0`" = "/sbin/rc" ]; then
shift
fi
+ elif [ "$system" = "slitaz" ]; then
+ if [ -f /etc/init.d/rc.functions ]; then
+ . /etc/init.d/rc.functions
+ fi
+ fail_msg() {
+ status
+ }
+ succ_msg() {
+ status "$?"
+ }
+ begin_msg() {
+ echo "$1"
+ }
else
fail_msg() {
echo " ...failed!"
@@ -132,6 +147,7 @@
echo " ...done."
}
fi
+
if [ "$system" != "gentoo" ]; then
begin_msg() {
[ -z "${1:-}" ] && return 1
@@ -169,7 +185,11 @@
if ! modprobe vboxdrv > /dev/null 2>&1; then
failure "modprobe vboxdrv failed. Please use 'dmesg' to find out why"
fi
- sleep .2
+ if [ "$system" = "slitaz" ]; then
+ sleep 1
+ else
+ sleep .2
+ fi
fi
# ensure the character special exists
if [ ! -c $DEVICE ]; then

EOT

./install.sh install /usr/share/VirtualBox
cd ..
find /usr /etc /lib > after
sed -i 's/ps -U/ps | grep/' /usr/share/VirtualBox/VBox.sh
echo 'lsmod | grep -q vboxdrv || modprobe vboxdrv' >> /etc/vbox/vbox.cfg
mkdir -p $PACKAGE-$VERSION/fs
diff -U0 before after | grep ^+/ | sed 's|^\+/||' | \
( cd / ; cpio -o -H newc ) | ( cd $PACKAGE-$VERSION/fs ; cpio -idm )

# Create pseudo package
cat > $PACKAGE-$VERSION/receipt <# SliTaz package receipt.

PACKAGE="$PACKAGE"
VERSION="$VERSION"
EXTRAVERSION=_$(uname -r | sed 's/-slitaz//')
CATEGORY="non-free"
SHORT_DESC="$SHORT_DESC"
WEB_SITE="$WEB_SITE"
DEPENDS="libsdl fontconfig gcc-lib-base glib libpng python udev libglu-mesa"

post_install()
{
$(grep ' udev[atp]' install/install.sh)
chroot "\$1/" depmod -a $(uname -r)

# Add vboxusers group
if (! grep -q ^vboxusers /etc/group); then
addgroup vboxusers
fi
}
EOT

# Pack
tazpkg pack $PACKAGE-$VERSION

# Install pseudo package
tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT

# Clean
cd $CUR_DIR
rm -rf $TMP_DIR
.

2010-05-18

Slitaz -- setxkbmap

Ctrl+Alt+Backspace

http://doc.slitaz.org/en:guides:xorg-xvesa

The # sign means that you do this command as root on your console.

The default Slitaz-3.0.iso uses xorg 7.4 with the xorg-xf86-video-vesa 2.0.0 driver. This xvesa-driver can cause quite a few problems - it can result in a very low resolution or X does not start at all (falls back to slim or to the console). There are however some more possibilities:

  • check first, if you have enough Ram to run the default.iso - if not use the lowram.iso
  • you use the slitaz-3.0-xvesa.iso (TinyX)
  • you install the xorg video driver for your card
  • you can try to change your xorg.conf

Note: In Xorg versions up to 7.3, the Ctrl+Alt+Backspace key combination could be used to quit the X server. To enable it in version 7.4 and later, you can type the following command from any X terminal emulator:

setxkbmap -option terminate:ctrl_alt_bksp

Good introductions to Xorg Configuration: The FreeBSD Handbook and X Configuration from Ubuntu
[..]
root@slitaz-3:~# tazpkg info xorg-setxkbmap

Tazpkg information
================================================================================
Package : xorg-setxkbmap
Version : 1.0.4
Category : x-window
Short desc : Set the keyboard using the X Keyboard Extension.
Maintainer : pascal.bellard@slitaz.org
Depends : xorg xorg-libX11 xorg-xkeyboard-config xorg-libxkbfile
Web site : http://www.x.org/
================================================================================

root@slitaz-3:~# tazpkg list-files xorg-setxkbmap

Installed files with : xorg-setxkbmap
================================================================================
/usr/bin/setxkbmap
================================================================================
1 files installed with xorg-setxkbmap.

root@slitaz-3:~#
.

2010-05-12

Slitaz -- kernel -2

tazwok cook linux

Env:
http://hg.slitaz.org/wok-stable/raw-file/d4f3fe7e0dc0/linux/receipt

wok-stable-cd66133a1f46.tar.bz2

error: zlib.h: No such file or directory

tazpkg get-install zlib-dev
or
ln -s /home/slitaz/wok/linux/linux-2.6.30.6/include/linux/zlib.h /usr/include

root@slitaz:/home/slitaz/wok# tazwok cook linux
[..]
================================================================================
Package linux-wireless (2.6.30.6) generated.
Size : 1.4M /home/slitaz/packages/linux-wireless-2.6.30.6.tazpkg

tazwok cook aufs-utils
tazwok cook broadcom-wl
tazwok cook catalyst
tazwok cook compcache
tazwok cook dahdi-linux
tazwok cook fuse
tazwok cook gnu-efi
tazwok cook iptables
tazwok cook kqemu
tazwok cook libcap
tazwok cook linmodem-agrsm
tazwok cook linmodem-intel-536ep
tazwok cook linmodem-intel-537
tazwok cook linmodem-slmodem
tazwok cook ndiswrapper-driver
tazwok cook nvidia
tazwok cook open-iscsi
tazwok cook usbip
======================================================================
These modules selected in .config were not categorized in linux-* pkgs:
smsc9420.ko.gz : /home/slitaz/wok/linux/linux-2.6.30.6/_pkg/lib/modules/2.6.30.6-slitaz/kernel/drivers/net/smsc9420.ko.gz
dvb-core.ko.gz : /home/slitaz/wok/linux/linux-2.6.30.6/_pkg/lib/modules/2.6.30.6-slitaz/kernel/drivers/media/dvb/dvb-core/dvb-core.ko.gz
dlm.ko.gz : /home/slitaz/wok/linux/linux-2.6.30.6/_pkg/lib/modules/2.6.30.6-slitaz/kernel/fs/dlm/dlm.ko.gz
configfs.ko.gz : /home/slitaz/wok/linux/linux-2.6.30.6/_pkg/lib/modules/2.6.30.6-slitaz/kernel/fs/configfs/configfs.ko.gz
======================================================================

Executing strip on all files... [ OK ]
Copying the receipt... [ OK ]
Creating the list of files... [ OK ]
Creating md5sum of files... [ OK ]
Compressing the fs...
LZMA 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
8861 blocks
[ OK ]
Updating receipt sizes... [ OK ]
Creating full cpio archive... 6361 blocks
[ OK ]
Restoring original package tree... 8861 blocks
================================================================================
Package linux (2.6.30.6) generated.
Size : 3.1M /home/slitaz/packages/linux-2.6.30.6.tazpkg

root@slitaz:/home/slitaz/wok# tazwok stats

Tazwok configuration statistics
================================================================================
Wok directory : /home/slitaz/wok
Packages repository : /home/slitaz/packages
Sources repository : /home/slitaz/src
Packages in the wok : 2293
Cooked packages : 53
================================================================================

root@slitaz:/home/slitaz/wok# ls ../packages
lguest-2.6.30.6.tazpkg
linux-2.6.30.6.tazpkg
linux-acpi-2.6.30.6.tazpkg
linux-agp-2.6.30.6.tazpkg
linux-appletalk-2.6.30.6.tazpkg
linux-aufs-2.6.30.6.tazpkg
linux-bluetooth-2.6.30.6.tazpkg
linux-bridge-2.6.30.6.tazpkg
linux-btrfs-2.6.30.6.tazpkg
linux-cifs-2.6.30.6.tazpkg
linux-coda-2.6.30.6.tazpkg
linux-cpufreq-2.6.30.6.tazpkg
linux-cramfs-2.6.30.6.tazpkg
linux-crypto-2.6.30.6.tazpkg
linux-cryptoloop-2.6.30.6.tazpkg
linux-dialup-2.6.30.6.tazpkg
linux-drm-2.6.30.6.tazpkg
linux-ext4-2.6.30.6.tazpkg
linux-gfs2-2.6.30.6.tazpkg
linux-headers-2.6.30.6.tazpkg
linux-hfs-2.6.30.6.tazpkg
linux-hfsplus-2.6.30.6.tazpkg
linux-ieee1394-2.6.30.6.tazpkg
linux-input-misc-2.6.30.6.tazpkg
linux-input-tablet-2.6.30.6.tazpkg
linux-input-touchscreen-2.6.30.6.tazpkg
linux-ipv6-2.6.30.6.tazpkg
linux-irda-2.6.30.6.tazpkg
linux-isdn-2.6.30.6.tazpkg
linux-jfs-2.6.30.6.tazpkg
linux-joystick-2.6.30.6.tazpkg
linux-kvm-2.6.30.6.tazpkg
linux-md-2.6.30.6.tazpkg
linux-memstick-2.6.30.6.tazpkg
linux-minix-2.6.30.6.tazpkg
linux-mmc-2.6.30.6.tazpkg
linux-mwave-2.6.30.6.tazpkg
linux-ncpfs-2.6.30.6.tazpkg
linux-netfilter-2.6.30.6.tazpkg
linux-reiserfs-2.6.30.6.tazpkg
linux-sched-2.6.30.6.tazpkg
linux-scsi-2.6.30.6.tazpkg
linux-sound-2.6.30.6.tazpkg
linux-source-2.6.30.6.tazpkg
linux-squashfs-2.6.30.6.tazpkg
linux-udf-2.6.30.6.tazpkg
linux-usbdsl-2.6.30.6.tazpkg
linux-usbip-2.6.30.6.tazpkg
linux-usb-misc-2.6.30.6.tazpkg
linux-uwb-2.6.30.6.tazpkg
linux-video-2.6.30.6.tazpkg
linux-wimax-2.6.30.6.tazpkg
linux-wireless-2.6.30.6.tazpkg
root@slitaz:/home/slitaz/wok#

====
root@slitaz:/home/slitaz/wok# tazwok cook linux
[..]
patching file lib/Kconfig
patching file lib/decompress_bunzip2.c
patching file lib/decompress_inflate.c
patching file lib/decompress_unlzma.c
cc -Wall -Wmissing-declarations -Wmissing-prototypes -O3 -I../../include -I../../arch/x86/include -U_FORTIFY_SOURCE lguest.c -lz -o lguest
lguest.c:34:18: error: zlib.h: No such file or directory
make: *** [lguest] Error 1

root@slitaz:/home/slitaz/wok# cat linux/receipt | grep -n lguest
59: cd Documentation/lguest
60: make lguest || return 1
root@slitaz:/home/slitaz/wok#
.

2010-05-11

Slitaz -- kernel

Build your own custom Linux Kernel for SliTaz
[http://doc.slitaz.org/en:guides:kernel]

1. tazpkg get-install slitaz-toolchain
2. tazpkg get-install linux-source


----
To modify the kernel configuration:
$ cd /usr/src/linux-2.6.30.6-slitaz
$ make menuconfig

To build the kernel and the modules:
$ cd /usr/src/linux-2.6.30.6-slitaz
$ make bzImage && make modules

To install the new kernel and the modules:
$ make modules_install
$ cp -a arch/x86/boot/bzImage /boot/vmlinuz-2.6.30.6-slitaz

To make a Slitaz package with the new kernel and the modules:
$ make tazpkg

See /usr/src/linux-2.6.30.6-slitaz/README
----
================================================================================
linux-source (2.6.30.6) is installed.

root@slitaz:~# gcc -v
Using built-in specs.
Target: i486-pc-linux-gnu
Configured with: ../gcc-4.4.1/configure --prefix=/usr --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls --enable-languages=c,c++,objc,fortran --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-threads=posix --with-tune=i486 i486-pc-linux-gnu
Thread model: posix
gcc version 4.4.1 (GCC)
root@slitaz:~#

root@slitaz:~# tazpkg info slitaz-toolchain

Tazpkg information
================================================================================
Package : slitaz-toolchain
Version : 1.0
Category : meta
Short desc : SliTaz toolchain meta package for devel.
Maintainer : pankso@slitaz.org
Depends : binutils linux-headers glibc-dev gcc make
Web site : http://www.slitaz.org/
================================================================================

root@slitaz:~# tazpkg info linux-source

Tazpkg information
================================================================================
Package : linux-source
Version : 2.6.30.6
Category : development
Short desc : The Linux kernel source files.
Maintainer : devel@slitaz.org
Depends : linux slitaz-toolchain ncurses-dev perl
Wanted src : linux
Web site : http://www.kernel.org/
================================================================================

root@slitaz:~# cat /var/log/tazpkg.log
2010-05-12 08:33:01 - Installed - binutils (2.19.1) - 3e0de34e007be29c0ebb6cbff43eba15
2010-05-12 08:33:01 - Installed - linux-headers (2.6.30.6) - f96101f9d3e1c29ff35edd54476e4577
2010-05-12 08:33:03 - Installed - bash (4.0) - 299bf79f5c8ea7b19715e9981a9419a8
2010-05-12 08:33:03 - Installed - libgd (2.0.35) - 539b6e178d8bcdbd7a0e4d4d97c0e04a
2010-05-12 08:33:04 - Installed - glibc-dev (2.10.1) - 1bfa095deffb35e64401b59856cf3ede
2010-05-12 08:33:05 - Installed - libgomp (4.4.1) - 2a1264d8e6daed0f6a0d51f30bdc6ede
2010-05-12 08:33:05 - Installed - make (3.81) - 6e37b7395ffa82c65ef5630c2e27dec2
2010-05-12 08:33:06 - Installed - gmp (4.2.2) - 549b48e2af6470f3babfcab6a407900c
2010-05-12 08:33:06 - Installed - mpfr (2.4.1) - 8af4c7df92b29ccf77d589a6e54001f6
2010-05-12 08:33:13 - Installed - gcc (4.4.1) - 3dd4b1be27a5a90f738c63f5654786c9
2010-05-12 08:33:13 - Installed - slitaz-toolchain (1.0) - dbf1a81f5e42e93b9f838b5e146c6783
2010-05-12 08:39:43 - Installed - ncursesw-dev (5.7) - 3a243df79f4ad2dfa1c1fc4c7981a0a9
2010-05-12 08:39:43 - Installed - ncurses-dev (5.7) - c7a96c4ae098b65809e2bd2165362a48
2010-05-12 08:39:43 - Installed - libdb (4.7.25) - 88b3fb91256dd36f1b8bd7d3aef73989
2010-05-12 08:39:43 - Installed - gdbm (1.8.3) - db31351e035c988201ab6a4f54582e96
2010-05-12 08:39:45 - Installed - perl (5.10.0) - 08a618230fbad37eaa63b7e4483eca80
2010-05-12 08:40:06 - Installed - patch (2.5.4) - 395aa6153644678ea3ff2512ac0bb8bb
2010-05-12 08:40:12 - Installed - linux-source (2.6.30.6) - 478e2bdb88dabc5ac32cd7781488305a
root@slitaz:~#

root@slitaz:~# ls -l /usr/src
lrwxrwxrwx 1 root root 21 May 12 08:39 linux -> linux-2.6.30.6-slitaz
drwxrwxr-x 24 root root 4096 May 12 08:40 linux-2.6.30.6-slitaz
-rwx------ 1 root root 59430223 Oct 14 2009 linux-2.6.30.6.tar.bz2
root@slitaz:~# ls -l /lib/modules/`uname -r`/ | grep linux
lrwxrwxrwx 1 root root 30 May 12 08:39 build -> /usr/src/linux-2.6.30.6-slitaz
lrwxrwxrwx 1 root root 30 May 12 08:39 source -> /usr/src/linux-2.6.30.6-slitaz
root@slitaz:~#
.