+2007-05-03 12:20 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * NEWS: Version 0.30.213.
+
+2007-05-03 12:13 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst: Add missing file.
+
+2007-05-02 20:11 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * configure.ac: Version 0.30.213.
+
+2007-04-27 09:08 Benedikt Böhm <hollow@gentoo.org>
+
+ * scripts/vserver.functions: fake init environment during shutdown,
+ otherwise rc just calls shutdown/halt which does not work without
+ init
+
+2007-04-27 09:02 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/gentoo/initpost, distrib/gentoo/initpre: add dummy net
+ dependency to default runlevel; dmesg/syslog is now handled in
+ baselayout
+
+2007-04-27 09:01 Benedikt Böhm <hollow@gentoo.org>
+
+ * src/chroot-sh.c: add link command to chroot-sh
+
+2007-04-27 08:42 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/gentoo/reboot.sh, distrib/gentoo/shutdown.sh: don't call
+ /halt/reboot -f for gentoo init style, but rather just exit,
+ since we would be killed by vshelper, does not matter for reboot
+ from inside: simple reboot wonÄt work with gentoo init style,
+ must use reboot -f inside
+
+2007-04-27 08:40 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/gentoo/initpre: fix distdir handling if prefix is not
+
+2007-04-21 14:06 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/cflags-v13.c, scripts/vshelper: Use the state change helper
+ to stop the guest when the last process exits.
+
+2007-04-21 14:05 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-build.template: Recognize the --nodevsanity
+ option.
+
+2007-04-21 14:04 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions: Don't do namespace cleanup if we're not in a
+ new namespace.
+
+2007-04-21 14:03 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/Makefile.am, distrib/centos5, distrib/centos5/pkgs,
+ distrib/centos5/yum, distrib/centos5/yum.repos.d,
+ distrib/centos5/yum.repos.d/CentOS-Base.repo,
+ distrib/centos5/yum/yum.conf: Add CentOS 5.
+
+2007-04-13 10:46 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/etch/vserver-config.sh: remove interactive setup steps
+
+2007-04-13 09:02 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/Makefile.am, distrib/etch, distrib/etch/initpost,
+ distrib/etch/vserver-config.sh, distrib/misc/debootstrap.mirror,
+ scripts/vserver-build.debootstrap: add build scripts for debian
+ etch
+
+2007-04-11 18:14 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vyum-worker: Fix typo.
+
+2007-04-11 17:55 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/misc/debootstrap.uri: New debootstrap.
+
+2007-04-08 00:40 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vlogin.c: terminal_copy doesn't return void anymore.
+
+2007-04-08 00:39 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/Makefile.am: Add shutdown.sh and reboot.sh to the
+ Makefile.
+
+2007-03-27 18:00 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/gentoo/initpost, distrib/gentoo/initpre,
+ distrib/gentoo/reboot.sh, distrib/gentoo/shutdown.sh: force
+ halt/reboot if using gentoo init style, enable syslog stub by
+ default for gentoo guests
+
+2007-03-24 12:54 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-build.debootstrap: Get rid of the work directory
+ on success.
+
+2007-03-21 04:46 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver: Fix help message.
+
+2007-03-20 20:38 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-build.debootstrap: Fix problems with debootstrap
+ on Ubuntu.
+
+2007-03-20 17:47 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-build.debootstrap: Remove the guest in case of
+ failure.
+
+2007-03-18 22:15 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/pkgmgmt: Supply the required argument.
+
+2007-03-18 22:02 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-setup.functions: nodev: shouldn't be in the ip
+ file.
+
+2007-03-18 17:51 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * gentoo/util-vserver: Verbosify initscript.
+
+2007-03-18 15:32 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions, scripts/pkgmgmt, scripts/vserver,
+ scripts/vserver-build.functions, scripts/vsomething: Rename
+ _setVserverDir to _setVserverDirName.
+ Rename _getVserverDir to _setVserverDir.
+ Add _setVserverName to set VSERVER_NAME.
+ pkgmgmt.initVariables cannot run before _setVserverDirName, and
+ the initialization must happen once per guest.
+
+2007-03-18 15:04 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vlogin.c: Attempt to fix the endless loop of select() read().
+
+2007-03-18 11:51 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * sysv/util-vserver: Create the directories here for strange
+ distros (e.g. Ubuntu).
+
+2007-03-11 21:25 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.functions: Fix IPv6 address assignment.
+
+2007-03-09 21:07 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/misc/debootstrap.uri: Update the debootstrap URI.
+
+2007-03-07 20:33 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vsched.c: Fix idle-time.
+
+2007-02-26 20:18 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/gentoo/init-vserver.sh, scripts/vserver.functions: Make
+ the gentoo initstyle work with baselayout-vserver.
+
+2007-02-25 14:06 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions, scripts/vserver.stop, scripts/vshelper: Don't
+ tell init to shutdown if we're called from vshelper, that
+ should've already happened.
+ Kill init and other remaining processes from vshelper once the
+ stop sync signal has arrived.
+
+2007-02-25 01:44 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.functions: Add $__LOCKDIR and /tmp to the
+ excluded paths.
+
+2007-02-24 23:43 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * configure.ac: Fix help message for --with-initscripts.
+
+2007-02-24 20:03 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/Makefile.am: Move the Gentoo in-guest scripts to *_DATA,
+ so rpm doesn't process them for deps.
+
+2007-02-24 20:03 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * m4/ensc_pathprog.m4: Fix the symlink problems.
+
+2007-02-22 05:18 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall-alternative.h: Update to latest shiny.
+
+2007-02-21 20:07 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-setup.functions: Update help message to
+ correspond better with reality.
+
+2007-02-20 17:33 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * ensc_wrappers/wrappers-vserver.hc, lib/syscall_ctxmigrate-v21.hc,
+ lib/syscall_ctxmigrate.c, lib/vserver.h,
+ lib_internal/switchtowatchxid.c, src/rpm-fake-resolver.c,
+ src/rpm-fake.c, src/vcontext.c: Add support for the migration
+ flags.
+
+2007-02-17 19:10 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-setup.functions: Make nodev: silence the warning.
+
+2007-02-17 19:01 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall-alternative.h: Update to latest shiny.
+
+2007-02-14 19:32 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions: &>> doesn't exist.
+
+2007-02-14 19:24 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall-alternative.h: Update to latest shiny.
+
+2007-02-11 20:21 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions: Work better if the default tty is a file by
+ using /dev/null for input and appending the output.
+
+2007-02-11 20:16 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall-alternative.h: Update to shiny15.
+
+2007-02-11 00:45 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-build.clone, src/vclone.c: Remove the --source
+ and --dest "options" from vclone, both are required.
+ Catch error conditions about the arguments in vclone.
+ Attempt to figure out where the source if it's not a directory,
+ and make sure it is one before running vclone.
+
+2007-02-10 15:06 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/getxidtype.c: Xid 65535 is a static one when dynamic ones are
+ disabled.
+
+2007-02-09 06:17 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.functions: Add /usr/bin to exception list, to
+ make sure we keep the /usr mount around.
+
+2007-02-05 20:59 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/Makefile-files, src/vkill.c: Fix the last, horribly broken
+ commit.
+
+2007-02-05 20:45 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vdevmap.c: Really silence the warning.
+
+2007-02-05 20:40 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vkill.c: Try to figure out the xid if not specified.
+
+2007-02-05 20:39 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vdevmap.c: Silence warning.
+
+2007-02-05 20:39 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/gentoo/net.vserver: Make distrib/gentoo/net.vserver
+ non-executable so RPM doesn't pick up a dependency on
+ /sbin/runscript.
+
+2007-02-05 18:08 Benedikt Böhm <hollow@gentoo.org>
+
+ * scripts/vdispatch-conf, scripts/vesync, scripts/vupdateworld: fix
+ vsomething arguments in gentoo wrappers
+
+2007-02-04 17:18 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+
+ * lib_internal/unify-copy.c: - documented parts of the code were I
+ needed to think >1min about its
+ sense
+ - use ftruncate(2) instead of a lseek(2)+write(2) sequence to
+ create a
+ sparse file
+ - set O_NOCTTY flag for temp file
+
+2007-02-04 17:17 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+
+ * lib_internal/testsuite/sigbus.c: - reworked the large pagesize
+ patch; it seems to be always PAGESIZE*2+1
+ bytes required to trigger a SIGBUS. Since PAGESIZE is not
+ available
+ directly, use sysconf(3) to get this value and memset(3) to
+ initialize
+ buffer
+ - removed byte crap
+
+2007-02-01 12:56 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * sysv/Makefile-files: Add missing hunk from the Gentoo initscripts
+ commit.
+
+2007-01-29 23:37 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * Makefile.am, configure.ac, gentoo, gentoo/Makefile-files,
+ gentoo/util-vserver, gentoo/vprocunhide, gentoo/vservers.default,
+ util-vserver.spec.in: Add Gentoo initscripts.
+ Force sysv initscripts for the RPMs.
+
+2007-01-29 02:06 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.stop, scripts/vserver.suexec: There's no need to
+ enter the filesystem namespaces twice.
+
+2007-01-28 11:35 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/secure-mount.c: When we call the external mount, we need to
+ preserve all of the options so it can parse them on its own.
+ The option defaults should set nodev in the flags.
+
+2007-01-27 23:16 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst: vserver-copy is legacy, put the
+ man page in the same package.
+
+2007-01-27 11:10 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst, distrib/Makefile.am,
+ distrib/misc/context.start, doc/configuration.xml,
+ scripts/vserver-setup.functions: Move dynamic context generation
+ to userspace.
+
+2007-01-27 10:20 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver-setup.functions: Set nodev rather than just
+ warning about it.
+
+2007-01-27 10:05 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib_internal/unify.h: Actually check the mtime when it's not
+ optional.
+
+2007-01-27 09:38 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib_internal/unify.h, src/vhashify.c, src/vhashify.h: Add an
+ option (--ignore-mtime) to vhashify to hashify files with
+ differing mtimes.
+
+2007-01-25 13:14 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * doc/configuration.xml: Add entries that were missing from
+ .defaults.
+
+2007-01-25 09:51 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/chxid.c, src/fstool.c, src/fstool.h: Add option to chxid to
+ skip unified files.
+
+2007-01-23 16:43 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vclone.c: Don't overwrite files that already exist.
+
+2007-01-23 16:41 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/Makefile.am, distrib/gentoo/initpost,
+ distrib/gentoo/initpre, distrib/gentoo/net.vserver: cleanup
+ gentoo/initpost; add fixes for syslog-ng.conf and net dependency
+ in baselayout >= 1.13
+
+2007-01-21 20:17 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/Makefile-files: ... and the Makefile.
+
+2007-01-21 20:06 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst: Add the build method to the
+ manifest too.
+
+2007-01-21 20:05 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst,
+ scripts/util-vserver-vars.pathsubst, scripts/vserver-build,
+ scripts/vserver-build.clone: Add the clone build method.
+
+2007-01-21 18:26 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * ensc_wrappers/wrappers-unistd.hc, lib_internal/pathinfo.h,
+ src/Makefile-files, src/vclone.c: Add vclone, to help with
+ cloning guests.
+
+2007-01-21 08:02 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.start, src/vsysctl.c: If it doesn't exist, only
+ error if requested.
+
+2007-01-20 17:31 Benedikt Böhm <hollow@gentoo.org>
+
+ * distrib/gentoo/initpost: fix runlevel scripts for older
+ baselayouts too; set hostname inside the guest
+
+2007-01-20 13:55 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/checkconfig.c: Return 0 on any error, older kernels will
+ return -EPERM for unknown syscalls.
+
+2007-01-20 09:36 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * doc/configuration.xml: Document the configuration for vdevmap.
+
+2007-01-20 09:25 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * doc/configuration.xml: Place-holder documentation for now, until
+ some better descriptions comes along.
+
+2007-01-20 07:43 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib_internal/testsuite/sigbus.c: Add patch from David Woodhouse
+ to work with 64 KiB pages.
+
+2007-01-18 16:35 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/util-vserver-vars.pathsubst, scripts/vserver.functions,
+ sysv/util-vserver: Add support for vdevmap in the configuration.
+
+2007-01-18 16:33 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vsysctl.c: Fix logic error.
+
+2007-01-18 13:38 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst,
+ scripts/util-vserver-vars.pathsubst, scripts/vserver.start,
+ src/Makefile-files, src/vsysctl.c: Add support for setting sysctl
+ values in the configuration.
+
+2007-01-18 07:56 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+
+ * contrib/Makefile-files, contrib/yum-3.0.3-chroot.patch: added
+ patch for yum-3.0.3
+
+2007-01-18 04:38 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.functions: Remove the disk limits after saving
+ them.
+
+2007-01-17 09:56 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/vserver.h: Add VC_VXSM_MSEC.
+
+2007-01-17 09:56 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall_setsched-v21.hc: Use VCMD_set_sched_v4 as intended.
+
+2007-01-17 09:54 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * configure.ac, m4/ensc_dietlibc.m4: Remove the dietlibc sanity
+ check function, as what it's doing is already done elsewhere.
+
+2007-01-14 12:30 Benedikt Böhm <hollow@gentoo.org>
+
+ * scripts/vupdateworld: fix missing world target in vupdateworld
+
+2007-01-10 22:23 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * util-vserver.spec.in: Teach the spec how to build prereleases and
+ release candidates.
+
+2007-01-10 19:27 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vserver-stat.c: The new method doesn't need to be a
+ spectator, and /proc/virtual isn't available there by default.
+
+2007-01-10 18:53 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * kernel/sched_cmd.h, lib/Makefile-files, lib/issupported.c,
+ lib/issupportedstring.c, lib/syscall_schedinfo-v21.hc,
+ lib/syscall_schedinfo.c, lib/vserver.h, src/vserver-stat.c: Add
+ vc_sched_info API.
+ Make vserver-stat use the various APIs instead of parsing
+ per-process /proc entries.
+
+ vc_virt_stat.uptime is a uint64_t.
+ vc_get_dlimit can handle a NULL limits argument.
+
+2007-01-10 18:49 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall.c, src/rpm-fake.c, src/vcontext.c: There is no
+ vc_create_context. Stop referencing it.
+
+2007-01-10 11:52 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.stop: Remove persistent on stop.
+
+2007-01-09 13:22 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/syscall-wrap.h, lib/vserver-internal.h,
+ lib_internal/sys_clone.h, lib_internal/sys_personality.h,
+ m4/ensc_dietlibc.m4: Check if dietlibc declares syscall
+ incompatibly, to avoid errors.
+ Move the syscall declaration to lib/syscall-wrap.h.
+
+2007-01-07 22:27 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * sysv/util-vserver: Fix output.
+
+2007-01-03 11:55 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/getvserverbyctx.c: Support legacy guests on 2.6 kernels as
+ well.
+
+2007-01-02 20:54 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.start: The CHBIND_OPTS need to be cleaned before
+ handing them to $_CHBIND_COMPAT, let $_CHBIND do that.
+
+2007-01-01 19:37 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * configure.ac: Let glibc use the alternative syscalls as well.
+
+2006-12-30 00:52 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/vserver.h: Organize things. Structures and functions dealing
+ with similar things are now grouped together.
+
+2006-12-30 00:40 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions: Use status for the process count instead since
+ persistent adds a task there.
+
+2006-12-30 00:37 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src: Add vdevmap to ignore.
+
+2006-12-29 20:34 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * sysv/util-vserver: Return a sane value from kill_contexts.
+
+2006-12-29 20:33 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * lib/vserver-internal.h: Use the correct type for the
+ configuration bitfield.
+
+2006-12-29 20:32 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * util-vserver.spec.in: Add util-vserver initscript handling.
+ Add %changelog comment.
+
+2006-12-29 20:30 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst: Add vdevmap.
+
+2006-12-28 00:07 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * contrib/manifest.dat.pathsubst, scripts/Makefile-files,
+ scripts/util-vserver-vars.pathsubst,
+ scripts/vserver-init.functions, scripts/vserver-wrapper,
+ sysv/Makefile-files, sysv/util-vserver, sysv/vprocunhide: Move
+ initscript functions to vserver-init.functions.
+ Make vprocunhide use said functions.
+ Add an initscript to set the helper and kill guest processes.
+
+2006-12-28 00:05 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * util-vserver.spec.in: Add --without doc and --with legacy
+ options.
+
+2006-12-20 13:39 Benedikt Böhm <hollow@gentoo.org>
+
+ * scripts/vserver-wrapper: cosmetic fixes for vserver-wrapper
+
+2006-12-19 19:18 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/fstool.c, src/fstool.h, src/setattr.c: Add --immutable,
+ --~immutable and --!immutable.
+
+2006-12-18 11:26 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/vserver.functions: Don't check the VLAN stuff if
+ novlandev was specified.
+
+2006-12-12 13:18 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * src/vdevmap.c: Error on too many arguments.
+
+2006-12-12 13:18 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * distrib/misc/debootstrap.uri: Update debootstrap URL.
+
+2006-12-12 01:39 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * kernel/device_cmd.h, kernel/switch.h, lib/Makefile-files,
+ lib/syscall_setmapping-v21.hc, lib/syscall_setmapping.c,
+ lib/virtual.h, lib/vserver.h, src/Makefile-files, src/vdevmap.c:
+ Add vdevmap and required functionality.
+
+2006-12-10 17:45 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * scripts/functions: Improve the vshelper warning (common sign of
+ multiple installs).
+
+2006-12-10 12:56 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+
+ * contrib/yum-2.6.0-chroot.patch, contrib/yum-2.9.6-chroot.patch:
+ fixed location of the lockfile; formerly, the chroot path was
+ prepended
+ twice
+
+2006-12-10 00:57 Daniel Hokka Zakrisson <daniel@hozac.com>
+
+ * sysv/vservers-legacy: Don't enable the legacy initscript by
+ default.
+
2006-12-09 16:13 Daniel Hokka Zakrisson <daniel@hozac.com>
* NEWS, THANKS, configure.ac: Version 0.30.212.
-## $Id: Makefile.am 2367 2006-11-03 19:59:15Z dhozac $
+## $Id: Makefile.am 2482 2007-01-29 23:37:07Z dhozac $
# Copyright (C) 2003,2004,2005,2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
include $(top_srcdir)/ensc_fmt/Makefile-files
include $(top_srcdir)/lib_internal/Makefile-files
include $(top_srcdir)/vserver-start/Makefile-files
+include $(top_srcdir)/gentoo/Makefile-files
include $(top_srcdir)/m4/gpgsig.am
include $(top_srcdir)/m4/validate.am
src/mask2prefix$(EXEEXT) src/exec-ulimit$(EXEEXT) \
src/rpm-fake-resolver$(EXEEXT) src/vshelper-sync$(EXEEXT) \
src/sigexec$(EXEEXT) src/chbind-compat$(EXEEXT) \
- $(am__EXEEXT_8) $(am__EXEEXT_9) $(am__EXEEXT_10) \
- $(am__EXEEXT_11)
+ src/vsysctl$(EXEEXT) $(am__EXEEXT_8) $(am__EXEEXT_9) \
+ $(am__EXEEXT_10) $(am__EXEEXT_11)
legacy_PROGRAMS = src/ifspec$(EXEEXT) src/listdevip$(EXEEXT) \
src/parserpmdump$(EXEEXT) src/rebootmgr$(EXEEXT) \
src/showperm$(EXEEXT) src/vreboot$(EXEEXT)
src/vrsetup$(EXEEXT) src/vsched$(EXEEXT) \
src/vserver-stat$(EXEEXT) src/vserver-info$(EXEEXT) \
src/vuname$(EXEEXT) src/vwait$(EXEEXT) src/ncontext$(EXEEXT) \
- src/nattribute$(EXEEXT) src/naddress$(EXEEXT) $(am__EXEEXT_9) \
- $(am__EXEEXT_12)
+ src/nattribute$(EXEEXT) src/naddress$(EXEEXT) \
+ src/vdevmap$(EXEEXT) $(am__EXEEXT_9) $(am__EXEEXT_12)
noinst_PROGRAMS = tests/escaperoot$(EXEEXT) tests/forkbomb$(EXEEXT) \
tests/testipc$(EXEEXT) tests/testlimit$(EXEEXT) \
tests/testopenf$(EXEEXT) $(am__EXEEXT_6)
$(top_srcdir)/ensc_fmt/Makefile-files \
$(top_srcdir)/ensc_vector/Makefile-files \
$(top_srcdir)/ensc_wrappers/Makefile-files \
+ $(top_srcdir)/gentoo/Makefile-files \
$(top_srcdir)/lib/Makefile-files \
$(top_srcdir)/lib/apidoc/Doxyfile.in \
$(top_srcdir)/lib_internal/Makefile-files \
@HAVE_XSLTP_TRUE@am__append_8 = $(doc_gen_DOCS)
@HAVE_XSLTPROC_TRUE@@HAVE_XSLTP_FALSE@am__append_9 = $(doc_gen_DOCS)
-@ENSC_USE_GLIBC_TRUE@am__append_10 = $(LIBENSCVECTOR_GLIBC)
-@ENSC_USE_DIETLIBC_TRUE@am__append_11 = $(LIBENSCVECTOR_DIET)
-@USE_DIETLIBC_TRUE@am__append_12 = $(LIBINTERNAL_DIET)
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_13 = lib_internal/testsuite/filecfg-ml \
+@HAVE_SYSV_INIT_TRUE@am__append_10 = $(sysv_conf_DTA)
+@HAVE_SYSV_INIT_TRUE@am__append_11 = $(sysv_src_SCRPTS) \
+@HAVE_SYSV_INIT_TRUE@ $(sysv_gen_SCRPTS)
+
+@ENSC_USE_GLIBC_TRUE@am__append_12 = $(LIBENSCVECTOR_GLIBC)
+@ENSC_USE_DIETLIBC_TRUE@am__append_13 = $(LIBENSCVECTOR_DIET)
+@USE_DIETLIBC_TRUE@am__append_14 = $(LIBINTERNAL_DIET)
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_15 = lib_internal/testsuite/filecfg-ml \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/copy \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/isnumber \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/isnumber-gnu \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/sigbus \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/sigbus-gnu
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_14 = lib_internal/testsuite/filecfg-ml \
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_16 = lib_internal/testsuite/filecfg-ml \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/copy-check \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/isnumber \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/isnumber-gnu \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/sigbus \
@ENSC_HAVE_C99_COMPILER_TRUE@ lib_internal/testsuite/sigbus-gnu
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_15 = vserver-start/vserver.start.bin
-@ENSC_HAVE_C99_COMPILER_TRUE@am__append_16 = vserver-start/vserver.start.bin
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_17 = vserver-start/vserver.start.bin
+@ENSC_HAVE_C99_COMPILER_TRUE@am__append_18 = vserver-start/vserver.start.bin
+@HAVE_GENTOO_INIT_TRUE@am__append_19 = $(gentoo_src_SCRPTS)
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ensc_cflags.m4 \
lib/syscall_getspacemask.c lib/syscall_getspacemask-v21.hc \
lib/syscall_enternamespace-v21.hc \
lib/syscall_setnamespace-v21.hc lib/syscall_ctxmigrate-v21.hc \
+ lib/syscall_setmapping.c lib/syscall_setmapping-v21.hc \
+ lib/syscall_schedinfo.c lib/syscall_schedinfo-v21.hc \
ensc_fmt/fmt-32.c ensc_fmt/fmt-64.c ensc_fmt/fmtx-32.c \
ensc_fmt/fmtx-64.c ensc_fmt/fmt-tai64n.c ensc_fmt/fmt.h \
ensc_fmt/fmt.hc ensc_fmt/fmtx.hc ensc_fmt/fmt-internal.h
lib/lib_libvserver_a-syscall_getvci.$(OBJEXT) \
lib/lib_libvserver_a-syscall_virtstat.$(OBJEXT) \
lib/lib_libvserver_a-syscall_ctxstat.$(OBJEXT) \
- lib/lib_libvserver_a-syscall_getspacemask.$(OBJEXT)
+ lib/lib_libvserver_a-syscall_getspacemask.$(OBJEXT) \
+ lib/lib_libvserver_a-syscall_setmapping.$(OBJEXT) \
+ lib/lib_libvserver_a-syscall_schedinfo.$(OBJEXT)
am__objects_8 = ensc_fmt/lib_libvserver_a-fmt-32.$(OBJEXT) \
ensc_fmt/lib_libvserver_a-fmt-64.$(OBJEXT) \
ensc_fmt/lib_libvserver_a-fmtx-32.$(OBJEXT) \
lib/syscall_getspacemask.c lib/syscall_getspacemask-v21.hc \
lib/syscall_enternamespace-v21.hc \
lib/syscall_setnamespace-v21.hc lib/syscall_ctxmigrate-v21.hc \
+ lib/syscall_setmapping.c lib/syscall_setmapping-v21.hc \
+ lib/syscall_schedinfo.c lib/syscall_schedinfo-v21.hc \
ensc_fmt/fmt-32.c ensc_fmt/fmt-64.c ensc_fmt/fmtx-32.c \
ensc_fmt/fmtx-64.c ensc_fmt/fmt-tai64n.c ensc_fmt/fmt.h \
ensc_fmt/fmt.hc ensc_fmt/fmtx.hc ensc_fmt/fmt-internal.h
lib/lib_libvserver_la-syscall_getvci.lo \
lib/lib_libvserver_la-syscall_virtstat.lo \
lib/lib_libvserver_la-syscall_ctxstat.lo \
- lib/lib_libvserver_la-syscall_getspacemask.lo
+ lib/lib_libvserver_la-syscall_getspacemask.lo \
+ lib/lib_libvserver_la-syscall_setmapping.lo \
+ lib/lib_libvserver_la-syscall_schedinfo.lo
am__objects_25 = ensc_fmt/lib_libvserver_la-fmt-32.lo \
ensc_fmt/lib_libvserver_la-fmt-64.lo \
ensc_fmt/lib_libvserver_la-fmtx-32.lo \
legacyPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
am__EXEEXT_6 = tests/getctx$(EXEEXT) tests/getinitpid$(EXEEXT) \
tests/vserver-info$(EXEEXT)
-am__EXEEXT_7 = src/vunify$(EXEEXT) src/vcopy$(EXEEXT)
+am__EXEEXT_7 = src/vunify$(EXEEXT) src/vcopy$(EXEEXT) \
+ src/vclone$(EXEEXT)
@ENSC_HAVE_C99_COMPILER_TRUE@am__EXEEXT_8 = $(am__EXEEXT_7)
@ENSC_HAVE_CXX_COMPILER_TRUE@am__EXEEXT_9 = $(am__EXEEXT_1)
@ENSC_HAVE_BEECRYPT_TRUE@@ENSC_HAVE_C99_COMPILER_TRUE@am__EXEEXT_10 = src/vhashify$(EXEEXT)
am_src_vattribute_OBJECTS = src/vattribute.$(OBJEXT)
src_vattribute_OBJECTS = $(am_src_vattribute_OBJECTS)
src_vattribute_DEPENDENCIES = $(am__DEPENDENCIES_11)
+am_src_vclone_OBJECTS = src/vclone.$(OBJEXT)
+src_vclone_OBJECTS = $(am_src_vclone_OBJECTS)
+src_vclone_DEPENDENCIES = $(am__DEPENDENCIES_9) $(am__DEPENDENCIES_11)
am_src_vcontext_OBJECTS = src/vcontext.$(OBJEXT) src/vlogin.$(OBJEXT)
src_vcontext_OBJECTS = $(am_src_vcontext_OBJECTS)
src_vcontext_DEPENDENCIES = $(am__DEPENDENCIES_11) \
am_src_vcopy_OBJECTS = src/vcopy.$(OBJEXT)
src_vcopy_OBJECTS = $(am_src_vcopy_OBJECTS)
src_vcopy_DEPENDENCIES = $(am__DEPENDENCIES_9) $(am__DEPENDENCIES_11)
+am_src_vdevmap_OBJECTS = src/vdevmap.$(OBJEXT)
+src_vdevmap_OBJECTS = $(am_src_vdevmap_OBJECTS)
+src_vdevmap_DEPENDENCIES = $(am__DEPENDENCIES_11) \
+ $(am__DEPENDENCIES_9)
am_src_vdlimit_OBJECTS = src/vdlimit.$(OBJEXT)
src_vdlimit_OBJECTS = $(am_src_vdlimit_OBJECTS)
src_vdlimit_DEPENDENCIES = $(am__DEPENDENCIES_11)
am_src_vshelper_sync_OBJECTS = src/vshelper-sync.$(OBJEXT)
src_vshelper_sync_OBJECTS = $(am_src_vshelper_sync_OBJECTS)
src_vshelper_sync_LDADD = $(LDADD)
+am_src_vsysctl_OBJECTS = src/vsysctl.$(OBJEXT)
+src_vsysctl_OBJECTS = $(am_src_vsysctl_OBJECTS)
+src_vsysctl_DEPENDENCIES = $(am__DEPENDENCIES_11)
am_src_vuname_OBJECTS = src/vuname.$(OBJEXT)
src_vuname_OBJECTS = $(am_src_vuname_OBJECTS)
src_vuname_DEPENDENCIES = $(am__DEPENDENCIES_11)
$(src_testsuite_hashcalc_plain_SOURCES) \
$(src_testsuite_rpm_fake_test_SOURCES) \
$(src_testsuite_vunify_functest_SOURCES) \
- $(src_vattribute_SOURCES) $(src_vcontext_SOURCES) \
- $(src_vcopy_SOURCES) $(src_vdlimit_SOURCES) $(src_vdu_SOURCES) \
- $(src_vhashify_SOURCES) $(src_vkill_SOURCES) \
- $(src_vlimit_SOURCES) $(src_vnamespace_SOURCES) \
- $(src_vps_SOURCES) $(src_vreboot_SOURCES) src/vrsetup.c \
- $(src_vsched_SOURCES) $(src_vserver_info_SOURCES) \
- $(src_vserver_stat_SOURCES) $(src_vshelper_sync_SOURCES) \
+ $(src_vattribute_SOURCES) $(src_vclone_SOURCES) \
+ $(src_vcontext_SOURCES) $(src_vcopy_SOURCES) \
+ $(src_vdevmap_SOURCES) $(src_vdlimit_SOURCES) \
+ $(src_vdu_SOURCES) $(src_vhashify_SOURCES) \
+ $(src_vkill_SOURCES) $(src_vlimit_SOURCES) \
+ $(src_vnamespace_SOURCES) $(src_vps_SOURCES) \
+ $(src_vreboot_SOURCES) src/vrsetup.c $(src_vsched_SOURCES) \
+ $(src_vserver_info_SOURCES) $(src_vserver_stat_SOURCES) \
+ $(src_vshelper_sync_SOURCES) $(src_vsysctl_SOURCES) \
$(src_vuname_SOURCES) $(src_vunify_SOURCES) \
$(src_vwait_SOURCES) $(tests_escaperoot_SOURCES) \
$(tests_forkbomb_SOURCES) $(tests_getctx_SOURCES) \
$(src_testsuite_hashcalc_plain_SOURCES) \
$(src_testsuite_rpm_fake_test_SOURCES) \
$(src_testsuite_vunify_functest_SOURCES) \
- $(src_vattribute_SOURCES) $(src_vcontext_SOURCES) \
- $(src_vcopy_SOURCES) $(src_vdlimit_SOURCES) $(src_vdu_SOURCES) \
- $(src_vhashify_SOURCES) $(src_vkill_SOURCES) \
- $(src_vlimit_SOURCES) $(src_vnamespace_SOURCES) \
- $(src_vps_SOURCES) $(src_vreboot_SOURCES) src/vrsetup.c \
- $(src_vsched_SOURCES) $(src_vserver_info_SOURCES) \
- $(src_vserver_stat_SOURCES) $(src_vshelper_sync_SOURCES) \
+ $(src_vattribute_SOURCES) $(src_vclone_SOURCES) \
+ $(src_vcontext_SOURCES) $(src_vcopy_SOURCES) \
+ $(src_vdevmap_SOURCES) $(src_vdlimit_SOURCES) \
+ $(src_vdu_SOURCES) $(src_vhashify_SOURCES) \
+ $(src_vkill_SOURCES) $(src_vlimit_SOURCES) \
+ $(src_vnamespace_SOURCES) $(src_vps_SOURCES) \
+ $(src_vreboot_SOURCES) src/vrsetup.c $(src_vsched_SOURCES) \
+ $(src_vserver_info_SOURCES) $(src_vserver_stat_SOURCES) \
+ $(src_vshelper_sync_SOURCES) $(src_vsysctl_SOURCES) \
$(src_vuname_SOURCES) $(src_vunify_SOURCES) \
$(src_vwait_SOURCES) $(tests_escaperoot_SOURCES) \
$(tests_forkbomb_SOURCES) $(tests_getctx_SOURCES) \
GPG_KEY = @GPG_KEY@
GREP = @GREP@
GZIP = @GZIP@
+HAVE_GENTOO_INIT_FALSE = @HAVE_GENTOO_INIT_FALSE@
+HAVE_GENTOO_INIT_TRUE = @HAVE_GENTOO_INIT_TRUE@
HAVE_SVN2CL_FALSE = @HAVE_SVN2CL_FALSE@
HAVE_SVN2CL_TRUE = @HAVE_SVN2CL_TRUE@
+HAVE_SYSV_INIT_FALSE = @HAVE_SYSV_INIT_FALSE@
+HAVE_SYSV_INIT_TRUE = @HAVE_SYSV_INIT_TRUE@
HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
HAVE_XSLTP_FALSE = @HAVE_XSLTP_FALSE@
lib_internal/util-perror.h lib_internal/util-safechdir.h \
lib_internal/util-unixsock.h lib_internal/string.hc
noinst_LIBRARIES = $(ENSC_VECTOR_LIBS) $(LIBINTERNAL_GLIBC) \
- $(am__append_12)
+ $(am__append_14)
lib_LIBRARIES = $(am__append_2)
lib_LTLIBRARIES = $(LIBVSERVER_GLIBC)
pkglib_LTLIBRARIES = src/rpm-fake.la
sbin_SCRIPTS = $(scripts_sbin_src_PRGS) $(scripts_sbin_gen_PRGS) \
$(scripts_legacy_src_PRGS)
noinst_DATA = $(contrib_gen_DTA)
-initrd_SCRIPTS = $(sysv_src_SCRPTS) $(sysv_gen_SCRPTS)
-sysconf_DATA = $(sysv_conf_DTA)
+initrd_SCRIPTS = $(am__append_11) $(am__append_19)
+sysconf_DATA = $(am__append_10)
DIETPROGS = $(LIBENSCVECTOR_DIET) lib/lib_libvserver_a-% \
ensc_fmt/lib_libvserver_a-% lib/testsuite/cflags \
lib/testsuite/personality lib/testsuite/fmt \
src/rpm-fake-resolver src/vcontext src/vcopy src/vkill \
src/vsched src/vshelper-sync src/vrsetup src/vserver-stat \
src/vserver-info src/vdlimit src/vdu src/vwait src/ncontext \
- src/nattribute src/naddress $(am__append_3) $(tests_dietprogs) \
+ src/nattribute src/naddress src/vdevmap src/vsysctl src/vclone \
+ $(am__append_3) $(tests_dietprogs) \
lib_internal/libinternal-diet.a \
lib_internal/testsuite/isnumber lib_internal/testsuite/sigbus \
- $(am__append_15)
+ $(am__append_17)
BUILT_SOURCES = pathconfig.h \
.fixups
contrib/make-manifest contrib/yum-2.2.1-chroot.patch \
contrib/yum-2.3.2-chroot.patch contrib/yum-2.3.3-chroot.patch \
contrib/yum-2.3.4-chroot.patch contrib/yum-2.6.0-chroot.patch \
- contrib/yum-2.9.6-chroot.patch \
- lib_internal/testsuite/copy-check $(addsuffix .pc.subst, \
- $(PKGCONFIG_FILES))
+ contrib/yum-2.9.6-chroot.patch contrib/yum-3.0.3-chroot.patch \
+ lib_internal/testsuite/copy-check $(gentoo_src_SCRPTS) \
+ $(addsuffix .pc.subst, $(PKGCONFIG_FILES))
check_SCRIPTS = $(src_testsuite_check_src_SCRPTS) \
$(src_testsuite_check_gen_SCRPTS)
TESTS_DEBUG = no
$(src_testsuite_check_active_PRGS) \
$(src_testsuite_check_src_SCRPTS) \
$(src_testsuite_check_gen_SCRPTS) ensc_vector/testsuite/test1 \
- ensc_vector/testsuite/test2 $(am__append_14)
+ ensc_vector/testsuite/test2 $(am__append_16)
TESTS_ENVIRONMENT = \
ensc_use_expensive_tests="$(ENSC_USE_EXPENSIVE_TESTS)" \
ensc_test_debug="$(TESTS_DEBUG)" \
scripts/legacy/save_s_context scripts/legacy/vserver \
scripts/legacy/rootshell scripts/legacy/vserver-copy \
scripts/legacy/vserverkillall $(sysv_src_SCRPTS) \
- $(sysv_gen_SCRPTS) vserver-start/vserver.start.bin
+ $(sysv_gen_SCRPTS) vserver-start/vserver.start.bin \
+ $(gentoo_src_SCRPTS)
@USE_DIETLIBC_TRUE@DIET_CC := $(DIET) $(DIETFLAGS) $(CC)
@USE_DIETLIBC_FALSE@VSERVER_LDFLGS :=
@USE_DIETLIBC_TRUE@VSERVER_LDFLGS := -static
lib/syscall_getspacemask-v21.hc \
lib/syscall_enternamespace-v21.hc \
lib/syscall_setnamespace-v21.hc \
- lib/syscall_ctxmigrate-v21.hc
+ lib/syscall_ctxmigrate-v21.hc \
+ lib/syscall_setmapping.c \
+ lib/syscall_setmapping-v21.hc \
+ lib/syscall_schedinfo.c \
+ lib/syscall_schedinfo-v21.hc
PKGCONFIG_FILES = lib/util-vserver
lib_SRCS = lib/syscall.c \
lib_testsuite_parselimit_CPPFLAGS = $(AM_CPPFLAGS) -DENSC_TESTSUITE
src_sbin_CXX_PROGS =
src_pkglib_CXX_PROGS =
-src_pkglib_C99_PROGS = src/vunify src/vcopy
+src_pkglib_C99_PROGS = src/vunify src/vcopy src/vclone
src_capchroot_SOURCES = src/capchroot.c
src_capchroot_LDADD = $(VSERVER_LDADDS)
src_capchroot_LDFLAGS = $(VSERVER_LDFLGS)
src_reducecap_LDFLAGS = $(VSERVER_LDFLGS)
src_vkill_SOURCES = src/vkill.c
src_vkill_LDADD = $(VSERVER_LDADDS)
-src_vkill_LDFLAGS = $(VSERVER_LDFLGS)
+src_vkill_LDFLAGS = $(VSERVER_LDFLGS) $(LIBINTERNAL)
src_vkill_CPPFLAGS = $(AM_CPPFLAGS) -DLEGACYDIR=\"$(legacydir)\"
src_vlimit_SOURCES = src/vlimit.c
src_vlimit_LDADD = $(VSERVER_LDADDS)
src_naddress_SOURCES = src/naddress.c
src_naddress_LDADD = $(VSERVER_LDADDS) $(LIBINTERNAL)
src_naddress_LDFLAGS = $(VSERVER_LDFLGS)
+src_vdevmap_SOURCES = src/vdevmap.c
+src_vdevmap_LDADD = $(VSERVER_LDADDS) $(LIBINTERNAL)
+src_vdevmap_LDFLAGS = $(VSERVER_LDFLGS)
+src_vsysctl_SOURCES = src/vsysctl.c
+src_vsysctl_LDADD = $(VSERVER_LDADDS)
+src_vsysctl_LDFLAGS = $(VSERVER_LDFLGS)
+src_vclone_SOURCES = src/vclone.c
+src_vclone_LDADD = $(LIBINTERNAL) $(VSERVER_LDADDS)
+src_vclone_LDFLAGS = $(VSERVER_LDLFGS)
@ENSC_HAVE_C99_COMPILER_FALSE@src_sbin_C99_X_PROGS =
@ENSC_HAVE_C99_COMPILER_TRUE@src_sbin_C99_X_PROGS = $(src_sbin_C99_PROGS)
@ENSC_HAVE_C99_COMPILER_FALSE@src_pkglib_C99_X_PROGS =
scripts/vserver-build.yum \
scripts/vserver-build.template \
scripts/vserver-build.rsync \
+ scripts/vserver-build.clone \
scripts/vserver-build.functions \
scripts/vserver-build.functions.apt \
scripts/vserver-build.functions.rpm \
scripts/vserver.start \
scripts/vserver.stop \
scripts/vserver.suexec \
- scripts/vserver.delete
+ scripts/vserver.delete \
+ scripts/vserver-init.functions
scripts_pkglib_gen_DTA = scripts/util-vserver-vars
scripts_pkglib_src_SCRPTS = scripts/pkgmgmt \
sysv_src_SCRPTS = sysv/rebootmgr \
sysv/vprocunhide \
sysv/vservers-default \
- sysv/vservers-legacy
+ sysv/vservers-legacy \
+ sysv/util-vserver
sysv_gen_SCRPTS = sysv/v_gated \
sysv/v_httpd \
libensc_vector_glibc_a_CPPFLAGS = $(AM_CPPFLAGS)
libensc_vector_diet_a_SOURCES = $(ENSC_VECTOR_SRCS)
libensc_vector_diet_a_CPPFLAGS = $(AM_CPPFLAGS)
-ENSC_VECTOR_LIBS = $(am__append_10) $(am__append_11)
+ENSC_VECTOR_LIBS = $(am__append_12) $(am__append_13)
@ENSC_USE_GLIBC_FALSE@LIBENSCVECTOR_GLIBC = lib-glibc-not-enabled-error.a
@ENSC_USE_GLIBC_TRUE@LIBENSCVECTOR_GLIBC = libensc_vector-glibc.a
@ENSC_USE_DIETLIBC_FALSE@LIBENSCVECTOR_DIET = lib-dietlibc-not-enabled-error.a
$(LIBENSCVECTOR)
vserver_start_vserver_start_bin_LDFLAGS = $(VSERVER_LDFLGS)
+gentoo_src_SCRPTS = gentoo/vprocunhide \
+ gentoo/vservers.default \
+ gentoo/util-vserver
+
BAD_INC_PATHS = /usr/include|/usr/local/include
BAD_LIB_PATHS = /usr/lib
pkgconfdir = $(libdir)/pkgconfig
.SUFFIXES: .c .lo .o .obj
am--refresh:
@:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/lib/Makefile-files $(srcdir)/lib/apidoc/Makefile-files $(srcdir)/lib/testsuite/Makefile-files $(top_srcdir)/src/Makefile-files $(top_srcdir)/src/testsuite/Makefile-files $(top_srcdir)/doc/Makefile-files $(top_srcdir)/man/Makefile-files $(top_srcdir)/scripts/Makefile-files $(top_srcdir)/tests/Makefile-files $(top_srcdir)/sysv/Makefile-files $(top_srcdir)/contrib/Makefile-files $(top_srcdir)/ensc_vector/Makefile-files $(srcdir)/ensc_vector/testsuite/Makefile-files $(top_srcdir)/ensc_wrappers/Makefile-files $(top_srcdir)/ensc_fmt/Makefile-files $(top_srcdir)/lib_internal/Makefile-files $(top_srcdir)/lib_internal/testsuite/Makefile-files $(top_srcdir)/vserver-start/Makefile-files $(top_srcdir)/m4/gpgsig.am $(top_srcdir)/m4/validate.am $(top_srcdir)/m4/changelog.am $(top_srcdir)/m4/pkgconfig.am $(top_srcdir)/m4/libsel.am $(top_srcdir)/m4/install-notify.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/lib/Makefile-files $(srcdir)/lib/apidoc/Makefile-files $(srcdir)/lib/testsuite/Makefile-files $(top_srcdir)/src/Makefile-files $(top_srcdir)/src/testsuite/Makefile-files $(top_srcdir)/doc/Makefile-files $(top_srcdir)/man/Makefile-files $(top_srcdir)/scripts/Makefile-files $(top_srcdir)/tests/Makefile-files $(top_srcdir)/sysv/Makefile-files $(top_srcdir)/contrib/Makefile-files $(top_srcdir)/ensc_vector/Makefile-files $(srcdir)/ensc_vector/testsuite/Makefile-files $(top_srcdir)/ensc_wrappers/Makefile-files $(top_srcdir)/ensc_fmt/Makefile-files $(top_srcdir)/lib_internal/Makefile-files $(top_srcdir)/lib_internal/testsuite/Makefile-files $(top_srcdir)/vserver-start/Makefile-files $(top_srcdir)/gentoo/Makefile-files $(top_srcdir)/m4/gpgsig.am $(top_srcdir)/m4/validate.am $(top_srcdir)/m4/changelog.am $(top_srcdir)/m4/pkgconfig.am $(top_srcdir)/m4/libsel.am $(top_srcdir)/m4/install-notify.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
lib/$(DEPDIR)/$(am__dirstamp)
lib/lib_libvserver_a-syscall_getspacemask.$(OBJEXT): \
lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp)
+lib/lib_libvserver_a-syscall_setmapping.$(OBJEXT): \
+ lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp)
+lib/lib_libvserver_a-syscall_schedinfo.$(OBJEXT): lib/$(am__dirstamp) \
+ lib/$(DEPDIR)/$(am__dirstamp)
ensc_fmt/$(am__dirstamp):
@$(mkdir_p) ensc_fmt
@: > ensc_fmt/$(am__dirstamp)
lib/$(DEPDIR)/$(am__dirstamp)
lib/lib_libvserver_la-syscall_getspacemask.lo: lib/$(am__dirstamp) \
lib/$(DEPDIR)/$(am__dirstamp)
+lib/lib_libvserver_la-syscall_setmapping.lo: lib/$(am__dirstamp) \
+ lib/$(DEPDIR)/$(am__dirstamp)
+lib/lib_libvserver_la-syscall_schedinfo.lo: lib/$(am__dirstamp) \
+ lib/$(DEPDIR)/$(am__dirstamp)
ensc_fmt/lib_libvserver_la-fmt-32.lo: ensc_fmt/$(am__dirstamp) \
ensc_fmt/$(DEPDIR)/$(am__dirstamp)
ensc_fmt/lib_libvserver_la-fmt-64.lo: ensc_fmt/$(am__dirstamp) \
src/vattribute$(EXEEXT): $(src_vattribute_OBJECTS) $(src_vattribute_DEPENDENCIES) src/$(am__dirstamp)
@rm -f src/vattribute$(EXEEXT)
$(LINK) $(src_vattribute_LDFLAGS) $(src_vattribute_OBJECTS) $(src_vattribute_LDADD) $(LIBS)
+src/vclone.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/vclone$(EXEEXT): $(src_vclone_OBJECTS) $(src_vclone_DEPENDENCIES) src/$(am__dirstamp)
+ @rm -f src/vclone$(EXEEXT)
+ $(LINK) $(src_vclone_LDFLAGS) $(src_vclone_OBJECTS) $(src_vclone_LDADD) $(LIBS)
src/vcontext.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/vlogin.$(OBJEXT): src/$(am__dirstamp) \
src/vcopy$(EXEEXT): $(src_vcopy_OBJECTS) $(src_vcopy_DEPENDENCIES) src/$(am__dirstamp)
@rm -f src/vcopy$(EXEEXT)
$(LINK) $(src_vcopy_LDFLAGS) $(src_vcopy_OBJECTS) $(src_vcopy_LDADD) $(LIBS)
+src/vdevmap.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/vdevmap$(EXEEXT): $(src_vdevmap_OBJECTS) $(src_vdevmap_DEPENDENCIES) src/$(am__dirstamp)
+ @rm -f src/vdevmap$(EXEEXT)
+ $(LINK) $(src_vdevmap_LDFLAGS) $(src_vdevmap_OBJECTS) $(src_vdevmap_LDADD) $(LIBS)
src/vdlimit.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/vdlimit$(EXEEXT): $(src_vdlimit_OBJECTS) $(src_vdlimit_DEPENDENCIES) src/$(am__dirstamp)
src/vshelper-sync$(EXEEXT): $(src_vshelper_sync_OBJECTS) $(src_vshelper_sync_DEPENDENCIES) src/$(am__dirstamp)
@rm -f src/vshelper-sync$(EXEEXT)
$(LINK) $(src_vshelper_sync_LDFLAGS) $(src_vshelper_sync_OBJECTS) $(src_vshelper_sync_LDADD) $(LIBS)
+src/vsysctl.$(OBJEXT): src/$(am__dirstamp) \
+ src/$(DEPDIR)/$(am__dirstamp)
+src/vsysctl$(EXEEXT): $(src_vsysctl_OBJECTS) $(src_vsysctl_DEPENDENCIES) src/$(am__dirstamp)
+ @rm -f src/vsysctl$(EXEEXT)
+ $(LINK) $(src_vsysctl_LDFLAGS) $(src_vsysctl_OBJECTS) $(src_vsysctl_LDADD) $(LIBS)
src/vuname.$(OBJEXT): src/$(am__dirstamp) \
src/$(DEPDIR)/$(am__dirstamp)
src/vuname$(EXEEXT): $(src_vuname_OBJECTS) $(src_vuname_DEPENDENCIES) src/$(am__dirstamp)
-rm -f lib/lib_libvserver_a-syscall_resetminmax.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_rlimit.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_rlimitstat.$(OBJEXT)
+ -rm -f lib/lib_libvserver_a-syscall_schedinfo.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setccaps.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setcflags.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setdlimit.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setiattr.$(OBJEXT)
+ -rm -f lib/lib_libvserver_a-syscall_setmapping.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setnamespace.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setncaps.$(OBJEXT)
-rm -f lib/lib_libvserver_a-syscall_setnflags.$(OBJEXT)
-rm -f lib/lib_libvserver_la-syscall_rlimit.lo
-rm -f lib/lib_libvserver_la-syscall_rlimitstat.$(OBJEXT)
-rm -f lib/lib_libvserver_la-syscall_rlimitstat.lo
+ -rm -f lib/lib_libvserver_la-syscall_schedinfo.$(OBJEXT)
+ -rm -f lib/lib_libvserver_la-syscall_schedinfo.lo
-rm -f lib/lib_libvserver_la-syscall_setccaps.$(OBJEXT)
-rm -f lib/lib_libvserver_la-syscall_setccaps.lo
-rm -f lib/lib_libvserver_la-syscall_setcflags.$(OBJEXT)
-rm -f lib/lib_libvserver_la-syscall_setdlimit.lo
-rm -f lib/lib_libvserver_la-syscall_setiattr.$(OBJEXT)
-rm -f lib/lib_libvserver_la-syscall_setiattr.lo
+ -rm -f lib/lib_libvserver_la-syscall_setmapping.$(OBJEXT)
+ -rm -f lib/lib_libvserver_la-syscall_setmapping.lo
-rm -f lib/lib_libvserver_la-syscall_setnamespace.$(OBJEXT)
-rm -f lib/lib_libvserver_la-syscall_setnamespace.lo
-rm -f lib/lib_libvserver_la-syscall_setncaps.$(OBJEXT)
-rm -f src/testsuite/rpm-fake-test.$(OBJEXT)
-rm -f src/testsuite/src_testsuite_vunify_functest-vunify-functest.$(OBJEXT)
-rm -f src/vattribute.$(OBJEXT)
+ -rm -f src/vclone.$(OBJEXT)
-rm -f src/vcontext.$(OBJEXT)
-rm -f src/vcopy.$(OBJEXT)
+ -rm -f src/vdevmap.$(OBJEXT)
-rm -f src/vdlimit.$(OBJEXT)
-rm -f src/vdu.$(OBJEXT)
-rm -f src/vhashify.$(OBJEXT)
-rm -f src/vserver-info.$(OBJEXT)
-rm -f src/vserver-stat.$(OBJEXT)
-rm -f src/vshelper-sync.$(OBJEXT)
+ -rm -f src/vsysctl.$(OBJEXT)
-rm -f src/vuname.$(OBJEXT)
-rm -f src/vunify.$(OBJEXT)
-rm -f src/vwait.$(OBJEXT)
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_resetminmax.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_rlimit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_rlimitstat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setccaps.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setcflags.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setdlimit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setiattr.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setnamespace.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setncaps.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_a-syscall_setnflags.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_resetminmax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_rlimit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_rlimitstat.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_schedinfo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setccaps.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setcflags.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setdlimit.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setiattr.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setmapping.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setnamespace.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setncaps.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lib_libvserver_la-syscall_setnflags.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_rpm_fake_la-rpm-fake.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/src_vkill-vkill.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vattribute.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vclone.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vcontext.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vcopy.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vdevmap.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vdlimit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vdu.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vhashify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vserver-info.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vserver-stat.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vshelper-sync.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vsysctl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vuname.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vunify.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/vwait.Po@am__quote@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_a-syscall_getspacemask.obj `if test -f 'lib/syscall_getspacemask.c'; then $(CYGPATH_W) 'lib/syscall_getspacemask.c'; else $(CYGPATH_W) '$(srcdir)/lib/syscall_getspacemask.c'; fi`
+lib/lib_libvserver_a-syscall_setmapping.o: lib/syscall_setmapping.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib/lib_libvserver_a-syscall_setmapping.o -MD -MP -MF "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Tpo" -c -o lib/lib_libvserver_a-syscall_setmapping.o `test -f 'lib/syscall_setmapping.c' || echo '$(srcdir)/'`lib/syscall_setmapping.c; \
+@am__fastdepCC_TRUE@ then mv -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Tpo" "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Po"; else rm -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/syscall_setmapping.c' object='lib/lib_libvserver_a-syscall_setmapping.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_a-syscall_setmapping.o `test -f 'lib/syscall_setmapping.c' || echo '$(srcdir)/'`lib/syscall_setmapping.c
+
+lib/lib_libvserver_a-syscall_setmapping.obj: lib/syscall_setmapping.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib/lib_libvserver_a-syscall_setmapping.obj -MD -MP -MF "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Tpo" -c -o lib/lib_libvserver_a-syscall_setmapping.obj `if test -f 'lib/syscall_setmapping.c'; then $(CYGPATH_W) 'lib/syscall_setmapping.c'; else $(CYGPATH_W) '$(srcdir)/lib/syscall_setmapping.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Tpo" "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Po"; else rm -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_setmapping.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/syscall_setmapping.c' object='lib/lib_libvserver_a-syscall_setmapping.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_a-syscall_setmapping.obj `if test -f 'lib/syscall_setmapping.c'; then $(CYGPATH_W) 'lib/syscall_setmapping.c'; else $(CYGPATH_W) '$(srcdir)/lib/syscall_setmapping.c'; fi`
+
+lib/lib_libvserver_a-syscall_schedinfo.o: lib/syscall_schedinfo.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib/lib_libvserver_a-syscall_schedinfo.o -MD -MP -MF "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Tpo" -c -o lib/lib_libvserver_a-syscall_schedinfo.o `test -f 'lib/syscall_schedinfo.c' || echo '$(srcdir)/'`lib/syscall_schedinfo.c; \
+@am__fastdepCC_TRUE@ then mv -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Tpo" "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Po"; else rm -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/syscall_schedinfo.c' object='lib/lib_libvserver_a-syscall_schedinfo.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_a-syscall_schedinfo.o `test -f 'lib/syscall_schedinfo.c' || echo '$(srcdir)/'`lib/syscall_schedinfo.c
+
+lib/lib_libvserver_a-syscall_schedinfo.obj: lib/syscall_schedinfo.c
+@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib/lib_libvserver_a-syscall_schedinfo.obj -MD -MP -MF "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Tpo" -c -o lib/lib_libvserver_a-syscall_schedinfo.obj `if test -f 'lib/syscall_schedinfo.c'; then $(CYGPATH_W) 'lib/syscall_schedinfo.c'; else $(CYGPATH_W) '$(srcdir)/lib/syscall_schedinfo.c'; fi`; \
+@am__fastdepCC_TRUE@ then mv -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Tpo" "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Po"; else rm -f "lib/$(DEPDIR)/lib_libvserver_a-syscall_schedinfo.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/syscall_schedinfo.c' object='lib/lib_libvserver_a-syscall_schedinfo.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_a-syscall_schedinfo.obj `if test -f 'lib/syscall_schedinfo.c'; then $(CYGPATH_W) 'lib/syscall_schedinfo.c'; else $(CYGPATH_W) '$(srcdir)/lib/syscall_schedinfo.c'; fi`
+
ensc_fmt/lib_libvserver_a-fmt-32.o: ensc_fmt/fmt-32.c
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ensc_fmt/lib_libvserver_a-fmt-32.o -MD -MP -MF "ensc_fmt/$(DEPDIR)/lib_libvserver_a-fmt-32.Tpo" -c -o ensc_fmt/lib_libvserver_a-fmt-32.o `test -f 'ensc_fmt/fmt-32.c' || echo '$(srcdir)/'`ensc_fmt/fmt-32.c; \
@am__fastdepCC_TRUE@ then mv -f "ensc_fmt/$(DEPDIR)/lib_libvserver_a-fmt-32.Tpo" "ensc_fmt/$(DEPDIR)/lib_libvserver_a-fmt-32.Po"; else rm -f "ensc_fmt/$(DEPDIR)/lib_libvserver_a-fmt-32.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_la-syscall_getspacemask.lo `test -f 'lib/syscall_getspacemask.c' || echo '$(srcdir)/'`lib/syscall_getspacemask.c
+lib/lib_libvserver_la-syscall_setmapping.lo: lib/syscall_setmapping.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib/lib_libvserver_la-syscall_setmapping.lo -MD -MP -MF "lib/$(DEPDIR)/lib_libvserver_la-syscall_setmapping.Tpo" -c -o lib/lib_libvserver_la-syscall_setmapping.lo `test -f 'lib/syscall_setmapping.c' || echo '$(srcdir)/'`lib/syscall_setmapping.c; \
+@am__fastdepCC_TRUE@ then mv -f "lib/$(DEPDIR)/lib_libvserver_la-syscall_setmapping.Tpo" "lib/$(DEPDIR)/lib_libvserver_la-syscall_setmapping.Plo"; else rm -f "lib/$(DEPDIR)/lib_libvserver_la-syscall_setmapping.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/syscall_setmapping.c' object='lib/lib_libvserver_la-syscall_setmapping.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_la-syscall_setmapping.lo `test -f 'lib/syscall_setmapping.c' || echo '$(srcdir)/'`lib/syscall_setmapping.c
+
+lib/lib_libvserver_la-syscall_schedinfo.lo: lib/syscall_schedinfo.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT lib/lib_libvserver_la-syscall_schedinfo.lo -MD -MP -MF "lib/$(DEPDIR)/lib_libvserver_la-syscall_schedinfo.Tpo" -c -o lib/lib_libvserver_la-syscall_schedinfo.lo `test -f 'lib/syscall_schedinfo.c' || echo '$(srcdir)/'`lib/syscall_schedinfo.c; \
+@am__fastdepCC_TRUE@ then mv -f "lib/$(DEPDIR)/lib_libvserver_la-syscall_schedinfo.Tpo" "lib/$(DEPDIR)/lib_libvserver_la-syscall_schedinfo.Plo"; else rm -f "lib/$(DEPDIR)/lib_libvserver_la-syscall_schedinfo.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lib/syscall_schedinfo.c' object='lib/lib_libvserver_la-syscall_schedinfo.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lib/lib_libvserver_la-syscall_schedinfo.lo `test -f 'lib/syscall_schedinfo.c' || echo '$(srcdir)/'`lib/syscall_schedinfo.c
+
ensc_fmt/lib_libvserver_la-fmt-32.lo: ensc_fmt/fmt-32.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(lib_libvserver_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ensc_fmt/lib_libvserver_la-fmt-32.lo -MD -MP -MF "ensc_fmt/$(DEPDIR)/lib_libvserver_la-fmt-32.Tpo" -c -o ensc_fmt/lib_libvserver_la-fmt-32.lo `test -f 'ensc_fmt/fmt-32.c' || echo '$(srcdir)/'`ensc_fmt/fmt-32.c; \
@am__fastdepCC_TRUE@ then mv -f "ensc_fmt/$(DEPDIR)/lib_libvserver_la-fmt-32.Tpo" "ensc_fmt/$(DEPDIR)/lib_libvserver_la-fmt-32.Plo"; else rm -f "ensc_fmt/$(DEPDIR)/lib_libvserver_la-fmt-32.Tpo"; exit 1; fi
esac
$(am__remove_distdir)
mkdir $(distdir)
- $(mkdir_p) $(distdir)/. $(distdir)/contrib $(distdir)/doc $(distdir)/ensc_fmt $(distdir)/ensc_vector $(distdir)/ensc_vector/testsuite $(distdir)/ensc_wrappers $(distdir)/kernel $(distdir)/lib $(distdir)/lib/apidoc $(distdir)/lib/testsuite $(distdir)/lib_internal $(distdir)/lib_internal/testsuite $(distdir)/m4 $(distdir)/man $(distdir)/scripts $(distdir)/scripts/legacy $(distdir)/src $(distdir)/src/testsuite $(distdir)/sysv $(distdir)/tests $(distdir)/vserver-start
+ $(mkdir_p) $(distdir)/. $(distdir)/contrib $(distdir)/doc $(distdir)/ensc_fmt $(distdir)/ensc_vector $(distdir)/ensc_vector/testsuite $(distdir)/ensc_wrappers $(distdir)/gentoo $(distdir)/kernel $(distdir)/lib $(distdir)/lib/apidoc $(distdir)/lib/testsuite $(distdir)/lib_internal $(distdir)/lib_internal/testsuite $(distdir)/m4 $(distdir)/man $(distdir)/scripts $(distdir)/scripts/legacy $(distdir)/src $(distdir)/src/testsuite $(distdir)/sysv $(distdir)/tests $(distdir)/vserver-start
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
+version 0.30.213
+================
+ - added support for the device mapping feature present in development
+ kernels.
+
+ - further improved Gentoo support, again thanks to Benedikt Böhm.
+
+ - support persistent contexts.
+
+ - add another initscript that creates directories, configures vshelper
+ as well as kills all contexts.
+
+ - new vserver-stat implementation, which uses the accounting APIs
+ available in Linux-VServer 2.2.
+
+ - added support for setting sysctl values in the guest configuration.
+
+ - added a clone build method, which simply links already unified files.
+
+ - implement dynamic contexts in userspace, generating a static one
+ during vserver ... build.
+
+ - fix the endless loop in vlogin.
+
+ - fix Ubuntu builds.
+
+ - improved support for Debian Etch, thanks to Benedikt Böhm.
+
+ - added CentOS 5.
+
+ - use the state change helper to try to cleanup after us if the guest
+ exited on its own.
+
version 0.30.212
================
- support for the Linux-VServer 2.1 API has been implemented.
/* Define to 1 if dietlibc supports C99 */
#undef ENSC_DIETLIBC_C99
+/* Define to 1 if dietlibc declares syscall */
+#undef ENSC_DIETLIBC_HAS_SYSCALL
+
/* define when <ext2fs/ext2_fs.h> is usable */
#undef ENSC_HAVE_EXT2FS_EXT2_FS_H
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for util-vserver 0.30.212.
+# Generated by GNU Autoconf 2.59 for util-vserver 0.30.213.
#
# Report bugs to <vserver@list.linux-vserver.org>.
#
# Identity of this package.
PACKAGE_NAME='util-vserver'
PACKAGE_TARNAME='util-vserver'
-PACKAGE_VERSION='0.30.212'
-PACKAGE_STRING='util-vserver 0.30.212'
+PACKAGE_VERSION='0.30.213'
+PACKAGE_STRING='util-vserver 0.30.213'
PACKAGE_BUGREPORT='vserver@list.linux-vserver.org'
ac_unique_file="src/capchroot.c"
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os GPG_KEY CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S ENSC_HAVE_CXX_COMPILER_TRUE ENSC_HAVE_CXX_COMPILER_FALSE ENSC_HAVE_C99_COMPILER_TRUE ENSC_HAVE_C99_COMPILER_FALSE ENSC_PATHPROG_SED CAT CHOWN CMP CP DIRNAME EGREP ENV GREP LN MKDIR MKFIFO MKTEMP MOUNT MV NICE PS RM RMDIR SED SH TAC TAR TOUCH TTY UMOUNT WC IP IPTABLES MODPROBE NAMEIF NOHUP RMMOD VCONFIG WGET FILE GZIP BZIP2 CPIO RESTORE RSYNC DOXYGEN XSLTP XSLTPROC HAVE_XSLTP_TRUE HAVE_XSLTP_FALSE HAVE_XSLTPROC_TRUE HAVE_XSLTPROC_FALSE LIB_DEBUG_CPPFLAGS ENSC_USE_EXPENSIVE_TESTS initrddir RELEASE_CPPFLAGS DIET DIETFLAGS USE_DIETLIBC_TRUE USE_DIETLIBC_FALSE USE_DIETLIBC_COMPAT_TRUE USE_DIETLIBC_COMPAT_FALSE ENSC_USE_DIETLIBC_TRUE ENSC_USE_DIETLIBC_FALSE ENSC_USE_GLIBC_TRUE ENSC_USE_GLIBC_FALSE ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL vserverdir SVN2CL HAVE_SVN2CL_TRUE HAVE_SVN2CL_FALSE ENSC_ENABLE_INTERNAL_HEADERS_TRUE ENSC_ENABLE_INTERNAL_HEADERS_FALSE ENSC_HAVE_BEECRYPT_TRUE ENSC_HAVE_BEECRYPT_FALSE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os GPG_KEY CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S ENSC_HAVE_CXX_COMPILER_TRUE ENSC_HAVE_CXX_COMPILER_FALSE ENSC_HAVE_C99_COMPILER_TRUE ENSC_HAVE_C99_COMPILER_FALSE ENSC_PATHPROG_SED CAT CHOWN CMP CP DIRNAME EGREP ENV GREP LN MKDIR MKFIFO MKTEMP MOUNT MV NICE PS RM RMDIR SED SH TAC TAR TOUCH TTY UMOUNT WC IP IPTABLES MODPROBE NAMEIF NOHUP RMMOD VCONFIG WGET FILE GZIP BZIP2 CPIO RESTORE RSYNC DOXYGEN XSLTP XSLTPROC HAVE_XSLTP_TRUE HAVE_XSLTP_FALSE HAVE_XSLTPROC_TRUE HAVE_XSLTPROC_FALSE LIB_DEBUG_CPPFLAGS ENSC_USE_EXPENSIVE_TESTS initrddir RELEASE_CPPFLAGS CPP DIET DIETFLAGS USE_DIETLIBC_TRUE USE_DIETLIBC_FALSE USE_DIETLIBC_COMPAT_TRUE USE_DIETLIBC_COMPAT_FALSE ENSC_USE_DIETLIBC_TRUE ENSC_USE_DIETLIBC_FALSE ENSC_USE_GLIBC_TRUE ENSC_USE_GLIBC_FALSE ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL vserverdir SVN2CL HAVE_SVN2CL_TRUE HAVE_SVN2CL_FALSE ENSC_ENABLE_INTERNAL_HEADERS_TRUE ENSC_ENABLE_INTERNAL_HEADERS_FALSE ENSC_HAVE_BEECRYPT_TRUE ENSC_HAVE_BEECRYPT_FALSE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE HAVE_GENTOO_INIT_TRUE HAVE_GENTOO_INIT_FALSE HAVE_SYSV_INIT_TRUE HAVE_SYSV_INIT_FALSE LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
ac_env_CFLAGS_value=$CFLAGS
ac_cv_env_CFLAGS_set=${CFLAGS+set}
ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
ac_env_DIET_set=${DIET+set}
ac_env_DIET_value=$DIET
ac_cv_env_DIET_set=${DIET+set}
ac_env_DIETFLAGS_value=$DIETFLAGS
ac_cv_env_DIETFLAGS_set=${DIETFLAGS+set}
ac_cv_env_DIETFLAGS_value=$DIETFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
ac_env_CXXCPP_set=${CXXCPP+set}
ac_env_CXXCPP_value=$CXXCPP
ac_cv_env_CXXCPP_set=${CXXCPP+set}
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures util-vserver 0.30.212 to adapt to many kinds of systems.
+\`configure' configures util-vserver 0.30.213 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of util-vserver 0.30.212:";;
+ short | recursive ) echo "Configuration of util-vserver 0.30.213:";;
esac
cat <<\_ACEOF
disable tests which might be expensive on some
systems (default: no)
--enable-release enable release mode (default: no)
- --disable-dietlibc do not use dietlibc resp. enforce its usage (with
- --enable-dietlibc) (default: autodetect dietlibc)
--disable-alternative-syscalls
do not use the alternative _syscallX macros provided
by Herbert Poetzl (default: use them)
+ --disable-dietlibc do not use dietlibc resp. enforce its usage (with
+ --enable-dietlibc) (default: autodetect dietlibc)
--enable-shared[=PKGS]
build shared libraries [default=yes]
--enable-static[=PKGS]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-initrddir <DIR> use <DIR> as directory for SysV init-files (default:
$sysconfdir/init.d)
+ --with-syscall=METHOD call syscall(2) with the specified METHOD; valid
+ values are 'fast', 'traditional' and 'auto'
+ (default: auto)
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-pic try to use only PIC/non-PIC objects [default=use
both]
--with-tags[=TAGS]
include additional configurations [automatic]
--with-vrootdir=DIR place vservers under DIR (default: /vservers)
- --with-syscall=METHOD call syscall(2) with the specified METHOD; valid
- values are 'fast', 'traditional' and 'auto'
- (default: auto)
+ --with-initscripts=TYPE force host initscripts; valid values are 'gentoo'
+ and 'sysv' (default: guess)
Some influential environment variables:
CXX C++ compiler command
headers in a nonstandard directory <include dir>
CC C compiler command
CFLAGS C compiler flags
+ CPP C preprocessor
DIET The 'diet' wrapper (default: diet)
DIETFLAGS Flags passed to the 'diet' wrapper (default: -O)
- CPP C preprocessor
CXXCPP C++ preprocessor
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-util-vserver configure 0.30.212
+util-vserver configure 0.30.213
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by util-vserver $as_me 0.30.212, which was
+It was created by util-vserver $as_me 0.30.213, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='util-vserver'
- VERSION='0.30.212'
+ VERSION='0.30.213'
cat >>confdefs.h <<_ACEOF
fi
fi
+ if test -e "${AWK}"; then
+ AWK=`readlink -f "${AWK}"`
+ fi
+
test "${AWK}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'AWK'@!${AWK}!g;"
test "${AWK}"
fi
fi
+ if test -e "${CAT}"; then
+ CAT=`readlink -f "${CAT}"`
+ fi
+
test "${CAT}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'CAT'@!${CAT}!g;"
test "${CAT}"
fi
fi
+ if test -e "${CHOWN}"; then
+ CHOWN=`readlink -f "${CHOWN}"`
+ fi
+
test "${CHOWN}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'CHOWN'@!${CHOWN}!g;"
test "${CHOWN}"
fi
fi
+ if test -e "${CMP}"; then
+ CMP=`readlink -f "${CMP}"`
+ fi
+
test "${CMP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'CMP'@!${CMP}!g;"
test "${CMP}"
fi
fi
+ if test -e "${CP}"; then
+ CP=`readlink -f "${CP}"`
+ fi
+
test "${CP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'CP'@!${CP}!g;"
test "${CP}"
fi
fi
+ if test -e "${DIRNAME}"; then
+ DIRNAME=`readlink -f "${DIRNAME}"`
+ fi
+
test "${DIRNAME}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'DIRNAME'@!${DIRNAME}!g;"
test "${DIRNAME}"
fi
fi
+ if test -e "${EGREP}"; then
+ EGREP=`readlink -f "${EGREP}"`
+ fi
+
test "${EGREP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'EGREP'@!${EGREP}!g;"
test "${EGREP}"
- env_old_searchpath="${ensc_searchpath}"
- ensc_searchpath="/bin:${ensc_searchpath:-$PATH}"
fi
fi
+ if test -e "${ENV}"; then
+ ENV=`readlink -f "${ENV}"`
+ fi
+
test "${ENV}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'ENV'@!${ENV}!g;"
test "${ENV}"
- ensc_searchpath="${env_old_searchpath}"
fi
fi
+ if test -e "${GREP}"; then
+ GREP=`readlink -f "${GREP}"`
+ fi
+
test "${GREP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'GREP'@!${GREP}!g;"
test "${GREP}"
fi
fi
+ if test -e "${LN}"; then
+ LN=`readlink -f "${LN}"`
+ fi
+
test "${LN}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'LN'@!${LN}!g;"
test "${LN}"
fi
fi
+ if test -e "${MKDIR}"; then
+ MKDIR=`readlink -f "${MKDIR}"`
+ fi
+
test "${MKDIR}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'MKDIR'@!${MKDIR}!g;"
test "${MKDIR}"
fi
fi
+ if test -e "${MKFIFO}"; then
+ MKFIFO=`readlink -f "${MKFIFO}"`
+ fi
+
test "${MKFIFO}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'MKFIFO'@!${MKFIFO}!g;"
test "${MKFIFO}"
fi
fi
+ if test -e "${MKTEMP}"; then
+ MKTEMP=`readlink -f "${MKTEMP}"`
+ fi
+
test "${MKTEMP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'MKTEMP'@!${MKTEMP}!g;"
test "${MKTEMP}"
fi
fi
+ if test -e "${MOUNT}"; then
+ MOUNT=`readlink -f "${MOUNT}"`
+ fi
+
test "${MOUNT}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'MOUNT'@!${MOUNT}!g;"
test "${MOUNT}"
fi
fi
+ if test -e "${MV}"; then
+ MV=`readlink -f "${MV}"`
+ fi
+
test "${MV}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'MV'@!${MV}!g;"
test "${MV}"
fi
fi
+ if test -e "${NICE}"; then
+ NICE=`readlink -f "${NICE}"`
+ fi
+
test "${NICE}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'NICE'@!${NICE}!g;"
test "${NICE}"
fi
fi
+ if test -e "${PS}"; then
+ PS=`readlink -f "${PS}"`
+ fi
+
test "${PS}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'PS'@!${PS}!g;"
test "${PS}"
fi
fi
+ if test -e "${RM}"; then
+ RM=`readlink -f "${RM}"`
+ fi
+
test "${RM}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'RM'@!${RM}!g;"
test "${RM}"
fi
fi
+ if test -e "${RMDIR}"; then
+ RMDIR=`readlink -f "${RMDIR}"`
+ fi
+
test "${RMDIR}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'RMDIR'@!${RMDIR}!g;"
test "${RMDIR}"
fi
fi
+ if test -e "${SED}"; then
+ SED=`readlink -f "${SED}"`
+ fi
+
test "${SED}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'SED'@!${SED}!g;"
test "${SED}"
fi
fi
+ if test -e "${SH}"; then
+ SH=`readlink -f "${SH}"`
+ fi
+
test "${SH}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'SH'@!${SH}!g;"
test "${SH}"
fi
fi
+ if test -e "${TAC}"; then
+ TAC=`readlink -f "${TAC}"`
+ fi
+
test "${TAC}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'TAC'@!${TAC}!g;"
test "${TAC}"
fi
fi
+ if test -e "${TAR}"; then
+ TAR=`readlink -f "${TAR}"`
+ fi
+
test "${TAR}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'TAR'@!${TAR}!g;"
test "${TAR}"
fi
fi
+ if test -e "${TOUCH}"; then
+ TOUCH=`readlink -f "${TOUCH}"`
+ fi
+
test "${TOUCH}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'TOUCH'@!${TOUCH}!g;"
test "${TOUCH}"
fi
fi
+ if test -e "${TTY}"; then
+ TTY=`readlink -f "${TTY}"`
+ fi
+
test "${TTY}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'TTY'@!${TTY}!g;"
test "${TTY}"
fi
fi
+ if test -e "${UMOUNT}"; then
+ UMOUNT=`readlink -f "${UMOUNT}"`
+ fi
+
test "${UMOUNT}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'UMOUNT'@!${UMOUNT}!g;"
test "${UMOUNT}"
fi
fi
+ if test -e "${WC}"; then
+ WC=`readlink -f "${WC}"`
+ fi
+
test "${WC}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'WC'@!${WC}!g;"
test "${WC}"
fi
fi
+ if test -e "${IP}"; then
+ IP=`readlink -f "${IP}"`
+ fi
+
test "${IP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'IP'@!${IP}!g;"
test "${IP}"
fi
fi
+ if test -e "${IPTABLES}"; then
+ IPTABLES=`readlink -f "${IPTABLES}"`
+ fi
+
test "${IPTABLES}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'IPTABLES'@!${IPTABLES}!g;"
test "${IPTABLES}"
fi
fi
+ if test -e "${MODPROBE}"; then
+ MODPROBE=`readlink -f "${MODPROBE}"`
+ fi
+
test "${MODPROBE}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'MODPROBE'@!${MODPROBE}!g;"
test "${MODPROBE}"
fi
fi
+ if test -e "${NAMEIF}"; then
+ NAMEIF=`readlink -f "${NAMEIF}"`
+ fi
+
test "${NAMEIF}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'NAMEIF'@!${NAMEIF}!g;"
test "${NAMEIF}"
fi
fi
+ if test -e "${NOHUP}"; then
+ NOHUP=`readlink -f "${NOHUP}"`
+ fi
+
test "${NOHUP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'NOHUP'@!${NOHUP}!g;"
test "${NOHUP}"
fi
fi
+ if test -e "${RMMOD}"; then
+ RMMOD=`readlink -f "${RMMOD}"`
+ fi
+
test "${RMMOD}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'RMMOD'@!${RMMOD}!g;"
test "${RMMOD}"
fi
fi
+ if test -e "${VCONFIG}"; then
+ VCONFIG=`readlink -f "${VCONFIG}"`
+ fi
+
test "${VCONFIG}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'VCONFIG'@!${VCONFIG}!g;"
test "${VCONFIG}"
fi
fi
+ if test -e "${WGET}"; then
+ WGET=`readlink -f "${WGET}"`
+ fi
+
test "${WGET}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'WGET'@!${WGET}!g;"
test "${WGET}"
fi
fi
+ if test -e "${FILE}"; then
+ FILE=`readlink -f "${FILE}"`
+ fi
+
test "${FILE}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'FILE'@!${FILE}!g;"
test "${FILE}"
fi
fi
+ if test -e "${GZIP}"; then
+ GZIP=`readlink -f "${GZIP}"`
+ fi
+
test "${GZIP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'GZIP'@!${GZIP}!g;"
test "${GZIP}"
fi
fi
+ if test -e "${BZIP2}"; then
+ BZIP2=`readlink -f "${BZIP2}"`
+ fi
+
test "${BZIP2}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'BZIP2'@!${BZIP2}!g;"
test "${BZIP2}"
fi
fi
+ if test -e "${CPIO}"; then
+ CPIO=`readlink -f "${CPIO}"`
+ fi
+
test "${CPIO}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'CPIO'@!${CPIO}!g;"
test "${CPIO}"
fi
fi
+ if test -e "${RESTORE}"; then
+ RESTORE=`readlink -f "${RESTORE}"`
+ fi
+
test "${RESTORE}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'RESTORE'@!${RESTORE}!g;"
test "${RESTORE}"
fi
fi
+ if test -e "${RSYNC}"; then
+ RSYNC=`readlink -f "${RSYNC}"`
+ fi
+
test "${RSYNC}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'RSYNC'@!${RSYNC}!g;"
test "${RSYNC}"
fi
fi
+ if test -e "${DOXYGEN}"; then
+ DOXYGEN=`readlink -f "${DOXYGEN}"`
+ fi
+
test "${DOXYGEN}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'DOXYGEN'@!${DOXYGEN}!g;"
test "${DOXYGEN}"
fi
fi
+ if test -e "${XSLTP}"; then
+ XSLTP=`readlink -f "${XSLTP}"`
+ fi
+
test "${XSLTP}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'XSLTP'@!${XSLTP}!g;"
test "${XSLTP}"
fi
fi
+ if test -e "${XSLTPROC}"; then
+ XSLTPROC=`readlink -f "${XSLTPROC}"`
+ fi
+
test "${XSLTPROC}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'XSLTPROC'@!${XSLTPROC}!g;"
test "${XSLTPROC}"
echo "${ECHO_T}$ensc_release_mode" >&6
+# HACK: This needs to be before ENSC_DIETLIBC_NEED_COMPAT, or the alternative
+# syscalls will never be enabled for glibc.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-case $host_cpu in
- (i*86|athlon) min_diet_ver=0.25;;
- (ia64|hppa*) min_diet_ver=0.29;;
- (sparc*) min_diet_ver=0.30;;
- (*) min_diet_ver=0.28;;
-esac
-
-
- echo "$as_me:$LINENO: checking whether to enable dietlibc" >&5
-echo $ECHO_N "checking whether to enable dietlibc... $ECHO_C" >&6
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
- : ${DIET:=diet}
- : ${DIETFLAGS=-Os}
+ done
+ ac_cv_prog_CPP=$CPP
- # Check whether --enable-dietlibc or --disable-dietlibc was given.
-if test "${enable_dietlibc+set}" = set; then
- enableval="$enable_dietlibc"
- case "$enableval" in
- (yes) use_dietlibc=forced;;
- (no) use_dietlibc=forced_no;;
- (*) { { echo "$as_me:$LINENO: error: '$enableval' is not a valid value for --enable-dietlibc" >&5
-echo "$as_me: error: '$enableval' is not a valid value for --enable-dietlibc" >&2;}
- { (exit 1); exit 1; }; };;
- esac
+fi
+ CPP=$ac_cv_prog_CPP
else
- which "$DIET" >/dev/null 2>/dev/null && use_dietlibc=detected || use_dietlibc=detected_no
-fi;
-
- if test "$use_dietlibc" = detected -a "$min_diet_ver"; then
- _dietlibc_ver=$($DIET -v 2>&1 | sed '1p;d')
- _dietlibc_ver=${_dietlibc_ver##*diet version }
- _dietlibc_ver=${_dietlibc_ver##*dietlibc-}
- _dietlibc_ver_maj=${_dietlibc_ver%%.*}
- _dietlibc_ver_min=${_dietlibc_ver##*.}
- _dietlibc_ver_min=${_dietlibc_ver_min%%[!0-9]*}
- _dietlibc_cmp="$min_diet_ver"
- _dietlibc_cmp_maj=${_dietlibc_cmp%%.*}
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+
+
+
+
+ echo "$as_me:$LINENO: checking for number of syscall 'vserver'" >&5
+echo $ECHO_N "checking for number of syscall 'vserver'... $ECHO_C" >&6
+if test "${ensc_cv_value_syscall_vserver+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+
+#ifdef ENSC_SYSCALL_FALLBACK
+# include ENSC_SYSCALL_FALLBACK
+#else
+# include <asm/unistd.h>
+#endif
+#ifdef __NR_vserver
+ensc_syscall_tmp_nr=__NR_vserver;
+ensc_syscall_tmp_src=ENSC_MARK
+#endif
+
+_ACEOF
+ ensc_syscall_tmp_nr=
+ ensc_syscall_tmp_src=
+ test x"$ensc_syscall_tmp_nr" != x || \
+ eval $($CPP $CPPFLAGS -D ENSC_MARK='glibc' conftest.c | $EGREP '^ensc_syscall_tmp_(nr=[1-9][0-9]*;|src=.*)$')
+ test x"$ensc_syscall_tmp_nr" != x -o x'lib/syscall-fallback.h' = x || \
+ eval $($CPP $CPPFLAGS -D ENSC_MARK='fallback' -D ENSC_SYSCALL_FALLBACK='"lib/syscall-fallback.h"' conftest.c | $EGREP '^ensc_syscall_tmp_(nr=[1-9][0-9]*;|src=.*)$')
+ test "$ensc_syscall_tmp_nr" || {
+ ensc_syscall_tmp_nr=273
+ ensc_syscall_tmp_src=default
+ }
+
+ if test x"$ensc_syscall_tmp_nr" = x; then
+ { { echo "$as_me:$LINENO: error: Can not determine value of __NR_vserver; please verify your glibc/kernelheaders, and/or set CPPFLAGS='-D__NR_vserver=<value>' environment when calling configure." >&5
+echo "$as_me: error: Can not determine value of __NR_vserver; please verify your glibc/kernelheaders, and/or set CPPFLAGS='-D__NR_vserver=<value>' environment when calling configure." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ ensc_cv_value_syscall_vserver="$ensc_syscall_tmp_nr/$ensc_syscall_tmp_src"
+
+fi
+echo "$as_me:$LINENO: result: $ensc_cv_value_syscall_vserver" >&5
+echo "${ECHO_T}$ensc_cv_value_syscall_vserver" >&6
+
+ ensc_syscall_tmp_nr=${ensc_cv_value_syscall_vserver%/*}
+ ensc_syscall_tmp_src=${ensc_cv_value_syscall_vserver#*/}
+
+ if test x"$ensc_syscall_tmp_src" != x'glibc'; then
+
+cat >>confdefs.h <<_ACEOF
+#define ENSC_SYSCALL__NR_vserver $ensc_syscall_tmp_nr
+_ACEOF
+
+ fi
+
+
+ echo "$as_me:$LINENO: checking whether to use alternative _syscallX macros" >&5
+echo $ECHO_N "checking whether to use alternative _syscallX macros... $ECHO_C" >&6
+ # Check whether --enable-alternative-syscalls or --disable-alternative-syscalls was given.
+if test "${enable_alternative_syscalls+set}" = set; then
+ enableval="$enable_alternative_syscalls"
+ case $enableval in
+ (yes|no) ensc_use_alternative_syscall_macros=$enableval;;
+ (*) { { echo "$as_me:$LINENO: error: '$enableval' is not a valid value for '--disable-alternative-syscalls'" >&5
+echo "$as_me: error: '$enableval' is not a valid value for '--disable-alternative-syscalls'" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+else
+ ensc_use_alternative_syscall_macros=yes
+fi;
+
+ case $ensc_use_alternative_syscall_macros in
+ (yes)
+cat >>confdefs.h <<\_ACEOF
+#define ENSC_USE_ALTERNATIVE_SYSCALL_MACROS 1
+_ACEOF
+;;
+ esac
+
+ echo "$as_me:$LINENO: result: $ensc_use_alternative_syscall_macros" >&5
+echo "${ECHO_T}$ensc_use_alternative_syscall_macros" >&6
+
+
+
+
+ echo "$as_me:$LINENO: checking for syscall(2) invocation method" >&5
+echo $ECHO_N "checking for syscall(2) invocation method... $ECHO_C" >&6
+
+# Check whether --with-syscall or --without-syscall was given.
+if test "${with_syscall+set}" = set; then
+ withval="$with_syscall"
+
+else
+ with_syscall=auto
+fi;
+ echo "$as_me:$LINENO: result: $with_syscall" >&5
+echo "${ECHO_T}$with_syscall" >&6
+
+ case x"$with_syscall" in
+ (xauto)
+ echo "$as_me:$LINENO: checking which syscall(2) invocation works" >&5
+echo $ECHO_N "checking which syscall(2) invocation works... $ECHO_C" >&6
+if test "${ensc_cv_test_syscall+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+#include "$srcdir/lib/syscall-wrap.h"
+#include <errno.h>
+
+#define __NR_foo0 300
+#define __NR_foo1 301
+#define __NR_foo2 302
+#define __NR_foo3 303
+#define __NR_foo4 304
+#define __NR_foo5 305
+inline static _syscall0(int, foo0)
+inline static _syscall1(int, foo1, int, a)
+inline static _syscall2(int, foo2, int, a, int, b)
+inline static _syscall3(int, foo3, int, a, int, b, int, c)
+inline static _syscall4(int, foo4, int, a, int, b, int, c, int, d)
+inline static _syscall5(int, foo5, int, a, int, b, int, c, int, d, int, e)
+
+int main() {
+ return foo0() || \
+ foo1(1) || \
+ foo2(1,2) || \
+ foo3(1,2,3) || \
+ foo4(1,2,3,4) || \
+ foo5(1,2,3,4,5);
+}
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ensc_cv_test_syscall=fast
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ensc_cv_test_syscall=traditional
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+fi
+echo "$as_me:$LINENO: result: $ensc_cv_test_syscall" >&5
+echo "${ECHO_T}$ensc_cv_test_syscall" >&6
+ with_syscall=$ensc_cv_test_syscall
+ ;;
+ (xfast|xtraditional)
+ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: '$with_syscall' is not a valid value for '--with-syscall'" >&5
+echo "$as_me: error: '$with_syscall' is not a valid value for '--with-syscall'" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if test x"$with_syscall $ensc_use_alternative_syscall_macros" = 'xfast yes'; then
+ with_syscall='alternative'
+ fi
+
+ if test x"$with_syscall" = xtraditional; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENSC_SYSCALL_TRADITIONAL 1
+_ACEOF
+
+ fi
+
+
+
+
+
+
+case $host_cpu in
+ (i*86|athlon) min_diet_ver=0.25;;
+ (ia64|hppa*) min_diet_ver=0.29;;
+ (sparc*) min_diet_ver=0.30;;
+ (x86_64) min_diet_ver=0.27;;
+ (*) min_diet_ver=0.28;;
+esac
+
+
+ echo "$as_me:$LINENO: checking whether to enable dietlibc" >&5
+echo $ECHO_N "checking whether to enable dietlibc... $ECHO_C" >&6
+
+
+
+
+ : ${DIET:=diet}
+ : ${DIETFLAGS=-Os}
+
+ # Check whether --enable-dietlibc or --disable-dietlibc was given.
+if test "${enable_dietlibc+set}" = set; then
+ enableval="$enable_dietlibc"
+ case "$enableval" in
+ (yes) use_dietlibc=forced;;
+ (no) use_dietlibc=forced_no;;
+ (*) { { echo "$as_me:$LINENO: error: '$enableval' is not a valid value for --enable-dietlibc" >&5
+echo "$as_me: error: '$enableval' is not a valid value for --enable-dietlibc" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+else
+ which "$DIET" >/dev/null 2>/dev/null && use_dietlibc=detected || use_dietlibc=detected_no
+fi;
+
+ if test "$use_dietlibc" = detected -a "$min_diet_ver"; then
+ _dietlibc_ver=$($DIET -v 2>&1 | sed '1p;d')
+ _dietlibc_ver=${_dietlibc_ver##*diet version }
+ _dietlibc_ver=${_dietlibc_ver##*dietlibc-}
+ _dietlibc_ver_maj=${_dietlibc_ver%%.*}
+ _dietlibc_ver_min=${_dietlibc_ver##*.}
+ _dietlibc_ver_min=${_dietlibc_ver_min%%[!0-9]*}
+ _dietlibc_cmp="$min_diet_ver"
+ _dietlibc_cmp_maj=${_dietlibc_cmp%%.*}
_dietlibc_cmp_min=${_dietlibc_cmp##*.}
ENSC_VERSION_DIETLIBC=$_dietlibc_ver_maj.$_dietlibc_ver_min
fi
- fi
-if test x"$ensc_have_dietlibc" = xno; then
- { echo "$as_me:$LINENO: WARNING: *** ***" >&5
-echo "$as_me: WARNING: *** ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** it is strongly recommended to link util-vserver against ***" >&5
-echo "$as_me: WARNING: *** it is strongly recommended to link util-vserver against ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** dietlibc; glibc's NSS functions are very unreliable in ***" >&5
-echo "$as_me: WARNING: *** dietlibc; glibc's NSS functions are very unreliable in ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** chroot() environments, so you have to expect problems ***" >&5
-echo "$as_me: WARNING: *** chroot() environments, so you have to expect problems ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** there. ***" >&5
-echo "$as_me: WARNING: *** there. ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** ***" >&5
-echo "$as_me: WARNING: *** ***" >&2;}
-if false; then
- USE_DIETLIBC_COMPAT_TRUE=
- USE_DIETLIBC_COMPAT_FALSE='#'
+ echo "$as_me:$LINENO: checking whether dietlibc declares syscall" >&5
+echo $ECHO_N "checking whether dietlibc declares syscall... $ECHO_C" >&6
+if test "${ensc_cv_c_dietlibc_syscall+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- USE_DIETLIBC_COMPAT_TRUE='#'
- USE_DIETLIBC_COMPAT_FALSE=
-fi
+ _ensc_dietlibc_syscall_old_CC="$CC"
+ CC="${DIET:-diet} $CC"
+
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+
+ #include <sys/syscall.h>
+ long int syscall(long int __sysno, ...);
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ensc_cv_c_dietlibc_syscall=no
else
- # HACK: libtool does not have cmdline options to build only
- # dynamic libraries; this can be done with the
- # '--disable-static' ./configure option only. As our static
- # libraries will be build with dietlibc, we have to do set
- # this option which is evaluated by 'AC_PROG_LIBTOOL'
- # below. Therefore, this macro must not be called earlier.
- enable_static=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ensc_cv_c_dietlibc_syscall=yes
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ CC="$_ensc_dietlibc_syscall_old_CC"
+fi
+echo "$as_me:$LINENO: result: $ensc_cv_c_dietlibc_syscall" >&5
+echo "${ECHO_T}$ensc_cv_c_dietlibc_syscall" >&6
+ if test x"$ensc_cv_c_dietlibc_syscall" = xyes; then
+ cat >>confdefs.h <<\_ACEOF
+#define ENSC_DIETLIBC_HAS_SYSCALL 1
+_ACEOF
- if test "$host_cpu" = x86_64 -a $ENSC_VERSION_DIETLIBC_NUM -le 0027; then
- { echo "$as_me:$LINENO: WARNING: *** ***" >&5
-echo "$as_me: WARNING: *** ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** dietlibc<=0.27 is known to be broken for x86_64 systems ***" >&5
-echo "$as_me: WARNING: *** dietlibc<=0.27 is known to be broken for x86_64 systems ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** please make sure that at least the environ.S fix is applied ***" >&5
-echo "$as_me: WARNING: *** please make sure that at least the environ.S fix is applied ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** and lib/__nice.c added ***" >&5
-echo "$as_me: WARNING: *** and lib/__nice.c added ***" >&2;}
- { echo "$as_me:$LINENO: WARNING: *** ***" >&5
-echo "$as_me: WARNING: *** ***" >&2;}
fi
+ fi
- echo "$as_me:$LINENO: checking whether to use alternative _syscallX macros" >&5
-echo $ECHO_N "checking whether to use alternative _syscallX macros... $ECHO_C" >&6
- # Check whether --enable-alternative-syscalls or --disable-alternative-syscalls was given.
-if test "${enable_alternative_syscalls+set}" = set; then
- enableval="$enable_alternative_syscalls"
- case $enableval in
- (yes|no) ensc_use_alternative_syscall_macros=$enableval;;
- (*) { { echo "$as_me:$LINENO: error: '$enableval' is not a valid value for '--disable-alternative-syscalls'" >&5
-echo "$as_me: error: '$enableval' is not a valid value for '--disable-alternative-syscalls'" >&2;}
- { (exit 1); exit 1; }; };;
- esac
-else
- ensc_use_alternative_syscall_macros=yes
-fi;
- case $ensc_use_alternative_syscall_macros in
- (yes)
-cat >>confdefs.h <<\_ACEOF
-#define ENSC_USE_ALTERNATIVE_SYSCALL_MACROS 1
-_ACEOF
-;;
- esac
+if test x"$ensc_have_dietlibc" = xno; then
+ { echo "$as_me:$LINENO: WARNING: *** ***" >&5
+echo "$as_me: WARNING: *** ***" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** it is strongly recommended to link util-vserver against ***" >&5
+echo "$as_me: WARNING: *** it is strongly recommended to link util-vserver against ***" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** dietlibc; glibc's NSS functions are very unreliable in ***" >&5
+echo "$as_me: WARNING: *** dietlibc; glibc's NSS functions are very unreliable in ***" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** chroot() environments, so you have to expect problems ***" >&5
+echo "$as_me: WARNING: *** chroot() environments, so you have to expect problems ***" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** there. ***" >&5
+echo "$as_me: WARNING: *** there. ***" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** ***" >&5
+echo "$as_me: WARNING: *** ***" >&2;}
+
- echo "$as_me:$LINENO: result: $ensc_use_alternative_syscall_macros" >&5
-echo "${ECHO_T}$ensc_use_alternative_syscall_macros" >&6
+if false; then
+ USE_DIETLIBC_COMPAT_TRUE=
+ USE_DIETLIBC_COMPAT_FALSE='#'
+else
+ USE_DIETLIBC_COMPAT_TRUE='#'
+ USE_DIETLIBC_COMPAT_FALSE=
+fi
+
+else
+ # HACK: libtool does not have cmdline options to build only
+ # dynamic libraries; this can be done with the
+ # '--disable-static' ./configure option only. As our static
+ # libraries will be build with dietlibc, we have to do set
+ # this option which is evaluated by 'AC_PROG_LIBTOOL'
+ # below. Therefore, this macro must not be called earlier.
+ enable_static=no
echo "$as_me:$LINENO: result: $SED" >&5
echo "${ECHO_T}$SED" >&6
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
- fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
-
-
# Check whether --with-gnu-ld or --without-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 10971 "configure"' > conftest.$ac_ext
+ echo '#line 11641 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
;;
-esac
-
-need_locks="$enable_libtool_lock"
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether non-existent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- # Broken: success on invalid input.
-continue
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
+esac
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
+need_locks="$enable_libtool_lock"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
echo "$as_me:$LINENO: checking for ANSI C header files" >&5
# Provide some information about the compiler.
-echo "$as_me:12105:" \
+echo "$as_me:12541:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13168: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13604: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13172: \$? = $ac_status" >&5
+ echo "$as_me:13608: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13436: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13872: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13440: \$? = $ac_status" >&5
+ echo "$as_me:13876: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13540: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13976: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13544: \$? = $ac_status" >&5
+ echo "$as_me:13980: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 15009 "configure"' > conftest.$ac_ext
+ echo '#line 15445 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 15906 "configure"
+#line 16342 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 16006 "configure"
+#line 16442 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18346: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18782: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:18350: \$? = $ac_status" >&5
+ echo "$as_me:18786: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:18450: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:18886: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:18454: \$? = $ac_status" >&5
+ echo "$as_me:18890: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 18986 "configure"' > conftest.$ac_ext
+ echo '#line 19422 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:20041: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:20477: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:20045: \$? = $ac_status" >&5
+ echo "$as_me:20481: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:20145: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:20581: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:20149: \$? = $ac_status" >&5
+ echo "$as_me:20585: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 21594 "configure"' > conftest.$ac_ext
+ echo '#line 22030 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:22369: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:22805: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:22373: \$? = $ac_status" >&5
+ echo "$as_me:22809: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:22637: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23073: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:22641: \$? = $ac_status" >&5
+ echo "$as_me:23077: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:22741: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:23177: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:22745: \$? = $ac_status" >&5
+ echo "$as_me:23181: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
libsuff=
case "$host_cpu" in
x86_64*|s390x*|powerpc64*)
- echo '#line 24210 "configure"' > conftest.$ac_ext
+ echo '#line 24646 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
-
-
- echo "$as_me:$LINENO: checking for number of syscall 'vserver'" >&5
-echo $ECHO_N "checking for number of syscall 'vserver'... $ECHO_C" >&6
-if test "${ensc_cv_value_syscall_vserver+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-
-#ifdef ENSC_SYSCALL_FALLBACK
-# include ENSC_SYSCALL_FALLBACK
-#else
-# include <asm/unistd.h>
-#endif
-#ifdef __NR_vserver
-ensc_syscall_tmp_nr=__NR_vserver;
-ensc_syscall_tmp_src=ENSC_MARK
-#endif
-
-_ACEOF
- ensc_syscall_tmp_nr=
- ensc_syscall_tmp_src=
- test x"$ensc_syscall_tmp_nr" != x || \
- eval $($CPP $CPPFLAGS -D ENSC_MARK='glibc' conftest.c | $EGREP '^ensc_syscall_tmp_(nr=[1-9][0-9]*;|src=.*)$')
- test x"$ensc_syscall_tmp_nr" != x -o x'lib/syscall-fallback.h' = x || \
- eval $($CPP $CPPFLAGS -D ENSC_MARK='fallback' -D ENSC_SYSCALL_FALLBACK='"lib/syscall-fallback.h"' conftest.c | $EGREP '^ensc_syscall_tmp_(nr=[1-9][0-9]*;|src=.*)$')
- test "$ensc_syscall_tmp_nr" || {
- ensc_syscall_tmp_nr=273
- ensc_syscall_tmp_src=default
- }
-
- if test x"$ensc_syscall_tmp_nr" = x; then
- { { echo "$as_me:$LINENO: error: Can not determine value of __NR_vserver; please verify your glibc/kernelheaders, and/or set CPPFLAGS='-D__NR_vserver=<value>' environment when calling configure." >&5
-echo "$as_me: error: Can not determine value of __NR_vserver; please verify your glibc/kernelheaders, and/or set CPPFLAGS='-D__NR_vserver=<value>' environment when calling configure." >&2;}
- { (exit 1); exit 1; }; }
- fi
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
- ensc_cv_value_syscall_vserver="$ensc_syscall_tmp_nr/$ensc_syscall_tmp_src"
-
-fi
-echo "$as_me:$LINENO: result: $ensc_cv_value_syscall_vserver" >&5
-echo "${ECHO_T}$ensc_cv_value_syscall_vserver" >&6
-
- ensc_syscall_tmp_nr=${ensc_cv_value_syscall_vserver%/*}
- ensc_syscall_tmp_src=${ensc_cv_value_syscall_vserver#*/}
-
- if test x"$ensc_syscall_tmp_src" != x'glibc'; then
-
-cat >>confdefs.h <<_ACEOF
-#define ENSC_SYSCALL__NR_vserver $ensc_syscall_tmp_nr
-_ACEOF
-
- fi
-
-
-
-
- echo "$as_me:$LINENO: checking for syscall(2) invocation method" >&5
-echo $ECHO_N "checking for syscall(2) invocation method... $ECHO_C" >&6
-
-# Check whether --with-syscall or --without-syscall was given.
-if test "${with_syscall+set}" = set; then
- withval="$with_syscall"
-
-else
- with_syscall=auto
-fi;
- echo "$as_me:$LINENO: result: $with_syscall" >&5
-echo "${ECHO_T}$with_syscall" >&6
-
- case x"$with_syscall" in
- (xauto)
- echo "$as_me:$LINENO: checking which syscall(2) invocation works" >&5
-echo $ECHO_N "checking which syscall(2) invocation works... $ECHO_C" >&6
-if test "${ensc_cv_test_syscall+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include "$srcdir/lib/syscall-wrap.h"
-#include <errno.h>
-
-#define __NR_foo0 300
-#define __NR_foo1 301
-#define __NR_foo2 302
-#define __NR_foo3 303
-#define __NR_foo4 304
-#define __NR_foo5 305
-inline static _syscall0(int, foo0)
-inline static _syscall1(int, foo1, int, a)
-inline static _syscall2(int, foo2, int, a, int, b)
-inline static _syscall3(int, foo3, int, a, int, b, int, c)
-inline static _syscall4(int, foo4, int, a, int, b, int, c, int, d)
-inline static _syscall5(int, foo5, int, a, int, b, int, c, int, d, int, e)
-
-int main() {
- return foo0() || \
- foo1(1) || \
- foo2(1,2) || \
- foo3(1,2,3) || \
- foo4(1,2,3,4) || \
- foo5(1,2,3,4,5);
-}
-
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ensc_cv_test_syscall=fast
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ensc_cv_test_syscall=traditional
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-echo "$as_me:$LINENO: result: $ensc_cv_test_syscall" >&5
-echo "${ECHO_T}$ensc_cv_test_syscall" >&6
- with_syscall=$ensc_cv_test_syscall
- ;;
- (xfast|xtraditional)
- ;;
- *)
- { { echo "$as_me:$LINENO: error: '$with_syscall' is not a valid value for '--with-syscall'" >&5
-echo "$as_me: error: '$with_syscall' is not a valid value for '--with-syscall'" >&2;}
- { (exit 1); exit 1; }; }
- ;;
- esac
-
- if test x"$with_syscall $ensc_use_alternative_syscall_macros" = 'xfast yes'; then
- with_syscall='alternative'
- fi
-
- if test x"$with_syscall" = xtraditional; then
-
-cat >>confdefs.h <<\_ACEOF
-#define ENSC_SYSCALL_TRADITIONAL 1
-_ACEOF
-
- fi
-
-
-
-
-
-
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+echo "$as_me:$LINENO: checking for host initscripts" >&5
+echo $ECHO_N "checking for host initscripts... $ECHO_C" >&6
+
+# Check whether --with-initscripts or --without-initscripts was given.
+if test "${with_initscripts+set}" = set; then
+ withval="$with_initscripts"
+
+ case "$withval" in
+ gentoo) ensc_with_init=gentoo;;
+ sysv) ensc_with_init=sysv;;
+ *) { { echo "$as_me:$LINENO: error: invalid initscripts value, only gentoo and sysv are supported" >&5
+echo "$as_me: error: invalid initscripts value, only gentoo and sysv are supported" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+
+else
+
+ if test -e /etc/gentoo-release; then
+ ensc_with_init=gentoo
+ else
+ ensc_with_init=sysv
+ fi
+
+fi;
+echo "$as_me:$LINENO: result: $ensc_with_init" >&5
+echo "${ECHO_T}$ensc_with_init" >&6
+
+
+if test x"$ensc_with_init" = xgentoo; then
+ HAVE_GENTOO_INIT_TRUE=
+ HAVE_GENTOO_INIT_FALSE='#'
+else
+ HAVE_GENTOO_INIT_TRUE='#'
+ HAVE_GENTOO_INIT_FALSE=
+fi
+
+
+
+if test x"$ensc_with_init" = xsysv; then
+ HAVE_SYSV_INIT_TRUE=
+ HAVE_SYSV_INIT_FALSE='#'
+else
+ HAVE_SYSV_INIT_TRUE='#'
+ HAVE_SYSV_INIT_FALSE=
+fi
+
+
+
cat >>confdefs.h <<\_ACEOF
#define UTMP_GID 22
{ { echo "$as_me:$LINENO: error: conditional \"ENSC_CAN_BEECRYPT_WITH_DIETLIBC\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
echo "$as_me: error: conditional \"ENSC_CAN_BEECRYPT_WITH_DIETLIBC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_GENTOO_INIT_TRUE}" && test -z "${HAVE_GENTOO_INIT_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"HAVE_GENTOO_INIT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_GENTOO_INIT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${HAVE_SYSV_INIT_TRUE}" && test -z "${HAVE_SYSV_INIT_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"HAVE_SYSV_INIT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"HAVE_SYSV_INIT\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
} >&5
cat >&5 <<_CSEOF
-This file was extended by util-vserver $as_me 0.30.212, which was
+This file was extended by util-vserver $as_me 0.30.213, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-util-vserver config.status 0.30.212
+util-vserver config.status 0.30.213
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
s,@ENSC_USE_EXPENSIVE_TESTS@,$ENSC_USE_EXPENSIVE_TESTS,;t t
s,@initrddir@,$initrddir,;t t
s,@RELEASE_CPPFLAGS@,$RELEASE_CPPFLAGS,;t t
+s,@CPP@,$CPP,;t t
s,@DIET@,$DIET,;t t
s,@DIETFLAGS@,$DIETFLAGS,;t t
s,@USE_DIETLIBC_TRUE@,$USE_DIETLIBC_TRUE,;t t
s,@ac_ct_AR@,$ac_ct_AR,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@CPP@,$CPP,;t t
s,@CXXCPP@,$CXXCPP,;t t
s,@F77@,$F77,;t t
s,@FFLAGS@,$FFLAGS,;t t
s,@ENSC_HAVE_BEECRYPT_FALSE@,$ENSC_HAVE_BEECRYPT_FALSE,;t t
s,@ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE@,$ENSC_CAN_BEECRYPT_WITH_DIETLIBC_TRUE,;t t
s,@ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE@,$ENSC_CAN_BEECRYPT_WITH_DIETLIBC_FALSE,;t t
+s,@HAVE_GENTOO_INIT_TRUE@,$HAVE_GENTOO_INIT_TRUE,;t t
+s,@HAVE_GENTOO_INIT_FALSE@,$HAVE_GENTOO_INIT_FALSE,;t t
+s,@HAVE_SYSV_INIT_TRUE@,$HAVE_SYSV_INIT_TRUE,;t t
+s,@HAVE_SYSV_INIT_FALSE@,$HAVE_SYSV_INIT_FALSE,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
s,@LTLIBOBJS@,$LTLIBOBJS,;t t
CEOF
-dnl $Id: configure.ac 2422 2006-12-09 16:13:54Z dhozac $
+dnl $Id: configure.ac 2539 2007-05-02 20:11:40Z dhozac $
dnl Copyright (C) 2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
dnl
dnl
AC_PREREQ(2.57)
-AC_INIT(util-vserver, 0.30.212, vserver@list.linux-vserver.org)
+AC_INIT(util-vserver, 0.30.213, vserver@list.linux-vserver.org)
AC_CONFIG_SRCDIR([src/capchroot.c])
AC_CONFIG_HEADER([config.h])
ENSC_INITRDDIR(initrddir)
ENSC_RELEASE(RELEASE_CPPFLAGS)
+# HACK: This needs to be before ENSC_DIETLIBC_NEED_COMPAT, or the alternative
+# syscalls will never be enabled for glibc.
+ENSC_SYSCALLNR(vserver,273,[lib/syscall-fallback.h])
+ENSC_SYSCALL
+
dnl ###########################
dnl
dnl {some dietlibc related tests
(i*86|athlon) min_diet_ver=0.25;;
(ia64|hppa*) min_diet_ver=0.29;;
(sparc*) min_diet_ver=0.30;;
+ (x86_64) min_diet_ver=0.27;;
(*) min_diet_ver=0.28;;
esac
# below. Therefore, this macro must not be called earlier.
enable_static=no
- ENSC_DIETLIBC_SANITYCHECK
ENSC_DIETLIBC_NEED_COMPAT(USE_DIETLIBC_COMPAT)
fi
dnl ##########################
-ENSC_SYSCALLNR(vserver,273,[lib/syscall-fallback.h])
-ENSC_SYSCALL
ENSC_CHECK_EXT2FS_HEADER
AC_CHECK_FUNCS([vserver])
AC_CHECK_DECLS(MS_MOVE,,,[#include <linux/fs.h>])
dnl ########################
+dnl Check what distro this is, use Gentoo initscripts if appropriate
+AC_MSG_CHECKING([for host initscripts])
+AC_ARG_WITH(initscripts, AC_HELP_STRING([--with-initscripts=TYPE], [force host initscripts; valid values are 'gentoo' and 'sysv' (default: guess)]), [
+ case "$withval" in
+ gentoo) ensc_with_init=gentoo;;
+ sysv) ensc_with_init=sysv;;
+ *) AC_MSG_ERROR([invalid initscripts value, only gentoo and sysv are supported]);;
+ esac
+ ], [
+ if test -e /etc/gentoo-release; then
+ ensc_with_init=gentoo
+ else
+ ensc_with_init=sysv
+ fi
+ ])
+AC_MSG_RESULT([$ensc_with_init])
+AM_CONDITIONAL(HAVE_GENTOO_INIT, test x"$ensc_with_init" = xgentoo)
+AM_CONDITIONAL(HAVE_SYSV_INIT, test x"$ensc_with_init" = xsysv)
+
+
dnl BIG HACK! Do some autodetection here!
AC_DEFINE(UTMP_GID, [22], [The utmp gid-number])
-## $Id: Makefile-files 2334 2006-09-28 15:08:25Z dhozac $ -*- makefile -*-
+## $Id: Makefile-files 2457 2007-01-18 07:56:35Z ensc $ -*- makefile -*-
## Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##
contrib/yum-2.3.3-chroot.patch \
contrib/yum-2.3.4-chroot.patch \
contrib/yum-2.6.0-chroot.patch \
- contrib/yum-2.9.6-chroot.patch
+ contrib/yum-2.9.6-chroot.patch \
+ contrib/yum-3.0.3-chroot.patch
contrib/manifest.dat: contrib/.manifest.dat.pathsubst.stamp
build @PKGLIBDIR@/vserver-build.rpm
build @PKGLIBDIR@/vserver-build.template
build @PKGLIBDIR@/vserver-build.rsync
+build @PKGLIBDIR@/vserver-build.clone
build @PKGLIBDIR@/vserver-build.functions
build @PKGLIBDIR@/vserver-build.functions.apt
build @PKGLIBDIR@/vserver-build.functions.rpm
base @PKGLIBDIR@/vserver.stop
base @PKGLIBDIR@/vserver.suexec
base @PKGLIBDIR@/vserver.delete
+sysv @PKGLIBDIR@/vserver-init.functions
core @PKGLIBDIR@/util-vserver-vars
build @PKGLIBDIR@/rpm-fake.so
legacy @LEGACYDIR@/save_s_context
base @PKGLIBDIR@/defaults/environment
build @PKGLIBDIR@/defaults/fstab
build @PKGLIBDIR@/defaults/debootstrap.uri
+build @PKGLIBDIR@/defaults/context.start
+build @PKGLIBDIR@/defaults/debootstrap.mirror
@ENSC_HAVE_C99_COMPILER_TRUE@build @PKGLIBDIR@/defaults/vunify-exclude
base @PKGLIBDIR@/capchroot
base @PKGLIBDIR@/chain-echo
sysv @PKGLIBDIR@/vserver-wrapper
base @PKGLIBDIR@/vshelper
base @PKGLIBDIR@/vshelper-sync
+base @PKGLIBDIR@/vsysctl
sysv @PKGLIBDIR@/vsysvwrapper
@ENSC_HAVE_C99_COMPILER_TRUE@build @PKGLIBDIR@/vcopy
@ENSC_HAVE_C99_COMPILER_TRUE@build @PKGLIBDIR@/vunify
@ENSC_HAVE_C99_COMPILER_TRUE@build @PKGLIBDIR@/vhashify
+@ENSC_HAVE_C99_COMPILER_TRUE@build @PKGLIBDIR@/vclone
base @PKGLIBDIR@/vservers.grabinfo.sh
build @PKGLIBDIR@/distributions
devel @LIBDIR@/pkgconfig/util-vserver.pc
build @SBINDIR@/vapt-get
core @SBINDIR@/vattribute
core @SBINDIR@/vcontext
+core @SBINDIR@/vdevmap
build @SBINDIR@/vdispatch-conf
core @SBINDIR@/vdlimit
base @SBINDIR@/vdu
core @MANDIR@/*/chcontext*
core @MANDIR@/*/reducecap*
legacy @MANDIR@/*/distrib-info*
-build @MANDIR@/*/vserver-copy*
+legacy @MANDIR@/*/vserver-copy*
legacy @MANDIR@/*/rebootmgr*
legacy @MANDIR@/*/vps.*
base @MANDIR@/*/vpstree.*
legacy @CONFIG@ @INITRDDIR@/v_xinetd
sysv @CONFIG@ @INITRDDIR@/vprocunhide
sysv @CONFIG@ @INITRDDIR@/vservers-default
+sysv @CONFIG@ @INITRDDIR@/util-vserver
legacy @CONFIG@ @INITRDDIR@/rebootmgr
legacy @CONFIG@ @INITRDDIR@/vservers-legacy
legacy @CONFIG_NOREPLACE@ @SYSCONFDIR@/vservers.conf
if os.path.isdir(reposdir):
#XXX: why can't we just pass the list of files?
-@@ -482,16 +481,20 @@
+@@ -482,16 +481,14 @@
self.log(2, 'Finished')
- def doLock(self, lockfile):
-+ def __getLockfileName(self):
-+ lockfile = self.conf.lockfile
-+ return self.conf.getRootedPath(lockfile,
-+ enforce_default = True,
-+ defaults_to_host = False)
-+
+ def doLock(self):
"""perform the yum locking, raise yum-based exceptions, not OSErrors"""
- root = self.conf.installroot
- lockfile = root + '/' + lockfile # lock in the chroot
- lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra /
-+ lockfile = self.__getLockfileName()
++ lockfile = self.conf.lockfile
mypid=str(os.getpid())
while not self._lock(lockfile, mypid, 0644):
- root = self.conf.installroot
- lockfile = root + '/' + lockfile # lock in the chroot
-+ lockfile=self.__getLockfileName()
++ lockfile=self.conf.lockfile
self._unlock(lockfile)
if os.path.isdir(reposdir):
#XXX: why can't we just pass the list of files?
-@@ -502,16 +501,20 @@ class YumBase(depsolve.Depsolve):
+@@ -502,16 +501,14 @@ class YumBase(depsolve.Depsolve):
self.verbose_logger.log(logginglevels.INFO_2, 'Finished')
- def doLock(self, lockfile):
-+ def __getLockfileName(self):
-+ lockfile = self.conf.lockfile
-+ return self.conf.getRootedPath(lockfile,
-+ enforce_default = True,
-+ defaults_to_host = False)
-+
+ def doLock(self):
"""perform the yum locking, raise yum-based exceptions, not OSErrors"""
- root = self.conf.installroot
- lockfile = root + '/' + lockfile # lock in the chroot
- lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra /
-+ lockfile = self.__getLockfileName()
++ lockfile = self.conf.lockfile
mypid=str(os.getpid())
while not self._lock(lockfile, mypid, 0644):
- root = self.conf.installroot
- lockfile = root + '/' + lockfile # lock in the chroot
-+ lockfile=self.__getLockfileName()
++ lockfile=self.conf.lockfile
self._unlock(lockfile)
--- /dev/null
+--- yum-3.0.3/docs/yum.conf.5.chroot 2006-11-17 08:10:32.000000000 +0100
++++ yum-3.0.3/docs/yum.conf.5 2007-01-16 20:28:39.000000000 +0100
+@@ -23,8 +23,10 @@
+ following options:
+
+ .IP \fBcachedir\fR
+-Directory where yum should store its cache and db files. The default is
+-`/var/cache/yum'.
++Directory where yum should store its cache and db files. The default
++is `/var/cache/yum'. Unless the prefixes `hostfs://' or `chrootfs://'
++are used, some magic will be applied to determine the real path in
++combination with `--installroot'.
+
+ .IP \fBkeepcache\fR
+ Either `1' or `0'. Determines whether or not yum keeps the cache
+@@ -40,6 +42,10 @@
+ repositories defined in /etc/yum.conf to form the complete set of repositories
+ that yum will use.
+
++Unless the prefixes `hostfs://' or `chrootfs://' are used, some magic
++will be applied to determine the real path in combination with
++`--installroot'.
++
+ .IP \fBdebuglevel\fR
+ Debug message output level. Practical range is 0\-10. Default is `2'.
+
+@@ -47,7 +53,10 @@
+ Error message output level. Practical range is 0\-10. Default is `2'.
+
+ .IP \fBlogfile\fR
+-Full directory and file name for where yum should write its log file.
++Full directory and file name for where yum should write its log
++file. Unless the prefixes `hostfs://' or `chrootfs://' are used,
++some magic will be applied to determine the real path in combination
++with `--installroot'.
+
+ .IP \fBgpgcheck\fR
+ Either `1' or `0'. This tells yum whether or not it should perform a GPG
+--- yum-3.0.3/yum/config.py.chroot 2006-12-07 18:25:02.000000000 +0100
++++ yum-3.0.3/yum/config.py 2007-01-16 20:28:39.000000000 +0100
+@@ -464,6 +464,26 @@
+ pluginpath = ListOption(['/usr/lib/yum-plugins'])
+ pluginconfpath = ListOption(['/etc/yum/pluginconf.d'])
+
++ def getRootedPath(self, path, enforce_default=False, defaults_to_host=False):
++ instroot = getattr(self, 'installroot', None)
++ if instroot==None:
++ return path
++
++ if path.startswith('hostfs://'): res = path[9:]
++ elif path.startswith('chrootfs://'): res = instroot + '/' + path[11:]
++ else:
++ tmp = instroot + '/' + path
++
++ if enforce_default:
++ if defaults_to_host: res = path
++ else: res = tmp
++ else:
++ if os.path.exists(tmp): res = tmp
++ elif defaults_to_host: res = path
++ else: res = tmp
++
++ return res
++
+ class YumConf(StartupConf):
+ '''
+ Configuration option definitions for yum.conf\'s [main] section.
+@@ -476,6 +496,7 @@
+ cachedir = Option('/var/cache/yum')
+ keepcache = BoolOption(True)
+ logfile = Option('/var/log/yum.log')
++ lockfile = Option('/var/run/yum.pid')
+ reposdir = ListOption(['/etc/yum/repos.d', '/etc/yum.repos.d'])
+ syslog_ident = Option()
+ syslog_facility = Option('LOG_DAEMON')
+@@ -602,9 +623,9 @@
+ yumconf.populate(startupconf._parser, 'main')
+
+ # Apply the installroot to directory options
+- for option in ('cachedir', 'logfile'):
++ for option in ('cachedir', 'logfile', 'lockfile'):
+ path = getattr(yumconf, option)
+- setattr(yumconf, option, yumconf.installroot + path)
++ setattr(yumconf, option, yumconf.getRootedPath(path))
+
+ # Add in some extra attributes which aren't actually configuration values
+ yumconf.yumvar = yumvars
+--- yum-3.0.3/yum/__init__.py.chroot 2007-01-07 21:09:27.000000000 +0100
++++ yum-3.0.3/yum/__init__.py 2007-01-16 20:32:04.000000000 +0100
+@@ -169,8 +169,7 @@
+ # (typically /etc/yum.repos.d and /etc/yum/repos.d)
+ parser = ConfigParser()
+ for reposdir in self.conf.reposdir:
+- if os.path.exists(self.conf.installroot+'/'+reposdir):
+- reposdir = self.conf.installroot + '/' + reposdir
++ reposdir = self.conf.getRootedPath(reposdir)
+
+ if os.path.isdir(reposdir):
+ for repofn in glob.glob('%s/*.repo' % reposdir):
+@@ -523,17 +522,15 @@
+
+ self.verbose_logger.log(logginglevels.INFO_2, 'Finished')
+
+- def doLock(self, lockfile = YUM_PID_FILE):
++ def doLock(self):
+ """perform the yum locking, raise yum-based exceptions, not OSErrors"""
+
+ # if we're not root then we don't lock - just return nicely
+ if self.conf.uid != 0:
+ return
+-
+- root = self.conf.installroot
+- lockfile = root + '/' + lockfile # lock in the chroot
+- lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra /
+-
++
++ lockfile = self.conf.lockfile
++
+ mypid=str(os.getpid())
+ while not self._lock(lockfile, mypid, 0644):
+ fd = open(lockfile, 'r')
+@@ -558,16 +555,15 @@
+ msg = 'Existing lock %s: another copy is running. Aborting.' % lockfile
+ raise Errors.LockError(0, msg)
+
+- def doUnlock(self, lockfile = YUM_PID_FILE):
++ def doUnlock(self):
+ """do the unlock for yum"""
+
+ # if we're not root then we don't lock - just return nicely
+ if self.conf.uid != 0:
+ return
+
+- root = self.conf.installroot
+- lockfile = root + '/' + lockfile # lock in the chroot
+-
++ lockfile=self.conf.lockfile
++
+ self._unlock(lockfile)
+
+ def _lock(self, filename, contents='', mode=0777):
+--- yum-3.0.3/cli.py.chroot 2006-12-08 00:27:08.000000000 +0100
++++ yum-3.0.3/cli.py 2007-01-16 20:28:39.000000000 +0100
+@@ -131,7 +131,7 @@
+ action="store_true", default=False,
+ help="run entirely from cache, don't update cache")
+ self.optparser.add_option("-c", "", dest="conffile", action="store",
+- default='/etc/yum.conf', help="config file location",
++ default=None, help="config file location",
+ metavar=' [config file]')
+ self.optparser.add_option("-R", "", dest="sleeptime", action="store",
+ type='int', default=None, help="maximum command wait time",
+@@ -188,9 +188,12 @@
+
+ # If the conf file is inside the installroot - use that.
+ # otherwise look for it in the normal root
+- if opts.installroot:
+- if os.access(opts.installroot+'/'+opts.conffile, os.R_OK):
++ if opts.conffile==None:
++ opts.conffile = '/etc/yum.conf'
++ if opts.installroot and os.access(opts.installroot+'/'+opts.conffile, os.R_OK):
+ opts.conffile = opts.installroot+'/'+opts.conffile
++
++ if opts.installroot:
+ root=opts.installroot
+ else:
+ root = '/'
-## $Id: Makefile.am 2360 2006-11-01 19:23:24Z hollow $
+## $Id: Makefile.am 2530 2007-04-21 14:03:09Z dhozac $
## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##
confdistribdir = $(confdir)/.distributions
confdefaultsdir = $(confdir)/.defaults
-defaults_DATA = misc/debootstrap.uri \
+defaults_DATA = misc/debootstrap.mirror \
+ misc/debootstrap.uri \
misc/fstab \
misc/mtab \
misc/vprocunhide-files \
misc/vunify-exclude \
- misc/environment
+ misc/environment \
+ misc/context.start
nobase_distrib_SCRIPTS = redhat/initpost \
redhat/initpre \
redhat/rc.sysinit \
gentoo/initpost \
gentoo/initpre \
- gentoo/init-vserver.sh
+ etch/initpost
nobase_distrib_DATA = defaults/devs \
defaults/apt.conf \
$(wildcard fc6/rpmlist.d/*.lst) $(wildcard fc6/rpmlist.d/*.opt) \
centos4/pkgs/01 centos4/pkgs/02 centos4/pkgs/03 \
centos4/yum/yum.conf $(wildcard centos4/yum.repos.d/*.repo) \
+ centos5/pkgs/01 centos5/pkgs/02 centos5/pkgs/03 \
+ centos5/yum/yum.conf $(wildcard centos5/yum.repos.d/*.repo) \
suse91/apt/rpmpriorities suse91/pkgs/01 suse91/pkgs/02 \
- suse91/rpm/macros
+ suse91/rpm/macros \
+ gentoo/init-vserver.sh gentoo/net.vserver \
+ gentoo/reboot.sh gentoo/shutdown.sh \
+ etch/vserver-config.sh
nobase_confdistrib_DATA = rh9/apt/sources.list \
fc1/apt/sources.list \
$(nobase_confdistrib_DATA) \
$(defaults_DATA)
-redhat_style = rh9 fc1 fc2 fc3 fc4 fc5 fc6 centos4
+redhat_style = rh9 fc1 fc2 fc3 fc4 fc5 fc6 centos4 centos5
install-exec-hook: install-notify-xtra
install-data-hook: install-data-xtras
GPG_KEY = @GPG_KEY@
GREP = @GREP@
GZIP = @GZIP@
+HAVE_GENTOO_INIT_FALSE = @HAVE_GENTOO_INIT_FALSE@
+HAVE_GENTOO_INIT_TRUE = @HAVE_GENTOO_INIT_TRUE@
HAVE_SVN2CL_FALSE = @HAVE_SVN2CL_FALSE@
HAVE_SVN2CL_TRUE = @HAVE_SVN2CL_TRUE@
+HAVE_SYSV_INIT_FALSE = @HAVE_SYSV_INIT_FALSE@
+HAVE_SYSV_INIT_TRUE = @HAVE_SYSV_INIT_TRUE@
HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
HAVE_XSLTP_FALSE = @HAVE_XSLTP_FALSE@
distribdir = $(pkglibdir)/distributions
confdistribdir = $(confdir)/.distributions
confdefaultsdir = $(confdir)/.defaults
-defaults_DATA = misc/debootstrap.uri \
+defaults_DATA = misc/debootstrap.mirror \
+ misc/debootstrap.uri \
misc/fstab \
misc/mtab \
misc/vprocunhide-files \
misc/vunify-exclude \
- misc/environment
+ misc/environment \
+ misc/context.start
nobase_distrib_SCRIPTS = redhat/initpost \
redhat/initpre \
redhat/rc.sysinit \
gentoo/initpost \
gentoo/initpre \
- gentoo/init-vserver.sh
+ etch/initpost
nobase_distrib_DATA = defaults/devs \
defaults/apt.conf \
$(wildcard fc6/rpmlist.d/*.lst) $(wildcard fc6/rpmlist.d/*.opt) \
centos4/pkgs/01 centos4/pkgs/02 centos4/pkgs/03 \
centos4/yum/yum.conf $(wildcard centos4/yum.repos.d/*.repo) \
+ centos5/pkgs/01 centos5/pkgs/02 centos5/pkgs/03 \
+ centos5/yum/yum.conf $(wildcard centos5/yum.repos.d/*.repo) \
suse91/apt/rpmpriorities suse91/pkgs/01 suse91/pkgs/02 \
- suse91/rpm/macros
+ suse91/rpm/macros \
+ gentoo/init-vserver.sh gentoo/net.vserver \
+ gentoo/reboot.sh gentoo/shutdown.sh \
+ etch/vserver-config.sh
nobase_confdistrib_DATA = rh9/apt/sources.list \
fc1/apt/sources.list \
$(nobase_confdistrib_DATA) \
$(defaults_DATA)
-redhat_style = rh9 fc1 fc2 fc3 fc4 fc5 fc6 centos4
+redhat_style = rh9 fc1 fc2 fc3 fc4 fc5 fc6 centos4 centos5
all: all-am
.SUFFIXES:
distdir: $(DISTFILES)
- $(mkdir_p) $(distdir)/../m4 $(distdir)/centos4/pkgs $(distdir)/centos4/yum $(distdir)/centos4/yum.repos.d $(distdir)/defaults $(distdir)/defaults/apt $(distdir)/defaults/rpm $(distdir)/fc1/apt $(distdir)/fc1/pkgs $(distdir)/fc2/apt $(distdir)/fc2/pkgs $(distdir)/fc3/apt $(distdir)/fc3/pkgs $(distdir)/fc3/rpmlist.d $(distdir)/fc3/yum $(distdir)/fc3/yum.repos.d $(distdir)/fc4/apt $(distdir)/fc4/pkgs $(distdir)/fc4/rpmlist.d $(distdir)/fc4/yum $(distdir)/fc4/yum.repos.d $(distdir)/fc5/apt $(distdir)/fc5/pkgs $(distdir)/fc5/rpmlist.d $(distdir)/fc5/yum $(distdir)/fc5/yum.repos.d $(distdir)/fc6/apt $(distdir)/fc6/pkgs $(distdir)/fc6/rpmlist.d $(distdir)/fc6/yum $(distdir)/fc6/yum.repos.d $(distdir)/gentoo $(distdir)/misc $(distdir)/redhat $(distdir)/rh9/apt $(distdir)/rh9/pkgs $(distdir)/suse91/apt $(distdir)/suse91/pkgs $(distdir)/suse91/rpm $(distdir)/template
+ $(mkdir_p) $(distdir)/../m4 $(distdir)/centos4/pkgs $(distdir)/centos4/yum $(distdir)/centos4/yum.repos.d $(distdir)/centos5/pkgs $(distdir)/centos5/yum $(distdir)/centos5/yum.repos.d $(distdir)/defaults $(distdir)/defaults/apt $(distdir)/defaults/rpm $(distdir)/etch $(distdir)/fc1/apt $(distdir)/fc1/pkgs $(distdir)/fc2/apt $(distdir)/fc2/pkgs $(distdir)/fc3/apt $(distdir)/fc3/pkgs $(distdir)/fc3/rpmlist.d $(distdir)/fc3/yum $(distdir)/fc3/yum.repos.d $(distdir)/fc4/apt $(distdir)/fc4/pkgs $(distdir)/fc4/rpmlist.d $(distdir)/fc4/yum $(distdir)/fc4/yum.repos.d $(distdir)/fc5/apt $(distdir)/fc5/pkgs $(distdir)/fc5/rpmlist.d $(distdir)/fc5/yum $(distdir)/fc5/yum.repos.d $(distdir)/fc6/apt $(distdir)/fc6/pkgs $(distdir)/fc6/rpmlist.d $(distdir)/fc6/yum $(distdir)/fc6/yum.repos.d $(distdir)/gentoo $(distdir)/misc $(distdir)/redhat $(distdir)/rh9/apt $(distdir)/rh9/pkgs $(distdir)/suse91/apt $(distdir)/suse91/pkgs $(distdir)/suse91/rpm $(distdir)/template
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
--- /dev/null
+--reinstall
+
+filesystem
--- /dev/null
+coreutils
+setup
--- /dev/null
+# CentOS-Base.repo
+#
+# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
+# The mirror system uses the connecting IP address of the client and the
+# update status of each mirror to pick mirrors that are updated to and
+# geographically close to the client. You should use this for CentOS updates
+# unless you are manually picking other mirrors.
+#
+# If the mirrorlist= does not work for you, as a fall back you can try the
+# remarked out baseurl= line instead.
+#
+#
+
+[base]
+name=CentOS-5 - Base
+mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
+#baseurl=http://mirror.centos.org/centos/5/os/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#released updates
+[updates]
+name=CentOS-5 - Updates
+mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
+#baseurl=http://mirror.centos.org/centos/5/updates/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#packages used/produced in the build but not released
+[addons]
+name=CentOS-5 - Addons
+mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
+#baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#additional packages that may be useful
+[extras]
+name=CentOS-5 - Extras
+mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
+#baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
+gpgcheck=1
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#additional packages that extend functionality of existing packages
+[centosplus]
+name=CentOS-5 - Plus
+mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
+#baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
+
+#contrib - packages by Centos Users
+[contrib]
+name=CentOS-5 - Contrib
+mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=contrib
+#baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
+gpgcheck=1
+enabled=0
+gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
--- /dev/null
+[main]
+cachedir=@YUMCACHEDIR@
+reposdir=@YUMETCDIR@/yum.repos.d
+debuglevel=1
+logfile=@YUMLOGDIR@/log
+lockfile=@YUMLOCKDIR@/yum.pid
+pkgpolicy=newest
+distroverpkg=centos-release
+installonlypkgs=
+exactarch=0
--- /dev/null
+#!/bin/bash
+
+# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+## Called as: initpost <cfgdir> <path of util-vserver-vars>
+
+# setup environment
+cfgdir="$1"
+vdir="$cfgdir"/vdir
+. "$2"
+
+
+# vserver name
+NAME=$(< "$cfgdir"/name)
+
+# debian mirror
+MIRROR=$3
+
+# debian distribution
+DIST="etch"
+
+
+# go to vdir for chroot-sh
+pushd "$vdir" &>/dev/null
+
+
+# helper for sed in chroot
+chrootsed() {
+ local file="$1"
+ shift
+
+ sedtmp=$($_MKTEMP chrootsed.XXXXXX)
+
+ $_CHROOT_SH cat "$file" | $_SED "$@" > $sedtmp
+ $_CHROOT_SH truncate "$file" < $sedtmp
+
+ $_RM -f $sedtmp
+}
+
+
+# create a locale.gen if needed.
+if test -n "$LANG" && test "$LANG" != "C"; then
+ echo $LANG $(locale charmap) | $_CHROOT_SH append /etc/locale.gen
+fi
+
+
+# make apt and friends work
+$_CHROOT_SH truncate /etc/apt/sources.list <<EOF
+deb $MIRROR/ $DIST main
+deb-src $MIRROR/ $DIST main
+
+deb http://security.debian.org $DIST/updates main
+EOF
+
+
+# setting hostname
+if test -r "$cfgdir"/uts/nodename; then
+ $_CHROOT_SH truncate /etc/hostname < "$cfgdir"/uts/nodename
+fi
+
+
+# setting default /etc/hosts
+$_CHROOT_SH truncate /etc/hosts <<EOF
+# /etc/hosts
+
+127.0.0.1 localhost
+
+# The following lines are desirable for IPv6 capable hosts
+# (added automatically by netbase upgrade)
+
+::1 ip6-localhost ip6-loopback
+fe00::0 ip6-localnet
+ff00::0 ip6-mcastprefix
+ff02::1 ip6-allnodes
+ff02::2 ip6-allrouters
+ff02::3 ip6-allhosts
+EOF
+
+
+# copy proxy server statement from host if any
+if test -f /etc/apt/apt.conf; then
+ $_CHROOT_SH truncate /etc/apt/apt.conf < /etc/apt/apt.conf
+fi
+
+
+# fix gettys in inittab
+if $_CHROOT_SH testfile /etc/inittab; then
+ chrootsed /etc/inittab \
+ -e 's/\(^[^#].*getty.*$\)/#\1/'
+fi
+
+
+# fix /proc/cmdline in sendsigs
+if $_CHROOT_SH testfile /etc/init.d/sendsigs; then
+ chrootsed /etc/init.d/sendsigs \
+ -e 's/^\(\s\+splash_back\)$/#\1/'
+fi
+
+# from here on we need to do things live in the server
+$_CHROOT_SH truncate /vserver-config.sh < "$__DISTRIBDIR"/etch/vserver-config.sh
+$_CHROOT_SH chmod 0755 /vserver-config.sh
+
+echo
+echo ">>> Executing post install script ... "
+echo
+
+# start vserver before we can exec anything inside it
+vserver $NAME start
+
+# run the configure commands from within the server
+vserver $NAME exec /vserver-config.sh
+$_CHROOT_SH rm /vserver-config.sh
+
+# stop the vserver
+vserver $NAME stop
+
+popd &>/dev/null
--- /dev/null
+#!/bin/sh
+
+REMOVE_LINKS="
+bootlogd
+checkfs
+checkroot
+halt
+hwclock.sh
+ifupdown
+klogd
+libdevmapper1.02
+makedev
+module-init-tools
+mountall.sh
+mountdevsubfs.sh
+mountnfs.sh
+mountkernfs.sh
+mountvirtfs
+networking
+reboot
+setserial
+single
+stop-bootlogd
+stop-bootlogd-single
+umountfs
+umountnfs.sh
+umountroot
+urandom
+"
+
+aptitude update
+LANG=C aptitude install locales
+
+test -x /usr/sbin/locale-gen && /usr/sbin/locale-gen
+
+for link in $REMOVE_LINKS; do
+ update-rc.d -f $link remove
+done
+
# You have been warned...
#
-RUNLEVEL=1 /sbin/rc sysinit
-/sbin/rc boot
+RUNLEVEL=1 /sbin/rc sysinit || exit 1
+/sbin/rc boot || exit 1
/sbin/rc ${1:-default}
+exit 0
## Called as: initpost <cfgdir> <path of util-vserver-vars>
-vdir="$1"/vdir
+# finish notice from initpre
+echo "ok"
+
+
+#setup environment
+cfgdir="$1"
+vdir="$cfgdir"/vdir
. "$2"
-# portage stuff
+
+# go to vdir for chroot-sh
pushd "$vdir" &>/dev/null
-$_CHROOT_SH mkdir /usr 2>/dev/null || :
+
+
+# helper for sed in chroot
+chrootsed() {
+ local file="$1"
+ shift
+
+ sedtmp=$($_MKTEMP chrootsed.XXXXXX)
+
+ $_CHROOT_SH cat "$file" | $_SED "$@" > $sedtmp
+ $_CHROOT_SH truncate "$file" < $sedtmp
+
+ $_RM -f $sedtmp
+}
+
+
+# portage stuff
+$_CHROOT_SH mkdir /usr 2>/dev/null || :
$_CHROOT_SH mkdir /usr/portage 2>/dev/null || :
-popd &>/dev/null
+$_CHROOT_SH mkdir /usr/portage/distfiles 2>/dev/null || :
# gentoo initstyle magic
initstyle=sysv
-test -e "$1"/apps/init/style && initstyle=$(<"$1"/apps/init/style)
+test -e "$cfgdir"/apps/init/style && initstyle=$(<"$cfgdir"/apps/init/style)
if test "$initstyle" == "gentoo"; then
- pushd "$vdir" &>/dev/null
-
echo ">>> Installing special init-style magic ... "
$_CAT "$__DISTRIBDIR"/gentoo/init-vserver.sh | \
$_CHROOT_SH truncate /lib/rcscripts/sh/init-vserver.sh
$_CHROOT_SH chmod 0755 /lib/rcscripts/sh/init-vserver.sh
- popd &>/dev/null
+ $_CAT "$__DISTRIBDIR"/gentoo/reboot.sh | \
+ $_CHROOT_SH truncate /etc/init.d/reboot.sh
+ $_CHROOT_SH chmod 0755 /etc/init.d/reboot.sh
+
+ $_CAT "$__DISTRIBDIR"/gentoo/shutdown.sh | \
+ $_CHROOT_SH truncate /etc/init.d/shutdown.sh
+ $_CHROOT_SH chmod 0755 /etc/init.d/shutdown.sh
echo "!!!"
- echo "!!! You have to install a service (e.g. syslog-ng) and add it to the"
+ echo "!!! You have to install a service (e.g. syslog/cron) and add it to the"
echo "!!! default runlevel before you start the guest the first time!"
echo "!!! Otherwise the guest will die as soon as it has finished booting."
echo "!!!"
fi
-# check for baselayout >= 1.13
-pushd "$vdir" &>/dev/null
-basever=$($_CHROOT_SH cat /etc/gentoo-release | $_AWK '{print $5}')
-popd &>/dev/null
+# unneeded runlevel scripts
+echo ">>> Fixing default runlevel scripts ... "
+$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
+$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
-echo ">>> Found baselayout-$basever"
-basemaj=${basever/.*}
-basemin=${basever#*.}
-basemin=${basemin/.*}
+# setting hostname
+if test -r "$cfgdir"/uts/nodename && $_CHROOT_SH testfile /etc/conf.d/hostname; then
+ echo ">>> Setting hostname ... "
+ chrootsed /etc/conf.d/hostname \
+ -e "s:HOSTNAME=\"\(.*\)\":HOSTNAME=\"$(< "$cfgdir"/uts/nodename)\":"
+fi
+
-if test "$basemaj" -lt 1 -o "$basemin" -lt 13; then
- echo "!!! Will not do automagic changes to baselayout < 1.13"
- echo "!!! You have to take care for yourself ..."
- exit 0
+# fix syslog-ng.conf
+if $_CHROOT_SH testfile /etc/syslog-ng/syslog-ng.conf; then
+ echo ">>> Fixing syslog-ng.conf ... "
+ chrootsed /etc/syslog-ng/syslog-ng.conf \
+ -e 's:pipe("/proc/kmsg"); ::' \
+ -e 's:\(.*console_all.*\):#\1:g'
fi
# fix gettys in inittab
-pushd "$vdir" &>/dev/null
-
if $_CHROOT_SH testfile /etc/inittab; then
echo ">>> Fixing inittab ... "
- inittabtmp=$($_MKTEMP inittab.XXXXXX)
-
- $_CHROOT_SH cat /etc/inittab | \
- $_SED 's/\(^[^#].*getty.*$\)/#\1/' > $inittabtmp
- $_CHROOT_SH truncate /etc/inittab < $inittabtmp
-
- $_RM -f $inittabtmp
+ chrootsed /etc/inittab \
+ -e 's/\(^[^#].*getty.*$\)/#\1/'
fi
-popd &>/dev/null
+# fix fstab for checkfs/localmount in baselayout-2
+# (does not affect any previous versions)
+echo ">>> Fixing fstab ... "
+echo "/dev/hdv1 / ufs defaults 0 0" | $_CHROOT_SH truncate /etc/fstab
-# unneeded runlevel scripts
-pushd "$vdir" &>/dev/null
-echo ">>> Fixing default runlevel scripts ... "
-$_CHROOT_SH rm /etc/runlevels/boot/{clock,consolefont,keymaps,modules,net.lo} 2>/dev/null || :
-$_CHROOT_SH rm /etc/runlevels/default/{hdparm,netmount} 2>/dev/null || :
-popd &>/dev/null
+# always satisfy net dependency in baselayout-2
+# (does not affect any previous versions)
+echo ">>> Providing dummy net dependency ... "
+$_CAT "$__DISTRIBDIR"/gentoo/net.vserver | \
+$_CHROOT_SH truncate /etc/init.d/net.vserver
+$_CHROOT_SH chmod 0755 /etc/init.d/net.vserver
+$_CHROOT_SH link /etc/init.d/net.vserver /etc/runlevels/boot/net.vserver
-# fix fstab for checkfs/localmount
-pushd "$vdir" &>/dev/null
-echo ">>> Fixing fstab ... "
-echo "/dev/hdv1 / ufs defaults 0 0" | $_CHROOT_SH truncate /etc/fstab
popd &>/dev/null
. "$2"
# portage stuff
-
echo ">>> Adding shared /usr/portage to fstab ... "
-if test -d /usr/portage; then
+hash portageq &>/dev/null
+
+if test $? -eq 0; then
+ _PORTDIR=$(portageq portdir)
+ _DISTDIR=$(portageq distdir)
+else
+ _PORTDIR=/usr/portage
+ _DISTDIR=/usr/portage/distfiles
+fi
+
+if test -d $_PORTDIR; then
( echo
echo "# shared portage tree"
- echo "/usr/portage /usr/portage none bind,ro 0 0"
- echo "/usr/portage/distfiles /usr/portage/distfiles none bind,rw 0 0"
+ echo "${_PORTDIR} /usr/portage none bind,ro 0 0"
) >> "$1"/fstab
else
- echo "!!! Cannot find /usr/portage! You should definitely use a"
+ echo "!!! Cannot find a portage tree! You should definitely use a"
echo "!!! shared portage tree if you have multiple Gentoo guests!"
fi
+if test -d $_DISTDIR; then
+ echo "${_DISTDIR} /usr/portage/distfiles none bind,rw 0 0" >> "$1"/fstab
+else
+ echo "!!! Cannot find distfiles directory! You should definitely use a"
+ echo "!!! shared distfiles directory if you have multiple Gentoo guests!"
+fi
+
# initstyle sanity
initstyle=sysv
echo "!!! The init-style you specified is not supported for Gentoo"
echo "!!! Please use one of: plain, gentoo"
fi
+
+echo -n ">>> Unpacking template ... "
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+depend() {
+ provide net
+}
+
+start() {
+ return 0
+}
+
+stop() {
+ return 0
+}
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# gentoo init style needs this (and nothing else)
+exit 0
--- /dev/null
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# gentoo init style needs this (and nothing else)
+exit 0
--- /dev/null
+http://ftp.debian.org/debian
-http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_0.3.3_all.deb
+http://ftp.debian.org/debian/pool/main/d/debootstrap/debootstrap_0.3.3.3_all.deb
<div class="description">
A link to the directory which will hold cached information about
vservers.
+ </div>
+ </li>
+ <li>
+ <span class="boolean" title="/etc/vservers/.defaults/context.dynamic">context.dynamic</span>
+ <br />
+ <div class="description">
+If this file exists, kernel-side dynamic contexts will be used by the "vserver
+... build" command. Otherwise a context will be generated, based on the
+contents of <a class="optionref" href="#context.next">context.next</a>.
+ </div>
+ </li>
+ <li id="context.next">
+ <span class="file" title="/etc/vservers/.defaults/context.next">context.next</span>
+ <br />
+ <div class="description">
+The context id to use for the next guest created by "vserver ... build".
+ </div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/fstab">fstab</span>
+ <br />
+ <div class="description">
+The default fstab file to put in newly built guests.
</div>
</li>
<li id="global-namespace-cleanup-skip">
NOTE: this link exists in 0.30.202+ only; in previous versions it was
a vserver specific setting.
+ </div>
+ </li>
+ <li>
+ <span class="file" title="/etc/vservers/.defaults/shell">shell</span>
+ <br />
+ <div class="description">
+Contains the pathname of the shell which will be used by the "vserver
+... enter" command. Can be overridden by the
+<a class="optionref" href="#shell">per-guest shell</a>.
</div>
</li>
<li>
<span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">apps</span></span>
<br />
<ul>
+ <li>
+ <span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">apps</span>/<span class="">build</span></span>
+ <br />
+ <ul>
+ <li>
+ <span class="list" title="/etc/vservers/.defaults/apps/build/options">options</span>
+ <br />
+ <div class="description">
+A list of default options to supply to vserver ... build, one option per line.
+ </div>
+ </li>
+ </ul>
+ </li>
<li>
<span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">apps</span>/<span class="">debootstrap</span></span>
<br />
</li>
</ul>
</li>
+ <li>
+ <span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">apps</span>/<span class="">vdevmap</span></span>
+ <br />
+ <ul>
+ <li>
+ <span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">apps</span>/<span class="">vdevmap</span>/<span class="sybmolic">x</span></span>
+ <br />
+ <div class="description">'x' is an arbitrary name, replace it with e.g. device names</div>
+ <ul>
+ <li>
+ <span class="boolean" title="/etc/vservers/.defaults/apps/vdevmap/x/create">create</span>
+ <br />
+ <div class="description">When this file exists, the device can be created (if the guest has <a class="optionref" href="#bcapabilities">CAP_MKNOD</a>)</div>
+ </li>
+ <li>
+ <span class="file" title="/etc/vservers/.defaults/apps/vdevmap/x/device">device</span>
+ <br />
+ <div class="description">Contains the name of a device node</div>
+ </li>
+ <li>
+ <span class="file" title="/etc/vservers/.defaults/apps/vdevmap/x/flags">flags</span>
+ <br />
+ <div class="description">This file will let you specify unimplemented flags manually</div>
+ </li>
+ <li>
+ <span class="boolean" title="/etc/vservers/.defaults/apps/vdevmap/x/open">open</span>
+ <br />
+ <div class="description">When this file exists, the device can be opened</div>
+ </li>
+ <li id="vdevmap-remap">
+ <span class="boolean" title="/etc/vservers/.defaults/apps/vdevmap/x/remap">remap</span>
+ <br />
+ <div class="description">
+When this file exists, <a class="optionref" href="#vdevmap-target">target</a> will
+have to exist as well and opening the device will in fact open the target device
+ </div>
+ </li>
+ <li id="vdevmap-target">
+ <span class="file" title="/etc/vservers/.defaults/apps/vdevmap/x/target">target</span>
+ <br />
+ <div class="description">Contains the device node of the target node to open instead of the device when <a class="optionref" href="#vdevmap-remap">remap</a> is set</div>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
<li>
<span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">apps</span>/<span class="">vlogin</span></span>
<br />
<span class="script" title="/etc/vservers/.defaults/apps/vshelper/vshelper-methods/$handler">handler</span>
<br />
<div class="description">
-See vshelper/action.
+See <a class="optionref" href="#vshelper-action">vshelper/action</a>.
</div>
</li>
</ul>
</li>
</ul>
</li>
+ <li>
+ <span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="">files</span></span>
+ <br />
+ <div class="description">This directory contains some files which will be copied to the guests during build.</div>
+ <ul>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/hosts">hosts</span>
+ <br />
+ <div class="description">The default /etc/hosts file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/krb.conf">krb.conf</span>
+ <br />
+ <div class="description">The default /etc/krb.conf file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/krb.realms">krb.realms</span>
+ <br />
+ <div class="description">The default /etc/krb.realms file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/krb5.conf">krb5.conf</span>
+ <br />
+ <div class="description">The default /etc/krb5.conf file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/ldap.conf">ldap.conf</span>
+ <br />
+ <div class="description">The default /etc/ldap.conf file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/localtime">localtime</span>
+ <br />
+ <div class="description">The default /etc/localtime file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/nsswitch.conf">nsswitch.conf</span>
+ <br />
+ <div class="description">The default /etc/nsswitch.conf file.</div>
+ </li>
+ <li>
+ <span class="data" title="/etc/vservers/.defaults/files/resolv.conf">resolv.conf</span>
+ <br />
+ <div class="description">The default /etc/resolv.conf file.</div>
+ </li>
+ </ul>
+ </li>
<li>
<span class="directory">/etc/vservers/<span class="">.defaults</span>/<span class="fixed">init</span></span>
<br />
VServer Wiki</a> for more information about this file.
</div>
</li>
- <li>
+ <li id="shell">
<span class="file" title="/etc/vservers/$vserver-name/shell">shell</span>
<br />
<div class="description">
<span class="directory">/etc/vservers/<span class="symbolic">vserver-name</span>/<span class="">apps</span>/<span class="">vshelper</span></span>
<br />
<ul>
- <li>
+ <li id="vshelper-action">
<span class="file" title="/etc/vservers/$vserver-name/apps/vshelper/action">action</span>
<br />
<div class="description">
<span class="script" title="/etc/vservers/$vserver-name/apps/vshelper-methods/$handler">handler</span>
<br />
<div class="description">
-See vshelper/action.
+See <a class="optionref" href="#vshelper-action">vshelper/action</a>.
</div>
</li>
</ul>
</li>
</ul>
</li>
+ <li>
+ <span class="directory">/etc/vservers/<span class="symbolic">vserver-name</span>/<span class="">sysctl</span></span>
+ <br />
+ <ul>
+ <li>
+ <span class="directory">/etc/vservers/<span class="symbolic">vserver-name</span>/<span class="">sysctl</span>/<span class="symbolic">x</span></span>
+ <br />
+ <div class="description">'x' is an arbitrary name, replace it with e.g. integers</div>
+ <ul>
+ <li>
+ <span class="file" title="/etc/vservers/$vserver-name/sysctl/$x/setting">setting</span>
+ <br />
+ <div class="description">The sysctl setting</div>
+ </li>
+ <li>
+ <span class="file" title="/etc/vservers/$vserver-name/sysctl/$x/value">value</span>
+ <br />
+ <div class="description">The value</div>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </li>
<li>
<span class="directory">/etc/vservers/<span class="symbolic">vserver-name</span>/<span class="">ulimits</span></span>
<br />
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database SYSTEM "configuration.dtd" []>
-<!-- $Id: configuration.xml 2397 2006-11-24 14:12:22Z dhozac $ -->
+<!-- $Id: configuration.xml 2478 2007-01-27 11:10:09Z dhozac $ -->
<database xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:configuration.xsd">
a vserver specific setting.
</description>
</link>
+
+ <scalar name="shell">
+ <description>
+Contains the pathname of the shell which will be used by the "vserver
+... enter" command. Can be overridden by the
+<optionref ref="shell">per-guest shell</optionref>.
+ </description>
+ </scalar>
+
+ <data name="fstab">
+ <description>
+The default fstab file to put in newly built guests.
+ </description>
+ </data>
+
+ <boolean name="context.dynamic">
+ <description>
+If this file exists, kernel-side dynamic contexts will be used by the "vserver
+... build" command. Otherwise a context will be generated, based on the
+contents of <optionref>context.next</optionref>.
+ </description>
+ </boolean>
+
+ <scalar id="context.next" name="context.next">
+ <description>
+The context id to use for the next guest created by "vserver ... build".
+ </description>
+ </scalar>
<collection name="apps">
<collection name="pkgmgmt">
</scalar>
</collection>
+ <collection name="vdevmap">
+ <collection name="x" type="sybmolic">
+ <description>'x' is an arbitrary name, replace it with e.g. device names</description>
+ <boolean name="open">
+ <description>When this file exists, the device can be opened</description>
+ </boolean>
+ <boolean name="create">
+ <description>When this file exists, the device can be created (if the guest has <optionref ref="bcapabilities">CAP_MKNOD</optionref>)</description>
+ </boolean>
+ <boolean id="vdevmap-remap" name="remap">
+ <description>
+When this file exists, <optionref ref="vdevmap-target">target</optionref> will
+have to exist as well and opening the device will in fact open the target device
+ </description>
+ </boolean>
+ <scalar name="flags">
+ <description>This file will let you specify unimplemented flags manually</description>
+ </scalar>
+ <scalar name="device">
+ <description>Contains the name of a device node</description>
+ </scalar>
+ <scalar id="vdevmap-target" name="target">
+ <description>Contains the device node of the target node to open instead of the device when <optionref ref="vdevmap-remap">remap</optionref> is set</description>
+ </scalar>
+ </collection>
+ </collection>
+
<collection name="vshelper">
<link name="logfile">
<description>
<collection name="vshelper-methods">
<program name="handler" type="symbolic">
<description>
-See vshelper/action.
+See <optionref ref="vshelper-action">vshelper/action</optionref>.
</description>
</program>
</collection>
</description>
</boolean>
</collection>
+
+ <collection name="build">
+ <list name="options">
+ <description>
+A list of default options to supply to vserver ... build, one option per line.
+ </description>
+ </list>
+ </collection>
</collection>
<collection name="interfaces" use="optional">
</description>
</boolean>
</collection>
+
+ <collection name="files">
+ <description>This directory contains some files which will be copied to the guests during build.</description>
+ <data name="hosts">
+ <description>The default /etc/hosts file.</description>
+ </data>
+ <data name="nsswitch.conf">
+ <description>The default /etc/nsswitch.conf file.</description>
+ </data>
+ <data name="krb5.conf">
+ <description>The default /etc/krb5.conf file.</description>
+ </data>
+ <data name="krb.conf">
+ <description>The default /etc/krb.conf file.</description>
+ </data>
+ <data name="krb.realms">
+ <description>The default /etc/krb.realms file.</description>
+ </data>
+ <data name="ldap.conf">
+ <description>The default /etc/ldap.conf file.</description>
+ </data>
+ <data name="localtime">
+ <description>The default /etc/localtime file.</description>
+ </data>
+ <data name="resolv.conf">
+ <description>The default /etc/resolv.conf file.</description>
+ </data>
+ </collection>
</collection>
<collection name=".distributions" use="optional">
only; for 2.6 use <optionref>bcapabilities</optionref>.
</description>
</list>
- <scalar name="shell">
+ <scalar id="shell" name="shell">
<description>
Contains the pathname of the shell which will be used by the "vserver
... enter" command.
</description>
</scalar>
- <scalar name="action">
+ <scalar id="vshelper-action" name="action">
<default>restart</default>
<description>
The action which is going to be executed when a vshelper event
<collection id="vshelper-methods" name="vshelper-methods">
<program name="handler" type="symbolic">
<description>
-See vshelper/action.
+See <optionref ref="vshelper-action">vshelper/action</optionref>.
</description>
</program>
</collection>
</collection>
</collection>
+ <collection name="sysctl" since="0.30.213">
+ <collection name="x" type="symbolic">
+ <description>'x' is an arbitrary name, replace it with e.g. integers</description>
+ <scalar name="setting">
+ <description>The sysctl setting</description>
+ </scalar>
+ <scalar name="value">
+ <description>The value</description>
+ </scalar>
+ </collection>
+ </collection>
+
<collection name="cpuset" since="0.30.211">
<scalar name="name">
<description>The name of the cpuset for this vserver</description>
-// $Id: wrappers-unistd.hc 2307 2006-09-12 17:09:08Z dhozac $ --*- c -*--
+// $Id: wrappers-unistd.hc 2467 2007-01-21 18:26:45Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
FatalErrnoError(unlink(pathname)==-1, "unlink()");
}
+inline static WRAPPER_DECL void
+Elink(char const *oldpath, char const *newpath)
+{
+ FatalErrnoError(link(oldpath, newpath)==-1, "link()");
+}
+
inline static void
Esetuid(uid_t uid)
{
-// $Id: wrappers-vserver.hc 2416 2006-12-08 13:25:29Z dhozac $ --*- c++ -*--
+// $Id: wrappers-vserver.hc 2501 2007-02-20 17:33:35Z dhozac $ --*- c++ -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
}
inline static WRAPPER_DECL void
-Evc_ctx_migrate(xid_t xid)
+Evc_ctx_migrate(xid_t xid, uint_least64_t flags)
{
- FatalErrnoError(vc_ctx_migrate(xid)==-1, "vc_ctx_migrate()");
+ FatalErrnoError(vc_ctx_migrate(xid, flags)==-1, "vc_ctx_migrate()");
}
inline static WRAPPER_DECL void
--- /dev/null
+## $Id$ -*- makefile -*-
+
+## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+
+AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += \
+ $(gentoo_src_SCRPTS)
+
+gentoo_src_SCRPTS = gentoo/vprocunhide \
+ gentoo/vservers.default \
+ gentoo/util-vserver
+
+EXTRA_DIST += $(gentoo_src_SCRPTS)
+
+if HAVE_GENTOO_INIT
+initrd_SCRIPTS += $(gentoo_src_SCRPTS)
+endif
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+set_helper() {
+ local f="/proc/sys/kernel/vshelper"
+ if [ -e "$f" ]; then
+ echo "$_VSHELPER" > "$f"
+ fi
+ return 0
+}
+
+kill_contexts() {
+ local xid
+ for xid in `ls -1 /proc/virtual`; do
+ [ "$xid" = "info" -o "$xid" = "status" ] && continue
+ $_VATTRIBUTE --xid $xid --set --flag ~persistent
+ $_VKILL --xid $xid -s 15
+ sleep 3
+ $_VKILL --xid $xid -s 9
+ done
+ local alive=0
+ for xid in `ls -1 /proc/virtual`; do
+ [ "$xid" = "info" -o "$xid" = "status" ] && continue
+ let alive+=1
+ done
+ return $alive
+}
+
+start() {
+ : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+ if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then
+ eerror "Cannot find util-vserver installation"
+ eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
+ return 1
+ fi
+
+ source ${UTIL_VSERVER_VARS}
+ source "$_LIB_FUNCTIONS"
+ source "$__PKGLIBDIR/vserver.functions"
+
+ ebegin "Setting vshelper path to $_VSHELPER"
+ set_helper
+ eend $?
+
+ ebegin "Loading default device map"
+ loadDeviceMap 0 "$__CONFDIR/.defaults/apps/vdevmap"
+ eend $?
+}
+
+stop() {
+ : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+ if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then
+ eerror "Cannot find util-vserver installation"
+ eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
+ return 1
+ fi
+
+ source ${UTIL_VSERVER_VARS}
+ source "$_LIB_FUNCTIONS"
+ source "$__PKGLIBDIR/vserver.functions"
+
+ ebegin "Stopping all running guests"
+ $_START_VSERVERS -j 1 --all --stop
+ eend $?
+
+ ebegin "Killing all running contexts"
+ kill_contexts
+ eend $?
+}
+
+# vim:ts=4:filetype=gentoo-init-d
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ : ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+ if [[ ! -e ${UTIL_VSERVER_VARS} ]]; then
+ eerror "Cannot find util-vserver installation"
+ eerror "(the file '$UTIL_VSERVER_VARS' would be expected)"
+ return 1
+ fi
+
+ source ${UTIL_VSERVER_VARS}
+
+ ebegin "Fixing /proc entries visibility"
+ ${_VPROCUNHIDE}
+ eend $?
+}
+
+# vim:ts=4:filetype=gentoo-init-d
--- /dev/null
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ need util-vserver vprocunhide
+}
+
+start() {
+ MARK=${SVCNAME#vservers.} /usr/lib/util-vserver/vserver-wrapper start
+}
+
+stop() {
+ MARK=${SVCNAME#vservers.} /usr/lib/util-vserver/vserver-wrapper stop
+}
+
+
+
+# vim:ts=4:filetype=gentoo-init-d
--- /dev/null
+#ifndef _VX_DEVICE_CMD_H
+#define _VX_DEVICE_CMD_H
+
+
+/* device vserver commands */
+
+#define VCMD_set_mapping VC_CMD(DEVICE, 1, 0)
+
+struct vcmd_set_mapping_v0 {
+ const char *device;
+ const char *target;
+ uint32_t flags;
+};
+
+
+#endif /* _VX_DEVICE_CMD_H */
#define VCMD_set_sched_v2 VC_CMD(SCHED, 1, 2)
#define VCMD_set_sched_v3 VC_CMD(SCHED, 1, 3)
-#define VCMD_set_sched VC_CMD(SCHED, 1, 4)
+#define VCMD_set_sched_v4 VC_CMD(SCHED, 1, 4)
struct vcmd_set_sched_v2 {
int32_t fill_rate;
int32_t bucket_id;
};
+#define VCMD_set_sched VC_CMD(SCHED, 1, 5)
+#define VCMD_get_sched VC_CMD(SCHED, 2, 5)
+
+struct vcmd_sched_v5 {
+ uint32_t mask;
+ int32_t cpu_id;
+ int32_t bucket_id;
+ int32_t fill_rate[2];
+ int32_t interval[2];
+ int32_t tokens;
+ int32_t tokens_min;
+ int32_t tokens_max;
+ int32_t prio_bias;
+};
#define VXSM_FILL_RATE 0x0001
#define VXSM_INTERVAL 0x0002
#define VXSM_CPU_ID 0x1000
#define VXSM_BUCKET_ID 0x2000
+#define VXSM_MSEC 0x4000
+
#define SCHED_KEEP (-2) /* only for v2 */
+
+#define VCMD_sched_info VC_CMD(SCHED, 3, 0)
+
+struct vcmd_sched_info {
+ int32_t cpu_id;
+ int32_t bucket_id;
+ uint64_t user_msec;
+ uint64_t sys_msec;
+ uint64_t hold_msec;
+ uint32_t token_usec;
+ int32_t vavavoom;
+};
+
#endif /* _VX_SCHED_CMD_H */
|STATS |DESTROY|ALTER |CHANGE |LIMIT |TEST | | | |
|INFO |SETUP | |MOVE | | | | | |
-------+-------+-------+-------+-------+-------+-------+ +-------+-------+
- SYSTEM |VERSION|VSETUP |VHOST | | | | |DEVICES| |
+ SYSTEM |VERSION|VSETUP |VHOST | | | | |DEVICE | |
HOST | 00| 01| 02| 03| 04| 05| | 06| 07|
-------+-------+-------+-------+-------+-------+-------+ +-------+-------+
CPU | |VPROC |PROCALT|PROCMIG|PROCTRL| | |SCHED. | |
#define VC_CAT_VSETUP 1
#define VC_CAT_VHOST 2
+#define VC_CAT_DEVICE 6
+
#define VC_CAT_VPROC 9
#define VC_CAT_PROCALT 10
#define VC_CAT_PROCMIG 11
-## $Id: Makefile-files 2415 2006-12-08 13:24:49Z dhozac $ -*- makefile -*-
+## $Id: Makefile-files 2449 2007-01-10 18:53:07Z dhozac $ -*- makefile -*-
## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##
lib/syscall_getspacemask-v21.hc \
lib/syscall_enternamespace-v21.hc \
lib/syscall_setnamespace-v21.hc \
- lib/syscall_ctxmigrate-v21.hc
+ lib/syscall_ctxmigrate-v21.hc \
+ lib/syscall_setmapping.c \
+ lib/syscall_setmapping-v21.hc \
+ lib/syscall_schedinfo.c \
+ lib/syscall_schedinfo-v21.hc
if ENSC_HAVE_C99_COMPILER
lib_v13_SRCS += lib/syscall_adddlimit-v13.hc \
-// $Id: cflags-v13.c 2393 2006-11-23 18:30:29Z dhozac $ --*- c -*--
+// $Id: cflags-v13.c 2533 2007-04-21 14:06:26Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <ensc@delenn.intern.sigma-chemnitz.de>
//
// Some pseudo flags
DECL("secure", VC_VXF_HIDE_NETIF),
- DECL("default", VC_VXF_VIRT_UPTIME),
+ DECL("default", VC_VXF_VIRT_UPTIME|VC_VXF_SC_HELPER),
// Aliases for the legacy flags
DECL("info_lock", VC_VXF_INFO_LOCK),
-// $Id: checkconfig.c 2415 2006-12-08 13:24:49Z dhozac $ --*- c++ -*--
+// $Id: checkconfig.c 2464 2007-01-20 13:55:42Z dhozac $ --*- c++ -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
// Copyright (C) 2006 Daniel Hokka Zakrisson
if (res==0) {
res = vc_get_vci();
v_errno = errno;
- if (res==(uint32_t)-1 && (errno==ENOSYS || errno==EINVAL)) res=0;
+ if (res==(uint32_t)-1) res=0;
}
errno = v_errno;
-// $Id: getvserverbyctx.c 2182 2005-10-25 16:20:07Z ensc $ --*- c -*--
+// $Id: getvserverbyctx.c 2444 2007-01-03 11:55:04Z dhozac $ --*- c -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
/*@null@*/char const *revdir,
bool validate_result)
{
- if (vc_isSupported(vcFEATURE_MIGRATE))
- return vc_getVserverByCtx_v13(ctx, style, revdir, validate_result);
- else
- return vc_getVserverByCtx_compat(ctx, style, revdir, validate_result);
+ char *ret;
+ if (vc_isSupported(vcFEATURE_MIGRATE)) {
+ ret = vc_getVserverByCtx_v13(ctx, style, revdir, validate_result);
+ if (ret)
+ return ret;
+ }
+ return vc_getVserverByCtx_compat(ctx, style, revdir, validate_result);
}
char *
-// $Id: getxidtype.c 2415 2006-12-08 13:24:49Z dhozac $ --*- c -*--
+// $Id: getxidtype.c 2493 2007-02-10 15:06:07Z dhozac $ --*- c -*--
// Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
if (MIN_D_CONTEXT == 0 && (utilvserver_checkCompatConfig() & VC_VCI_NO_DYNAMIC) == 0)
MIN_D_CONTEXT = 49152;
else
- MIN_D_CONTEXT = MAX_S_CONTEXT;
+ MIN_D_CONTEXT = MAX_S_CONTEXT+1;
if (xid==0) return vcTYPE_MAIN;
if (xid==1) return vcTYPE_WATCH;
-// $Id: issupported.c 2247 2006-01-18 23:35:54Z ensc $ --*- c -*--
+// $Id: issupported.c 2449 2007-01-10 18:53:07Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
case vcFEATURE_VWAIT : return ver >= 0x00010025;
case vcFEATURE_SCHED : return ver >= 0x00020000; // todo
case vcFEATURE_VNET : return ver >= 0x00020001;
+ case vcFEATURE_VSTAT : return ver >= 0x00020103;
default : assert(false);
}
-// $Id: issupportedstring.c 2247 2006-01-18 23:35:54Z ensc $ --*- c -*--
+// $Id: issupportedstring.c 2449 2007-01-10 18:53:07Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
DECL(VKILL), DECL(IATTR), DECL(RLIMIT), DECL(COMPAT),
DECL(MIGRATE), DECL(NAMESPACE), DECL(SCHED), DECL(VINFO),
DECL(VHI), DECL(VSHELPER0), DECL(VSHELPER), DECL(VWAIT),
- DECL(VNET)
+ DECL(VNET), DECL(VSTAT),
};
bool
- // from http://vserver.13thfloor.at/Experimental/SYSCALL/syscall_shiny10.h
+ // from http://vserver.13thfloor.at/Experimental/SYSCALL/syscall_shiny17.h
#ifndef __SYSCALL_NEW_H
#define __SYSCALL_NEW_H
-/* Copyright (C) 2005-2006 Herbert Pötzl
+/* Copyright (C) 2005-2007 Herbert Pötzl
global config options
- __sysc_setret ... set return value (default none)
- __sysc_seterr ... set error value (default errno)
-
+ __sysc_seterr ... set error value (def: errno)
+ __sysc_cid(N) ... syscall 'name' id (def: __NR_<N>)
arch specific config
- __sysc_reg_cid ... the callid (if define), immediate otherwise
-
- __sysc_reg(n) ... syscall argument registers
-
- __sysc_reg_res ... simple result register (either that or)
- __sysc_reg_ret ... complex result register (and)
- __sysc_reg_err ... complex error register
-
- __sysc_cmd_pre ... preparation command(s) __sysc_pre(n)
- __sysc_cmd_sys ... the syscall __sysc_cmd(n)
- __sysc_cmd_fin ... syscall finalization __sysc_fin(n)
+ __sysc_regs ... the syscall registers (asm load)
+ __sysc_cmd(n) ... the syscall
+ __sysc_reg_cid ... syscall id register (asm load)
+ __sysc_reg_ret ... syscall return register (asm out)
+ __sysc_reg_err ... syscall error register (asm out)
- __sysc_clobber ... clobbered registers (default memory)
- __sysc_max_err ... maximum error number (for simple result)
+ __sysc_clbrs ... the clobbered syscall registers
+ __sysc_clobber ... clobbered registers (def: memory)
+ __sysc_max_err ... maximum error number (def: separate)
+ __sysc_errc(r,e)... error condition (def: e)
- __sysc_errc(r,e) ... error condition (e cmplx)
- __sysc_retv(t,r,e) ... syscall return value (e cmplx)
+ __sysc_type ... type of syscall arguments (def: long)
+ __sysc_acon(n) ... argument constraint (def: "r")
+ __sysc_con_cid ... syscall id constraint (def: "i"/"r")
+ __sysc_con_ret ... return value contraint (def: "=r")
+ __sysc_con_err ... error value contraint (def: "=r")
- if gcc cannot be trusted
+ hard core replacements
- __sysc_load(r,a) ... asm code for register load
- __sysc_save(r,a) ... asm code to save result(s)
- __sysc_limm(r,i) ... asm code to load immediate
- __sysc_rcon(n) ... syscall register constraint
- __sysc_regs ... list of input regs for clobber
- __sysc_type ... register type
- __sysc_aout ... asm code output constraint
-
- if all else fails
-
- __sc_asmload(n,N,...) ... asm code to prepare arguments
- __sc_asmsysc(n,N) ... asm code to execute syscall
- __sc_asmsave(n) ... asm code to store results
+ __sc_body(n,type,name,...)
+ __sc_results
+ __sc_cidvar(N)
+ __sc_input(n,...)
+ __sc_syscall(n,N,...)
+ __sc_return(t)
*/
+ /* some fallback defaults */
+#ifndef __sysc_seterr
+#define __sysc_seterr(e) do { errno = (e); } while(0)
+#endif
+
+#ifndef __sysc_cid
+#define __sysc_cid(N) __NR_##N
+#endif
/* *****************************************
serr: e0($19) (!=0, err=sret)
call: callsys
clob: memory
+ move: mov $sR,$dR
+ picr: pr($29) do we need to save that?
*/
+#define __sysc_cmd(n) "callsys"
+
#define __sysc_reg_cid "$0"
+#define __sysc_con_cid "v"
#define __sysc_reg_ret "$0"
+#define __sysc_con_ret "=v"
#define __sysc_reg_err "$19"
-#define __sysc_cmd_sys "callsys"
-
-#define __sysc_reg(n) __arg_##n\
- ("$16", "$17", "$18", "$19", "$20", "$21")
-
-#define __sysc_clobber __sysc_regs, \
- "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
- "$22", "$23", "$24", "$25", "$27", "$28", "memory" \
+#define __sysc_regs "$16", "$17", "$18", "$19", "$20", "$21"
+#define __sysc_clbrs "$16", "$17", "$18", "memory", "$20", "$21"
+#define __sysc_clobber "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
+ "$22", "$23", "$24", "$25", "$27", "$28", "memory"
/* *****************************************
serr: (sret >= (unsigned)-EMAXERRNO)
call: swi
clob: memory
+ move: mov $dR,$sR
*/
#define __sysc_max_err 125
-#define __sysc_reg_res "r0"
-#define __sysc_cmd_sys "swi %0"
-#define __sysc_reg(n) __arg_##n\
- ("r0", "r1", "r2", "r3", "r4", "r5")
+#define __sysc_cmd(n) "swi %1"
-#define __sysc_clobber __sysc_regs, "memory"
+#define __sysc_regs "r0", "r1", "r2", "r3", "r4", "r5"
+#define __sysc_reg_ret "r0"
#warning syscall arch arm not tested yet
clob: memory
*/
-#define __sysc_max_err 125
-#define __sysc_reg_cid "r9"
-#define __sysc_reg_res "r0"
-#define __sysc_cmd_sys "break 13"
-
-#define __sysc_regs "r10", "r11", "r12", "r13"
-#define __sysc_reg(n) __arg_##n\
- ("r10", "r11", "r12", "r13", "r0", "srp")
-
-#define __sysc_pre(n) __casm(n,5,0,"move r0,mof",)
-
-#define __sysc_clobber __sysc_regs, "memory"
-
-#warning syscall arch cris not tested yet
+#error syscall arch cris not implemented yet
clob: memory
*/
-#define __sysc_max_err 125
-#define __sysc_reg_cid "gr7"
-#define __sysc_reg_res "gr8"
-#define __sysc_cmd_sys "tira gr0,#0"
-
-#define __sysc_reg(n) __arg_##n\
- ("gr8", "gr9", "gr10", "gr11", "gr12", "gr13")
-
-#define __sysc_clobber __sysc_regs, "memory"
-
-#warning syscall arch frv not tested yet
+#error syscall arch frv not implemented yet
clob: memory
*/
-#define __sysc_max_err 125
-#define __sysc_reg_res "er0"
-
-#define __sysc_reg(n) __arg_##n\
- ("er1", "er2", "er3", "er4", "er5", "er6")
-
-#define __sysc_clobber "memory"
-
-#define __sc_asmload(n,N,...) __sc_asm ( \
- __casm(n,1,1, "mov.l %0,er1" , )\
- __casm(n,2,1, "mov.l %1,er2" , )\
- __casm(n,3,1, "mov.l %2,er3" , )\
- __casm(n,4,1, "mov.l %3,er4" , )\
- __casm(n,5,1, "mov.l %4,er5" , )\
- __casm(n,6,1, "mov.l er6,@-sp" , )\
- __casm(n,6,1, "mov.l %5,er6" , )\
- ""::__sc_iregs(n,__VA_ARGS__):__sysc_regs)
-
-#define __sysc_cmd_pre "mov.l %0,er0"
-#define __sysc_cmd_sys "trapa #0"
-#define __sysc_fin(n) __casm(n,6,0,"mov.l @sp+,er6",)
-
-#warning syscall arch h8300 not tested yet
+#error syscall arch h8300 not implemented yet
serr: (sret >= (unsigned)-EMAXERRNO)
call: ble 0x100(%%sr2, %%r0)
clob: r1, r2, (r4), r20, r29, r31, memory
- picr: pr(r19)
+ picr: pr(r19) do we need to save that?
*/
#define __sysc_max_err 4095
-#define __sysc_reg_res "r28"
-
-#define __sysc_reg(n) __arg_##n\
- ("r26", "r25", "r24", "r23", "r22", "r21")
-#define __sysc_cmd_sys "ble 0x100(%%sr2,%%r0)"
+#define __sysc_cmd(n) \
+ __pasm(n,1,1, "copy %%r19, %%r4" ,)\
+ __casm(n,0,1, "ble 0x100(%%sr2,%%r0)" ,)\
+ __casm(n,0,1, "ldi %1,%%r20" ,)\
+ __pasm(n,1,1, "copy %%r4, %%r19" ,)
-#define __sysc_pre(n) \
- __pasm(n,1,1, "copy %%r19, %%r4" , )
-
-#define __sysc_fin(n) \
- __casm(n,1,1, "ldi %0,%%r20" , )\
- __pasm(n,1,1, "copy %%r4, %%r19" , )
+#define __sysc_regs "r26", "r25", "r24", "r23", "r22", "r21"
#ifndef __PIC__
-#define __sysc_clobber __sysc_regs, \
- "r1", "r2", "r20", "r29", "r31", "memory"
+#define __sysc_clobber "r1", "r2", "r20", "r29", "r31", "memory"
#else
-#define __sysc_clobber __sysc_regs, \
- "r1", "r2", "r4", "r20", "r29", "r31", "memory"
+#define __sysc_clobber "r1", "r2", "r4", "r20", "r29", "r31", "memory"
#endif
+#warning syscall arch hppa not tested yet
+
+
/* *****************************************
I386 I386 I386 I386 *
call: int 0x80
picr: pr(ebx)
clob: memory
+ move: movl $sR,$dR
*/
#define __sysc_max_err 129
-#define __sysc_reg_res "eax"
-#define __sysc_cmd_sys "int $0x80"
-#ifndef __PIC__
-#define __sysc_regs "ebx", "ecx", "edx", "esi", "edi"
-#else
-#define __sysc_regs "ecx", "edx", "esi", "edi"
-#endif
+#define __sc_reg1(...) __sc_cast(__arg_1(__VA_ARGS__,,,,,,))
+#define __sc_reg6(...) __sc_cast(__arg_6(__VA_ARGS__,,,,,,))
+
+#define __scsd struct { __sc_ldef(__a); __sc_ldef(__b); } __scs
+#define __scsa(n,...) \
+ __scs.__a = __sc_reg1(__VA_ARGS__); \
+ __scs.__b = __sc_reg6(__VA_ARGS__);
+
+#define __sc_input(n,...) __casm(n,6,0, \
+ __scsd; __scsa(n,__VA_ARGS__), )
+
+#define __cm ,
+#define __sc_null(n) __arg_##n( \
+ __cm,__cm,__cm,__cm,__cm,__cm)
-#define __sc_asmload(n,N,...) __sc_asm ( \
- __casm(n,6,1, "movl %5,%%eax" , )\
- __casm(n,5,1, "movl %4,%%edi" , )\
- __casm(n,4,1, "movl %3,%%esi" , )\
- __casm(n,3,1, "movl %2,%%edx" , )\
- __casm(n,2,1, "movl %1,%%ecx" , )\
- __pasm(n,1,1, "pushl %%ebx" , )\
- __casm(n,1,1, "movl %0,%%ebx" , )\
- __casm(n,6,1, "pushl %%ebp" , )\
- ""::__sc_iregs(n,__VA_ARGS__):__sysc_clobber)
+#define __sc_rvcs(r,v) r (__sc_cast(v))
-#define __sc_asmsave(n)
+#define __sc_rvrd(n,N) __arg_##n(, \
+ __cm __sc_rvcs("c", N), \
+ __cm __sc_rvcs("d", N), \
+ __cm __sc_rvcs("S", N), \
+ __cm __sc_rvcs("D", N),)
-#define __sysc_pre(n) \
- __casm(n,6,1, "movl %%eax,%%ebp" , )\
- __casm(n,0,1, "movl %1,%%eax" , )\
+#define __sc_arg1(n,...) __Casm(n,1,6,0,, \
+ __sc_rvcs(__pic("ri") __nopic("b"), \
+ __sc_reg1(__VA_ARGS__)), \
+ __sc_rvcs("0", &__scs))
-#define __sysc_fin(n) \
- __casm(n,6,1, "popl %%ebp" , )\
- __pasm(n,1,1, "popl %%ebx" , )\
+#define __sc_syscall(n,N,...) \
+ __sc_asm_vol (__sysc_cmd(n) \
+ : __sc_oregs \
+ : __sc_cidval(N) __sc_null(n) \
+ __sc_arg1(n,__VA_ARGS__) \
+ __con_##n(__sc_rvrd,__VA_ARGS__) \
+ : "memory" )
+
+#define __sysc_cmd(n) \
+ __pasm(n,1,1, "pushl %%ebx" ,)\
+ __Pasm(n,1,5,1,,"movl %2, %%ebx" ,)\
+ __casm(n,6,1, "pushl %%ebp" ,)\
+ __casm(n,6,1, "movl 0(%2), %%ebx" ,)\
+ __casm(n,6,1, "movl 4(%2), %%ebp" ,)\
+ __casm(n,0,1, "movl %1, %%eax" ,)\
+ __casm(n,0,1, "int $0x80" ,)\
+ __casm(n,6,1, "popl %%ebp" ,)\
+ __pasm(n,1,1, "popl %%ebx" ,)
+
+#define __sysc_reg_ret "eax"
+#define __sysc_con_ret "=a"
-#define __sysc_aout "=a"(__res)
-#define __sysc_clobber __sysc_regs, "memory"
/* *****************************************
serr: e0(r10)
call: break 0x100000
clob: out6/7, r2/3/9, r11-r14, r16-r31, p6-p15, f6-f15, b6/7
+ move: mov %dR = %sR
*/
+#define __sysc_errc(r,e) ((e) == -1)
+
+#define __sysc_cmd(n) "break.i 0x100000"
+#define __sysc_regs "out0", "out1", "out2", "out3", "out4", "out5"
+#define __sysc_reg_cid "r15"
#define __sysc_reg_ret "r8"
#define __sysc_reg_err "r10"
-#define __sysc_reg_cid "r15"
-#define __sysc_cmd_sys "break.i 0x100000"
-#define __sysc_errc(r,e) ((e) == -1)
-
-#define __sysc_reg(n) __arg_##n\
- ("out0", "out1", "out2", "out3", "out4", "out5")
-
-#define __sysc_clobber __sysc_regs, \
+#define __sysc_clobber \
"out6", "out7", "r2", "r3", "r9", "r11", "r12", "r13", \
- "r14", "r16", "r17", "r18", "r19", "r20", "r21", "r22", \
+ "r14", "r16", "r17", "r18", "r19", "r20", "r21", "r22", \
"r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", \
"r31", "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", \
"p14", "p15", "f6", "f7", "f8", "f9", "f10", "f11", "f12", \
serr: (sret >= (unsigned)-EMAXERRNO)
call: trap #2
clob: out6/7, r2/3/9, r11-r14, r16-r31, p6-p15, f6-f15, b6/7
+ move: mv %dR,%sR
*/
#define __sysc_max_err 125
-#define __sysc_reg_cid "r7"
-#define __sysc_reg_res "r0"
-#define __sysc_cmd_sys "trap #2"
-#define __sysc_reg(n) __arg_##n\
- ("r0", "r1", "r2", "r3", "r4", "r5")
+#define __sysc_cmd(n) "trap #2"
-#define __sysc_clobber __sysc_regs, "memory"
+#define __sysc_regs "r0", "r1", "r2", "r3", "r4", "r5"
+#define __sysc_reg_cid "r7"
+#define __sysc_reg_ret "r0"
#warning syscall arch m32r not tested yet
#elif defined(__mips__)
/* The ABIO32 calling convention uses a0-a3 to pass the first
- four arguments, the rest is passed on the userspace stack. The 5th arg
- starts at 16($sp).
+ four arguments, the rest is passed on the userspace stack.
+ The 5th arg starts at 16($sp). The new mips calling abi uses
+ registers a0-a5, restart requires a reload of v0 (#syscall)
ABIN32 and ABI64 pass 6 args in a0-a3, t0-t1.
scnr: id(v0)
- args: a1(a0), a2(a1), a3(a2), a4(a3), a5(16($sp)), a6(20($sp))
+ args: a1(a0), a2(a1), a3(a2), a4(a3), a5(t0), a6(t1)
sret: r0(v0)
serr: e0(a3)
call: syscall
- clob: at, v0, t0-t7, t8-t9
+ clob: at, v1, t2-t7, t8-t9
+ move: move %dR,%sR
*/
-#define __sysc_reg_cid "v0"
+#define __sysc_cmd(n) \
+ __casm(n,0,1, "ori $v0,$0,%2" ,)\
+ __casm(n,0,1, "syscall" ,)
+
+#define __sysc_regs "a0","a1","a2","a3", "t0", "t1"
#define __sysc_reg_ret "v0"
#define __sysc_reg_err "a3"
-#define __sysc_cmd_sys "syscall"
-
-#define __sysc_reg(n) __arg_##n\
- ("a0","a1","a2","a3", "t0", "t1")
-
-#define __sysc_clobber "$1", "$3", "$8", "$9", "$10", "$11", "$12", \
- "$13", "$14", "$15", "$24", "$25", "memory"
-
-#if _MIPS_SIM == _ABIO32
-#define __sysc_pre(n) \
- __casm(n,5,1,"addiu $sp,$sp,-32",) \
- __casm(n,6,1,"sw $9,20($sp)",) \
- __casm(n,5,1,"sw $8, 16($sp)",)
-#define __sysc_fin(n) \
- __casm(n,5,1,"addiu $sp,$sp,32",)
-#elif (_MIPS_SIM == _ABIN32) || (_MIPS_SIM == _ABI64)
-#warning syscall arch mips with ABI N32 and 64 not tested yet
-#else
-#error unknown mips ABI version
-#endif
+
+#define __sysc_clobber "$1", "$3", "$10", "$11", "$12", \
+ "$13", "$14", "$15", "$24", "$25", "memory"
+
+#warning syscall arch mips not tested yet
+
/* *****************************************
sret: r0(r3)
serr: (carry)
call: sc
- clob: cr0, ctr
+ clob: r9-r12, cr0, ctr
+ move: mr %dR,%sR
*/
-
-#define __sysc_reg_cid "r0"
-#define __sysc_reg_ret "r3"
-#define __sysc_reg_err "r0"
-
#define __sysc_errc(r,e) ((e) & 0x10000000)
-#define __sysc_reg(n) __arg_##n\
- ("r3", "r4", "r5", "r6", "r7", "r8")
+#define __sysc_cmd(n) \
+ __casm(n,0,1, "sc" ,)\
+ __casm(n,0,1, "mfcr %1" ,)
-#define __sysc_cmd_sys "sc"
-#define __sysc_cmd_fin "mfcr 0"
+#define __sysc_regs "r3", "r4", "r5", "r6", "r7", "r8"
+#define __sysc_reg_cid "r0"
+#define __sysc_reg_ret "r3"
-#define __sysc_clobber __sysc_regs, \
- "r9", "r10", "r11", "r12", "cr0", "ctr", "memory"
+#define __sysc_clobber "r9", "r10", "r11", "r12", "cr0", "ctr", "memory"
*/
#define __sysc_max_err 4095
-#define __sysc_reg_cid "r1"
-#define __sysc_reg_res "r2"
-#define __sysc_cmd_sys "svc 0"
-#define __sysc_regtyp unsigned long
+#define __sysc_cmd(n) "svc 0"
+
+// #define __sysc_type unsigned long
-#define __sysc_reg(n) __arg_##n\
- ("r2", "r3", "r4", "r5", "r6", "r7")
+#define __sysc_regs "r2", "r3", "r4", "r5", "r6", "r7"
+#define __sysc_reg_cid "r1"
+#define __sysc_reg_ret "r2"
-#define __sysc_clobber __sysc_regs, "memory"
+#warning syscall arch s390 not tested yet
/* The SuperH calling convention passes the first four arguments
in r4-r7, the remainder is spilled onto the stack. However
- the Linux kernel passes the remainder in r0-r2.
+ the Linux kernel passes the remainder in r0-r1.
scnr: id(r3)
args: a1(r4), a2(r5), a3(r6), a4(r7), a5(r0), a6(r1)
serr: (sret >= (unsigned)-EMAXERRNO)
call: trapa #0x1x (x=#args)
clob: memory
+ move: ori %sR,0,%dR
*/
-#define __sysc_max_err 4095
-#define __sysc_reg_cid "r3"
-#define __sysc_reg_res "r0"
-
-#define __sysc_reg(n) __arg_##n\
- ("r4", "r5", "r6", "r7", "r0", "r1")
+#ifdef __sh2__
+#define __sysc_arch "trapa #0x2"
+#else
+#define __sysc_arch "trapa #0x1"
+#endif
-#define __sysc_cmd(n) "trapa #0x1" __stringify(n)
+#define __sysc_max_err 4095
-#define __rep_6(x) x x x x x x
-#define __sysc_cmd_fin __rep_6("or r0,r0\n\t")
+#define __sysc_cmd(n) __sysc_arch #n
-#define __sysc_clobber __sysc_regs, "memory"
+#define __sysc_regs "r4", "r5", "r6", "r7", "r0", "r1"
+#define __sysc_reg_cid "r3"
+#define __sysc_reg_ret "r0"
#warning syscall arch sh not tested yet
#elif defined(__sh__) && defined(__SH5__)
/* The SuperH-5 calling convention passes the first eight
- arguments in r2-r9
+ arguments in r2-r9. The Linux kernel uses only six of
+ them as arguments, and the last one for the syscall id.
scnr: id(r9)
args: a1(r2), a2(r3), a3(r4), a4(r5), a5(r6), a6(r7)
serr: (sret >= (unsigned)-EMAXERRNO)
call: trapa #0x1x (x=#args)
clob: memory
+ move: ori %sR,0,%dR
*/
#define __sysc_max_err 4095
-#define __sysc_reg_res "r9"
-#define __sysc_cmd_sys "trapa r9"
-#define __sysc_reg(n) __arg_##n\
- ("r2", "r3", "r4", "r5", "r6", "r7")
+#define __sysc_cmd(n) \
+ __casm(n,0,1, "movi 0x1" #n ",r9" ,)\
+ __casm(n,0,1, "shori %1,r9" ,)\
+ __casm(n,0,1, "trapa r9" ,)
-#define __sc_asmsysc(n,N) __sc_asm_vol ( \
- __casm(n,0,1, "movi %0,r9" , )\
- __casm(n,0,1, __sc_cmds(n,N) , )\
- ""::"i"(__sc_id(N) | 0x1##n << 16) : __sysc_clobber)
-
-#define __sysc_clobber __sysc_regs, "memory"
+#define __sysc_regs "r2", "r3", "r4", "r5", "r6", "r7"
+#define __sysc_reg_ret "r9"
#warning syscall arch sh64 not tested yet
serr: (carry)
call: ta 0x6d, t 0x10
clob: g1-g6, g7?, o7?, f0-f31, cc
+ move: mov %sR,%dR
*/
-#define __sysc_max_err 515
-#define __sysc_reg_cid "g1"
-#define __sysc_reg_ret "o0"
-#define __sysc_reg_err "l1"
-
-#define __sysc_reg(n) __arg_##n\
- ("o0", "o1", "o2", "o3", "o4", "o5")
-
#ifdef __arch64__
-#define __sysc_cmd_sys "ta 0x6d"
+#define __sysc_arch "ta 0x6d"
#else
-#define __sysc_cmd_sys "t 0x10"
+#define __sysc_arch "ta 0x10"
#endif
-#define __sysc_cmd_fin "addx %%g0,%%g0,%%l1"
+#define __sysc_cmd(n) \
+ __casm(n,0,1, __sysc_arch ,)\
+ __casm(n,0,1, "addx %%g0,%%g0,%1" ,)
+#define __sysc_regs "o0", "o1", "o2", "o3", "o4", "o5"
+#define __sysc_reg_cid "g1"
+#define __sysc_reg_ret "o0"
-#define __sysc_clobber __sysc_regs, \
- "g2", "g3", "g4", "g5", "g6", \
+#define __sysc_clobber "g2", "g3", "g4", "g5", "g6", \
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", \
"f9", "f10", "f11", "f12", "f13", "f14", "f15", "f16", \
"f17", "f18", "f19", "f20", "f21", "f22", "f23", "f24", \
"f50", "f52", "f54", "f56", "f58", "f60", "f62", \
"cc", "memory"
-#warning syscall arch sparc not tested yet
-
/* *****************************************
*/
#define __sysc_max_err 515
-#define __sysc_reg_cid "r12"
-#define __sysc_reg_res "r10"
-#define __sysc_reg(n) __arg_##n\
- ("r6", "r7", "r8", "r9", "r13", "r14")
+#define __sysc_cmd(n) \
+ __casm(n,4,0, "trap 1" ,"trap 0" )
-#define __sysc_cmd(n) __casm(n,4,0,"trap 1","trap 0")
+#define __sysc_regs "r6", "r7", "r8", "r9", "r13", "r14"
+#define __sysc_reg_cid "r12"
+#define __sysc_reg_ret "r10"
-#define __sysc_clobber __sysc_regs, \
- "r1", "r5", "r11", "r15", "r16", "r17", "r18", "r19", "memory"
+#define __sysc_clobber "r1", "r5", "r11", \
+ "r15", "r16", "r17", "r18", "r19", "memory"
#warning syscall arch v850 not tested yet
*/
#define __sysc_max_err 4095
-#define __sysc_reg_cid "rax"
-#define __sysc_reg_res "rax"
-#define __sysc_cmd_sys "syscall"
-#define __sysc_reg(n) __arg_##n\
- ("rdi", "rsi", "rdx", "r10", "r8", "r9")
+#define __sysc_cmd(n) "syscall"
-#define __sysc_clobber __sysc_regs, \
- "cc", "r11", "rcx", "memory"
+#define __sysc_regs "rdi", "rsi", "rdx", "r10", "r8", "r9"
+#define __sysc_reg_cid "rax"
+#define __sysc_reg_ret "rax"
+#define __sysc_con_ret "=a"
-#define __sysc_aout "=a"(__res)
+#define __sysc_clobber "cc", "r11", "rcx", "memory"
#else
#error unknown kernel arch
#endif
+
+ /* implementation defaults */
+
+
+
+#ifndef __sysc_clobber
+#define __sysc_clobber "memory"
+#endif
+
+#ifndef __sysc_acon
+#define __sysc_acon(n) "r"
+#endif
+
+#ifndef __sysc_con_ret
+#define __sysc_con_ret "=r"
+#endif
+
+#ifndef __sysc_con_err
+#define __sysc_con_err "=r"
+#endif
+
+#ifndef __sysc_con_cid
+#ifdef __sysc_reg_cid
+#define __sysc_con_cid "r"
+#else
+#define __sysc_con_cid "i"
+#endif
+#endif
+
+#ifndef __sysc_type
+#define __sysc_type long
+#endif
+#ifdef __sysc_regs
+#define __sysc_rega(n,...) __arg_##n(__VA_ARGS__)
+#ifndef __sysc_reg
+#define __sysc_reg(n) __sysc_rega(n,__sysc_regs)
+#endif
+#endif
#define __lst_4(x,a1,a2,a3,a4) __lst_3(x,a1,a2,a3),x(4,a4)
#define __lst_3(x,a1,a2,a3) __lst_2(x,a1,a2),x(3,a3)
#define __lst_2(x,a1,a2) __lst_1(x,a1),x(2,a2)
-#define __lst_1(x,a1) __lst_0(x,*)x(1,a1)
+#define __lst_1(x,a1) __lst_0(x,*),x(1,a1)
#define __lst_0(x,a0)
- /* argument concat */
+ /* argument concatenation */
#define __con_6(x,a1,a2,a3,a4,a5,a6) __con_5(x,a1,a2,a3,a4,a5)x(6,a6)
#define __con_5(x,a1,a2,a3,a4,a5) __con_4(x,a1,a2,a3,a4)x(5,a5)
#define __arg_3(a1,a2,a3,...) a3
#define __arg_4(a1,a2,a3,a4,...) a4
#define __arg_5(a1,a2,a3,a4,a5,...) a5
-#define __arg_6(a1,a2,a3,a4,a5,a6) a6
-
+#define __arg_6(a1,a2,a3,a4,a5,a6,...) a6
+ /* list remainder */
-#ifdef __PIC__
-#define __pic(v) v
-#define __nopic(v)
-#else
-#define __pic(v)
-#define __nopic(v) v
-#endif
-
-#define __casm_nl(v) v "\n\t"
+#define __rem_0(a1,a2,a3,a4,a5,a6) ,a1,a2,a3,a4,a5,a6
+#define __rem_1(a1,a2,a3,a4,a5,a6) ,a2,a3,a4,a5,a6
+#define __rem_2(a1,a2,a3,a4,a5,a6) ,a3,a4,a5,a6
+#define __rem_3(a1,a2,a3,a4,a5,a6) ,a4,a5,a6
+#define __rem_4(a1,a2,a3,a4,a5,a6) ,a5,a6
+#define __rem_5(a1,a2,a3,a4,a5,a6) ,a6
+#define __rem_6(...)
-#define __casm(n,a,r,v,w) __casm_##n##a(v,w,r)
-#define __pasm(n,a,r,v,w) __pic(__casm(n,a,r,v,w))
-#define __Pasm(n,a,r,v,w) __nopic(__casm(n,a,r,v,w))
+ /* conditional asm */
#define __casm_use(q,r,v) v __casm_use_##q##r(__casm_nl(""))
#define __casm_65(v,w,r) __casm_use(1,r,v)
#define __casm_66(v,w,r) __casm_use(1,r,v)
-#define __casm_cn_0
-#define __casm_cn_1 ,
-#define __casm_cn_2 ,
-#define __casm_cn_3 ,
-#define __casm_cn_4 ,
-#define __casm_cn_5 ,
-#define __casm_cn_6 ,
-
-
-#define __sc_asm __asm__
-#define __sc_asm_vol __asm__ __volatile__
+ /* special PIC handling */
-#ifndef __sysc_setret
-#define __sysc_setret(v) do { } while(0)
-#endif
-
-#ifndef __sysc_seterr
-#define __sysc_seterr(e) do { errno = (e); } while(0)
-#endif
-
-#ifndef __stringify0
-#define __stringify0(val) #val
-#endif
-
-#ifndef __stringify
-#define __stringify(val) __stringify0(val)
+#ifdef __PIC__
+#define __pic(v) v
+#define __nopic(v)
+#else
+#define __pic(v)
+#define __nopic(v) v
#endif
+#define __casm_nl(v) v "\n\t"
-#if !defined(__sysc_load) && !defined(__sysc_save)
-#if !defined(__sysc_limm) && !defined(__sc_asmload)
-#define __sc_trust
-#endif
-#endif
+#define __casm(n,a,r,v,w) __casm_##n##a(v,w,r)
+#define __Casm(n,a,b,r,u,v,w) __casm_##n##b(w,__casm_##n##a(v,u,r),r)
-#if defined(__sysc_reg_ret) && defined(__sysc_reg_err)
-#define __sc_complex
-#endif
+#define __pasm(n,a,r,v,w) __pic(__casm(n,a,r,v,w))
+#define __Pasm(n,a,b,r,u,v,w) __pic(__Casm(n,a,b,r,u,v,w))
+#define __nasm(n,a,r,v,w) __nopic(__casm(n,a,r,v,w))
+#define __Nasm(n,a,b,r,u,v,w) __nopic(__Casm(n,a,b,r,u,v,w))
-#ifndef __sysc_type
-#define __sysc_type long
-#endif
#define __sc_cast(v) (__sysc_type)(v)
+#define __sc_ldef(N) __sysc_type N
+#define __sc_rdef(N,R) register __sc_ldef(N) __sc_asm (R)
+#define __sc_scid(N,v) __sc_ldef(N) = __sc_cast(v)
+#define __sc_areg(N,R,v) __sc_rdef(N,R) = __sc_cast(v)
-#define __sc_reg(n) register __sysc_type n
-#define __sc_asm_reg(n,r) register __sysc_type n __sc_asm (r)
-#define __sc_asm_val(n,r,v) __sc_asm_reg(n,r) = __sc_cast(v)
+#define __sc_rval(n,v) "r"(__sc_a##n)
+#define __sc_ival(n,v) __sysc_acon(n)(__sc_cast(v))
+#define __sc_idef(n,v) __sc_areg(__sc_a##n, __sysc_reg(n), v);
-#ifndef __sysc_load
-#define __sc_inp_def(n,v) __sc_asm_val(__sc_a##n, __sysc_reg(n), v);
+#ifdef __sysc_clbrs
+#define __sc_cregs(n,...) __rem_##n(__VA_ARGS__)
#else
-#define __sc_inp_def(n,value)
+#define __sc_cregs(n,...)
#endif
-#if !defined(__sysc_save) && !defined(__sysc_aout)
-#define __sc_res_def(n,r) __sc_asm_reg(n, r);
+#ifdef __sysc_regs
+#define __sc_input(n,...) __con_##n(__sc_idef,__VA_ARGS__)
+#define __sc_ivals(n,...) __lst_##n(__sc_rval,__VA_ARGS__)
#else
-#define __sc_res_def(n,r) __sc_reg(n);
+#define __sc_ivals(n,...) __lst_##n(__sc_ival,__VA_ARGS__)
#endif
+#ifdef __sysc_reg_cid
+#define __sc_cidvar(N) __sc_areg(__sc_id, \
+ __sysc_reg_cid, __sysc_cid(N))
+#define __sc_cidval(N) __sysc_con_cid (__sc_id)
+#endif
-#define __sc_rreg(n,v) "r"(__sc_a##n)
-#define __sc_creg(n,v) __sysc_rcon(n)(__sc_cast(v))
-
-#ifdef __sc_trust
-#define __sc_iregs(n,...) __lst_##n(__sc_rreg,__VA_ARGS__)
-#define __sc_input(n,...) __con_##n(__sc_inp_def,__VA_ARGS__)
-#else
-#define __sc_iregs(n,...) __lst_##n(__sc_creg,__VA_ARGS__)
+#ifndef __sc_input
#define __sc_input(n,...)
#endif
+#ifndef __sc_cidval
+#define __sc_cidval(N) __sysc_con_cid (__sysc_cid(N))
+#endif
+#ifndef __sc_cidvar
+#define __sc_cidvar(N)
+#endif
-#define __sc_list(x) x(1), x(2), x(3), x(4), x(5), x(6)
-#ifndef __sysc_regs
-#define __sysc_regs __sc_list(__sysc_reg)
+#ifdef __sysc_reg_ret
+#define __sc_ret __ret
+#define __sc_def_ret __sc_ldef(ret); __sc_rdef(__sc_ret,__sysc_reg_ret)
+#else
+#define __sc_ret ret
+#define __sc_def_ret __sc_ldef(__sc_ret)
#endif
-#ifndef __sysc_rcon
-#define __sysc_rcon(n) "g"
+#ifdef __sysc_reg_err
+#define __sc_err __err
+#define __sc_def_err __sc_ldef(err); __sc_rdef(__sc_err,__sysc_reg_err)
+#else
+#define __sc_err err
+#define __sc_def_err __sc_ldef(__sc_err)
#endif
+#ifndef __sysc_max_err
+#define __sc_complex
+#endif
+
#ifdef __sc_complex /* complex result */
+#ifndef __sc_results
+#define __sc_results __sc_def_ret; __sc_def_err
+#endif
+
#ifndef __sysc_errc
#define __sysc_errc(ret, err) (err)
#endif
#ifndef __sysc_retv
#define __sysc_retv(type, ret, err) \
- __sysc_setret(ret); \
if (__sysc_errc(ret, err)) { \
- int __err = (ret); \
- __sysc_seterr(__err); \
+ __sysc_seterr(ret); \
ret = -1; \
} \
return (type)(ret)
#endif
-#define __sc_results \
- __sc_res_def(__err, __sysc_reg_err) \
- __sc_res_def(__ret, __sysc_reg_ret)
-
-#define __sc_oregs "=r"(__ret), "=r"(__err)
-
-#if defined(__sc_trust) || !defined(__sysc_save)
-#define __sc_saveres __sc_dummy_save(1)
-#else
-#define __sc_saveres \
- __casm_nl(__sysc_save(__sysc_reg_ret,"%0")) \
- __casm_nl(__sysc_save(__sysc_reg_err,"%1"))
+#define __sc_oregs __sysc_con_ret (__sc_ret), \
+ __sysc_con_err (__sc_err)
+#ifndef __sc_return
+#define __sc_return(t) ret = __sc_ret; err = __sc_err; \
+ __sysc_retv(t, ret, err)
#endif
-
-#define __sc_return(t) __sysc_retv(t, __ret, __err)
-
#else /* simple result */
+#ifndef __sc_results
+#define __sc_results __sc_def_ret
+#endif
+
#ifndef __sysc_errc
-#define __sysc_errc(res) \
- ((unsigned __sysc_type)(res) >= \
+#define __sysc_errc(ret) \
+ ((unsigned __sysc_type)(ret) >= \
(unsigned __sysc_type)(-(__sysc_max_err)))
#endif
#ifndef __sysc_retv
-#define __sysc_retv(type, res) \
- __sysc_setret(res); \
- if (__sysc_errc(res)) { \
- int __err = -(res); \
- __sysc_seterr(__err); \
- res = -1; \
+#define __sysc_retv(type, ret) \
+ if (__sysc_errc(ret)) { \
+ __sysc_seterr(-ret); \
+ ret = -1; \
} \
- return (type)(res)
+ return (type)(ret)
#endif
-
-#define __sc_results \
- __sc_res_def(__res, __sysc_reg_res)
-
-#define __sc_oregs "=r"(__res)
-
-#if defined(__sc_trust) || !defined(__sysc_save)
-#define __sc_saveres __sc_dummy_save(0)
-#else
-#define __sc_saveres __casm_nl(__sysc_save(__sysc_reg_res,"%0"))
+#define __sc_oregs __sysc_con_ret (__sc_ret)
+#ifndef __sc_return
+#define __sc_return(t) ret = __sc_ret; __sysc_retv(t, ret)
#endif
-
-#define __sc_return(t) __sysc_retv(t, __res)
-
#endif /* simple/complex */
-#define __sc_dummy_load(n) "/* gcc dummy load " \
- __casm(n,0,0,"%0 ",) __casm(n,1,0,"%1 ",) __casm(n,2,0,"%2 ",) \
- __casm(n,3,0,"%3 ",) __casm(n,4,0,"%4 ",) __casm(n,5,0,"%5 ",) \
- __casm(n,6,0,"%6 ",) "*/"
-
-#ifdef __sysc_aout
-#define __sc_dummy_save(n)
-#define __sc_asmsave(n)
-#else
-#define __sc_dummy_save(n) "/* gcc dummy save " \
- __casm(n,0,0,"%0 ",) __casm(n,1,0,"%1 ",) "*/"
-#endif
-
-#define __comment(name) "\t/* kernel sys_" \
- #name "[" __stringify(__sc_id(name)) "] */"
+ /* the inline syscall */
-#define __sc_id(N) __NR_##N
+#define __sc_asm __asm__
+#define __sc_asm_vol __asm__ __volatile__
-#ifndef __sysc_reg_cid
-#define __sc_cid(N) "i"(__sc_id(N))
-#define __sc_load_cid ""
-#define __sc_callid(N)
-#else
-#define __sc_cid(N) "r"(__cid)
-#define __sc_load_cid __sysc_limm(__sysc_reg_cid,"%0")
-#define __sc_callid(N) \
- __sc_asm_val(__cid, __sysc_reg_cid, __sc_id(N));
-#endif
-
-#ifndef __sysc_cmd_pre
-#define __sc_cmd_pre ""
-#else
-#define __sc_cmd_pre __casm_nl(__sysc_cmd_pre)
+#ifndef __sc_syscall
+#define __sc_syscall(n,N,...) \
+ __sc_asm_vol (__sysc_cmd(n) \
+ : __sc_oregs \
+ : __sc_cidval(N) __sc_ivals(n,__VA_ARGS__) \
+ : __sysc_clobber __sc_cregs(n,__sysc_clbrs))
#endif
-#ifndef __sysc_cmd_fin
-#define __sc_cmd_fin ""
-#else
-#define __sc_cmd_fin __sysc_cmd_fin
-#endif
-
-#ifndef __sysc_pre
-#define __sysc_pre(n) __sc_cmd_pre
-#endif
-
-#ifndef __sysc_cmd
-#define __sysc_cmd(n) __sysc_cmd_sys
-#endif
-
-#ifndef __sysc_fin
-#define __sysc_fin(n) __sc_cmd_fin
-#endif
-
-#define __sc_cmds(n,name) \
- __sysc_pre(n) \
- __casm_nl(__sysc_cmd(n) __comment(name)) \
- __sysc_fin(n)
-
-#ifndef __sc_asmload
-#ifdef __sc_trust
-#define __sc_asmload(n,N,...) __sc_asm( \
- __sc_dummy_load(n) \
- ::__sc_cid(N) __casm_cn_##n __sc_iregs(n,__VA_ARGS__))
-#else
-#define __sc_asmload(n,N,...) __sc_asm( \
- __casm(n,1,1, __sysc_load(__sysc_reg(1),"%1"), )\
- __casm(n,2,1, __sysc_load(__sysc_reg(2),"%2"), )\
- __casm(n,3,1, __sysc_load(__sysc_reg(3),"%3"), )\
- __casm(n,4,1, __sysc_load(__sysc_reg(4),"%4"), )\
- __casm(n,5,1, __sysc_load(__sysc_reg(5),"%5"), )\
- __casm(n,6,1, __sysc_load(__sysc_reg(6),"%6"), )\
- __sc_load_cid ::__sc_cid(N) __casm_cn_##n \
- __sc_iregs(n,__VA_ARGS__):__sysc_regs)
-#endif
-#endif
-
-#ifndef __sysc_aout
-#define __sysc_aout
-#endif
-
-#ifndef __sc_asmsysc
-#define __sc_asmsysc(n,N) __sc_asm_vol( \
- __casm(n,0,0, __sc_cmds(n,N) , )\
- :__sysc_aout:"i"(__sc_id(N)) : __sysc_clobber)
-#endif
-
-#ifndef __sc_asmsave
-#define __sc_asmsave(n) __sc_asm( \
- __sc_saveres :__sc_oregs)
-#endif
-
-
-
-
+#ifndef __sc_body
#define __sc_body(n, type, name, ...) \
{ \
- __sc_results __sc_callid(name) __sc_input(n, __VA_ARGS__) \
- __sc_asmload(n, name, __VA_ARGS__); \
- __sc_asmsysc(n, name); \
- __sc_asmsave(n); \
+ __sc_results;__sc_cidvar(name); \
+ __sc_input(n,__VA_ARGS__) \
+ __sc_syscall(n,name,__VA_ARGS__); \
__sc_return(type); \
}
-
-
+#endif
#define _syscall0(type, name) \
type name(void) \
__sc_body(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6)
+
#endif /* __SYSCALL_NEW_H */
-// $Id: syscall-wrap.h 2076 2005-05-02 21:42:05Z ensc $ --*- c -*--
+// $Id: syscall-wrap.h 2446 2007-01-09 13:22:11Z dhozac $ --*- c -*--
// Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
# include "syscall-alternative.h"
#endif
+#if defined(ENSC_SYSCALL_TRADITIONAL) && defined(__dietlibc__) && !defined(ENSC_DIETLIBC_HAS_SYSCALL)
+extern long int syscall(long int __sysno, ...);
+#endif
+
#endif // H_UTIL_VSERVER_LIB_SYSCALL_WRAP_H
-// $Id: syscall.c 2272 2006-01-22 18:19:06Z ensc $ --*- c++ -*--
+// $Id: syscall.c 2448 2007-01-10 18:49:13Z dhozac $ --*- c++ -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
CALL_VC_LEGACY(vc_set_ipv4root, bcast, nb, ips));
}
-LINK_WARNING("vc_new_s_context", "warning: vc_new_s_context() is obsoleted; use vc_create_context() instead of");
+LINK_WARNING("vc_new_s_context", "warning: vc_new_s_context() is obsoleted; use vc_ctx_create() instead of");
LINK_WARNING("vc_set_ipv4root", "warning: vc_set_ipv4root() is obsoleted; use vc_net_create() instead of");
#endif
-// $Id: syscall_ctxmigrate-v21.hc 2419 2006-12-08 15:35:24Z dhozac $ --*- c -*--
+// $Id: syscall_ctxmigrate-v21.hc 2501 2007-02-20 17:33:35Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
// Copyright (C) 2006 Daniel Hokka Zakrisson
#endif
static inline ALWAYSINLINE int
-vc_ctx_migrate_spaces(xid_t xid)
+vc_ctx_migrate_spaces(xid_t xid, uint_least64_t flags)
{
- int ret = vc_getXIDType(xid);
+ int ret;
+ struct vcmd_ctx_migrate data = { .flagword = flags };
+
+ ret = vc_getXIDType(xid);
if (ret == vcTYPE_STATIC || ret == vcTYPE_DYNAMIC) {
ret = vc_enter_namespace(xid, vc_get_space_mask() & ~(CLONE_NEWNS|CLONE_FS));
if (ret)
return ret;
}
- return vserver(VCMD_ctx_migrate_v0, CTX_USER2KERNEL(xid), NULL);
+ return vserver(VCMD_ctx_migrate, CTX_USER2KERNEL(xid), &data);
}
-// $Id: syscall_ctxmigrate.c 2415 2006-12-08 13:24:49Z dhozac $ --*- c -*--
+// $Id: syscall_ctxmigrate.c 2501 2007-02-20 17:33:35Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
#if defined(VC_ENABLE_API_V13) || defined(VC_ENABLE_API_V21)
int
-vc_ctx_migrate(xid_t xid)
+vc_ctx_migrate(xid_t xid, uint_least64_t flags)
{
- CALL_VC(CALL_VC_SPACES(vc_ctx_migrate, xid),
+ CALL_VC(CALL_VC_SPACES(vc_ctx_migrate, xid, flags),
CALL_VC_V13A (vc_ctx_migrate, xid));
}
#endif
--- /dev/null
+// $Id: syscall_schedinfo-v21.hc 2449 2007-01-10 18:53:07Z dhozac $ --*- c++ -*--
+
+// Copyright (C) 2007 Daniel Hokka Zakrisson <daniel@hozac.com>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+static inline ALWAYSINLINE int
+vc_sched_info_v21(xid_t ctx, struct vc_sched_info *info)
+{
+ int ret;
+ struct vcmd_sched_info param = { .cpu_id = info->cpu_id, .bucket_id = info->bucket_id };
+
+ ret = vserver(VCMD_sched_info, CTX_USER2KERNEL(ctx), ¶m);
+ if (ret)
+ return ret;
+
+#define G(ATTR) info->ATTR = param.ATTR
+ G(user_msec);
+ G(sys_msec);
+ G(hold_msec);
+ G(token_usec);
+ G(vavavoom);
+
+ return 0;
+}
--- /dev/null
+// $Id: syscall_schedinfo.c 2449 2007-01-10 18:53:07Z dhozac $ --*- c++ -*--
+
+// Copyright (C) 2007 Daniel Hokka Zakrisson <daniel@hozac.com>
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "vserver.h"
+#include "vserver-internal.h"
+#include "virtual.h"
+
+#if defined(VC_ENABLE_API_V21)
+# include "syscall_schedinfo-v21.hc"
+#endif
+
+#if defined(VC_ENABLE_API_V21)
+
+int
+vc_sched_info(xid_t ctx, struct vc_sched_info *info)
+{
+ CALL_VC(CALL_VC_V21(vc_sched_info, ctx, info));
+}
+
+#endif
--- /dev/null
+// $Id: syscall_setmapping-v21.hc 2427 2006-12-12 01:39:54Z dhozac $ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+// Copyright (C) 2006 Daniel Hokka Zakrisson
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+static inline ALWAYSINLINE int
+vc_set_mapping_v21(xid_t xid, const char *device, const char *target, uint32_t flags)
+{
+ struct vcmd_set_mapping_v0 data = { .device = device, .target = target, .flags = flags };
+ return vserver(VCMD_set_mapping, xid, &data);
+}
--- /dev/null
+// $Id: syscall_setmapping.c 2427 2006-12-12 01:39:54Z dhozac $ --*- c -*--
+
+// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+// Copyright (C) 2006 Daniel Hokka Zakrisson
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "vserver.h"
+#include "vserver-internal.h"
+#include "virtual.h"
+
+#if defined(VC_ENABLE_API_V21)
+# include "syscall_setmapping-v21.hc"
+#endif
+
+#if defined(VC_ENABLE_API_V21)
+int
+vc_set_mapping(xid_t xid, const char *device, const char *target, uint32_t flags)
+{
+ CALL_VC(CALL_VC_V21(vc_set_mapping, xid, device, target, flags));
+}
+#endif
-// $Id: syscall_setsched-v21.hc 2372 2006-11-05 17:48:24Z dhozac $ --*- c -*--
+// $Id: syscall_setsched-v21.hc 2454 2007-01-17 09:56:23Z dhozac $ --*- c -*--
// Copyright (C) 2006 Daniel Hokka Zakrisson <daniel@hozac.com>
//
(data->set_mask & VC_VXSM_INTERVAL2 && data->interval != data->interval2)) {
/* first set the regular values */
k_data.set_mask = data->set_mask & ~(VC_VXSM_FILL_RATE2|VC_VXSM_INTERVAL2|VC_VXSM_FORCE);
- ret = vserver(VCMD_set_sched, CTX_USER2KERNEL(xid), &k_data);
+ ret = vserver(VCMD_set_sched_v4, CTX_USER2KERNEL(xid), &k_data);
if (ret)
return ret;
/* then set idle time */
k_data.set_mask = data->set_mask & (VC_VXSM_FILL_RATE2|VC_VXSM_INTERVAL2|VC_VXSM_FORCE|VC_VXSM_IDLE_TIME|VC_VXSM_CPU_ID|VC_VXSM_BUCKET_ID);
k_data.fill_rate = data->fill_rate2;
k_data.interval = data->interval2;
- return vserver(VCMD_set_sched, CTX_USER2KERNEL(xid), &k_data);
+ return vserver(VCMD_set_sched_v4, CTX_USER2KERNEL(xid), &k_data);
}
else {
k_data.set_mask = data->set_mask;
- return vserver(VCMD_set_sched, CTX_USER2KERNEL(xid), &k_data);
+ return vserver(VCMD_set_sched_v4, CTX_USER2KERNEL(xid), &k_data);
}
}
-// $Id: virtual.h 2415 2006-12-08 13:24:49Z dhozac $ --*- c -*--
+// $Id: virtual.h 2427 2006-12-12 01:39:54Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
#include <kernel/network_cmd.h>
#include <kernel/sched_cmd.h>
#include <kernel/signal_cmd.h>
+#include <kernel/device_cmd.h>
#include <kernel/legacy.h>
-// $Id: vserver-internal.h 2415 2006-12-08 13:24:49Z dhozac $ --*- c++ -*--
+// $Id: vserver-internal.h 2446 2007-01-09 13:22:11Z dhozac $ --*- c++ -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
# define CALL_VC(...) \
do { \
int ver = utilvserver_checkCompatVersion(); \
- int UNUSED conf = utilvserver_checkCompatConfig(); \
+ uint_least32_t conf = utilvserver_checkCompatConfig(); \
if (ver==-1) return -1; \
VC_SUFFIX, __VA_ARGS__, VC_PREFIX; \
errno = ENOSYS; \
inline static UNUSED ALWAYSINLINE
int vserver(uint32_t cmd, uint32_t id, void *data)
{
-#if defined __dietlibc__
- extern long int syscall (long int __sysno, ...);
-#endif
-
return syscall(__NR_vserver, cmd, id, data);
}
#else
-/* $Id: vserver.h 2415 2006-12-08 13:24:49Z dhozac $
+/* $Id: vserver.h 2501 2007-02-20 17:33:35Z dhozac $
* Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
*
#define VC_VXSM_IDLE_TIME 0x0200
#define VC_VXSM_FORCE 0x0400
+#define VC_VXSM_MSEC 0x4000
#define VC_VXSM_V3_MASK 0x0173
#define VC_VCI_SPACES (1 << 10)
+// the device mapping flags
+#define VC_DATTR_CREATE 0x00000001
+#define VC_DATTR_OPEN 0x00000002
+
+#define VC_DATTR_REMAP 0x00000010
+
+
+// the process context migration flags
+#define VC_VXM_SET_INIT 0x00000001
+#define VC_VXM_SET_REAPER 0x00000002
+
+
#ifndef CLONE_NEWNS
# define CLONE_NEWNS 0x00020000
#endif
extern "C" {
#endif
- struct vc_ip_mask_pair {
- uint32_t ip;
- uint32_t mask;
- };
-
/** \brief The generic vserver syscall
* \ingroup syscalls
*
* \param data additional arguments; depends on \c cmd
* \returns depends on \c cmd; usually, -1 stands for an error
*/
- int vc_syscall(uint32_t cmd, xid_t xid, void *data);
+ int vc_syscall(uint32_t cmd, xid_t xid, void *data);
/** \brief Returns the version of the current kernel API.
* \ingroup syscalls
* \returns The versionnumber of the kernel API
*/
- int vc_get_version();
+ int vc_get_version();
/** \brief Returns the kernel configuration bits
* \ingroup syscalls
* \returns The kernel configuration bits
*/
- int vc_get_vci();
-
+ int vc_get_vci();
+
/** \brief Moves current process into a context
* \ingroup syscalls
*
* will be set appropriately
*
* See http://vserver.13thfloor.at/Stuff/Logic.txt for details */
- xid_t vc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags);
+ xid_t vc_new_s_context(xid_t ctx, unsigned int remove_cap, unsigned int flags);
+
+ struct vc_ip_mask_pair {
+ uint32_t ip;
+ uint32_t mask;
+ };
/** \brief Sets the ipv4root information.
* \ingroup syscalls
* \pre \a nb < NB_IPV4ROOT && \a ips != 0 */
- int vc_set_ipv4root(uint32_t bcast, size_t nb,
+ int vc_set_ipv4root(uint32_t bcast, size_t nb,
struct vc_ip_mask_pair const *ips) VC_ATTR_NONNULL((3));
/** \brief Returns the value of NB_IPV4ROOT.
* running kernel. */
size_t vc_get_nb_ipv4root() VC_ATTR_CONST VC_ATTR_PURE;
+ /* process context */
+ /** \brief Flags of process-contexts
+ */
+ struct vc_ctx_flags {
+ /** \brief Mask of set context flags */
+ uint_least64_t flagword;
+ /** \brief Mask of set and unset context flags when used by set
+ * operations, or modifiable flags when used by get
+ * operations */
+ uint_least64_t mask;
+ };
+
/** \brief Creates a context without starting it.
* \ingroup syscalls
*
*
* \returns the xid of the created context, or VC_NOCTX on errors. \c errno
* will be set appropriately. */
- xid_t vc_ctx_create(xid_t xid);
+ xid_t vc_ctx_create(xid_t xid);
/** \brief Moves the current process into the specified context.
* \ingroup syscalls
*
- * \param xid The new context
+ * \param xid The new context
+ * \param flags The flags, see VC_VXM_*
* \returns 0 on success, -1 on errors */
- int vc_ctx_migrate(xid_t xid);
+ int vc_ctx_migrate(xid_t xid, uint_least64_t flags);
/** \brief Statistics about a context */
struct vc_ctx_stat {
* \param stat Where to store the result
*
* \returns 0 on success, -1 on errors. */
- int vc_ctx_stat(xid_t xid, struct vc_ctx_stat /*@out@*/ *stat) VC_ATTR_NONNULL((2));
+ int vc_ctx_stat(xid_t xid, struct vc_ctx_stat /*@out@*/ *stat) VC_ATTR_NONNULL((2));
/** \brief Contains further statistics about a context. */
struct vc_virt_stat {
uint_least64_t offset;
- uint_least32_t uptime;
+ uint_least64_t uptime;
uint_least32_t nr_threads;
uint_least32_t nr_running;
uint_least32_t nr_uninterruptible;
* \param stat Where to store the result
*
* \returns 0 on success, -1 on errors. */
- int vc_virt_stat(xid_t xid, struct vc_virt_stat /*@out@*/ *stat) VC_ATTR_NONNULL((2));
+ int vc_virt_stat(xid_t xid, struct vc_virt_stat /*@out@*/ *stat) VC_ATTR_NONNULL((2));
+
+ /** \brief Sends a signal to a context/pid
+ * \ingroup syscalls
+ *
+ * Special values for \a pid are:
+ * - -1 which means every process in ctx except the init-process
+ * - 0 which means every process in ctx inclusive the init-process */
+ int vc_ctx_kill(xid_t ctx, pid_t pid, int sig);
+
+ int vc_get_cflags(xid_t xid, struct vc_ctx_flags /*@out@*/ *) VC_ATTR_NONNULL((2));
+ int vc_set_cflags(xid_t xid, struct vc_ctx_flags /*@in@*/ const *) VC_ATTR_NONNULL((2));
+
+ /** \brief Capabilities of process-contexts */
+ struct vc_ctx_caps {
+ /** \brief Mask of set common system capabilities */
+ uint_least64_t bcaps;
+ /** \brief Mask of set and unset common system capabilities when used by
+ * set operations, or the modifiable capabilities when used by
+ * get operations */
+ uint_least64_t bmask;
+ /** \brief Mask of set process context capabilities */
+ uint_least64_t ccaps;
+ /** \brief Mask of set and unset process context capabilities when used
+ * by set operations, or the modifiable capabilities when used
+ * by get operations */
+ uint_least64_t cmask;
+ };
+
+ int vc_get_ccaps(xid_t xid, struct vc_ctx_caps *);
+ int vc_set_ccaps(xid_t xid, struct vc_ctx_caps const *);
+
+ struct vc_vx_info {
+ xid_t xid;
+ pid_t initpid;
+ };
+
+ int vc_get_vx_info(xid_t xid, struct vc_vx_info *info) VC_ATTR_NONNULL((2));
+
+ /** \brief Returns the context of the given process.
+ * \ingroup syscalls
+ *
+ * \param pid the process-id whose xid shall be determined;
+ * pid==0 means the current process.
+ * \returns the xid of process \c pid or -1 on errors
+ */
+ xid_t vc_get_task_xid(pid_t pid);
+
+ /** \brief Waits for the end of a context
+ * \ingroup syscalls
+ */
+ int vc_wait_exit(xid_t xid);
/* rlimit related functions */
* resource; it might be bytes, pages, seconds or litres of beer. */
typedef uint_least64_t vc_limit_t;
- /** \brief The limits of a resources.
- *
- * This is a triple consisting of a minimum, soft and hardlimit. */
- struct vc_rlimit {
- vc_limit_t min; ///< the guaranted minimum of a resources
- vc_limit_t soft; ///< the softlimit of a resource
- vc_limit_t hard; ///< the absolute hardlimit of a resource
- };
-
/** \brief Masks describing the supported limits. */
struct vc_rlimit_mask {
uint_least32_t min; ///< masks the resources supporting a minimum limit
uint_least32_t hard; ///< masks the resources supporting a hard limit
};
- /** \brief Statistics for a resource limit. */
- struct vc_rlimit_stat {
- uint_least32_t hits; ///< number of hits on the limit
- uint_least64_t value; ///< current value
- uint_least64_t minimum; ///< minimum value observed
- uint_least64_t maximum; ///< maximum value observed
+ /** \brief Returns the limits supported by the kernel */
+ int vc_get_rlimit_mask(xid_t xid,
+ struct vc_rlimit_mask /*@out@*/ *lim) VC_ATTR_NONNULL((2));
+
+ /** \brief The limits of a resources.
+ *
+ * This is a triple consisting of a minimum, soft and hardlimit. */
+ struct vc_rlimit {
+ vc_limit_t min; ///< the guaranted minimum of a resources
+ vc_limit_t soft; ///< the softlimit of a resource
+ vc_limit_t hard; ///< the absolute hardlimit of a resource
};
/** \brief Returns the limits of \a resource.
* \param lim The result which will be filled with the limits
*
* \returns 0 on success, and -1 on errors. */
- int vc_get_rlimit(xid_t xid, int resource,
+ int vc_get_rlimit(xid_t xid, int resource,
struct vc_rlimit /*@out@*/ *lim) VC_ATTR_NONNULL((3));
/** \brief Sets the limits of \a resource.
* \ingroup syscalls
* \param lim The new limits
*
* \returns 0 on success, and -1 on errors. */
- int vc_set_rlimit(xid_t xid, int resource,
+ int vc_set_rlimit(xid_t xid, int resource,
struct vc_rlimit const /*@in@*/ *lim) VC_ATTR_NONNULL((3));
- int vc_get_rlimit_mask(xid_t xid,
- struct vc_rlimit_mask *lim) VC_ATTR_NONNULL((2));
+
+ /** \brief Statistics for a resource limit. */
+ struct vc_rlimit_stat {
+ uint_least32_t hits; ///< number of hits on the limit
+ vc_limit_t value; ///< current value
+ vc_limit_t minimum; ///< minimum value observed
+ vc_limit_t maximum; ///< maximum value observed
+ };
+
/** \brief Returns the current stats of \a resource.
* \ingroup syscalls
*
* \param stat The result which will be filled with the stats
*
* \returns 0 on success, and -1 on errors. */
- int vc_rlimit_stat(xid_t xid, int resource,
+ int vc_rlimit_stat(xid_t xid, int resource,
struct vc_rlimit_stat /*@out@*/ *stat) VC_ATTR_NONNULL((3));
- /** \brief Resets the minimum and maximum observed values for all resources.
+
+ /** \brief Resets the minimum and maximum observed values of all resources.
* \ingroup syscalls
*
- * \param xid The id of the context
+ * \param xid The id of the context
*
* \returns 0 on success, and -1 on errors. */
- int vc_reset_minmax(xid_t xid);
+ int vc_reset_minmax(xid_t xid);
+
/** \brief Parses a string describing a limit
* \ingroup helper
*
*
* \pre \a str!=0 && \a res!=0
*/
- bool vc_parseLimit(char const /*@in@*/ *str, vc_limit_t /*@out@*/ *res) VC_ATTR_NONNULL((1,2));
-
-
- /** \brief Sends a signal to a context/pid
- * \ingroup syscalls
- *
- * Special values for \a pid are:
- * - -1 which means every process in ctx except the init-process
- * - 0 which means every process in ctx inclusive the init-process */
- int vc_ctx_kill(xid_t ctx, pid_t pid, int sig);
+ bool vc_parseLimit(char const /*@in@*/ *str, vc_limit_t /*@out@*/ *res) VC_ATTR_NONNULL((1,2));
+ /* network context */
struct vc_nx_info {
nid_t nid;
};
uint32_t mask[4];
};
+ struct vc_net_flags {
+ uint_least64_t flagword;
+ uint_least64_t mask;
+ };
+
nid_t vc_net_create(nid_t nid);
int vc_net_migrate(nid_t nid);
int vc_net_add(nid_t nid, struct vc_net_nx const *info);
int vc_net_remove(nid_t nid, struct vc_net_nx const *info);
- struct vc_net_flags {
- uint_least64_t flagword;
- uint_least64_t mask;
- };
-
int vc_get_nflags(nid_t, struct vc_net_flags *);
int vc_set_nflags(nid_t, struct vc_net_flags const *);
-
struct vc_net_caps {
uint_least64_t ncaps;
uint_least64_t cmask;
int vc_set_ncaps(nid_t, struct vc_net_caps const *);
-
+ /* iattr related functions */
int vc_set_iattr(char const *filename, xid_t xid,
uint_least32_t flags, uint_least32_t mask) VC_ATTR_NONNULL((1));
int vc_get_iattr(char const *filename, xid_t * /*@null@*/ xid,
uint_least32_t * /*@null@*/ flags,
uint_least32_t * /*@null@*/ mask) VC_ATTR_NONNULL((1));
-
- struct vc_vx_info {
- xid_t xid;
- pid_t initpid;
- };
- /** \brief Returns the context of the given process.
- * \ingroup syscalls
- *
- * \param pid the process-id whose xid shall be determined;
- * pid==0 means the current process.
- * \returns the xid of process \c pid or -1 on errors
- */
- xid_t vc_get_task_xid(pid_t pid);
- int vc_get_vx_info(xid_t xid, struct vc_vx_info *info) VC_ATTR_NONNULL((2));
+ /** \brief Returns the context of \c filename
+ * \ingroup syscalls
+ *
+ * This function calls vc_get_iattr() with appropriate arguments to
+ * determine the context of \c filename. In error-case or when no context
+ * is assigned, \c VC_NOCTX will be returned. To differ between both cases,
+ * \c errno must be examined.
+ *
+ * \b WARNING: this function can modify \c errno although no error happened.
+ *
+ * \param filename The file to check
+ * \returns The assigned context, or VC_NOCTX when an error occured or no
+ * such assignment exists. \c errno will be 0 in the latter case */
+ xid_t vc_getfilecontext(char const *filename) VC_ATTR_NONNULL((1));
+ /* vhi related functions */
typedef enum { vcVHI_CONTEXT, vcVHI_SYSNAME, vcVHI_NODENAME,
vcVHI_RELEASE, vcVHI_VERSION, vcVHI_MACHINE,
vcVHI_DOMAINNAME } vc_uts_type;
int vc_get_vhi_name(xid_t xid, vc_uts_type type,
char *val, size_t len) VC_ATTR_NONNULL((3));
- /** Returns true iff \a xid is a dynamic xid */
- bool vc_is_dynamic_xid(xid_t xid);
-
+ /* namespace related functions */
int vc_enter_namespace(xid_t xid, uint_least64_t mask);
int vc_set_namespace(xid_t xid, uint_least64_t mask);
int vc_cleanup_namespace();
uint_least64_t vc_get_space_mask();
+
+ /* disk limit related things */
+ struct vc_ctx_dlimit {
+ uint_least32_t space_used;
+ uint_least32_t space_total;
+ uint_least32_t inodes_used;
+ uint_least32_t inodes_total;
+ uint_least32_t reserved;
+ };
- /** \brief Flags of process-contexts
- */
- struct vc_ctx_flags {
- /** \brief Mask of set context flags */
- uint_least64_t flagword;
- /** \brief Mask of set and unset context flags when used by set
- * operations, or modifiable flags when used by get
- * operations */
- uint_least64_t mask;
+
+ /** Add a disk limit to a file system. */
+ int vc_add_dlimit(char const *filename, xid_t xid,
+ uint_least32_t flags) VC_ATTR_NONNULL((1));
+ /** Remove a disk limit from a file system. */
+ int vc_rem_dlimit(char const *filename, xid_t xid,
+ uint_least32_t flags) VC_ATTR_NONNULL((1));
+
+ /** Set a disk limit. */
+ int vc_set_dlimit(char const *filename, xid_t xid,
+ uint_least32_t flags,
+ struct vc_ctx_dlimit const *limits) VC_ATTR_NONNULL((1,4));
+ /** Get a disk limit. */
+ int vc_get_dlimit(char const *filename, xid_t xid,
+ uint_least32_t flags,
+ struct vc_ctx_dlimit *limits) VC_ATTR_NONNULL((1));
+
+ /* scheduler related syscalls */
+ struct vc_set_sched {
+ uint_least32_t set_mask;
+ int_least32_t fill_rate;
+ int_least32_t interval;
+ int_least32_t fill_rate2;
+ int_least32_t interval2;
+ int_least32_t tokens;
+ int_least32_t tokens_min;
+ int_least32_t tokens_max;
+ int_least32_t priority_bias;
+ int_least32_t cpu_id;
+ int_least32_t bucket_id;
};
- /** \brief Capabilities of process-contexts */
- struct vc_ctx_caps {
- /** \brief Mask of set common system capabilities */
- uint_least64_t bcaps;
- /** \brief Mask of set and unset common system capabilities when used by
- * set operations, or the modifiable capabilities when used by
- * get operations */
- uint_least64_t bmask;
- /** \brief Mask of set process context capabilities */
- uint_least64_t ccaps;
- /** \brief Mask of set and unset process context capabilities when used
- * by set operations, or the modifiable capabilities when used
- * by get operations */
- uint_least64_t cmask;
+ int vc_set_sched(xid_t xid, struct vc_set_sched const *) VC_ATTR_NONNULL((2));
+
+ struct vc_sched_info {
+ int_least32_t cpu_id;
+ int_least32_t bucket_id;
+ uint_least64_t user_msec;
+ uint_least64_t sys_msec;
+ uint_least64_t hold_msec;
+ uint_least32_t token_usec;
+ int_least32_t vavavoom;
};
+ int vc_sched_info(xid_t xid, struct vc_sched_info *info) VC_ATTR_NONNULL((2));
+
+ /* misc. syscalls */
+ int vc_set_mapping(xid_t xid, const char *device, const char *target, uint32_t flags);
+
+
/** \brief Information about parsing errors
* \ingroup helper
*/
char const *ptr; ///< Pointer to the first character of an erroneous string
size_t len; ///< Length of the erroneous string
};
-
- int vc_get_cflags(xid_t xid, struct vc_ctx_flags *) VC_ATTR_NONNULL((2));
- int vc_set_cflags(xid_t xid, struct vc_ctx_flags const *) VC_ATTR_NONNULL((2));
-
- int vc_get_ccaps(xid_t xid, struct vc_ctx_caps *);
- int vc_set_ccaps(xid_t xid, struct vc_ctx_caps const *);
/** \brief Converts a single string into bcapability
* \ingroup helper
uint_least32_t vc_str2personalitytype(char const /*@in@*/*,
size_t len) VC_ATTR_NONNULL((1));
-
- /** \brief Returns the context of \c filename
- * \ingroup syscalls
- *
- * This function calls vc_get_iattr() with appropriate arguments to
- * determine the context of \c filename. In error-case or when no context
- * is assigned, \c VC_NOCTX will be returned. To differ between both cases,
- * \c errno must be examined.
- *
- * \b WARNING: this function can modify \c errno although no error happened.
- *
- * \param filename The file to check
- * \returns The assigned context, or VC_NOCTX when an error occured or no
- * such assignment exists. \c errno will be 0 in the latter case */
- xid_t vc_getfilecontext(char const *filename) VC_ATTR_NONNULL((1));
-
-
- struct vc_set_sched {
- uint_least32_t set_mask;
- int_least32_t fill_rate;
- int_least32_t interval;
- int_least32_t fill_rate2;
- int_least32_t interval2;
- int_least32_t tokens;
- int_least32_t tokens_min;
- int_least32_t tokens_max;
- int_least32_t priority_bias;
- int_least32_t cpu_id;
- int_least32_t bucket_id;
- };
- int vc_set_sched(xid_t xid, struct vc_set_sched const *);
-
-
- struct vc_ctx_dlimit {
- uint_least32_t space_used;
- uint_least32_t space_total;
- uint_least32_t inodes_used;
- uint_least32_t inodes_total;
- uint_least32_t reserved;
- };
-
-
- /** Add a disk limit to a file system. */
- int vc_add_dlimit(char const *filename, xid_t xid,
- uint_least32_t flags) VC_ATTR_NONNULL((1));
- /** Remove a disk limit from a file system. */
- int vc_rem_dlimit(char const *filename, xid_t xid,
- uint_least32_t flags) VC_ATTR_NONNULL((1));
-
- /** Set a disk limit. */
- int vc_set_dlimit(char const *filename, xid_t xid,
- uint_least32_t flags,
- struct vc_ctx_dlimit const *limits) VC_ATTR_NONNULL((1,4));
- /** Get a disk limit. */
- int vc_get_dlimit(char const *filename, xid_t xid,
- uint_least32_t flags,
- struct vc_ctx_dlimit *limits) VC_ATTR_NONNULL((1));
-
- /** \brief Waits for the end of a context
- * \ingroup syscalls
- */
- int vc_wait_exit(xid_t xid);
typedef enum { vcFEATURE_VKILL, vcFEATURE_IATTR, vcFEATURE_RLIMIT,
vcFEATURE_COMPAT, vcFEATURE_MIGRATE, vcFEATURE_NAMESPACE,
vcFEATURE_SCHED, vcFEATURE_VINFO, vcFEATURE_VHI,
vcFEATURE_VSHELPER0, vcFEATURE_VSHELPER, vcFEATURE_VWAIT,
- vcFEATURE_VNET }
+ vcFEATURE_VNET, vcFEATURE_VSTAT }
vcFeatureSet;
bool vc_isSupported(vcFeatureSet) VC_ATTR_CONST;
vcXidType vc_getXIDType(xid_t xid) VC_ATTR_CONST;
+ /** Returns true iff \a xid is a dynamic xid */
+ bool vc_is_dynamic_xid(xid_t xid);
+
+
/* The management part */
#define VC_LIMIT_VSERVER_NAME_LEN 1024
-// $Id: pathinfo.h 1619 2004-07-02 23:44:53Z ensc $ --*- c -*--
+// $Id: pathinfo.h 2467 2007-01-21 18:26:45Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
#define ENSC_PI_DECLARE(VAR,VAL) PathInfo VAR={.d = VAL,.l = sizeof(VAL)-1}
#define ENSC_PI_APPSZ(P1,P2) ((P1).l + sizeof("/") + (P2).l)
+#define ENSC_PI_SETSTR(VAR,VAL) do { VAR.d = VAL; VAR.l = strlen(VAL); } while (0)
typedef String PathInfo;
-// $Id: switchtowatchxid.c 1988 2005-03-25 02:37:41Z ensc $ --*- c -*--
+// $Id: switchtowatchxid.c 2501 2007-02-20 17:33:35Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
if (vc_get_task_xid(0)==1) return true;
if (vc_isSupported(vcFEATURE_MIGRATE)) {
- if (vc_ctx_migrate(1)==-1) {
+ if (vc_ctx_migrate(1, 0)==-1) {
if (errptr) *errptr = "vc_migrate_context()";
return false;
}
-// $Id: sys_clone.h 2421 2006-12-09 16:12:18Z dhozac $ --*- c -*--
+// $Id: sys_clone.h 2446 2007-01-09 13:22:11Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
#ifdef __sparc__
int parent = getpid();
#endif
-#if defined(__dietlibc__) && defined(ENSC_SYSCALL_TRADITIONAL)
- extern long int syscall (long int __sysno, ...);
-#endif
#if defined(__s390__) && defined(ENSC_SYSCALL_TRADITIONAL)
ret = syscall(__NR__sys_clone, child_stack, flags);
-// $Id: sys_personality.h 2062 2005-04-28 18:01:16Z ensc $ --*- c -*--
+// $Id: sys_personality.h 2446 2007-01-09 13:22:11Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
inline static UNUSED ALWAYSINLINE
int sys_personality(int pers)
{
-#if defined __dietlibc__
- extern long int syscall (long int __sysno, ...);
-#endif
-
return syscall(__NR_sys_personality, pers);
}
#else
-// $Id: sigbus.c 1979 2005-03-24 12:42:56Z ensc $ --*- c -*--
+// $Id: sigbus.c 2484 2007-02-04 17:17:02Z ensc $ --*- c -*--
// Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
int wrapper_exit_code = 1;
-#define TEST_BLOCKSIZE 0x10000
+#define TEST_BLOCKSIZE (sysconf(_SC_PAGESIZE)*2 + 0x10000)
+
static bool is_gremlin = false;
static int sync_p[2];
char f_name1[] = "/tmp/sigbus.XXXXXX";
int fd_src = mkstemp(f_name0);
int fd_dst = mkstemp(f_name1);
- char buf[TEST_BLOCKSIZE] = { [0] = '\0' };
+ char buf[TEST_BLOCKSIZE];
struct stat st;
bool res;
-
- fd_src =
-
- write(fd_src, buf, sizeof(buf));
+
+ memset(buf, 0, TEST_BLOCKSIZE);
+ write(fd_src, buf, TEST_BLOCKSIZE);
close(fd_src);
close(fd_dst);
-// $Id: unify-copy.c 1977 2005-03-24 12:42:16Z ensc $ --*- c -*--
+// $Id: unify-copy.c 2485 2007-02-04 17:18:27Z ensc $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
copyMem(void *dst_v, void const *src_v, size_t len_v)
{
#if 1
+ // Do not use memcpy because this would dirty pages consisting only of
+ // '\0'
int *dst = dst_v;
int const *src = src_v;
size_t len = len_v / sizeof(int);
bool volatile res = false;
if (in_len==-1) return false;
- if (in_len>0 &&
- (lseek(out_fd, in_len-1, SEEK_SET)==-1 ||
- write(out_fd, "\0", 1)!=1)) // create sparse file
+ if (in_len>0 && ftruncate(out_fd, in_len)==-1) // create sparse file
return false;
bus_error = 0;
char const *dst)
{
int in_fd = open(src, O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NOFOLLOW|O_LARGEFILE);
- int out_fd = in_fd==-1 ? -1 : open(dst, O_RDWR|O_CREAT|O_EXCL, 0200);
+ int out_fd = in_fd==-1 ? -1 : open(dst, O_RDWR|O_CREAT|O_EXCL|O_NOCTTY, 0200);
bool res = false;
if (in_fd==-1 || out_fd==-1 ||
-// $Id: unify.h 1926 2005-03-18 03:56:06Z ensc $ --*- c -*--
+// $Id: unify.h 2476 2007-01-27 10:05:58Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
((bool)((LHS)->st_dev ==(RHS)->st_dev && \
(LHS)->st_ino ==(RHS)->st_ino))
-#define Unify_isUnifyable(LHS, RHS) \
+#define _Unify_isUnifyable(LHS, RHS) \
((bool)((LHS)->st_dev ==(RHS)->st_dev && \
(LHS)->st_ino !=(RHS)->st_ino && \
(LHS)->st_mode ==(RHS)->st_mode && \
(LHS)->st_uid ==(RHS)->st_uid && \
(LHS)->st_gid ==(RHS)->st_gid && \
- (LHS)->st_size ==(RHS)->st_size && \
- (LHS)->st_mtime==(RHS)->st_mtime))
+ (LHS)->st_size ==(RHS)->st_size))
+#ifdef UTIL_VSERVER_UNIFY_MTIME_OPTIONAL
+# define Unify_isUnifyable(LHS, RHS) \
+ ((bool)(_Unify_isUnifyable(LHS, RHS) && \
+ (global_args->ignore_mtime || \
+ (LHS)->st_mtime==(RHS)->st_mtime)))
+#else
+# define Unify_isUnifyable(LHS, RHS) \
+ ((bool)(_Unify_isUnifyable(LHS, RHS) && \
+ (LHS)->st_mtime==(RHS)->st_mtime))
+#endif
#endif // H_UTIL_VSERVER_LIB_INTERNAL_UNIFY_H
-dnl $Id: ensc_dietlibc.m4 2091 2005-05-05 19:13:52Z ensc $
+dnl $Id: ensc_dietlibc.m4 2453 2007-01-17 09:54:53Z dhozac $
dnl Copyright (C) 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
dnl
fi
])
+AC_DEFUN([_ENSC_DIETLIBC_SYSCALL],
+[
+ AH_TEMPLATE([ENSC_DIETLIBC_HAS_SYSCALL], [Define to 1 if dietlibc declares syscall])
+
+ AC_CACHE_CHECK([whether dietlibc declares syscall], [ensc_cv_c_dietlibc_syscall],
+ [
+ _ensc_dietlibc_syscall_old_CC="$CC"
+ CC="${DIET:-diet} $CC"
+
+ AC_LANG_PUSH(C)
+ AC_COMPILE_IFELSE([
+ #include <sys/syscall.h>
+ long int syscall(long int __sysno, ...);
+ ],
+ [ensc_cv_c_dietlibc_syscall=no],
+ [ensc_cv_c_dietlibc_syscall=yes])
+ AC_LANG_POP
+
+ CC="$_ensc_dietlibc_syscall_old_CC"
+ ])
+
+ if test x"$ensc_cv_c_dietlibc_syscall" = xyes; then
+ AC_DEFINE(ENSC_DIETLIBC_HAS_SYSCALL,1)
+ fi
+])
+
dnl Usage: ENSC_ENABLE_DIETLIBC(<conditional>[,<min-version>])
dnl <conditional> ... automake-conditional which will be set when
dnl dietlibc shall be enabled
if test x"$ensc_have_dietlibc" != xno; then
_ENSC_DIETLIBC_C99
+ _ENSC_DIETLIBC_SYSCALL
fi
])
-
-dnl Usage: ENSC_DIETLIBC_SANITYCHECK
-AC_DEFUN([ENSC_DIETLIBC_SANITYCHECK],
-[
- AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([ENSC_ENABLE_DIETLIBC])
-
- if test "$host_cpu" = x86_64 -a $ENSC_VERSION_DIETLIBC_NUM -le 0027; then
- AC_MSG_WARN([*** ***])
- AC_MSG_WARN([*** dietlibc<=0.27 is known to be broken for x86_64 systems ***])
- AC_MSG_WARN([*** please make sure that at least the environ.S fix is applied ***])
- AC_MSG_WARN([*** and lib/__nice.c added ***])
- AC_MSG_WARN([*** ***])
- fi
-])
-dnl $Id: ensc_pathprog.m4 2324 2006-09-19 17:29:52Z dhozac $
+dnl $Id: ensc_pathprog.m4 2504 2007-02-24 20:03:10Z dhozac $
dnl Copyright (C) 2002 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
dnl
fi
fi
+ if test -e "${$1}"; then
+ $1=`readlink -f "${$1}"`
+ fi
+
test "${$1}" && ENSC_PATHPROG_SED="${ENSC_PATHPROG_SED}s!@'$1'@!${$1}!g;"
test "${$1}"])
ENSC_PATHPROG(CP, cp)
ENSC_PATHPROG(DIRNAME, dirname)
ENSC_PATHPROG(EGREP, egrep)
- env_old_searchpath="${ensc_searchpath}"
- ensc_searchpath="/bin:${ensc_searchpath:-$PATH}"
ENSC_PATHPROG(ENV, env)
- ensc_searchpath="${env_old_searchpath}"
ENSC_PATHPROG(GREP, grep)
ENSC_PATHPROG(LN, ln)
ENSC_PATHPROG(MKDIR, mkdir)
-## $Id: Makefile-files 2398 2006-11-24 15:20:09Z dhozac $ -*- makefile -*-
+## $Id: Makefile-files 2470 2007-01-21 20:17:14Z dhozac $ -*- makefile -*-
## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##
scripts/vserver-build.yum \
scripts/vserver-build.template \
scripts/vserver-build.rsync \
+ scripts/vserver-build.clone \
scripts/vserver-build.functions \
scripts/vserver-build.functions.apt \
scripts/vserver-build.functions.rpm \
scripts/vserver.start \
scripts/vserver.stop \
scripts/vserver.suexec \
- scripts/vserver.delete
+ scripts/vserver.delete \
+ scripts/vserver-init.functions
scripts_pkglib_gen_DTA = scripts/util-vserver-vars
-# $Id: functions 2420 2006-12-09 16:02:03Z dhozac $ --*- sh -*--
+# $Id: functions 2531 2007-04-21 14:04:35Z dhozac $ --*- sh -*--
# Copyright (C) 2003,2004,2005,2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
export INIT_CWD
}
-function _getVserverDir
+function _setVserverDir
{
local vserver="$1"
case "$vserver" in
esac
}
+function _setVserverName
+{
+ if test -e "$VSERVER_DIR"/name; then
+ read VSERVER_NAME <"$VSERVER_DIR"/name
+ else
+ VSERVER_NAME=$(basename "$VSERVER_DIR")
+ fi
+}
+
function _pkgMountBindDir()
{
test "$1" != "$2" || return 0
$_VSERVER_INFO - FEATURE namespace || return 1
cfgdir=$($_VSERVER_INFO "$1" CFGDIR) || return 1
+ isAvoidNamespace "$1" && return 1
test -e "$cfgdir"/namespace-cleanup && return 0
test -e "$cfgdir"/nonamespace-cleanup -o \
-e "$__CONFDIR"/.defaults/nonamespace-cleanup && return 1
# Use /proc/virtual from kernel 2.6 when possible
if test -d "/proc/virtual"; then
- set -- $($_GREP '^PROC:' "/proc/virtual/$1/limit" 2>/dev/null)
+ set -- $($_GREP '^Tasks:' "/proc/virtual/$1/status" 2>/dev/null)
_gp_procnr_cnt=$2
else
_gp_procnr_cnt=$($_VPS ax | $_AWK '{print $2}' | $_GREP -x "$1" | $_WC -l )
"$__CONFDIR/.defaults/apps/init/tty" \
$2 /dev/null
- exec <$ttyname
- exec &>$ttyname
+ if test -f "$ttyname"; then
+ exec </dev/null
+ else
+ exec <$ttyname
+ fi
+ exec >>$ttyname 2>&1
}
## Usage: killContext <XID> [<SIG>]
vshelper=$(cat "$proc_file")
$_CMP -s "$vshelper" "$_VSHELPER" || {
+ local readable=""
+ test -r "$vshelper" && readable=1
warnings=( "${warnings[@]}"
$"The configured vshelper '$vshelper' does not match the 'vshelper'
- script of the util-vserver package"
+ script of the util-vserver package.${readable:+ Maybe you have two versions installed?}"
)
solution_disable=1
solution_sysctl=1
test ! -p "$VSHELPER_STOP_SYNC" || echo stopped > "$VSHELPER_STOP_SYNC"
}
+function vshelper.isStopSync
+{
+ test -p "$VSHELPER_STOP_SYNC" || return 1
+ return 0
+}
+
function _rpmFake.getCapFlags
{
local ctx=$1
#!/bin/bash
-# $Id: pkgmgmt 2291 2006-09-12 10:47:38Z dhozac $
+# $Id: pkgmgmt 2518 2007-03-18 22:15:07Z dhozac $
# Copyright (C) 2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
}
. "$UTIL_VSERVER_VARS"
. "$_LIB_FUNCTIONS"
+. "$_LIB_VSERVER_BUILD_FUNCTIONS"
. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
. "$__PKGLIBDIR/vserver.functions"
else
rpmdb_mntpoint=/.rpmdb
fi
- pkgmgmt.initVariables
}
function _createDirs()
echo $"Vserver '$vserver' does not seem to exist; skipping it..."
return 1
} >&2
+
+ _setVserverDir "$vserver"
+ _setVserverName
+ _setVserverDirName
+ pkgmgmt.initVariables
pkgmgmt.isInternal "$vserver" || is_external=1
-# $Id: util-vserver-vars.pathsubst 2398 2006-11-24 15:20:09Z dhozac $ --*- sh -*--
+# $Id: util-vserver-vars.pathsubst 2468 2007-01-21 20:05:19Z dhozac $ --*- sh -*--
PACKAGE='@PACKAGE@'
PACKAGE_BUGREPORT='@PACKAGE_BUGREPORT@'
_KEEP_CTX_ALIVE="$__PKGLIBDIR/keep-ctx-alive"
_LIB_FUNCTIONS="$__PKGLIBDIR/functions"
_LIB_MAGIC="$__PKGLIBDIR/magic"
+_LIB_VSERVER_INIT_FUNCTIONS="$__PKGLIBDIR/vserver-init.functions"
_LIB_VSERVER_SETUP_FUNCTIONS="$__PKGLIBDIR/vserver-setup.functions"
_LIB_VSERVER_BUILD_FUNCTIONS="$__PKGLIBDIR/vserver-build.functions"
_LIB_VSERVER_BUILD_FUNCTIONS_APT="$__PKGLIBDIR/vserver-build.functions.apt"
_VAPT_GET="$__SBINDIR/vapt-get"
_VAPT_GET_WORKER="$__PKGLIBDIR/vapt-get-worker"
_VATTRIBUTE="$__SBINDIR/vattribute"
+_VCLONE="$__PKGLIBDIR/vclone"
_VCONTEXT="$__SBINDIR/vcontext"
+_VDEVMAP="$__SBINDIR/vdevmap"
_VDLIMIT="$__SBINDIR/vdlimit"
_VDU="$__SBINDIR/vdu"
_VHASHIFY="$__PKGLIBDIR/vhashify"
_VSHELPER="$__PKGLIBDIR/vshelper"
_VSHELPER_SYNC="$__PKGLIBDIR/vshelper-sync"
_VSOMETHING="$__SBINDIR/vsomething"
+_VSYSCTL="$__PKGLIBDIR/vsysctl"
_VWAIT="$__SBINDIR/vwait"
_VUNAME="$__SBINDIR/vuname"
_VUNIFY="$__PKGLIBDIR/vunify"
#!/bin/bash
-# $Id: vdispatch-conf 2363 2006-11-03 14:36:23Z hollow $
+# $Id: vdispatch-conf 2486 2007-02-05 18:08:17Z hollow $
# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org>
#
export VSOMETHING_TITLE VSOMETHING_PKGMGMT
-exec $_VSOMETHING "${send_through[@]}" dispatch-conf "${vsomething_opts[@]}"
+exec $_VSOMETHING "${send_through[@]}" dispatch-conf "${vsomething_opts[@]}" "$@"
#!/bin/bash
-# $Id: vesync 2363 2006-11-03 14:36:23Z hollow $
+# $Id: vesync 2486 2007-02-05 18:08:17Z hollow $
# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org>
#
export VSOMETHING_TITLE VSOMETHING_PKGMGMT
-test ${#vsomething_opts[@]} -eq 0 || vsomething_opts=( "${vsomething_opts[@]}" -- )
-
ret=0
test $overlay_only -eq 0 && \
- $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" --metadata
+ $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" "$@" -- --metadata
ret=$?
test -n "$overlay" -a -n "$overlay_host" && \
- $_VSOMETHING "${send_through[@]}" rsync "${vsomething_opts[@]}" \
+ $_VSOMETHING "${send_through[@]}" rsync "${vsomething_opts[@]}" "$@" -- \
-rtW --progress --delete --delete-after "${overlay_host}/" "${overlay}/"
test $? -eq 0 -a $ret -eq 0
#! /bin/bash
-# $Id: vserver 2418 2006-12-08 13:28:02Z dhozac $
+# $Id: vserver 2521 2007-03-21 04:46:18Z dhozac $
# Copyright (C) 2003,2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
... builds a new vserver from scratch
delete ... remove a vserver
- unify [-R]
- ... (de)unify vserver
+ unify [-R] <vunify-opts>*
+ ... (de)unify the vserver with its reference vserver(s).
pkg install <pkg>
... installs package(s) in the vserver
while 'internalize' means that data and programs from the
vserver will be used.
- unify <vunify-opts>*
- ... unify the vserver with its reference vserver(s).
+ hashify
+ ... hashify the guest.
Please report bugs to $PACKAGE_BUGREPORT"
exit 5
} >&2
-if test -e "$VSERVER_DIR"/name; then
- read VSERVER_NAME <"$VSERVER_DIR"/name
-else
- VSERVER_NAME=$(basename "$VSERVER_DIR")
-fi
+_setVserverName
# Create a new namespace when starting the guest
test "$2" != start -o -n "$OPTION_NONAMESPACE" || isAvoidNamespace "$VSERVER_DIR" || \
#! /bin/bash
-# $Id: vserver-build 2398 2006-11-24 15:20:09Z dhozac $
+# $Id: vserver-build 2468 2007-01-21 20:05:19Z dhozac $
# Copyright (C) 2003,2004,2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
the -f option implies -n and -d are relative to the <fai_vserver>
rsync ... -- [-d <distribution>] --source <source> [-o <rsync option>]*
... installs a guest by rsyncing from <source> to the guest root
+ clone ... -- [-d <distribution>] --source <source>
+ ... clones a guest by linking unified files and copying the rest
Please report bugs to $PACKAGE_BUGREPORT"
exit 0
case x"$method" in
(xlegacy) exec $_VSERVER_LEGACY "$VSERVER_NAME" build "$@" ;;
- (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xtemplate|xfai|xrsync)
+ (xapt-rpm|xcopy|xskeleton|xdebootstrap|xyum|xrpm|xtemplate|xfai|xrsync|xclone)
. $__PKGLIBDIR/vserver-build.$method
;;
(x) panic $"No build-method specified";;
--- /dev/null
+# $Id: vserver-build.clone 2494 2007-02-11 00:45:04Z dhozac $ --*- sh -*--
+
+# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+tmp=$(getopt -o '+d:s:o:' --long debug,pkgmgmt,source: -n "$0" -- "$@") || exit 1
+eval set -- "$tmp"
+
+. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
+
+DISTRIBUTION=:
+use_pkgmgmt=
+SOURCE=
+while true; do
+ case "$1" in
+ -d) DISTRIBUTION=$2; shift;;
+ --debug) set -x;;
+ --pkgmgmt) use_pkgmgmt=1;;
+ -s|--source) SOURCE=$2; shift;;
+ --) shift; break ;;
+ *) echo "vserver-build.clone: internal error: unrecognized option '$1'" >&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+if test -d "$SOURCE"; then
+ :
+elif test -d "$__CONFDIR/$SOURCE"; then
+ SOURCE=`getPhysicalDir "$__CONFDIR/$SOURCE/vdir"`
+elif test -d "$__DEFAULT_VSERVERDIR/$SOURCE"; then
+ SOURCE=`getPhysicalDir "$__DEFAULT_VSERVERDIR/$SOURCE"`
+else
+ SOURCE=
+fi
+
+test -n "$SOURCE" || panic $"vserver-build.clone: valid --source argument required"
+
+getDistribution '' 1
+
+base.init
+test -z "$use_pkgmgmt" || pkgmgmt.initVariables
+
+base.initFilesystem "$OPTION_FORCE"
+test -z "$use_pkgmgmt" || pkgmgmt.initFilesystem "$OPTION_FORCE"
+
+
+setup_writeOption "$VSERVER_NAME"
+setup_writeInitialFstab
+
+test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
+
+$_VCLONE "$SOURCE"/ "$VDIR"/
+
+test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
+
+base.setSuccess
-# $Id: vserver-build.debootstrap 2298 2006-09-12 11:21:38Z dhozac $ --*- sh -*--
+# $Id: vserver-build.debootstrap 2528 2007-04-13 09:02:29Z hollow $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-function cleanUp
-{
- test ! -d "$workdir" || $_RM -rf "$workdir"
-}
-
function init
{
workdir=
mirror=
- trap "cleanUp" EXIT
}
function initVariables
{
base.init
- test -n "${mirror-unset}" || {
+ test -n "${mirror}" || {
local aux
- findFile aux "$__CONFDIR"/.defaults/apps/debootstrap/mirror ''
+ findFile aux "$__CONFDIR"/.defaults/apps/debootstrap/mirror "$__PKGLIBDEFAULTDIR"/debootstrap.mirror
test -z "$aux" || read mirror <"$aux"
}
}
dir=$($_MKTEMPDIR -p /var/tmp debootstrap.XXXXXX)
workdir=$dir
dst=$dir/debootstrap.deb
+
+ base._addGeneratedFile "$workdir"
findFile DEBOOTSTRAP_URI "$__CONFDIR"/.defaults/apps/debootstrap/uri "$__PKGLIBDEFAULTDIR"/debootstrap.uri
read tmp <$DEBOOTSTRAP_URI
findDebootstrap
-test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
+test -z "$BUILD_INITPRE" || "$BUILD_INITPRE" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" "$mirror"
mv "$VDIR"/dev "$VDIR"/dev.X
-"$DEBOOTSTRAP" "$@" "$DISTRIBUTION" "$VDIR" "$mirror" "$script" || : ## HACK: ignore all errors...
+"$_VNAMESPACE" --new -- "$DEBOOTSTRAP" "$@" "$DISTRIBUTION" "$VDIR" "$mirror" "$script" || : ## HACK: ignore all errors...
fixupDebian "$VDIR"
-test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS"
+test -z "$BUILD_INITPOST" || "$BUILD_INITPOST" "$SETUP_CONFDIR" "$UTIL_VSERVER_VARS" "$mirror"
+$_RM -fr "$workdir"
base.setSuccess
-# $Id: vserver-build.functions 2315 2006-09-15 19:16:48Z hollow $ --*- sh -*--
+# $Id: vserver-build.functions 2515 2007-03-18 15:32:22Z dhozac $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
}
}
-function _setVserverDir
+function _setVserverDirName
{
test -z "$VSERVERDIRNAME" || return 0
VSERVERDIRNAME="$VSERVER_NAME"
{
_setRootDir
_setCacheDir
- _setVserverDir
+ _setVserverDirName
_setVdir
findFile _DEV_FILE "$__CONFDIR/.distributions/$DISTRIBUTION/devs" "$__DISTRIBDIR/$DISTRIBUTION/devs" "$__DISTRIBDIR/defaults/devs"
-# $Id: vserver-build.template 2358 2006-10-31 14:33:30Z hollow $ --*- sh -*--
+# $Id: vserver-build.template 2532 2007-04-21 14:05:32Z dhozac $ --*- sh -*--
# Copyright (C) 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-tmp=$(getopt -o '+d:t:' --long debug,pkgmgmt,template: -n "vserver-build.template" -- "$@") || exit 1
+tmp=$(getopt -o '+d:t:' --long debug,pkgmgmt,template:,nodevsanity -n "vserver-build.template" -- "$@") || exit 1
eval set -- "$tmp"
. "$_LIB_VSERVER_BUILD_FUNCTIONS_PKGMGMT"
--- /dev/null
+#! /bin/bash
+
+# Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if test -e /etc/init.d/functions; then
+ . /etc/init.d/functions
+ _beginResult() { echo -n "$@..."; }
+ _postResult() { echo; }
+ lockfile=/var/lock/subsys/$LOCKFILE
+elif test -e /etc/gentoo-release; then
+ . /sbin/functions.sh
+ _beginResult() { ebegin "$@"; }
+ _postResult() { :; }
+ success() { eend 0; }
+ passed() { eend 0; }
+ failure() { eend 1; }
+ lockfile=/var/lock/vservers/$LOCKFILE
+else
+ _beginResult() { echo -n "$@..."; }
+ _postResult() { :; }
+ success() { echo .; }
+ passed() { echo .; }
+ failure() { echo ERROR; }
+ lockfile=/var/run/$LOCKFILE
+fi
+
+function _endResult()
+{
+ local rc=$1
+ case "$rc" in
+ (0) success;;
+ (2) passed; rc=0;;
+ (*) failure;;
+ esac
+ _postResult
+ return $rc
+}
-# $Id: vserver-setup.functions 2300 2006-09-12 12:16:53Z dhozac $ --*- sh -*--
+# $Id: vserver-setup.functions 2517 2007-03-18 22:02:22Z dhozac $ --*- sh -*--
# Copyright (C) 2003,2004,2005,2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
declare -r SETUP_OPTIONS="confdir:,lockfile:,hostname:,netdev:,netmask:,netprefix:,netbcast:,interface:,flags:,context:,initstyle:,cpuset:,cpusetcpus:,cpusetmems:,cpusetvirt"
declare -r SETUP_HELPMSG=$"
- --context ... the static context of the vserver [default: none; a dynamic
- context will be assumed]
+ --context ... the static context of the vserver [default: none; one will
+ be generated for you]
--confdir ... [default: $__CONFDIR/<name>]
--lockfile <filename>
... [default: $__RUNDIR/<name>]
tmp=${tmp##${name}=}
local dev=${tmp%%:*}
- test "$dev" != "$tmp" || dev=
+ local nodev=
+ test "$dev" != "$tmp" || dev=
tmp=${tmp##${dev}:}
+ test "$dev" != "nodev" || {
+ dev=
+ nodev=1
+ }
local mask=${tmp##*/}
test "$mask" != "$tmp" || mask=
_setup_writeSingleOption "$mask" $d/mask
_setup_writeSingleOption "$prefix" $d/prefix
- test -n "$dev" -o -n "$SETUP_NETDEV" || \
- echo $"No device specified for interface '$idx'; do not forget to set the 'nodev' option" >&2
+ test -n "$dev" -o -n "$SETUP_NETDEV" || {
+ test -n "$nodev" || \
+ echo $"No device specified for interface '$idx'; setting 'nodev'" >&2
+ $_TOUCH $d/nodev
+ }
}
function setup_setDefaults
findFile SETUP_FSTAB "$__CONFDIR"/.defaults/fstab "$__PKGLIBDEFAULTDIR"/fstab
}
+function _setup_generateContext
+{
+ if test -z "$SETUP_CONTEXT" && test ! -e "$__CONFDIR/.defaults/context.dynamic"; then
+ if test -e "$__CONFDIR/.defaults/context.next"; then
+ SETUP_CONTEXT=`$_CAT "$__CONFDIR/.defaults/context.next"`
+ else
+ SETUP_CONTEXT=`$_CAT "$__PKGLIBDEFAULTDIR/context.start"`
+ fi
+ expr "$SETUP_CONTEXT" + 1 > "$__CONFDIR/.defaults/context.next"
+ fi
+}
+
function setup_writeOption
{
local name=$1
mkdir -p "$cfgdir"/interfaces "$cfgdir"/apps/init "$cfgdir"/uts "$cfgdir"/cpuset
+ _setup_generateContext
+
_setup_writeSingleOption "$name" "$cfgdir"/name
_setup_writeSingleOption "$SETUP_CONTEXT" "$cfgdir"/context
_setup_writeSingleOption "$SETUP_HOSTNAME" "$cfgdir"/uts/nodename
: ${LOCKFILE:=vservers-$MARK}
: ${NUMPARALLEL:=6}
-
-if test -e /etc/init.d/functions; then
- . /etc/init.d/functions
- _beginResult() { echo -n "$@"; }
- lockfile=/var/lock/subsys/$LOCKFILE
-elif test -e /etc/gentoo-release; then
- . /sbin/functions.sh
- _beginResult() { ebegin "$@"; }
- success() { eend "$@"; }
- passed() { eend "$@"; }
- failure() { eend "$@"; }
- lockfile=/var/lock/vservers/$LOCKFILE
-else
- _beginResult() { echo -n "$@"; }
- success() { echo .; }
- passed() { echo .; }
- failure() { echo ERROR; }
- lockfile=/var/run/$LOCKFILE
-fi
-
-function _tellResult()
-{
- local rc=$1
- case "$rc" in
- (0) success;;
- (2) passed; rc=0;;
- (*) failure;;
- esac
- echo
- return $rc
-}
+. "$_LIB_VSERVER_INIT_FUNCTIONS"
function start()
{
- _beginResult $"Starting vservers of type '$MARK'..."
+ _beginResult $"Starting vservers of type '$MARK'"
$_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --start
- _tellResult $?
+ _endResult $?
local rc=$?
test "$rc" -ne 0 || touch "$lockfile"
return $rc
function stop()
{
- _beginResult $"Stopping vservers of type '$MARK'..."
+ _beginResult $"Stopping vservers of type '$MARK'"
$_START_VSERVERS -m "$MARK" -j "$NUMPARALLEL" --all --stop
- _tellResult $?
+ _endResult $?
local rc=$?
$_RM -f "$lockfile"
return $rc
-# $Id: vserver.functions 2418 2006-12-08 13:28:02Z dhozac $ --*- sh -*--
+# $Id: vserver.functions 2538 2007-04-27 09:08:43Z hollow $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
test -n "$RUNLEVEL_START" || RUNLEVEL_START="default"
INITCMD_START=( /lib/rcscripts/sh/init-vserver.sh "$RUNLEVEL_START" )
- INITCMD_STOP=( /sbin/rc shutdown )
+ INITCMD_STOP=( env -i RUNLEVEL=0 /sbin/rc shutdown )
INITCMD_PREPARE=( $_FAKE_RUNLEVEL 3 /var/run/utmp )
-
- pushd "$vdir"/vdir &>/dev/null
- basever=$($_CHROOT_SH cat /etc/gentoo-release | $_AWK '{print $5}')
- popd &>/dev/null
-
- basemaj=${basever/.*}
- basemin=${basever#*.}
- basemin=${basemin/.*}
-
- test "$basemaj" -lt 1 -o "$basemin" -lt 13 && \
- panic "\
-Using init-style 'gentoo' requires >=baselayout-1.13 inside the vserver!
-
-Your vserver ($(basename "$vdir")) seems to have baselayout-$basever,
-please use 'plain' init-style instead!"
;;
(x) ;;
## LEGACY ALERT
test ! -e "$iface"/only_ip || break
- local vlan_info
- if vlan_info=$(_getVLANInfo "$dev"); then
- test -d /proc/net/vlan || {
- echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers" >&2
- return 1
- }
- test -e "$iface/vlandev" \
- -o \( -e "$iface/../vlandev" -a ! -e "$iface/novlandev" \) \
- -o \( -e "$__CONFDIR/.defaults/interfaces/vlandev" \
- -a ! -e "$iface/novlandev" \
- -a ! -e "$iface/../novlandev" \) && {
+ test -e "$iface/vlandev" \
+ -o \( -e "$iface/../vlandev" -a ! -e "$iface/novlandev" \) \
+ -o \( -e "$__CONFDIR/.defaults/interfaces/vlandev" \
+ -a ! -e "$iface/novlandev" \
+ -a ! -e "$iface/../novlandev" \) && {
+ local vlan_info
+ if vlan_info=$(_getVLANInfo "$dev"); then
+ test -d /proc/net/vlan || {
+ echo -e $"VLAN device-name used, but vlan subsystem not enabled.\nTry to execute 'modprobe 8021q' before starting the vservers" >&2
+ return 1
+ }
_addInterfaceCmd VCONFIG $vlan_info
- }
- fi
+ fi
+ }
if ! test -e "$iface"/indirect; then
- _addInterfaceCmd IP_ADDR "$ip${prefix:+/$prefix}" broadcast ${bcast:-+} ${name:+label "$dev:$name"} dev "$dev"
+ # XXX: IPv6 hack
+ use_bcast="broadcast ${bcast:-+}"
+ echo "$ip" | $_GREP -q : && use_bcast=
+ _addInterfaceCmd IP_ADDR "$ip${prefix:+/$prefix}" $use_bcast ${name:+label "$dev:$name"} dev "$dev"
#_addInterfaceCmd IP_ROUTE "$ip${prefix:+/$prefix}" dev "$dev"
_addInterfaceCmd IP_LINK "$dev" $up
elif ! test -n "$ctx"; then
$_VDLIMIT --xid $ctx "$directory" | \
$_GREP '_used=' > "$vdir/cache/dlimits/$cachename"
+
+ $_VDLIMIT --xid $ctx --remove "$directory"
}
# these are things that have to be accessible post-cleanup
for tmp in "$root" "$__SBINDIR" "$__PKGLIBDIR" "$vdir" \
- "$__PKGSTATEDIR" "${skip[@]}"; do
+ "$__PKGSTATEDIR" "$__LOCKDIR" /usr/local /tmp "${skip[@]}"; do
while test -n "$tmp"; do
list=( "${list[@]}" "$tmp" )
tmp="${tmp%/*}"
done
}
+function loadDeviceMap
+{
+ local xid="$1"
+ local dir="$2"
+ local flags device target
+
+ test -d "$dir" || return 0
+
+ for i in "$dir"/*; do
+ test -d "$i" || continue
+
+ local -a vdevmap_opts=()
+ test -e "$i/create" && vdevmap_opts=( "${vdevmap_opts[@]}" --create )
+ test -e "$i/open" && vdevmap_opts=( "${vdevmap_opts[@]}" --open )
+ test -e "$i/remap" && vdevmap_opts=( "${vdevmap_opts[@]}" --remap )
+
+ getFileValue flags "$i/flags" || :
+ getFileValue device "$i/device" || :
+ getFileValue target "$i/target" || :
+ vdevmap_opts=( "${vdevmap_opts[@]}" ${flags:+--flags "$flags"} \
+ ${device:+--device "$device"} ${target:+--target "$target"} )
+
+ $_VDEVMAP --xid "$xid" "${vdevmap_opts[@]}" || return $?
+ done
+}
-# $Id: vserver.start 2389 2006-11-20 15:10:00Z dhozac $ --*- sh -*--
+# $Id: vserver.start 2466 2007-01-21 08:02:44Z dhozac $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
${USE_VNAMESPACE:+$_VNAMESPACE --set -- } \
$_VLIMIT --dir "$VSERVER_DIR"/rlimits --missingok -- \
$_VSCHED --xid self --force "${OPTS_VSCHED[@]}" -- \
- $_VUNAME --xid self --dir "$VSERVER_DIR"/uts --missingok -- \
+ $_VSYSCTL --xid self --dir "$VSERVER_DIR"/sysctl --missingok -- \
+ $_VUNAME --xid self --dir "$VSERVER_DIR"/uts --missingok -- \
"${VSERVER_EXTRA_CMDS[@]}" \
$_VUNAME --xid self --set -t context="$VSERVER_DIR" -- \
$_VATTRIBUTE --set "${OPTS_VATTRIBUTE[@]}" -- \
fi
${NICE_CMD[@]} \
- $_CHBIND_COMPAT "${CHBIND_OPTS[@]}" \
+ $_CHBIND "${CHBIND_OPTS[@]}" \
$_EXEC_ULIMIT "$VSERVER_DIR/ulimits" \
$_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" "${CHCONTEXT_INIT_OPTS[@]}" \
$_SAVE_CTXINFO "$VSERVER_DIR" \
-# $Id: vserver.stop 2312 2006-09-15 04:32:28Z dhozac $ --*- sh -*--
+# $Id: vserver.stop 2508 2007-02-25 14:06:51Z dhozac $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
initWait "$VSERVER_DIR" "$S_CONTEXT" vwait_statdir
if test -n "$_IS_FAKEINIT" && \
$_VSERVER_INFO - FEATURE vkill; then
- $_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
- ## HACK: remove the 'initpid' stuff above when PID virtualization
- ## is implemented
+ if ! vshelper.isStopSync; then
+ $_VKILL -s INT --xid "$S_CONTEXT" -- 1 || fail=1
+ fi
elif $_VSERVER_INFO - FEATURE migrate; then
"${NICE_CMD[@]}" \
- ${USE_VNAMESPACE:+$_VNAMESPACE --enter "$S_CONTEXT" -- } \
$_VCONTEXT $SILENT_OPT --migrate --chroot --xid "$S_CONTEXT" -- \
"${INITCMD_STOP[@]}" || fail=1
else
"${NICE_CMD[@]}" \
"$_CHBIND" "${CHBIND_OPTS[@]}" \
"$_EXEC_ULIMIT" "$VSERVER_DIR/ulimits" \
- ${USE_VNAMESPACE:+$_VNAMESPACE --enter "$S_CONTEXT"} \
$_CHCONTEXT_COMPAT "${CHCONTEXT_OPTS[@]}" \
"$_CAPCHROOT" "${CAPCHROOT_OPTS[@]}" "." \
"${INITCMD_STOP[@]}" || fail=1
fi
+# Remove persistent so those contexts can be stopped
+$_VATTRIBUTE --set --xid "$S_CONTEXT" --flag ~persistent 2>/dev/null || :
+if $_VSERVER_INFO -q "$S_CONTEXT" XIDTYPE static &&
+ $_VSERVER_INFO - FEATURE vnet; then
+ $_NATTRIBUTE --set --nid "$S_CONTEXT" --flag ~persistent 2>/dev/null || :
+fi
+
vshelper.doStopSync
waitForSync "$VSERVER_DIR" "$sync_fifo" "$vwait_statdir"
-# $Id: vserver.suexec 2300 2006-09-12 12:16:53Z dhozac $ --*- sh -*--
+# $Id: vserver.suexec 2481 2007-01-29 02:06:30Z dhozac $ --*- sh -*--
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
cd "$VSERVER_DIR"/vdir/
+test -z "$OPTION_NONAMESPACE" || USE_VNAMESPACE=
+
if $_VSERVER_INFO - FEATURE migrate; then
if test -z "$is_stopped"; then
exec \
disown %%
vshelper.waitForStopSync "$sync_dir"
+ spawn killContext "$XID"
;;
(swsusp)
## TODO: any senseful action here? Perhaps shutdown scheduler for it?
exit 0
;;
(restart2) ;;
+ (shutdown)
+ logging $"Cleaning up after vserver '$VSERVER'"
+ spawn $_VSERVER --defaulttty "$VSERVER" stop
+ ;;
(*)
warning $"Unknown action '$ACTION' for vserver '$VSERVER'"
exit 1
responsible_xid=$pxid
done
-vserver_id=$($_VSERVER_INFO "$responsible_xid" ID) ||
+vserver_id=$($_VSERVER_INFO "$responsible_xid" ID) || test "$ACTION" = "shutdown" ||
panic $"No responsible vserver found for xid '$responsible_xid' ($XID); aborting..."
test "$XID" = "$responsible_xid" || {
#! /bin/bash
-# $Id: vsomething 2303 2006-09-12 12:39:00Z dhozac $
+# $Id: vsomething 2515 2007-03-18 15:32:22Z dhozac $
# Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
if pkgmgmt.isInternal "$i"; then
$_VSERVER "$i" exec "$cmd" "$@"
else
- _getVserverDir "$i"
+ _setVserverDir "$i"
( _generateChbindOptions "$VSERVER_DIR"
$_VSERVER "$i" status &> /dev/null && \
CHBIND_CMD=( "$_CHBIND" "${CHBIND_OPTS[@]}" -- )
#!/bin/bash
-# $Id: vupdateworld 2363 2006-11-03 14:36:23Z hollow $
+# $Id: vupdateworld 2486 2007-02-05 18:08:17Z hollow $
# Copyright (C) 2006 Benedikt Boehm <hollow@gentoo.org>
#
shift
done
+declare -a vserver_names
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ (--) shift; break;;
+ (*) vserver_names=( "${vserver_names[@]}" "$1" );;
+ esac
+ shift
+done
+
VSOMETHING_TITLE=vemerge
VSOMETHING_PKGMGMT=1
export VSOMETHING_TITLE VSOMETHING_PKGMGMT
test ${#vsomething_opts[@]} -eq 0 || vsomething_opts=( "${vsomething_opts[@]}" -- )
-exec $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" --update --deep --newuse "$@"
+exec $_VSOMETHING "${send_through[@]}" emerge "${vsomething_opts[@]}" "${vserver_names[@]}" -- world --update --deep --newuse "$@"
#! /bin/bash
-# $Id: vyum-worker 2361 2006-11-01 19:46:02Z dhozac $
+# $Id: vyum-worker 2527 2007-04-11 18:14:47Z dhozac $
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
#
You are using a version of yum which current status is unknown to vyum.
Just to be sure, 'vyum' will use dirty hacks which might not work when
-the vsrever is running and local DOS attacks are possible.
+the vserver is running and local DOS attacks are possible.
Execution will continue in 5 seconds..."
sleep 5
-## $Id: Makefile-files 2385 2006-11-20 00:23:13Z dhozac $ -*- makefile -*-
+## $Id: Makefile-files 2491 2007-02-05 20:59:03Z dhozac $ -*- makefile -*-
## Copyright (C) 2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##
src_sbin_CXX_PROGS =
src_pkglib_CXX_PROGS =
-src_pkglib_C99_PROGS = src/vunify src/vcopy
+src_pkglib_C99_PROGS = src/vunify src/vcopy src/vclone
AM_INSTALLCHECK_STD_OPTIONS_EXEMPT += \
src/vwait \
src/ncontext \
src/nattribute \
- src/naddress
+ src/naddress \
+ src/vdevmap \
+ src/vsysctl \
+ src/vclone
if ENSC_CAN_BEECRYPT_WITH_DIETLIBC
DIETPROGS += src/vhashify
src/vshelper-sync \
src/sigexec \
src/chbind-compat \
+ src/vsysctl \
$(src_pkglib_C99_X_PROGS) \
$(src_pkglib_CXX_X_PROGS)
src/ncontext \
src/nattribute \
src/naddress \
+ src/vdevmap \
$(src_sbin_CXX_X_PROGS)
if ENSC_HAVE_C99_COMPILER
src_vkill_SOURCES = src/vkill.c
src_vkill_LDADD = $(VSERVER_LDADDS)
-src_vkill_LDFLAGS = $(VSERVER_LDFLGS)
+src_vkill_LDFLAGS = $(VSERVER_LDFLGS) $(LIBINTERNAL)
src_vkill_CPPFLAGS = $(AM_CPPFLAGS) -DLEGACYDIR=\"$(legacydir)\"
src_vlimit_SOURCES = src/vlimit.c
src_naddress_LDADD = $(VSERVER_LDADDS) $(LIBINTERNAL)
src_naddress_LDFLAGS = $(VSERVER_LDFLGS)
+src_vdevmap_SOURCES = src/vdevmap.c
+src_vdevmap_LDADD = $(VSERVER_LDADDS) $(LIBINTERNAL)
+src_vdevmap_LDFLAGS = $(VSERVER_LDFLGS)
+
+src_vsysctl_SOURCES = src/vsysctl.c
+src_vsysctl_LDADD = $(VSERVER_LDADDS)
+src_vsysctl_LDFLAGS = $(VSERVER_LDFLGS)
+
+src_vclone_SOURCES = src/vclone.c
+src_vclone_LDADD = $(LIBINTERNAL) $(VSERVER_LDADDS)
+src_vclone_LDFLAGS = $(VSERVER_LDLFGS)
+
EXTRA_PROGRAMS += $(src_sbin_CXX_PROGS) $(src_pkglib_CXX_PROGS)
TESTS_ENVIRONMENT += srctestsuitedir=$(top_builddir)/src/testsuite
-// $Id: chroot-sh.c 2407 2006-11-25 19:18:06Z dhozac $ --*- c -*--
+// $Id: chroot-sh.c 2536 2007-04-27 09:01:20Z hollow $ --*- c -*--
// Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
return res;
}
+static int
+execLink(int argc, char *argv[])
+{
+ int res = EXIT_SUCCESS;
+
+ if (argc!=3) {
+ WRITE_MSG(2, "Need exactly two files for 'link' operation; try '--help' for more information\n");
+ return wrapper_exit_code;
+ }
+
+ if (symlink(argv[1], argv[2])==-1) {
+ PERROR_Q(ENSC_WRAPPERS_PREFIX "link", argv[1]);
+ res = EXIT_FAILURE;
+ }
+
+ return res;
+}
+
static struct Command {
char const *cmd;
int (*handler)(int argc, char *argv[]);
{ "rm", execRm },
{ "mkdir", execMkdir },
{ "chmod", execChmod },
+ { "link", execLink },
{ 0,0 }
};
" rm <file>+ ... unlink the given files\n"
" mkdir <file>+ ... create the given directories\n"
" chmod <mode> <file>+\n"
- " ... change access permissions of files\n\n"
+ " ... change access permissions of files\n"
+ " link <src> dst> ... create a symbolic link from <src> to <dst>\n\n"
"Please report bugs to " PACKAGE_BUGREPORT "\n");
exit(0);
}
-// $Id: chxid.c 1670 2004-08-19 14:28:57Z ensc $ --*- c -*--
+// $Id: chxid.c 2473 2007-01-25 09:51:43Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
{ 0,0,0,0 }
};
-char const CMDLINE_OPTIONS_SHORT[] = "Rc:x";
+char const CMDLINE_OPTIONS_SHORT[] = "Rc:xU";
void
showHelp(int fd, char const *cmd, int res)
WRITE_MSG(fd, "Usage: ");
WRITE_STR(fd, cmd);
WRITE_MSG(fd,
- " -c <ctx|vserver> [-Rx] [--] <file>+\n\n"
+ " -c <ctx|vserver> [-RxU] [--] <file>+\n\n"
" Options:\n"
" -R ... recurse through directories\n"
" -c ... assign the given context/vserver to the file(s)\n"
- " -x ... do not cross filesystems\n\n"
+ " -x ... do not cross filesystems\n"
+ " -U ... skip unified files\n\n"
"Please report bugs to " PACKAGE_BUGREPORT "\n");
exit(res);
}
exit(0);
}
+static inline bool
+isUnified(char const *filename)
+{
+ uint_least32_t const V = VC_IATTR_IUNLINK|VC_IATTR_IMMUTABLE;
+
+ uint_least32_t flags;
+ uint_least32_t mask = V;
+
+ if (vc_get_iattr(filename, 0, &flags, &mask)==-1 || (mask & V) != V)
+ return false;
+
+ return (flags & V)==V ? true : false;
+}
+
bool
handleFile(char const *name, char const * display_name)
{
- int rc = vc_set_iattr(name, global_args->ctx, 0, VC_IATTR_XID);
+ if (!global_args->no_unified || !isUnified(name)) {
+ int rc = vc_set_iattr(name, global_args->ctx, 0, VC_IATTR_XID);
- if (rc==-1) {
- perror(display_name);
- return false;
+ if (rc==-1) {
+ perror(display_name);
+ return false;
+ }
}
return true;
-// $Id: fstool.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c -*--
+// $Id: fstool.c 2473 2007-01-25 09:51:43Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
.do_set = false,
.do_unset = false,
.local_fs = false,
- .set_mask = 0,
- .del_mask = 0
+ .set_mask = 0,
+ .del_mask = 0,
+ .no_unified = false,
};
global_args = &args;
case CMD_HELP : showHelp(1, argv[0], 0);
case CMD_VERSION : showVersion();
case CMD_IMMU : args.set_mask |= VC_IATTR_IMMUTABLE; /*@fallthrough@*/
- case CMD_IMMUX : args.set_mask |= VC_IATTR_IUNLINK; break;
- case CMD_ADMIN : args.set_mask |= VC_IATTR_ADMIN; break;
- case CMD_WATCH : args.set_mask |= VC_IATTR_WATCH; break;
- case CMD_HIDE : args.set_mask |= VC_IATTR_HIDE; break;
- case CMD_BARRIER : args.set_mask |= VC_IATTR_BARRIER; break;
+ case CMD_IMMUX : args.set_mask |= VC_IATTR_IUNLINK; break;
+ case CMD_IMMUTABLE : args.set_mask |= VC_IATTR_IMMUTABLE; break;
+ case CMD_ADMIN : args.set_mask |= VC_IATTR_ADMIN; break;
+ case CMD_WATCH : args.set_mask |= VC_IATTR_WATCH; break;
+ case CMD_HIDE : args.set_mask |= VC_IATTR_HIDE; break;
+ case CMD_BARRIER : args.set_mask |= VC_IATTR_BARRIER; break;
case CMD_UNSET_IMMU : args.del_mask |= VC_IATTR_IMMUTABLE; /*@fallthrough@*/
- case CMD_UNSET_IMMUX : args.del_mask |= VC_IATTR_IUNLINK; break;
- case CMD_UNSET_ADMIN : args.del_mask |= VC_IATTR_ADMIN; break;
- case CMD_UNSET_WATCH : args.del_mask |= VC_IATTR_WATCH; break;
- case CMD_UNSET_HIDE : args.del_mask |= VC_IATTR_HIDE; break;
- case CMD_UNSET_BARRIER : args.del_mask |= VC_IATTR_BARRIER; break;
- case 'R' : args.do_recurse = true; break;
- case 'a' : args.do_display_dot = true; break;
- case 'd' : args.do_display_dir = true; break;
- case 'n' : args.do_mapping = false; break;
- case 's' : args.do_set = true; break;
- case 'u' : args.do_unset = true; break;
- case 'c' : args.ctx_str = optarg; break;
- case 'x' : args.local_fs = true; break;
+ case CMD_UNSET_IMMUX : args.del_mask |= VC_IATTR_IUNLINK; break;
+ case CMD_UNSET_IMMUTABLE : args.del_mask |= VC_IATTR_IMMUTABLE; break;
+ case CMD_UNSET_ADMIN : args.del_mask |= VC_IATTR_ADMIN; break;
+ case CMD_UNSET_WATCH : args.del_mask |= VC_IATTR_WATCH; break;
+ case CMD_UNSET_HIDE : args.del_mask |= VC_IATTR_HIDE; break;
+ case CMD_UNSET_BARRIER : args.del_mask |= VC_IATTR_BARRIER; break;
+ case 'R' : args.do_recurse = true; break;
+ case 'a' : args.do_display_dot = true; break;
+ case 'd' : args.do_display_dir = true; break;
+ case 'n' : args.do_mapping = false; break;
+ case 's' : args.do_set = true; break;
+ case 'u' : args.do_unset = true; break;
+ case 'c' : args.ctx_str = optarg; break;
+ case 'x' : args.local_fs = true; break;
+ case 'U' : args.no_unified = true; break;
default :
WRITE_MSG(2, "Try '");
WRITE_STR(2, argv[0]);
-// $Id: fstool.h 1672 2004-08-19 14:29:44Z ensc $ --*- c -*--
+// $Id: fstool.h 2473 2007-01-25 09:51:43Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
#define CMD_UNSET_HIDE 0x8023
#define CMD_UNSET_BARRIER 0x8024
#define CMD_UNSET_IMMUX 0x8025
+#define CMD_UNSET_IMMUTABLE 0x8026
struct stat;
bool do_set;
bool do_unset;
bool local_fs;
+ bool no_unified;
uint32_t set_mask;
uint32_t del_mask;
-// $Id: rpm-fake-resolver.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c -*--
+// $Id: rpm-fake-resolver.c 2501 2007-02-20 17:33:35Z dhozac $ --*- c -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
Evc_set_cflags(xid, &flags);
}
else if (vc_isSupported(vcFEATURE_MIGRATE))
- Evc_ctx_migrate(xid);
+ Evc_ctx_migrate(xid, 0);
else {
#ifdef VC_ENABLE_API_COMPAT
Evc_new_s_context(xid, xid_caps, xid_flags);
-// $Id: rpm-fake.c 2421 2006-12-09 16:12:18Z dhozac $ --*- c++ -*--
+// $Id: rpm-fake.c 2501 2007-02-20 17:33:35Z dhozac $ --*- c++ -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
if ((xid==VC_DYNAMIC_XID || !vc_is_dynamic_xid(xid)) &&
(rc=vc_ctx_create(xid))==VC_NOCTX &&
errno!=EEXIST) {
- perror(ENSC_WRAPPERS_PREFIX "vc_create_context()");
+ perror(ENSC_WRAPPERS_PREFIX "vc_ctx_create()");
exit(255);
}
int res = -1;
if (vc_isSupported(vcFEATURE_MIGRATE))
- res = vc_ctx_migrate(ctx);
+ res = vc_ctx_migrate(ctx, 0);
else {
#ifdef VC_ENABLE_API_COMPAT
res = vc_new_s_context(ctx,caps,flags);
-// $Id: secure-mount.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c++ -*--
+// $Id: secure-mount.c 2480 2007-01-28 11:35:19Z dhozac $ --*- c++ -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
unsigned long xflag;
unsigned long mask;
char * data;
+ char * data_parsed;
};
struct Options {
unsigned long const xflag;
bool const is_dflt;
} const FSTAB_OPTIONS[] = {
- { "defaults", 0, (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|
+ { "defaults", MS_NODEV, (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|
MS_SYNCHRONOUS), 0, false },
{ "rbind", MS_BIND|MS_REC, MS_BIND|MS_REC, 0, false },
{ "bind", MS_BIND, MS_BIND, 0, false },
if (canHandleInternal(mnt)) {
if (mount(mnt->src, ".",
mnt->type ? mnt->type : "",
- mnt->flag, mnt->data)==-1) {
+ mnt->flag, mnt->data_parsed)==-1) {
perror("secure-mount: mount()");
return false;
}
} while (*ptr!='\0');
- info->data = data;
+ info->data_parsed = data;
return true;
}
-// $Id: setattr.c 1112 2004-03-05 19:50:45Z ensc $ --*- c -*--
+// $Id: setattr.c 2431 2006-12-19 19:18:12Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
{ "iunlink-but-not-immutable", no_argument, 0, CMD_IMMUX },
{ "~iunlink-but-not-immutable", no_argument, 0, CMD_UNSET_IMMUX },
{ "!iunlink-but-not-immutable", no_argument, 0, CMD_UNSET_IMMUX },
+ { "immutable", no_argument, 0, CMD_IMMUTABLE },
+ { "~immutable", no_argument, 0, CMD_UNSET_IMMUTABLE },
+ { "!immutable", no_argument, 0, CMD_UNSET_IMMUTABLE },
{ 0,0,0,0 }
};
--- /dev/null
+// $Id: vclone.c 2494 2007-02-11 00:45:04Z dhozac $ --*- c -*--
+
+// Copyright (C) 2007 Daniel Hokka Zakrisson
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "util.h"
+#include "vserver.h"
+
+#include "lib_internal/pathinfo.h"
+#include "lib_internal/unify.h"
+
+#include <unistd.h>
+#include <getopt.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <errno.h>
+#include <assert.h>
+#include <utime.h>
+#include <libgen.h>
+#include <sys/param.h>
+
+#define ENSC_WRAPPERS_PREFIX "vclone: "
+#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_FCNTL 1
+#define ENSC_WRAPPERS_DIRENT 1
+#include <wrappers.h>
+
+#define CMD_HELP 0x8000
+#define CMD_VERSION 0x8001
+
+struct WalkdownInfo
+{
+ PathInfo state;
+ PathInfo src;
+ PathInfo dst;
+};
+
+struct Arguments {
+ unsigned int verbosity;
+};
+
+static struct WalkdownInfo global_info;
+static struct Arguments const * global_args;
+
+int wrapper_exit_code = 1;
+
+struct option const
+CMDLINE_OPTIONS[] = {
+ { "help", no_argument, 0, CMD_HELP },
+ { "version", no_argument, 0, CMD_VERSION },
+ { 0,0,0,0 }
+};
+
+
+static void
+showHelp(int fd, char const *cmd, int res)
+{
+ VSERVER_DECLARE_CMD(cmd);
+
+ WRITE_MSG(fd, "Usage:\n ");
+ WRITE_STR(fd, cmd);
+ WRITE_MSG(fd,
+ " <source> <absolute path to destination>\n\n"
+ "Please report bugs to " PACKAGE_BUGREPORT "\n");
+ exit(res);
+}
+
+static void
+showVersion()
+{
+ WRITE_MSG(1,
+ "vclone " VERSION " -- clones a guest\n"
+ "This program is part of " PACKAGE_STRING "\n\n"
+ "Copyright (C) 2007 Daniel Hokka Zakrisson\n"
+ VERSION_COPYRIGHT_DISCLAIMER);
+ exit(0);
+}
+
+int Global_getVerbosity() {
+ return global_args->verbosity;
+}
+
+bool Global_doRenew() {
+ return true;
+}
+
+#include "vserver-visitdir.hc"
+
+static uint64_t
+visitDirEntry(struct dirent const *ent)
+{
+ char const * dirname = ent->d_name;
+ if (isDotfile(dirname)) return 0;
+
+ uint64_t res = 1;
+ PathInfo src_path = global_info.state;
+ PathInfo src_d_path = {
+ .d = dirname,
+ .l = strlen(dirname)
+ };
+ char path_buf[ENSC_PI_APPSZ(src_path, src_d_path)];
+ struct stat f_stat = { .st_dev = 0 };
+
+ PathInfo_append(&src_path, &src_d_path, path_buf);
+
+
+ if (lstat(dirname, &f_stat)==-1)
+ perror(ENSC_WRAPPERS_PREFIX "lstat()");
+ else {
+ PathInfo dst_path = global_info.dst;
+ char dst_path_buf[ENSC_PI_APPSZ(dst_path, src_path)];
+
+ PathInfo_append(&dst_path, &src_path, dst_path_buf);
+
+ /* skip files that already exist */
+ if (access(dst_path.d, F_OK)!=-1)
+ res = 0;
+ else if (S_ISREG(f_stat.st_mode) && Unify_isIUnlinkable(src_d_path.d) == unifyBUSY) {
+ Elink(src_d_path.d, dst_path.d);
+ res = 0;
+ }
+ else {
+ if (!Unify_copy(src_d_path.d, &f_stat, dst_path.d)) {
+ perror(ENSC_WRAPPERS_PREFIX "Unify_copy()");
+ exit(wrapper_exit_code);
+ }
+ res = 0;
+ }
+ if (S_ISDIR(f_stat.st_mode))
+ res = visitDir(dirname, &f_stat);
+ }
+
+ return res;
+}
+
+int main(int argc, char *argv[])
+{
+ struct Arguments args = {
+ .verbosity = 0,
+ };
+ uint64_t res;
+ int num_args;
+
+ global_args = &args;
+ while (1) {
+ int c = getopt_long(argc, argv, "+",
+ CMDLINE_OPTIONS, 0);
+ if (c==-1) break;
+
+ switch (c) {
+ case CMD_HELP : showHelp(1, argv[0], 0);
+ case CMD_VERSION : showVersion();
+ default :
+ WRITE_MSG(2, "Try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ break;
+ }
+ }
+
+ num_args = argc - optind;
+ if (num_args < 1) {
+ WRITE_MSG(2, "Source is missing; try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ }
+ else if (num_args < 2) {
+ WRITE_MSG(2, "Destination is missing; try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ }
+ else if (num_args > 2) {
+ WRITE_MSG(2, "Too many arguments; try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ }
+ else if (*argv[optind+1] != '/') {
+ WRITE_MSG(2, "The destination must be an absolute path; try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ }
+ ENSC_PI_SETSTR(global_info.src, argv[optind]);
+ ENSC_PI_SETSTR(global_info.dst, argv[optind+1]);
+
+ if (global_args->verbosity>3)
+ WRITE_MSG(1, "Starting to traverse directories...\n");
+
+ Echdir(global_info.src.d);
+ res = visitDir("/", 0);
+
+ return res>0 ? 1 : 0;
+}
-// $Id: vcontext.c 2415 2006-12-08 13:24:49Z dhozac $ --*- c -*--
+// $Id: vcontext.c 2501 2007-02-20 17:33:35Z dhozac $ --*- c -*--
// Copyright (C) 2004-2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
switch (errno) {
case EEXIST :
if (!args->is_silentexist)
- perror(ENSC_WRAPPERS_PREFIX "vc_create_context()");
+ perror(ENSC_WRAPPERS_PREFIX "vc_ctx_create()");
return 254;
default :
- perror(ENSC_WRAPPERS_PREFIX "vc_create_context()");
+ perror(ENSC_WRAPPERS_PREFIX "vc_ctx_create()");
return wrapper_exit_code;
}
}
setFlags(args, xid);
if (args->do_migrate && !args->do_migrateself)
- Evc_ctx_migrate(xid);
+ Evc_ctx_migrate(xid, 0);
if (args->uid != NULL) {
uid_t uid = 0;
--- /dev/null
+// $Id: vdevmap.c 2490 2007-02-05 20:45:25Z dhozac $ --*- c -*--
+
+// Copyright (C) 2006 Daniel Hokka Zakrisson
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "util.h"
+#include <lib/internal.h>
+
+#include <vserver.h>
+
+#include <getopt.h>
+#include <errno.h>
+
+#define ENSC_WRAPPERS_PREFIX "vdevmap: "
+#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_VSERVER 1
+#include <wrappers.h>
+
+#define CMD_HELP 0x1000
+#define CMD_VERSION 0x1001
+
+int wrapper_exit_code = 1;
+
+struct option const
+CMDLINE_OPTIONS[] = {
+ { "help", no_argument, 0, CMD_HELP },
+ { "version", no_argument, 0, CMD_VERSION },
+ { "xid", required_argument, 0, 'x' },
+ { "open", no_argument, 0, 'o' },
+ { "create", no_argument, 0, 'c' },
+ { "remap", no_argument, 0, 'r' },
+ { "flags", required_argument, 0, 'f' },
+ { "device", required_argument, 0, 'd' },
+ { "target", required_argument, 0, 't' },
+ {0,0,0,0}
+};
+
+static void
+showHelp(int fd, char const *cmd)
+{
+ WRITE_MSG(fd, "Usage: ");
+ WRITE_STR(fd, cmd);
+ WRITE_MSG(fd,
+ " --xid <xid> [--flags <flags>] [--open] [--create] [--remap] [--device <dev>] [--target <dev>]\n"
+ "\n"
+ "Please report bugs to " PACKAGE_BUGREPORT "\n");
+
+ exit(0);
+}
+
+static void
+showVersion()
+{
+ WRITE_MSG(1,
+ "vdevmap " VERSION " -- manages device mappings\n"
+ "This program is part of " PACKAGE_STRING "\n\n"
+ "Copyright (C) 2006 Daniel Hokka Zakrisson\n"
+ VERSION_COPYRIGHT_DISCLAIMER);
+ exit(0);
+}
+
+int main(int argc, char *argv[])
+{
+ xid_t xid = VC_NOCTX;
+ bool allow_open = false;
+ bool allow_create = false;
+ bool do_remap = false;
+ uint32_t flags = 0;
+ char *device = NULL;
+ char *target = NULL;
+ unsigned long tmp = 0;
+
+ while (1) {
+ int c = getopt_long(argc, argv, "+x:ocrf:d:t:", CMDLINE_OPTIONS, 0);
+ if (c==-1) break;
+
+ switch (c) {
+ case CMD_HELP : showHelp(1, argv[0]);
+ case CMD_VERSION : showVersion();
+ case 'x' : xid = Evc_xidopt2xid(optarg, true); break;
+ case 'o' : allow_open = true; break;
+ case 'c' : allow_create = true; break;
+ case 'r' : do_remap = true; break;
+ case 'd' : device = optarg; break;
+ case 't' : target = optarg; break;
+ case 'f' :
+ if (!isNumberUnsigned(optarg, &tmp, false)) {
+ WRITE_MSG(2, "Invalid flags argument: '");
+ WRITE_STR(2, optarg);
+ WRITE_MSG(2, "'; try '--help' for more information\n");
+ return EXIT_FAILURE;
+ }
+ flags |= (uint32_t) tmp;
+ break;
+
+ default :
+ WRITE_MSG(2, "Try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ break;
+ }
+ }
+
+ if (allow_open) flags |= VC_DATTR_OPEN;
+ if (allow_create) flags |= VC_DATTR_CREATE;
+ if (do_remap) flags |= VC_DATTR_REMAP;
+
+ if (xid==VC_NOCTX)
+ WRITE_MSG(2, "No xid specified; try '--help' for more information\n");
+ else if (optind!=argc)
+ WRITE_MSG(2, "Unused argument(s); try '--help' for more information\n");
+ else if (vc_set_mapping(xid, device, target, flags)==-1)
+ perror("vc_set_mapping()");
+ else
+ return EXIT_SUCCESS;
+
+ return EXIT_FAILURE;
+}
-// $Id: vhashify.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c -*--
+// $Id: vhashify.c 2475 2007-01-27 09:38:56Z dhozac $ --*- c -*--
// Copyright (C) 2005 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
# include <config.h>
#endif
+#define UTIL_VSERVER_UNIFY_MTIME_OPTIONAL
+
#include "vhashify.h"
#include "util.h"
#define CMD_SLEDGE 0x1002
#define CMD_MANUALLY 0x1003
#define CMD_REFRESH 0x1004
+#define CMD_NOMTIME 0x1005
struct option const
CMDLINE_OPTIONS[] = {
{ "sledgehammer", no_argument, 0, CMD_SLEDGE },
{ "manually", no_argument, 0, CMD_MANUALLY },
{ "refresh", no_argument, 0, CMD_REFRESH },
+ { "ignore-mtime", no_argument, 0, CMD_NOMTIME },
{ "dry-run", no_argument, 0, 'n' },
{ "verbose", no_argument, 0, 'v' },
{ 0,0,0,0 }
SET_ATTR(gid),
SET_ATTR(rdev),
SET_ATTR(size),
- SET_ATTR(mtime)
+ .mtime = (global_args->ignore_mtime ? 0 : st->st_mtime),
};
#undef SET_ATTR
.insecure = 0,
.dry_run = false,
.do_refresh = false,
+ .ignore_mtime = false,
};
Vector_init(&global_info.hash_dirs, sizeof(struct HashDirInfo));
case CMD_INSECURE : args.insecure = 1; break;
case CMD_SLEDGE : args.insecure = 2; break;
case CMD_REFRESH : args.do_refresh = true; break;
+ case CMD_NOMTIME : args.ignore_mtime = true; break;
case 'n' : args.dry_run = true; break;
case 'v' : ++args.verbosity; break;
default :
-// $Id: vhashify.h 1922 2005-03-18 00:25:37Z ensc $ --*- c -*--
+// $Id: vhashify.h 2475 2007-01-27 09:38:56Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
char const * hash_dir;
bool dry_run;
bool do_refresh;
+ bool ignore_mtime;
};
struct HashDirInfo {
-// $Id: vkill.c 2403 2006-11-24 23:06:08Z dhozac $ --*- c -*--
+// $Id: vkill.c 2491 2007-02-05 20:59:03Z dhozac $ --*- c -*--
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
//
}
#else // VC_ENABLE_API_LEGACY
inline static int
-kill_wrapper(xid_t xid, char const *pid, int sig)
+kill_wrapper(xid_t xid, char const *pid_s, int sig)
{
- if (vc_ctx_kill(xid,atoi(pid),sig)==-1) {
+ pid_t pid;
+ long tmp;
+
+ if (!isNumber(pid_s, &tmp, true)) {
+ WRITE_MSG(2, "vkill: '");
+ WRITE_STR(2, pid_s);
+ WRITE_MSG(2, "' is not a number\n");
+ }
+ pid = (pid_t) tmp;
+
+ if (xid==VC_NOCTX)
+ xid = vc_get_task_xid(pid);
+ if (vc_ctx_kill(xid,pid,sig)==-1) {
perror("vkill: vc_ctx_kill()");
return 1;
}
-// $Id: vlogin.c 2325 2006-09-21 19:42:31Z dhozac $
+// $Id: vlogin.c 2525 2007-04-08 00:40:16Z dhozac $
// Copyright (C) 2006 Benedikt Böhm <hollow@gentoo.org>
// Based on vserver-utils' vlogin program.
}
/* copy terminal activities */
-static void
+static ssize_t
terminal_copy(int src, int dst)
{
char buf[64];
terminal_kill(SIGTERM);
exit(1);
} else if (len == -1)
- return;
+ return -1;
/* write activity to user */
EwriteAll(dst, buf, len);
+
+ return len;
}
/* shuffle all output, and reset the terminal */
exit(wrapper_exit_code);
}
- if (FD_ISSET(STDIN_FILENO, &rfds))
- terminal_copy(STDIN_FILENO, t.fd);
+ if (FD_ISSET(STDIN_FILENO, &rfds)) {
+ /* EOF */
+ if (terminal_copy(STDIN_FILENO, t.fd) == 0) {
+ terminal_kill(SIGHUP);
+ exit(0);
+ }
+ }
- if (FD_ISSET(t.fd, &rfds))
- terminal_copy(t.fd, STDOUT_FILENO);
+ if (FD_ISSET(t.fd, &rfds)) {
+ /* EOF */
+ if (terminal_copy(t.fd, STDOUT_FILENO) == 0) {
+ terminal_kill(SIGHUP);
+ exit(0);
+ }
+ }
}
/* never get here, signal handler exits */
-// $Id: vsched.c 2408 2006-11-27 14:06:57Z dhozac $ --*- c -*--
+// $Id: vsched.c 2510 2007-03-07 20:33:56Z dhozac $ --*- c -*--
// Copyright (C) 2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
// Copyright (C) 2006 Daniel Hokka Zakrisson <daniel@hozac.com>
static void do_dir_entry(struct vc_set_sched *sched, const char *name)
{
- int fd;
- char buf[128];
- signed long val;
struct sched_opt *opt;
- ssize_t len;
- char *newline;
for (opt = FILE_OPTIONS; opt->name != 0; opt++) {
if (strcmp(name, opt->name) == 0)
if (opt->name == 0)
return;
- fd = Eopen(name, O_RDONLY, 0);
- len = Eread(fd, buf, sizeof(buf)-1);
- Eclose(fd);
- buf[len] = '\0';
- if ((newline=strchr(buf, '\n')) != NULL)
- *newline = '\0';
-
- if (!isNumber(buf, &val, true)) {
- WRITE_MSG(2, ENSC_WRAPPERS_PREFIX);
- WRITE_STR(2, name);
- WRITE_MSG(2, ": is not a number\n");
- exit(1);
- }
+ if (opt->offset != offsetof(struct vc_set_sched, set_mask)) {
+ int fd;
+ char buf[128], *newline;
+ signed long val;
+ ssize_t len;
+
+ fd = Eopen(name, O_RDONLY, 0);
+ len = Eread(fd, buf, sizeof(buf)-1);
+ Eclose(fd);
+ buf[len] = '\0';
+ if ((newline=strchr(buf, '\n')) != NULL)
+ *newline = '\0';
+
+ if (!isNumber(buf, &val, true)) {
+ WRITE_MSG(2, ENSC_WRAPPERS_PREFIX);
+ WRITE_STR(2, name);
+ WRITE_MSG(2, ": is not a number\n");
+ exit(1);
+ }
- if (opt->offset != offsetof(struct vc_set_sched, set_mask))
*(int_least32_t *)(((char *)sched)+opt->offset) = (int_least32_t) val;
+ }
sched->set_mask |= opt->mask;
}
-// $Id: vserver-stat.c 2403 2006-11-24 23:06:08Z dhozac $
+// $Id: vserver-stat.c 2450 2007-01-10 19:27:56Z dhozac $
// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
// based on vserver-stat.cc by Guillaum Dallaire and Jacques Gelinas
#include <stdbool.h>
#include <getopt.h>
#include <sys/param.h>
+#include <sys/resource.h>
#define ENSC_WRAPPERS_DIRENT 1
#define ENSC_WRAPPERS_VSERVER 1
#include "wrappers.h"
#define PROC_DIR_NAME "/proc"
+#define PROC_VIRT_DIR_NAME "/proc/virtual"
#define CTX_DIR_NAME "/var/run/vservers/"
#define CTX_NAME_MAX_LEN 50
res->start_time_oldest = MIN(res->start_time_oldest, process->start_time);
}
+static void
+registerXidVstat(struct Vector *vec, unsigned long xid_l)
+{
+ xid_t xid = (xid_t) xid_l;
+ struct XidData *res;
+ struct vc_rlimit_stat limit[3];
+ struct vc_virt_stat vstat;
+ struct vc_sched_info sched;
+ int cpu;
+
+ res = Vector_search(vec, &xid, cmpData);
+ if (res!=0) {
+ WRITE_MSG(2, "Duplicate xid found?!\n");
+ return;
+ }
+ if (vc_virt_stat(xid, &vstat) == -1) {
+ perror("vc_virt_stat()");
+ return;
+ }
+ if (vc_rlimit_stat(xid, RLIMIT_NPROC, &limit[0]) == -1) {
+ perror("vc_rlimit_stat(RLIMIT_NRPOC)");
+ return;
+ }
+ if (vc_rlimit_stat(xid, RLIMIT_AS, &limit[1]) == -1) {
+ perror("vc_rlimit_stat(RLIMIT_AS)");
+ return;
+ }
+ if (vc_rlimit_stat(xid, RLIMIT_RSS, &limit[2]) == -1) {
+ perror("vc_rlimit_stat(RLIMIT_RSS)");
+ return;
+ }
+
+ res = Vector_insert(vec, &xid, cmpData);
+ res->xid = xid;
+
+ res->process_count = limit[0].value;
+ res->VmSize_total = limit[1].value * pagesize;
+ res->VmRSS_total = limit[2].value;
+ res->start_time_oldest= getUptime() - vstat.uptime/1000000;
+
+ res->utime_total = 0;
+ res->stime_total = 0;
+ // XXX: arbitrary CPU limit.
+ for (cpu = 0; cpu < 1024; cpu++) {
+ sched.cpu_id = cpu;
+ sched.bucket_id = 0;
+ if (vc_sched_info(xid, &sched) == -1)
+ break;
+
+ res->utime_total += sched.user_msec;
+ res->stime_total += sched.sys_msec;
+ }
+}
+
static inline uint64_t
toMsec(uint64_t v)
{
if (hertz==0x42) initHertz();
if (pagesize==0x42) initPageSize();
- my_pid = getpid();
+ Vector_init(&xid_data, sizeof(struct XidData));
- if (!switchToWatchXid(&errptr)) {
- perror(errptr);
- exit(1);
+ if (vc_isSupported(vcFEATURE_VSTAT)) {
+ unsigned long xid;
+ Echdir(PROC_VIRT_DIR_NAME);
+ proc_dir = Eopendir(".");
+ while ((dir_entry = readdir(proc_dir)) != NULL) {
+ if (!isNumberUnsigned(dir_entry->d_name, &xid, false))
+ continue;
+
+ registerXidVstat(&xid_data, xid);
+ }
+ closedir(proc_dir);
}
+ else {
+ my_pid = getpid();
+
+ if (!switchToWatchXid(&errptr)) {
+ perror(errptr);
+ exit(1);
+ }
- if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT)
- WRITE_MSG(2,
+ if (access("/proc/uptime",R_OK)==-1 && errno==ENOENT)
+ WRITE_MSG(2,
"WARNING: can not access /proc/uptime. Usually, this is caused by\n"
" procfs-security. Please read the FAQ for more details\n"
" http://linux-vserver.org/Proc-Security\n");
- Vector_init(&xid_data, sizeof(struct XidData));
-
- Echdir(PROC_DIR_NAME);
- proc_dir = Eopendir(".");
- while ((dir_entry = readdir(proc_dir)) != NULL)
- {
+ Echdir(PROC_DIR_NAME);
+ proc_dir = Eopendir(".");
+ while ((dir_entry = readdir(proc_dir)) != NULL)
+ {
// select only process file
- if (!isdigit(*dir_entry->d_name))
- continue;
+ if (!isdigit(*dir_entry->d_name))
+ continue;
- if (atoi(dir_entry->d_name) != my_pid) {
- struct process_info * info = get_process_info(dir_entry->d_name);
- if (info)
- registerXid(&xid_data, info);
+ if (atoi(dir_entry->d_name) != my_pid) {
+ struct process_info * info = get_process_info(dir_entry->d_name);
+ if (info)
+ registerXid(&xid_data, info);
+ }
}
+ closedir(proc_dir);
}
- closedir(proc_dir);
Vector_foreach(&xid_data, fillName, 0);
--- /dev/null
+// $Id: vsysctl.c 2466 2007-01-21 08:02:44Z dhozac $ --*- c -*--
+
+// Copyright (C) 2007 Daniel Hokka Zakrisson
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "util.h"
+#include <lib/internal.h>
+
+#include <vserver.h>
+
+#include <stdio.h>
+#include <getopt.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <dirent.h>
+
+#define ENSC_WRAPPERS_PREFIX "vsysctl: "
+#define ENSC_WRAPPERS_UNISTD 1
+#define ENSC_WRAPPERS_FCNTL 1
+#define ENSC_WRAPPERS_DIRENT 1
+#define ENSC_WRAPPERS_VSERVER 1
+#define ENSC_WRAPPERS_IO 1
+#include <wrappers.h>
+
+
+#define PROC_SYS_DIRECTORY "/proc/sys"
+
+
+#define CMD_HELP 0x1000
+#define CMD_VERSION 0x1001
+#define CMD_XID 0x4000
+#define CMD_DIR 0x4001
+#define CMD_MISSINGOK 0x4002
+
+int wrapper_exit_code = 1;
+
+struct option const
+CMDLINE_OPTIONS[] = {
+ { "help", no_argument, 0, CMD_HELP },
+ { "version", no_argument, 0, CMD_VERSION },
+ { "xid", required_argument, 0, CMD_XID },
+ { "dir", required_argument, 0, CMD_DIR },
+ { "missingok", no_argument, 0, CMD_MISSINGOK },
+ {0,0,0,0}
+};
+
+static void
+showHelp(int fd, char const *cmd)
+{
+ WRITE_MSG(fd, "Usage: ");
+ WRITE_STR(fd, cmd);
+ WRITE_MSG(fd,
+ " --xid <xid> --dir <directory> [--missingok] -- <command> <args>*\n"
+ "\n"
+ "Please report bugs to " PACKAGE_BUGREPORT "\n");
+
+ exit(0);
+}
+
+static void
+showVersion()
+{
+ WRITE_MSG(1,
+ "vsysctl " VERSION " -- sets sysctl values during guest boot\n"
+ "This program is part of " PACKAGE_STRING "\n\n"
+ "Copyright (C) 2007 Daniel Hokka Zakrisson\n"
+ VERSION_COPYRIGHT_DISCLAIMER);
+ exit(0);
+}
+
+void handle_setting(const char *dir, const char *name)
+{
+ int len_dir = strlen(dir), len_name = strlen(name);
+ char filename[len_dir+1+len_name+sizeof("/setting")];
+ char setting[128], value[128], *ptr;
+ int fd;
+ size_t setting_len, value_len;
+
+ strcpy(filename, dir);
+ *(filename+len_dir) = '/';
+ strcpy(filename+len_dir+1, name);
+
+#define READFILE(f) \
+ strcpy(filename+len_dir+1+len_name, "/" #f); \
+ fd = EopenD(filename, O_RDONLY, 0); \
+ f##_len = Eread(fd, f, sizeof(f)); \
+ if (f##_len == sizeof(f)) { \
+ errno = EOVERFLOW; \
+ perror(ENSC_WRAPPERS_PREFIX "read"); \
+ exit(EXIT_FAILURE); \
+ } \
+ f[f##_len] = '\0'; \
+ Eclose(fd);
+
+ READFILE(setting);
+ READFILE(value);
+
+ /* replace all . with / in setting to get a filename */
+ for (ptr = strchr(setting, '.'); ptr; ptr = strchr(ptr, '.'))
+ *ptr = '/';
+
+ /* we just want the first line, and not the linefeed */
+ if ((ptr = strchr(setting, '\n')) != NULL)
+ *ptr = '\0';
+
+ fd = EopenD(setting, O_WRONLY, 0);
+ EwriteAll(fd, value, value_len);
+ Eclose(fd);
+}
+
+int main(int argc, char *argv[])
+{
+ xid_t xid = VC_NOCTX;
+ const char *dir = NULL;
+ bool missing = false;
+
+ while (1) {
+ int c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0);
+ if (c==-1) break;
+
+ switch (c) {
+ case CMD_HELP : showHelp(1, argv[0]);
+ case CMD_VERSION : showVersion();
+ case CMD_XID : xid = Evc_xidopt2xid(optarg, true); break;
+ case CMD_DIR : dir = optarg; break;
+ case CMD_MISSINGOK: missing = true; break;
+
+ default :
+ WRITE_MSG(2, "Try '");
+ WRITE_STR(2, argv[0]);
+ WRITE_MSG(2, " --help' for more information.\n");
+ return EXIT_FAILURE;
+ break;
+ }
+ }
+
+ if (dir != NULL) {
+ int curdir = EopenD(".", O_RDONLY, 0);
+ DIR *dp;
+ struct dirent *de;
+
+ Echdir(PROC_SYS_DIRECTORY);
+
+ dp = opendir(dir);
+ if (dp != NULL) {
+ while ((de = Ereaddir(dp)) != NULL) {
+ if (*de->d_name == '.')
+ continue;
+ handle_setting(dir, de->d_name);
+ }
+ Eclosedir(dp);
+ }
+ else if (!missing) {
+ perror(ENSC_WRAPPERS_PREFIX "opendir");
+ exit(wrapper_exit_code);
+ }
+
+ Efchdir(curdir);
+ }
+
+ Eexecvp(argv[optind], argv+optind);
+ return EXIT_FAILURE;
+}
-## $Id: Makefile-files 1336 2004-03-24 01:44:43Z ensc $ -*- makefile -*-
+## $Id: Makefile-files 2483 2007-02-01 12:56:20Z dhozac $ -*- makefile -*-
## Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
##
sysv_src_SCRPTS = sysv/rebootmgr \
sysv/vprocunhide \
sysv/vservers-default \
- sysv/vservers-legacy
+ sysv/vservers-legacy \
+ sysv/util-vserver
sysv_gen_SCRPTS = sysv/v_gated \
sysv/v_httpd \
sysv/v_named \
sysv/v_xinetd
sysv_conf_DTA = sysv/vservers.conf
-sysconf_DATA += $(sysv_conf_DTA)
EXTRA_DIST += sysv/v_gated.subst \
sysv/v_httpd.subst \
sysv/v_named.subst \
$(sysv_src_SCRPTS) \
$(sysv_conf_DTA)
+if HAVE_SYSV_INIT
+sysconf_DATA += $(sysv_conf_DTA)
initrd_SCRIPTS += $(sysv_src_SCRPTS) \
$(sysv_gen_SCRPTS)
+endif
CLEANFILES += $(sysv_gen_SCRPTS)
--- /dev/null
+#!/bin/bash
+#
+# util-vserver sets the path to vshelper and kills all guest processes
+#
+# chkconfig: 2345 10 90
+# description: Sets the path to vshelper and kills all guest processes
+
+: ${UTIL_VSERVER_VARS:=/usr/lib/util-vserver/util-vserver-vars}
+test -e "$UTIL_VSERVER_VARS" || {
+ echo $"Can not find util-vserver installation (the file '$UTIL_VSERVER_VARS' would be expected); aborting..." >&2
+ exit 1
+}
+. "$UTIL_VSERVER_VARS"
+
+LOCKFILE=util-vserver
+. "$_LIB_VSERVER_INIT_FUNCTIONS"
+. "$_LIB_FUNCTIONS"
+. "$__PKGLIBDIR/vserver.functions"
+
+
+function set_helper()
+{
+ local f="/proc/sys/kernel/vshelper"
+ if test -e "$f"; then
+ echo "$_VSHELPER" > "$f"
+ return 0
+ else
+ return 2
+ fi
+}
+
+function kill_contexts()
+{
+ local xid
+ for xid in `ls -1 /proc/virtual`; do
+ test "$xid" = "info" -o "$xid" = "status" && continue
+ $_VATTRIBUTE --xid $xid --set --flag ~persistent
+ $_VKILL --xid $xid -s 15
+ sleep 3
+ $_VKILL --xid $xid -s 9
+ done
+ local alive=0
+ for xid in `ls -1 /proc/virtual`; do
+ test "$xid" = "info" -o "$xid" = "status" && continue
+ let alive+=1
+ done
+ test $alive = 0
+}
+
+function create_dirs()
+{
+ $_MKDIR -p "$__RUNDIR" && $_MKDIR -p "$__VSHELPERSTATEDIR" && $_MKDIR -p `getPhysicalDir "$__PKGSTATEREVDIR"`
+}
+
+function start()
+{
+ _beginResult $"Creating required directories"
+ create_dirs
+ _endResult $?
+ _beginResult $"Setting path to vshelper"
+ set_helper
+ _endResult $?
+ local retval=$?
+ _beginResult $"Loading default device map"
+ loadDeviceMap 0 "$__CONFDIR/.defaults/apps/vdevmap"
+ _endResult $?
+ test "$retval" -ne 0 || touch "$lockfile"
+ return $retval
+}
+
+function stop()
+{
+ # Stop all running, but non-default guests"
+ _beginResult $"Stopping all running guests"
+ $_START_VSERVERS -j 1 --all --stop
+ _endResult $?
+ _beginResult $"Killing all running contexts"
+ kill_contexts
+ _endResult $?
+ local retval=$?
+ $_RM -f "$lockfile"
+ return $retval
+}
+
+function restart()
+{
+ stop
+ start
+}
+
+case "$1" in
+ start|stop|restart) $1;;
+ reload) ;;
+ condrestart)
+ test -f $lockfile && restart || :
+ ;;
+ status)
+ test -f $lockfile && {
+ echo $"Path to vshelper has been set"
+ exit 0
+ }
+ echo $"Path to vshelper has not been set"
+ exit 1
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
+ exit 2
+ ;;
+esac
$_VSERVER_INFO - FEATURE iattr || exit 0
-f=/etc/rc.d/init.d/functions
-if test -e "$f"; then
- . "$f"
- lockfile=/var/lock/subsys/vprocunhide
-else
- success() { echo .; }
- passed() { echo .; }
- failure() { echo ERROR; }
- lockfile=/var/run/vprocunhide
-fi
+LOCKFILE=vprocunhide
+. "$_LIB_VSERVER_INIT_FUNCTIONS"
function start()
{
- echo -n $"Fixing /proc entries visibility..."
+ _beginResult $"Fixing /proc entries visibility"
$_VPROCUNHIDE
- retval=$?
- case "$retval" in
- 0) success;;
- 2) passed; retval=0;;
- *) failure;
- esac
- echo
+ _endResult $?
+ local retval=$?
test "$retval" -ne 0 || touch "$lockfile"
return $retval
}
function stop()
{
- rm -f "$lockfile"
+ $_RM -f "$lockfile"
}
function restart()
#!/bin/sh
-# chkconfig: 345 98 02
+# chkconfig: - 98 02
# description: The vservers service is used to start and stop all
# the virtual servers.
-# $Id: util-vserver.spec.in 2283 2006-09-10 17:07:57Z hollow $
+# $Id: util-vserver.spec.in 2482 2007-01-29 23:37:07Z dhozac $
## This package understands the following switches:
## --without dietlibc ... disable usage of dietlibc
## --with xalan ... require/use the xalan xslt processor
+## --without doc ... disable doc generation
+## --with legacy ... enable the legacy APIs
%global confdir %_sysconfdir/vservers
%global confdefaultdir %confdir/.defaults
%global _localstatedir %_var
+%global ver %( echo 0.30.213 | sed 's/-.*//' )
+%global subver %( s=`echo 0.30.213 | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
+%global fullver 0.30.213
+
%{!?release_func:%global release_func() %1%{?dist}}
Summary: Linux virtual server utilities
Name: util-vserver
-Version: 0.30.212
-Release: %release_func 0
+Version: %ver
+Release: %release_func 0%subver
License: GPL
Group: System Environment/Base
URL: http://savannah.nongnu.org/projects/util-vserver/
-Source0: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%version.tar.bz2
-#Source1: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%version.tar.bz2.asc
+Source0: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%fullver.tar.bz2
+#Source1: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%fullver.tar.bz2.asc
BuildRoot: %_tmppath/%name-%version-%release-root
Requires: init(%name)
Requires: %name-core = %version-%release
BuildRequires: mount vconfig gawk iproute iptables
BuildRequires: gcc-c++ wget which diffutils
BuildRequires: e2fsprogs-devel beecrypt-devel
-BuildRequires: doxygen tetex-latex
+%{!?_without_doc:BuildRequires: doxygen tetex-latex}
Requires(post): %name-core
Requires(pre): %pkglibdir
Requires(postun): %pkglibdir
%prep
-%setup -q
+%setup -q -n %name-%fullver
%build
%configure --with-initrddir=%_initrddir --enable-release \
- %{?_without_dietlibc:--disable-dietlibc}
+ %{?_without_dietlibc:--disable-dietlibc} \
+ %{?_with_legacy:--enable-apis=NOLEGACY} \
+ --with-initscripts=sysv
%__make %{?_smp_mflags} all
-%__make %{?_smp_mflags} doc
+%{!?_without_doc:%__make %{?_smp_mflags} doc}
%install
%post sysv
%chkconfig --add vservers-default
%chkconfig --add vprocunhide
+%chkconfig --add util-vserver
test "$1" != 0 || %chkconfig --del vprocunhide
test "$1" != 0 || %chkconfig --del vservers-default
+test "$1" != 0 || %chkconfig --del util-vserver
%postun sysv
%files devel -f %name-devel.list
%defattr(-,root,root,-)
-%doc lib/apidoc/latex/refman.pdf
-%doc lib/apidoc/html
+%{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
+%{!?_without_doc:%doc lib/apidoc/html}
%changelog
+* Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
+- add --with legacy and --without doc switches
+- add util-vserver initscript
+
* Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
- do not require 'xalan' anymore by default
- removed 'Requires: apt'; apt-rpm is not maintained upstream anymore
-# $Id: util-vserver.spec.in 2283 2006-09-10 17:07:57Z hollow $
+# $Id: util-vserver.spec.in 2482 2007-01-29 23:37:07Z dhozac $
## This package understands the following switches:
## --without dietlibc ... disable usage of dietlibc
## --with xalan ... require/use the xalan xslt processor
+## --without doc ... disable doc generation
+## --with legacy ... enable the legacy APIs
%global confdir %_sysconfdir/vservers
%global confdefaultdir %confdir/.defaults
%global _localstatedir %_var
+%global ver %( echo @VERSION@ | sed 's/-.*//' )
+%global subver %( s=`echo @VERSION@ | grep -- - | sed 's/.*-/./'`; echo ${s:-.1} )
+%global fullver @VERSION@
+
%{!?release_func:%global release_func() %1%{?dist}}
Summary: Linux virtual server utilities
Name: @PACKAGE@
-Version: @VERSION@
-Release: %release_func 0
+Version: %ver
+Release: %release_func 0%subver
License: GPL
Group: System Environment/Base
URL: http://savannah.nongnu.org/projects/util-vserver/
-Source0: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%version.tar.bz2
-#Source1: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%version.tar.bz2.asc
+Source0: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%fullver.tar.bz2
+#Source1: http://www.13thfloor.at/~ensc/util-vserver/files/alpha/%name-%fullver.tar.bz2.asc
BuildRoot: %_tmppath/%name-%version-%release-root
Requires: init(%name)
Requires: %name-core = %version-%release
BuildRequires: mount vconfig gawk iproute iptables
BuildRequires: gcc-c++ wget which diffutils
BuildRequires: e2fsprogs-devel beecrypt-devel
-BuildRequires: doxygen tetex-latex
+%{!?_without_doc:BuildRequires: doxygen tetex-latex}
Requires(post): %name-core
Requires(pre): %pkglibdir
Requires(postun): %pkglibdir
%prep
-%setup -q
+%setup -q -n %name-%fullver
%build
%configure --with-initrddir=%_initrddir --enable-release \
- %{?_without_dietlibc:--disable-dietlibc}
+ %{?_without_dietlibc:--disable-dietlibc} \
+ %{?_with_legacy:--enable-apis=NOLEGACY} \
+ --with-initscripts=sysv
%__make %{?_smp_mflags} all
-%__make %{?_smp_mflags} doc
+%{!?_without_doc:%__make %{?_smp_mflags} doc}
%install
%post sysv
%chkconfig --add vservers-default
%chkconfig --add vprocunhide
+%chkconfig --add util-vserver
test "$1" != 0 || %chkconfig --del vprocunhide
test "$1" != 0 || %chkconfig --del vservers-default
+test "$1" != 0 || %chkconfig --del util-vserver
%postun sysv
%files devel -f %name-devel.list
%defattr(-,root,root,-)
-%doc lib/apidoc/latex/refman.pdf
-%doc lib/apidoc/html
+%{!?_without_doc:%doc lib/apidoc/latex/refman.pdf}
+%{!?_without_doc:%doc lib/apidoc/html}
%changelog
+* Fri Dec 29 2006 Daniel Hokka Zakrisson <daniel@hozac.com> - 0.30.213-0
+- add --with legacy and --without doc switches
+- add util-vserver initscript
+
* Sun Jan 22 2006 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.30.210-0
- do not require 'xalan' anymore by default
- removed 'Requires: apt'; apt-rpm is not maintained upstream anymore