Commit e48c67f5 authored by Ritesh Sarraf's avatar Ritesh Sarraf

Cleanup and re-add debian/ work

parent b72b4729
The easiest way to use virtual networking is to use the "daemon"
transport with the uml_switch instance which is configured and running
by default.
1. Add an entry to /etc/network/interfaces to configure a persistent
tap interface on the host:
auto tap0
iface tap0 inet static
address 192.168.1.1
netmask 255.255.255.0
tunctl_user uml-net
2. Configure uml_switch to connect to this interface by editing
/etc/default/uml-utilities:
UML_SWITCH_OPTIONS="-tap tap0"
3. Activate the tap interface:
# ifup tap0
4. Restart the daemon
# /etc/init.d/uml-utilities restart
5. Use the "daemon" transport with UML:
$ linux eth0=daemon
You should then be able to pass traffic between UML and the host over
the tap interface. You may also set up forwarding, masquerading,
etc. in order to communicate beyond the host. It is convenient to run
dhcpd on the host, configured to listen on the tap0 interface and
provide configuration information for UMLs as needed.
As an alternative to the above procedure, to enable virtual networking
using TUN/TAP directly from UML (the "tuntap" transport), add trusted
users to the uml-net group, e.g.:
adduser bill uml-net
If you wish to use a different group or different permissions, use a
statoverride for /usr/lib/uml/uml_net. Note that members of the
uml-net group will have privileges to do potentially harmful things to
the system, such as reconfiguring network interfaces.
Note also that the uml_net helper is installed in a different place in this
package than by the upstream distribution (/usr/lib/uml/uml_net rather than
PREFIX/bin/uml_net). This is done in order to comply with FHS. because
uml_net is not meant to be executed by users, it does not belong in the system
PATH.
-- Matt Zimmerman <mdz@debian.org>, Sun Sep 28 23:08:26 2003
This diff is collapsed.
Source: uml-utilities
Section: otherosfs
Priority: extra
Maintainer: User Mode Linux Maintainers <team+uml@tracker.debian.org>
Uploaders: Mattia Dongili <malattia@debian.org>, Ritesh Raj Sarraf <rrs@debian.org>
Build-Depends: debhelper (>> 9.0.0), libreadline-dev, docbook-to-man, libfuse-dev
Standards-Version: 3.9.8
Homepage: http://user-mode-linux.sourceforge.net/
Vcs-Git: https://salsa.debian.org/uml-team/uml-utilities.git
Vcs-Browser: https://salsa.debian.org/uml-team/uml-utilities.git
Package: uml-utilities
Architecture: linux-any
Depends: adduser, ${shlibs:Depends}, lsb-base (>= 3.0-10), ${misc:Depends}
Suggests: user-mode-linux
Description: User-mode Linux (utility programs)
User-mode Linux is a port of the Linux kernel to its own system call
interface. It provides a kind of virtual machine, which runs Linux
as a user process under another Linux kernel. This is useful for
kernel development, sandboxing, jailing, experimentation, and
many other things.
.
This package contains userspace utilities for use with User-mode
Linux, including uml_mconsole, uml_moo, uml_switch, uml_net and
tunctl.
This package was debianized by Matt Zimmerman <mdz@debian.org> on
Wed, 5 Dec 2001 07:46:29 -0500.
It was downloaded from http://user-mode-linux.sourceforge.net/
Upstream Author: Jeff Dike <jdike@karaya.com>
Copyright (from */*.c):
/* Copyright 2001 Jeff Dike and others
* Licensed under the GPL
*/
On Debian systems, a copy of the GNU General Public License (GPL) may
be found in /usr/share/common-licenses/GPL.
[DEFAULT]
color = auto
debian-branch = debian-unstable
upstream-branch = upstream
pristine-tar = False
[git-import-orig]
dch = True
[dch]
meta = True
multimaint-merge = True
id-length = 0
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!-- Process this file with docbook-to-man to generate an nroff manual
page: `docbook-to-man manpage.sgml > manpage.1'. You may view
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>Stefano</firstname>">
<!ENTITY dhsurname "<surname>Melchior</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>October 26, 2006</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
<!ENTITY dhemail "<email>stefano.melchior@openlabs.it</email>">
<!ENTITY dhusername "Stefano Melchior">
<!ENTITY dhucpackage "<refentrytitle>HUMFSIFY</refentrytitle>">
<!ENTITY dhpackage "humfsify">
<!ENTITY debian "<productname>Debian GNU/Linux</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">
]>
<refentry>
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
<copyright>
<year>2006</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
</refentryinfo>
<refmeta>
&dhucpackage;
&dhsection;
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>convert a directory to the format needed by the UML
humfs file system</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<arg>user</arg>
<arg>group</arg>
<arg>size</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&dhpackage;</command> command.</para>
<para>This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in HTML format; see below.</para>
<para><command>&dhpackage;</command> is a Perl script necessary to
convert a directory to a format expected by the UML humfs file system.
</para>
</refsect1>
<refsect1>
<title>HISTORY</title>
<para>UMLFS was born with the idea to substitute the Hostfs
implementation with a proper one for the UML purpose: when you
manage files with Hostfs within UML you need to work with
two different permission layers (the Host one and the UML one),
which have different ideas of ownerships.</para>
<para>This becomes evident when you need to
create a file as a non-root user on UML: you first need to interact
with the UML file system implementation, and then with the host side.</para>
<para>The result of a file creation on a mounted hostfs file system
is not what you expected: you can see that the file permissions refer to
the Host side user rather than the UML creator.</para>
<para>The Host side user is to be intended as the UML instance
launcher, meanwhile the UML side user is the one you used to log in
the UML instance.</para>
<para>You can encounter a more-critical problem when creating a
device node, operation that usually requires root privileges: you
used a common user to launch the UML and, since the operation is
done on the Host, it fails, even if you logged in as root.</para>
<para>Thus you need a set of tools which requires to bypass the
Hostfs permission checks on the Host side: this is done by
separating the file permissions and the ownership from the host's
files. This is the concept behind the HumFs and its &dhpackage;
implementation.</para>
</refsect1>
<refsect1>
<title>ARGUMENTS</title>
<variablelist>
<varlistentry>
<term><option>user</option></term>
<listitem>
<para>This is the user that needs to 'convert' a directory to the UML
file system to use UML. This is the host user who
will be using this filesystem from within UML. It
may be specified as either a user name or a numeric
user id.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>group</option></term>
<listitem>
<para>This is the group which your UML user belongs to.
This may be either a group name or a numeric group id</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>size</option></term>
<listitem>
<para>This is the size of the file system as seen within the
UML instance. It must be expressed in Gigabytes ("G"),
Megabytes ("M"), or KiloBytes ("K").</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>EXAMPLES</title>
<para>Create a directory on the host and mount it with &dhpackage;</para>
<para>host% <command>mkdir your-humfs-dir</command></para>
<para>host% <command>cd humfs-dir</command></para>
<para>Within this directory create a new one where you would like to have
a UML-like hierarchy, i.e. you can loop-mount an UML rootfs</para>
<para>host% <command>mkdir dir-to-be-humsified</command></para>
<para>host# <command>mount -o loop rootfs /mnt</command></para>
<para>host% <command>cp -a /mnt dir-to-be-humsified/data</command></para>
<para>host# <command>&dhpackage; user group 512M</command></para>
<para>Then verify it on UML and mount the humfsified
directory:</para>
<para>UML# <command>mount none /your-uml-host -t humfs -o
.../dir-to-be-humfsified</command></para>
<para>where '/your-uml-mount-point' is the mount point on UML for
the humfsified file system, and .../dir-to-be-humfsified is
the humfsified directory in the example above. The '-t' mount option
specifies that the file system is to be mounted as 'humfs'.</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>The <ulink
url="http://user-mode-linux.sourceforge.net/new/hostfs.html"
type=alternate>HostFs</ulink> usage explanation within the
User-Mode-Linux Web Site</para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>&dhpackage; was written by Jeff Dike.</para>
<para>This manual page was written by &dhusername; &dhemail; for
the &debian; system, based on material in the Official User Mode
Linux Web Site.</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
# Use this stanza if you want to configure an interface to connect
# the uml_switch daemon to the host via a tap interface
auto tap0
iface tap0 inet static
address 192.168.1.1
netmask 255.255.255.0
tunctl_user uml-net
# This is an example of how to set up a tap device for a particular
# user to use, with an IP address on the local network (eth0) via
# proxy ARP
auto tap1
iface tap1 inet static
address 192.168.1.1
netmask 255.255.255.255
tunctl_user omega
uml_proxy_arp 192.168.100.52
#uml_proxy_arp 192.168.100.52 192.168.100.53 192.168.100.54
uml_proxy_ether eth0
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!-- Process this file with docbook-to-man to generate an nroff manual
page: `docbook-to-man manpage.sgml > manpage.1'. You may view
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>Mattia</firstname>">
<!ENTITY dhsurname "<surname>Dongili</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>June 3, 2006</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>1</manvolnum>">
<!ENTITY dhemail "<email>malattia@debian.org</email>">
<!ENTITY dhusername "Mattia Dongili">
<!ENTITY dhucpackage "<refentrytitle>JAIL_UML</refentrytitle>">
<!ENTITY dhpackage "jail_uml">
<!ENTITY debian "<productname>Debian GNU/Linux</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">
]>
<refentry>
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
<copyright>
<year>2006</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
</refentryinfo>
<refmeta>
&dhucpackage;
&dhsection;
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>run UML in a chroot-jail</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<arg>jail-directory</arg>
<arg>user</arg>
<arg>uml-command-line</arg>
</cmdsynopsis>
<cmdsynopsis>
<command>&dhpackage;</command>
<arg>jail-directory</arg>
<arg>uid</arg>
<arg>uml-command-line</arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&dhpackage;</command> command.</para>
<para>This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in HTML format; see below.</para>
<para><command>&dhpackage;</command> is a small utility to run
UML in a jailed chroot as the user <command>user</command> or with id
<command>uid</command>.</para>
<para>When <command>user</command> does not exist it will be
assumed to be an <command>uid</command>.</para>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>The <ulink
url="http://user-mode-linux.sourceforge.net/UserModeLinux-HOWTO.html"
type=alternate>UserModeLinux-HOWTO</ulink></para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>This manual page was written by &dhusername; &dhemail; for
the &debian; system, based on the command help and sources.</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
Author: nwf
Description: Allow creation of IFF_TUN devices
Index: uml-utilities/tunctl/tunctl.c
===================================================================
--- uml-utilities.orig/tunctl/tunctl.c
+++ uml-utilities/tunctl/tunctl.c
@@ -28,6 +28,7 @@ static void Usage(char *name)
fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
" use\n/dev/misc/net/tun instead\n\n");
fprintf(stderr, "-b will result in brief output (just the device name)\n");
+ fprintf(stderr, "-3 will open the interface in TUN mode, not TAP mode.\n");
exit(1);
}
@@ -38,10 +39,10 @@ int main(int argc, char **argv)
struct group *gr;
uid_t owner = -1;
gid_t group = -1;
- int tap_fd, opt, delete = 0, brief = 0;
+ int tap_fd, opt, delete = 0, brief = 0, tun_mode = 0;
char *tun = "", *file = "/dev/net/tun", *name = argv[0], *end;
- while((opt = getopt(argc, argv, "bd:f:t:u:g:")) > 0){
+ while((opt = getopt(argc, argv, "3bd:f:t:u:g:")) > 0){
switch(opt) {
case 'b':
brief = 1;
@@ -83,6 +84,9 @@ int main(int argc, char **argv)
case 't':
tun = optarg;
break;
+ case '3':
+ tun_mode = 1;
+ break;
case 'h':
default:
Usage(name);
@@ -102,8 +106,7 @@ int main(int argc, char **argv)
}
memset(&ifr, 0, sizeof(ifr));
-
- ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+ ifr.ifr_flags = (tun_mode ? IFF_TUN : IFF_TAP) | IFF_NO_PI;
strncpy(ifr.ifr_name, tun, sizeof(ifr.ifr_name) - 1);
if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0){
perror("TUNSETIFF");
Author: Sven Joachim <svenjoac@gmx.de>
Description: Do not unnecessarily link against ncurses
--- uml-utilities-20070815.orig/mconsole/Makefile
+++ uml-utilities-20070815/mconsole/Makefile
@@ -1,7 +1,7 @@
BIN = uml_mconsole
OBJS = $(BIN).o
CFLAGS ?= -g -Wall
-LIBS = ../lib/libuml.a -lreadline -lncurses
+LIBS = ../lib/libuml.a -lreadline
BIN_DIR ?= /usr/bin
Author: Mattia Dongili <malattia@debian.org>
Description: upstream make file removes the spec file on cleaning and that causes grief.
Index: uml-utilities/Makefile
===================================================================
--- uml-utilities.orig/Makefile
+++ uml-utilities/Makefile
@@ -20,7 +20,7 @@ export BIN_DIR LIB_DIR CFLAGS
all install:
set -e ; for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@; done
-tarball : clean spec
+tarball : clean
cd .. ; \
mv tools tools-$(UMLVER); \
tar cjf $(TARBALL) tools-$(UMLVER); \
@@ -28,7 +28,6 @@ tarball : clean spec
clean:
rm -rf *~
- rm -f uml_util.spec
set -e ; for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@; done
spec:
#! /bin/sh
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
case "$1" in
configure)
if ! getent passwd uml-net >/dev/null; then
if getent group uml-net >/dev/null; then
# earlier versions only created a group
adduser --quiet --system --ingroup uml-net --no-create-home --home /nonexistent uml-net
else
adduser --quiet --system --group --no-create-home --home /nonexistent uml-net
fi
fi
if ! dpkg-statoverride --list /usr/bin/uml_net >/dev/null; then
dpkg-statoverride --update --add root uml-net 04754 \
/usr/bin/uml_net
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
#! /bin/sh
# postrm script for uml-utilities
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postrm> `remove'
# * <postrm> `purge'
# * <old-postrm> `upgrade' <new-version>
# * <new-postrm> `failed-upgrade' <old-version>
# * <new-postrm> `abort-install'
# * <new-postrm> `abort-install' <old-version>
# * <new-postrm> `abort-upgrade' <old-version>
# * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
purge|remove|abort-install)
if dpkg-statoverride --list /usr/bin/uml_net >/dev/null; then
dpkg-statoverride --remove /usr/bin/uml_net
fi
;;
upgrade|failed-upgrade|abort-upgrade|disappear)
# do nothing
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
if [ "${1}" = "purge" ] ; then
rm -rf /var/run/uml-utilities
fi
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DEB_BUILD_ARCH?=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
tmp:=$(CURDIR)/debian/uml-utilities
configure: configure-stamp
configure-stamp:
dh_testdir
touch configure-stamp
build: configure-stamp build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp:
dh_prep
dh_testdir
ifeq "$(DEB_BUILD_ARCH)" "arm"
touch tunctl/tunctl
endif
$(MAKE)
for man in debian/*.sgml; do \
docbook-to-man $$man > `dirname $$man`/`basename $$man .sgml`.1; \
done
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
$(MAKE) clean
rm -f debian/*.1
dh_clean
install: build
dh_testdir
dh_testroot
$(MAKE) install DESTDIR=$(tmp)
dh_installdirs etc/network/if-up.d etc/network/if-pre-up.d
install -m 755 debian/uml-utilities.if-up.d $(tmp)/etc/network/if-up.d/uml-utilities
install -m 755 debian/uml-utilities.if-pre-up.d $(tmp)/etc/network/if-pre-up.d/uml-utilities
ifeq "$(DEB_BUILD_ARCH)" "arm"
rm -f $(tmp)/usr/bin/tunctl
endif
# Build architecture-independent files here.
binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -a
dh_testroot -a
# dh_installdebconf -a
dh_installdocs -a
dh_installexamples -a
# dh_installmenu -a
# dh_installlogrotate -a
dh_installinit -a
dh_installman -a debian/*.1
dh_installinfo -a
# dh_undocumented
dh_installchangelogs -a
dh_link -a
dh_strip -a
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
<!-- Process this file with docbook-to-man to generate an nroff manual
page: `docbook-to-man manpage.sgml > manpage.1'. You may view
the manual page with: `docbook-to-man manpage.sgml | nroff -man |
less'. A typical entry in a Makefile or Makefile.am is:
manpage.1: manpage.sgml
docbook-to-man $< > $@
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>Matt</firstname>">
<!ENTITY dhsurname "<surname>Zimmerman</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>February 12, 2002</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>8</manvolnum>">
<!ENTITY dhemail "<email>mdz@debian.org</email>">
<!ENTITY dhusername "Matt Zimmerman">
<!ENTITY dhucpackage "<refentrytitle>TUNCTL</refentrytitle>">
<!ENTITY dhpackage "tunctl">
<!ENTITY debian "<productname>Debian GNU/Linux</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">