Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 309861 - New ebuild for vserver-sources 2.3.0.36.30.3
Summary: New ebuild for vserver-sources 2.3.0.36.30.3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High enhancement (vote)
Assignee: Gentoo VPS Team (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-16 21:24 UTC by Pavol Dilung
Modified: 2010-04-04 06:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
vserver patches archive (vserver-patches-2.6.33_2.3.0.36.30.3.tar.bz2,160.33 KB, application/octet-stream)
2010-03-16 21:25 UTC, Pavol Dilung
Details
Linux Vserver sources for 2.6.33 and vs2.3.0.36.30.3 patchset (vserver-sources-2.3.0.36.30.3.ebuild,810 bytes, text/plain)
2010-03-16 21:26 UTC, Pavol Dilung
Details
Vserver-enabled kernel configuration for Dell Latitude d630 (kernel-config-x86_64-2.6.33-vs2.3.0.36.30.3,61.45 KB, text/plain)
2010-03-17 09:14 UTC, Pavol Dilung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavol Dilung 2010-03-16 21:24:13 UTC
I've created a new ebuild for vserver-sources using the following:
1. Stock 2.6.33 linux kernel
2. Gentoo patches (genpatches) version 1
3. Vserver patch 2.3.0.36.30.3 from http://vserver.13thfloor.at/Experimental/patch-2.6.33-vs2.3.0.36.30.3.diff



Reproducible: Always

Actual Results:  
The reason why I did it is that 2.6.33 and the vserver patch implements support for VIRT_MEM using cgroups properly, i.e. free and top-alike show proper values. 

Note, that limiting memory resources works properly in prevoius versions, contained in portage tree.

Tested subsystems (works):
1. vserver guests (gnetoo, debian)
2. cgroups for cpu shares (FSS), for memory and for swap limits.
3. free, top tools within guests report proper size of memory, that has been limited.

Platform: amd64.



See the ebuild and gentooized vserver patches in attachments.

emerge --info
emerge --info
Portage 2.1.7.17 (default/linux/amd64/10.0, gcc-4.3.4, glibc-2.10.1-r1, 2.6.33-vs2.3.0.36.30.3 x86_64)
=================================================================
System uname: Linux-2.6.33-vs2.3.0.36.30.3-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7300_@_2.00GHz-with-gentoo-2.0.1
Timestamp of tree: Sun, 14 Mar 2010 11:15:03 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.10
dev-lang/python:     2.6.4
dev-python/pycrypto: 2.1.0_beta1
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.3
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -fomit-frame-pointer -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -fomit-frame-pointer -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="http://mirror.gentoo.sk/pub ftp://gentoo.mirror.web4u.cz/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
LINGUAS="en sk"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/sunrise /usr/local/portage/layman/vps /usr/local/portage/layman/jokey /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="a52 aac acpi aim alsa amd64 bash-completion bcmath berkdb bidi blas bzip2 cairo caps cddb cdinstall cdparanoia cdr cli cracklib cscope ctype curl curlwrappers cxx dbm dbus doc dri dv dvd dvdr dvdread encode examples exif expat ffmpeg fftw firefox flac flatfile fltk foomaticdb fortran freewnn ftp gd gdbm gif ginac glut gmp gpm gtk gtkhtml guile howl iconv icq idn ieee1394 imagemagick inifile jabber javascript jbig jikes jpeg jpeg2k lapack lcms lesstif libcaca libedit libnotify libwww mad maildir memlimit mhash mime mmap mmx mng modules mp3 mpeg mplayer mudflap multilib musepack musicbrainz ncurses nls nocd nptl nptlonly nsplugin offensive ogg old-linux openal opengl openmp openxer pam pcmcia pcntl pcre pdf perl plotutils png posix ppds pppd pulseaudio python rdesktop readline recode reflection scanner session sharedext sharedmem shorten simplexml slang slp sockets source speex spell sse sse2 startup-notification sysfs sysvipc szip tcpd threads tidy tiff tokenizer truetype unicode usb vcd verbose vhosts videos vim-syntax vorbis wifi wmf x264 xcomposite xface xine xinerama xml xmlrpc xorg xpm xscreensaver xsl xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="alias authz_host authz_owner authz_user autoindex dir env ext_filter       filter info log_config logio mime mime_magic negotiation rewrite setenvif status      unique_id userdir vhost_alias auth_digest" APACHE2_MPMS="worker" CAMERAS="adc65 agfa_cl20 aox barbie canon casio_qv clicksmart310 digigr8 digita dimagev dimera3500 directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 jl2005a kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150 largan lg_gsm mars mustek panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l 859 pccam300 pccam600 polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2 ricoh ricoh_g3 samsung sierra sipix_blink sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 stv0674 stv0680 sx330z template topfield toshiba_pdrm11" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="en sk" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Pavol Dilung 2010-03-16 21:25:31 UTC
Created attachment 223963 [details]
vserver patches archive
Comment 2 Pavol Dilung 2010-03-16 21:26:44 UTC
Created attachment 223965 [details]
Linux Vserver sources for 2.6.33 and vs2.3.0.36.30.3 patchset
Comment 3 Pavol Dilung 2010-03-16 21:29:28 UTC
Added hollow to CC
Comment 4 Benedikt Böhm (RETIRED) gentoo-dev 2010-03-17 07:33:40 UTC
did you encounter the following problem while testing 2.6.33? http://list.linux-vserver.org/archive?mss:3633:201003:mjpjeilcfnfaepfcnddb
Comment 5 Pavol Dilung 2010-03-17 09:12:37 UTC
Nope, I didn't. Everything seems to work.

Let me sumarize what SW components I use for testing (maybe it helps):

- Host:
=======

1. Gentoo Linux with default/linux/amd64/10.0 profile

2. Linux kernel 2.6.33 with gentoo patchset (see sys-kernel/gentoo-sources-2.6.33) and the vserver patch from http://vserver.13thfloor.at/Experimental/patch-2.6.33-vs2.3.0.36.30.3.diff (packed into vserver-patches-2.6.33_2.3.0.36.30.3.tar.bz2 to stick with gentoo kernel patch mechanism). Let me emphasize that NO CHANGES IN SOURCES (neither in stock kernel nor in patches) WERE MADE BY ME.

3. Furthermore, I use this "core system" software:
   - sys-apps/baselayout-2.0.1
   - sys-apps/openrc-0.6.0-r1
   - sys-fs/udev-149

4. I use the attached kernel configuration (see kernel-config-x86_64-2.6.33-vs2.3.0.36.30.3)

5. Vserver utils: sys-cluster/util-vserver-0.30.216_pre2864

6. cat /etc/portage/package.keywords (to get an overview of what is used from masked):
app-crypt/ccid ~amd64
app-emulation/emul-linux-x86-baselibs
app-emulation/emul-linux-x86-compat
app-emulation/emul-linux-x86-gtklibs
app-emulation/emul-linux-x86-medialibs
app-emulation/emul-linux-x86-sdl
app-emulation/emul-linux-x86-soundlibs
app-emulation/emul-linux-x86-xlibs
=app-emulation/virtualbox-bin-3.1.4* ~amd64
=app-emulation/virtualbox-modules-3.1.4* ~amd64
app-emulation/wine ~amd64
=app-text/acroread-9.1* ~amd64
app-text/pdftk ~amd64
dev-db/pysql ~amd64
dev-libs/opensc ~amd64
dev-python/cx-oracle ~amd64
=dev-util/kbuild-0.1.5* ~amd64
media-gfx/picasa ~amd64
media-gfx/rawstudio ~amd64
net-wireless/iwl3945-ucode ~amd64
=net-wireless/wpa_supplicant-0.6.9* ~amd64
sys-apps/baselayout ~amd64
sys-apps/openrc ~amd64
sys-apps/pcsc-lite ~amd64
=sys-apps/sysvinit-2.87* ~amd64
sys-cluster/util-vserver ~amd64
=sys-fs/cryptsetup-1.0.7* ~amd64
>=sys-fs/lvm2-2.02.56-r1 ~amd64
=sys-kernel/gentoo-sources-2.6.32* ~amd64
sys-kernel/vserver-sources ~amd64
www-apache/mod_wsgi ~amd64
x11-wm/fluxbox ~amd64


- Guests:
=========

I've created the template from stage3, that can be found on mirrors (for example: http://www.gentoo.sk/pub/releases/amd64/current-stage3/hardened/).
Here is the info from within the "RAW" guest template (only package.use varies among guests)

1. emerge --info

Portage 2.1.7.17 (hardened/linux/amd64/10.0/no-multilib, gcc-4.3.4, glibc-2.10.1-r1, 2.6.33-vs2.3.0.36.30.3 x86_64)
=================================================================
System uname: Linux-2.6.33-vs2.3.0.36.30.3-x86_64-Intel-R-_Core-TM-2_Duo_CPU_T7300_@_2.00GHz-with-gentoo-2.0.0
Timestamp of tree: Sun, 14 Mar 2010 11:15:03 +0000
app-shells/bash:     4.0_p35
dev-lang/python:     2.6.4-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.6.0-r1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.10.3
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.3.4
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=core2 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news nodoc noinfo noman parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
GENTOO_MIRRORS="http://mirror.gentoo.sk/pub ftp://gentoo.mirror.web4u.cz/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="acl amd64 bash-completion berkdb bzip2 cli cracklib crypt cups cxx dri gdbm hardened iconv justify minimal mmx modules mudflap ncurses nls nptl nptlonly openmp pam pcre pic pppd readline reflection session spl sse sse2 sysfs tcpd vim-syntax xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="alias authz_host authz_owner authz_user autoindex dir env ext_filter         filter info log_config logio mime mime_magic negotiation rewrite setenvif status      unique_id userdir vhost_alias auth_digest" APACHE2_MPMS="worker" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa via vmware voodoo" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

2. cat /etc/portage/package.keywords 
# baselayout-2/openrc stuff
=sys-apps/makedev-3.23.1 ~amd64
sys-apps/openrc ~amd64
~sys-apps/baselayout-2.0.0 ~amd64
~sys-fs/udev-141 ~amd64
=sys-apps/sysvinit-2.86-r12 ~amd64

3. cat /etc/portage/package.unmask 
# we want portage-2.2
#=sys-apps/portage-2.2*

4. cat /etc/portage/package.use 
app-editors/vim -minimal
dev-lang/python ssl
dev-libs/libxml2 python
net-misc/wget ssl
sys-devel/gcc fortran
sys-libs/cracklib python
sys-libs/glibc glibc-omitfp
sys-process/vixie-cron -pam

Note that I also tried to build debian guest to check the hashify feature, works out of the box.

- Vserver configuration
=======================

Only things added into /etc/vserver/<vsX>:

1. ls -la /etc/vservers/ldap01/cgroup/
total 24
drwx------ 2 root root 4096 Mar 16 21:34 ./
drwx------ 7 root root 4096 Mar 16 21:37 ../
-rw------- 1 root root    4 Mar 16 20:59 cpu.shares
-rw------- 1 root root    2 Mar  9 22:40 cpuset.cpus
-rw------- 1 root root    5 Mar 16 21:25 memory.limit_in_bytes
-rw------- 1 root root    5 Mar 16 16:35 memory.memsw.limit_in_bytes

2. cat /etc/vservers/ldap01/cflags 
hideinfo
hide_vinfo
#hide_mount
virt_mem
virt_uptime
virt_cpu
virt_load

- Using cgroups:
================

If omitted, CGROUP based limit enforcement does not take place, however, the guest are runable.

1. mkdir /lib/udev/devices/cgroup (make it persistent across reboots)

2. mount -t cgroup none /dev/cgroup -o cpu,cpuset,memory,cpuacct,devices,freezer


- Creating guests
=================

vserver <VS_X> build -m clone 
  --context <XID> \
  --hostname <hostname> \
  --interface <iface:ip/net_bits> \
  --initstyle gentoo \
  -- -d gentoo --source /vservers/<LIVING_VS_TPL>

Note, that this guest will be actually copied not cloned using hashes (debian guest will uses hashes and COW links if the LIVING_VS_TPL is hashified).


I was rather long, but maybe helpfull :)
Comment 6 Pavol Dilung 2010-03-17 09:14:42 UTC
Created attachment 223981 [details]
Vserver-enabled kernel configuration for Dell Latitude d630
Comment 7 Benedikt Böhm (RETIRED) gentoo-dev 2010-04-04 06:41:25 UTC
in cvs now, thanks for testing