aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordancer <dancer>2003-02-13 08:51:36 +0000
committerdancer <dancer>2003-02-13 08:51:36 +0000
commit609105c1b19b92a526751f84264c79b87878411d (patch)
tree4106abfb445510657b0f6a560193339a8b98cf8a
parent9bbc9cb948a45ca4e58f7988c33d6a69bba0fbb2 (diff)
downloadpbuilder-609105c1b19b92a526751f84264c79b87878411d.tar
pbuilder-609105c1b19b92a526751f84264c79b87878411d.tar.gz
+2003-02-13 Junichi Uekawa <dancer@debian.org>
+ + * Documentation/pbuilder-doc.xml: document an example script to + start up ssh inside pbuilder-uml. + + * pbuilder-checkparams: support execute option. + + * Documentation/pbuilder-doc.xml: document pbuilder-uml more, + and execute command. + + * pbuilder-modules: update copyright statement. + document "execute" + + * pbuilder-user-mode-linux.1: document "execute" command + + * pbuilder-user-mode-linux: implement execute command. + + * pbuilder.8: document "execute" + + * pbuilder: "execute" command. +
-rw-r--r--ChangeLog21
-rw-r--r--Documentation/pbuilder-doc.xml74
-rw-r--r--debian/changelog6
-rwxr-xr-xpbuilder16
-rwxr-xr-xpbuilder-checkparams2
-rw-r--r--pbuilder-modules7
-rwxr-xr-xpbuilder-user-mode-linux5
-rw-r--r--pbuilder-user-mode-linux.111
-rw-r--r--pbuilder.815
9 files changed, 151 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 4a903dc..04fa9af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2003-02-13 Junichi Uekawa <dancer@debian.org>
+
+ * Documentation/pbuilder-doc.xml: document an example script to
+ start up ssh inside pbuilder-uml.
+
+ * pbuilder-checkparams: support execute option.
+
+ * Documentation/pbuilder-doc.xml: document pbuilder-uml more,
+ and execute command.
+
+ * pbuilder-modules: update copyright statement.
+ document "execute"
+
+ * pbuilder-user-mode-linux.1: document "execute" command
+
+ * pbuilder-user-mode-linux: implement execute command.
+
+ * pbuilder.8: document "execute"
+
+ * pbuilder: "execute" command.
+
2003-02-10 Junichi Uekawa <dancer@debian.org>
* pdebuild: set pdebuild here as well.
diff --git a/Documentation/pbuilder-doc.xml b/Documentation/pbuilder-doc.xml
index 733958d..dd9d5bf 100644
--- a/Documentation/pbuilder-doc.xml
+++ b/Documentation/pbuilder-doc.xml
@@ -408,7 +408,43 @@ export DEBIAN_BUILDGCCVER=3.2
</para>
</sect1>
</chapter>
- <chapter>
+ <chapter id="otheruse">
+ <title>Other uses of pbuilder</title>
+ <sect1 id="chroot">
+ <title>Using pbuilder for small experiments</title>
+ <para>
+ There are cases when some small experimenting is required, and
+ do not want to damage the main system,
+ like installing experimental library packages,
+ or compiling with experimental compilers.
+ For such cases, <command>pbuilder login</command> command is available.
+ </para>
+ <para>
+ <command>pbuilder login </command> is a debuggin feature for
+ pbuilder itself, but it also allows users to have a temporal chroot.
+ </para>
+ <para>
+ Note that chroot is cleaned after logging out of the shell,
+ and mounting filesystems inside it is considered harmful.
+ </para>
+ </sect1>
+ <sect1>
+ <title>Running little programs inside the chroot</title>
+ <para>
+ To facilitate using pbuilder for other uses,
+ <command>pbuilder execute</command> is available.
+ <command>pbuilder execute </command> will take a script
+ specified in the command-line argument, and
+ invoke the script inside the chroot.
+ </para>
+ <para>
+ The script can be useful for sequence of operations such as
+ installing ssh and adding a new user inside the chroot.
+ </para>
+ </sect1>
+
+ </chapter>
+ <chapter id="experimental">
<title>Experimental or wishlist features of pbuilder</title>
<para>
There are some advanced features, above that of the
@@ -544,6 +580,42 @@ PBUILDER_UML_IMAGE="/home/dancer/uml-image"
</listitem>
</itemizedlist>
</sect2>
+ <sect2>
+ <title>Using pbuilder-uml as a wrapper script to start up virtual machine</title>
+ <para>
+ It is possible to use pbuilder-uml for other uses than just building Debian
+ packages.
+ <command>pbuilder-user-mode-linux login</command>
+ will let a user use a shell inside the user-mode-linux using the
+ pbuilder base image,
+ and <command>pbuilder-user-mode-linux execute</command> will
+ allow the user to execute a script inside the chroot.
+ </para>
+ <para>
+ You can use the script to install ssh and add a new user,
+ so that it is possible to access inside the UML through ssh.
+ </para>
+ <para>
+ Note that it is not possible to use a script from
+ <filename>/tmp</filename> due to the way pbuilder-uml mounts
+ tmpfs at <filename>/tmp</filename>.
+ </para>
+ <para>
+ The following is an example script that may be useful in starting a sshd
+ inside uml.
+ </para>
+ <screen>
+#!/bin/bash
+
+apt-get install ssh
+echo "enter root password"
+passwd
+sshd
+ifconfig
+echo "Hit enter to finish"
+read
+ </screen>
+ </sect2>
</sect1>
<sect1>
<title>Using LVM</title>
diff --git a/debian/changelog b/debian/changelog
index b45bddc..fe4236b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pbuilder (0.66) UNRELEASED; urgency=low
+
+ * add execute option to pbuilder
+
+ -- Junichi Uekawa <dancer@debian.org> Thu, 13 Feb 2003 17:14:29 +0900
+
pbuilder (0.65) unstable; urgency=low
* pdebuild-user-mode-linux script.
diff --git a/pbuilder b/pbuilder
index 1f9df25..3626b4b 100755
--- a/pbuilder
+++ b/pbuilder
@@ -45,6 +45,22 @@ File extracted to: $BUILDPLACE
"
chroot "$BUILDPLACE" bin/bash
;;
+ execute)
+ # try to execute arbitrary program.
+ shift
+ . /usr/lib/pbuilder/pbuilder-checkparams
+ EXECPROGRAM="$1"
+ if [ ! -f "${EXECPROGRAM}" ]; then
+ echo "Command line parameter [$EXECPROGRAM] does not exist" >&2
+ exit 1;
+ fi;
+ extractbuildplace
+ trap umountproc_cleanbuildplace exit
+ RUNNAME="$BUILDPLACE/run"
+ cat "$EXECPROGRAM" > "$RUNNAME"
+ chmod a+x "$RUNNAME"
+ chroot "$BUILDPLACE" /run
+ ;;
*)
. /usr/lib/pbuilder/pbuilder-modules
showhelp
diff --git a/pbuilder-checkparams b/pbuilder-checkparams
index 104ce03..caca4ee 100755
--- a/pbuilder-checkparams
+++ b/pbuilder-checkparams
@@ -168,7 +168,7 @@ if [ -z "${CHROOTEXEC}" ]; then
fi
case "$PBCURRENTCOMMANDLINEOPERATION" in
- login|pdebuild)
+ login|execute|pdebuild)
# don't do anything if it is "login", or pdebuild
;;
*)
diff --git a/pbuilder-modules b/pbuilder-modules
index d9007cc..d4d9abc 100644
--- a/pbuilder-modules
+++ b/pbuilder-modules
@@ -1,7 +1,7 @@
#! /bin/bash
# common modules for pbuilder.
# pbuilder -- personal Debian package builder
-# Copyright (C) 2001,2002 Junichi Uekawa
+# Copyright (C) 2001-2003 Junichi Uekawa
#
# 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
@@ -20,7 +20,7 @@
function showhelp () {
cat <<EOF
pbuilder - a personal builder
-Copyright 2001,2002 Junichi Uekawa
+Copyright 2001-2003 Junichi Uekawa
Distributed under GNU Public License version 2 or later
pbuilder [operation] [pbuilder-options]
@@ -40,7 +40,8 @@ pbuilder clean
Cleans the temporal build directory.
pbuilder login
- Logs in to the build environment
+pbuilder execute [command]
+ Logs in to the build environment and execute command.
pbuilder-options:
--basetgz [base.tgz location]
diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux
index 61847f9..0b62fc2 100755
--- a/pbuilder-user-mode-linux
+++ b/pbuilder-user-mode-linux
@@ -237,6 +237,11 @@ case "${OPERATION}" in
EXTRACLEANUP=cleancow
operate_uml login
;;
+ execute)
+ usecow
+ EXTRACLEANUP=cleancow
+ operate_uml execute
+ ;;
create)
rootstrap -s 1000 ${PBUILDER_UML_IMAGE}
operate_uml update
diff --git a/pbuilder-user-mode-linux.1 b/pbuilder-user-mode-linux.1
index db99e9b..0508018 100644
--- a/pbuilder-user-mode-linux.1
+++ b/pbuilder-user-mode-linux.1
@@ -7,6 +7,10 @@ pbuilder-user-mode-linux \- personal package builder in UML
.BI "pbuilder-user-mode-linux update [" "options" "]"
.PP
.BI "pbuilder-user-mode-linux build [" "options" "] " ".dsc-file"
+.PP
+.BI "pbuilder-user-mode-linux execute [" "options" "] " "script"
+.PP
+.BI "pbuilder-user-mode-linux login [" "options" "]"
.SH DESCRIPTION
Front end program to the
.B "pbuilder"
@@ -43,6 +47,13 @@ within the user-mode-linux environment.
Invokes shell within UML.
.TP
+.B "execute"
+Invokes a command or script inside UML.
+.B "execute"
+will copy the specified file into the UML system,
+and run it.
+
+.TP
.BI "--uml-image [" "UML image" "]"
Specify the UML image to use.
diff --git a/pbuilder.8 b/pbuilder.8
index 858ad81..7986357 100644
--- a/pbuilder.8
+++ b/pbuilder.8
@@ -8,9 +8,11 @@ pbuilder \- personal package builder
.PP
.BI "pbuilder build [" "options" "] " ".dsc-file"
.PP
+.BI "pbuilder execute [" "options" "] " "script"
+.PP
.BI "pbuilder clean"
.PP
-.BI "pbuilder login"
+.BI "pbuilder login [" "options" "]"
.SH DESCRIPTION
Front end program to the
.B "pbuilder"
@@ -59,6 +61,17 @@ specified in
.B "login"
Logs into the chroot, and cleaned up afterwards.
Any changes you make will not be kept.
+Only use this for temporary and debugging purposes.
+Do not bind-mount filesystems.
+
+.TP
+.B "exceute"
+Execute a script or command inside the chroot,
+in a similar manner to
+.B "login"
+
+The file specified in the command-line argument will be
+copied into the chroot, and invoked.
.TP
.B "debuild"