From eebd1fa3ff0e4f2334d9c69a3db57b85594c284d Mon Sep 17 00:00:00 2001 From: dancer Date: Tue, 7 Jan 2003 08:36:23 +0000 Subject: +2003-01-07 Junichi Uekawa + + * Documentation/pbuilder-doc.xml: update documentation + and add chapter on pbuilder-uml, document that pbuilder-uml actually + works, and some detailed nodes on how to use them. + Add FAQ entry on how to specify extra apt sources. + + * pbuilder-user-mode-linux.1: update doc to document that + configuration files for pbuilder is now read in. + + * pbuilder-user-mode-linux: add debug info, to print out + the command-line used for running uml. + export TMPDIR=/tmp inside the chroot inside UML. + change UML_CHROOT_MOUNTPOINT from /tmp/ubd1 to /mnt, + and do not mkdir UML_CHROOT_MOUNTPOINT. + fix /tmp creation script so that /tmp is writable when + not using tmpfs. + use tempfile in creating the COW file. + clean COW file after finishing. + remove temporary file created by tempfile, because UML doesn't seem to + like the zero-byte file. (POSSIBLE SECURITY PROBLEM) + extra cleanup added for cleanup_function + + * pbuilder-uml.conf (BUILDPLACE): add definition of BUILDPLACE + for pbuilder-uml. It is probably needed, because BUILDPLACE + needs to be writable by the user for UML, while it is not for + pbuilder. + + * pbuilder-user-mode-linux: load config for pbuilder also, before + trying to load other things. + +2003-01-06 Junichi Uekawa + + * Documentation/pbuilder-doc.xml (EXTRAPACKAGES): document possible usage of pbuilder for dchroot. + + * pbuilder.8: document --no-targz + + * pbuilder-checkparams (USE_PKGNAME_LOGFILE): allow + --no-targz option as alias to --internal-build-uml + + * pdebuild (ARCHITECTURE): use dpkg-architecture + to find out the architecture. + sign changes file not dsc file. + pointed out by + Andrew Lau , bug #175432 + +2003-01-04 Junichi Uekawa + + * debian/control (Description): fix suggests to pbuilder-uml --- ChangeLog | 50 ++++++++++++++++ Documentation/pbuilder-doc.xml | 133 ++++++++++++++++++++++++++++++++++++++--- debian/changelog | 24 ++++++++ debian/control | 2 +- pbuilder-checkparams | 2 +- pbuilder-uml.conf | 1 + pbuilder-user-mode-linux | 31 +++++++--- pbuilder-user-mode-linux.1 | 13 +++- pbuilder.8 | 14 +++++ pdebuild | 3 +- 10 files changed, 252 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe98de1..d0cc062 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,53 @@ +2003-01-07 Junichi Uekawa + + * Documentation/pbuilder-doc.xml: update documentation + and add chapter on pbuilder-uml, document that pbuilder-uml actually + works, and some detailed nodes on how to use them. + Add FAQ entry on how to specify extra apt sources. + + * pbuilder-user-mode-linux.1: update doc to document that + configuration files for pbuilder is now read in. + + * pbuilder-user-mode-linux: add debug info, to print out + the command-line used for running uml. + export TMPDIR=/tmp inside the chroot inside UML. + change UML_CHROOT_MOUNTPOINT from /tmp/ubd1 to /mnt, + and do not mkdir UML_CHROOT_MOUNTPOINT. + fix /tmp creation script so that /tmp is writable when + not using tmpfs. + use tempfile in creating the COW file. + clean COW file after finishing. + remove temporary file created by tempfile, because UML doesn't seem to + like the zero-byte file. (POSSIBLE SECURITY PROBLEM) + extra cleanup added for cleanup_function + + * pbuilder-uml.conf (BUILDPLACE): add definition of BUILDPLACE + for pbuilder-uml. It is probably needed, because BUILDPLACE + needs to be writable by the user for UML, while it is not for + pbuilder. + + * pbuilder-user-mode-linux: load config for pbuilder also, before + trying to load other things. + +2003-01-06 Junichi Uekawa + + * Documentation/pbuilder-doc.xml (EXTRAPACKAGES): document possible usage of pbuilder for dchroot. + + * pbuilder.8: document --no-targz + + * pbuilder-checkparams (USE_PKGNAME_LOGFILE): allow + --no-targz option as alias to --internal-build-uml + + * pdebuild (ARCHITECTURE): use dpkg-architecture + to find out the architecture. + sign changes file not dsc file. + pointed out by + Andrew Lau , bug #175432 + +2003-01-04 Junichi Uekawa + + * debian/control (Description): fix suggests to pbuilder-uml + 2003-01-03 Junichi Uekawa * Documentation/pbuilder-doc.xml: add notes on what kind of things diff --git a/Documentation/pbuilder-doc.xml b/Documentation/pbuilder-doc.xml index cb2c478..2dcda88 100644 --- a/Documentation/pbuilder-doc.xml +++ b/Documentation/pbuilder-doc.xml @@ -359,14 +359,14 @@ export DEBIAN_BUILDGCCVER=3.2 - Known Problems + Frequently asked questions Here, known problems and frequently asked questions are - documented. - This part is moved from README.Debian file. + documented. This portion was initially available in README.Debian + file, but moved into here. - Notes on pbuilder create + pbuilder create fails It often happens that pbuilder cannot create latest chroot. Try upgrading pbuilder and debootstrap. @@ -388,6 +388,18 @@ export DEBIAN_BUILDGCCVER=3.2 in pbuilderrc. Take your pick. + + Specialized requirement on apt sources list + + If you have some very specialized requirements on your + apt setup inside pbuilder, + it is possible to specify that through + + option. + Try something like: + + + Experimental or wishlist features of pbuilder @@ -413,12 +425,96 @@ export DEBIAN_BUILDGCCVER=3.2 on chroot and tar and gzip, which are known to work on most Unix systems. + However, pbuilder-uml uses COW method for + file access, and it is so much more faster than pbuilder + when building most packages. - Currently there are problems with rootstrap that - stops pbuilder-uml from starting, - and help, or success reports would be appreciated. + It has been verified that pbuilder-uml works, + as of version 0.59. + The configuration of pbuilder-uml goes in two steps: + + + Configuration of rootstrap + Configuration of pbuilder-uml + + + + Configuring rootstrap + + rootstrap is a program that + is a wrapper to debootstrap, creating a Debian disk image inside + UML. + To configure rootstrap, there are several requirements. + + + + install rootstrap package + + + add the user to uml-net group to allow access to network + +adduser dancer uml-net + + + + Check that compile supports tun/tap interface, + and recompile the kernel if necessary + + + + Set up /etc/rootstrap/rootstrap.conf, for example, + if the current host is 192.168.1.2, changing following + entries to something like this seems to work. + +transport=tuntap +interface=eth0 +gateway=192.168.1.1 +mirror=http://192.168.1.2:8081/debian +host=192.168.1.198 +uml=192.168.1.199 +netmask=255.255.255.0 + + Some experimentation with configuration and running + rootstrap ~/test.uml to actually + test it would be handy. + + + + + + Configuring pbuilder-uml + + The following needs to happen: + + + install pbuilder-uml package + + + + Set configuration file /etc/pbuilder/pbuilder-uml.conf as follows + +MY_ETH0=tuntap,,,192.168.1.198 +UML_IP=192.168.1.199 +UML_NETMASK=255.255.255.0 +UML_NETWORK=192.168.1.0 +UML_BROADCAST=255.255.255.255 +UML_GATEWAY=192.168.1.1 +PBUILDER_UML_IMAGE="/home/dancer/uml-image" + + and it needs to match rootstrap configuration. + + + + Run pbuilder-user-mode-linux create --distribution sid to create the image + + + Try running pbuilder-user-mode-linux build + + + + Using LVM @@ -430,6 +526,29 @@ export DEBIAN_BUILDGCCVER=3.2 and so no measurement has been made, yet. + + Using pbuilder without tar.gz + + + option of pbuilder + will allow usage of pbuilder in a different way + to conventional usage. + It will try to use existing chroot, + and will not try to clean up after + working on it. + It is an operation mode more like + sbuild. + + + It should be possible to create chroot images + for dchroot with following commands: + +# pbuilder create --distribution potato --no-targz --basetgz /chroot/potato +# pbuilder create --distribution woody --no-targz --basetgz /chroot/woody +# pbuilder create --distribution sid --no-targz --basetgz /chroot/sid + + + Minor details diff --git a/debian/changelog b/debian/changelog index 7ad26b8..899e68f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,27 @@ +pbuilder (0.59) unstable; urgency=low + + * Load config for pbuilder in pbuilder-uml, so that BUILDPLACE is defined. + buildpackage didn't work otherwise. + * Fixed pbuilder-uml so that it actually works. + * Document how to add extra apt sources in the documentation FAQ section. + * pbuider-uml now works, and document how to set it up in the documentation + (closes: #175583) + + -- Junichi Uekawa Tue, 7 Jan 2003 17:34:33 +0900 + +pbuilder (0.58) unstable; urgency=low + + * Fix Suggests to pbuider-uml. (closes: #175158) + * Sign changes file instead of dsc file in pdebuild + (closes: #175432) + thanks to Andrew Lau for + reporting. + * Documentation updates, document some features possibly + useful for dchroot. + * add --no-targz option. + + -- Junichi Uekawa Mon, 6 Jan 2003 16:34:17 +0900 + pbuilder (0.57) unstable; urgency=low * A new year release. diff --git a/debian/control b/debian/control index 7b5668b..0e658c1 100644 --- a/debian/control +++ b/debian/control @@ -9,7 +9,7 @@ Package: pbuilder Architecture: all Depends: debootstrap (>= 0.1.17.9), wget, gcc, debianutils (>= 1.13.1) Recommends: fakeroot, sudo, devscripts -Suggests: pbuilder-user-mode-linux +Suggests: pbuilder-uml Description: personal package builder for Debian packages pbuilder constructs a chroot system, and builds a package inside the chroot. diff --git a/pbuilder-checkparams b/pbuilder-checkparams index 6e0f6e1..6eb51da 100755 --- a/pbuilder-checkparams +++ b/pbuilder-checkparams @@ -135,7 +135,7 @@ while [ -n "$1" ]; do CHROOTEXEC="$2" shift; shift; ;; - --internal-build-uml) + --internal-build-uml|--no-targz) # specify this option if I am running inside UML. echo " -> Running in pbuilder-user-mode-linux mode" INTERNAL_BUILD_UML="yes" diff --git a/pbuilder-uml.conf b/pbuilder-uml.conf index 9b0377d..f927623 100644 --- a/pbuilder-uml.conf +++ b/pbuilder-uml.conf @@ -6,4 +6,5 @@ UML_BROADCAST=255.255.255.255 UML_GATEWAY=192.168.0.1 PBUILDER_UML_IMAGE="${HOME}/uml-image" UML_MOUNT_TMPFS="no" +BUILDPLACE="${HOME}/tmp/" diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux index a260748..7383404 100755 --- a/pbuilder-user-mode-linux +++ b/pbuilder-user-mode-linux @@ -22,34 +22,43 @@ set -e function cleanup_function () { rm -f ${INSIDE_PBUILDER} + ${EXTRACLEANUP} } -for CONFIGFILE in /usr/share/pbuilder/pbuilder-uml.conf /etc/pbuilder/pbuilder-uml.conf ${HOME}/.pbuilderrc; do +. /usr/lib/pbuilder/pbuilder-loadconfig + +for CONFIGFILE in /usr/share/pbuilder/pbuilder-uml.conf /etc/pbuilder/pbuilder-uml.conf ${HOME}/.pbuilderrc; do if [ -f ${CONFIGFILE} ]; then . ${CONFIGFILE} fi done function usecow () { - PBUILDER_COW="$BUILDPLACE/$$.cow," + PBUILDER_COWFILENAME=$(tempfile -d "${BUILDPLACE}" --suffix .cow) + PBUILDER_COW="${PBUILDER_COWFILENAME}," + rm -f "${PBUILDER_COWFILENAME}" +} + +function cleancow () { + # clean the cow file + rm -f "${PBUILDER_COWFILENAME}" } function operate_uml () { # opeartes on UML, and runs pbuilder $1 - - # use this script file to bootstrap the pbuilder inside the UML INSIDE_PBUILDER=$(tempfile) trap cleanup_function exit - UML_CHROOT_MOUNTPOINT=/tmp/ubd1 + UML_CHROOT_MOUNTPOINT=/mnt/ + +#The following script is ran inside UML as soon as it is started. cat < ${INSIDE_PBUILDER} #! /bin/bash mount -t proc /proc /proc mount -t tmpfs /tmp /tmp -mkdir -p ${UML_CHROOT_MOUNTPOINT} mount -t ext2 /dev/ubd/1 ${UML_CHROOT_MOUNTPOINT} if [ "${UML_MOUNT_TMPFS}" = "yes" ]; then mount -t tmpfs ${UML_CHROOT_MOUNTPOINT}/tmp ${UML_CHROOT_MOUNTPOINT}/tmp @@ -57,6 +66,7 @@ else # clean up tmp before playing with it. rm -rf ${UML_CHROOT_MOUNTPOINT}/tmp mkdir ${UML_CHROOT_MOUNTPOINT}/tmp + chmod 1777 ${UML_CHROOT_MOUNTPOINT}/tmp fi cat < ${UML_CHROOT_MOUNTPOINT}/etc/network/interfaces @@ -85,16 +95,18 @@ chroot ${UML_CHROOT_MOUNTPOINT} /tmp/chrootshell #some variables need to be set from outside values, possibly export PATH=/sbin:/bin:/usr/sbin:/usr/bin +export TMPDIR=/tmp export LOGNAME="${LOGNAME}" EXTRAOPT= if [ -n "${UML_DISTRIBUTION}" ]; then EXTRAOPT="--distribution ${UML_DISTRIBUTION}" fi -pbuilder "$1" ${EXTRAOPT} --buildresult "" --buildplace /tmp/ubd1/ --internal-build-uml ${BUILDING_DSC_FILE} +pbuilder "$1" ${EXTRAOPT} --buildresult "" --buildplace ${UML_CHROOT_MOUNTPOINT} --internal-build-uml ${BUILDING_DSC_FILE} EOF chmod a+x ${INSIDE_PBUILDER} + echo Invoking: "linux eth0=${MY_ETH0} con0=fd:0,fd:1 con=pty ubd0=/ ubd1=${PBUILDER_COW}${PBUILDER_UML_IMAGE} devfs=mount init=${INSIDE_PBUILDER}" linux eth0=${MY_ETH0} con0=fd:0,fd:1 con=pty ubd0=/ ubd1="${PBUILDER_COW}${PBUILDER_UML_IMAGE}" devfs=mount init=${INSIDE_PBUILDER} } @@ -102,7 +114,6 @@ PBUILDER_COW="" OPERATION="$1" shift; - while [ -n "$1" ] ; do case "$1" in --eth0) @@ -156,11 +167,12 @@ while [ -n "$1" ] ; do done BUILDING_DSC_FILE=$(readlink -f "$1") - +EXTRACLEANUP= case "${OPERATION}" in build) usecow + EXTRACLEANUP=cleancow operate_uml build ;; update) @@ -168,6 +180,7 @@ case "${OPERATION}" in ;; login) usecow + EXTRACLEANUP=cleancow operate_uml login ;; create) diff --git a/pbuilder-user-mode-linux.1 b/pbuilder-user-mode-linux.1 index 3eb86f2..6b91bd3 100644 --- a/pbuilder-user-mode-linux.1 +++ b/pbuilder-user-mode-linux.1 @@ -86,11 +86,20 @@ will try to use COW devices. .SH "FILES" .TP +.I "/etc/pbuilderrc" +The system-wide configuration file for pbuilder. +.TP +.I "/usr/share/pbuilder/pbuilderrc" +The default settings for pbuilder, used as fallback for all +values that is not specified in +.B "/etc/pbuilderrc." +.TP .B "/etc/pbuilder/pbuilder-uml.conf" -System-wide configuration file. +System-wide configuration file for pbuilder-uml, +it will take priority over pbuilder configurations. .TP .B "/usr/share/pbuilder/pbuilder-uml.conf" -Software-default configuration file. +Software-default configuration file for pbuilder-uml. .TP .B "${HOME}/.pbuilderrc" User-default configuration file. diff --git a/pbuilder.8 b/pbuilder.8 index b5d318e..0cf8766 100644 --- a/pbuilder.8 +++ b/pbuilder.8 @@ -322,6 +322,20 @@ Setting after this option will re-set some parts of the effect. +.TP +.BI "--no-targz" +Not using base.tgz for operation. +The +.B "--buildplace" +will not be deleted and reconstructed from +a +.B .tar.gz +file. + +Useful when experimenting with +chroots, or trying to create chroots outside control +of +.B pbuilder. .SH "FILES" .TP diff --git a/pdebuild b/pdebuild index cb3c7bb..3ed7067 100644 --- a/pdebuild +++ b/pdebuild @@ -14,10 +14,11 @@ fi; PKG_SOURCENAME=$(dpkg-parsechangelog|sed -n 's/^Source: //p') PKG_VERSION=$(dpkg-parsechangelog|sed -n 's/^Version: \(.*:\|\)//p') +ARCHITECTURE=$(dpkg-architecture -qDEB_HOST_ARCH) dpkg-buildpackage -S -us -uc -r${BUILDSOURCEROOTCMD} || true ${PBUILDERROOTCMD} pbuilder build "$@" --buildresult "${BUILDRESULT}" ../"${PKG_SOURCENAME}_${PKG_VERSION}".dsc if [ "${AUTO_DEBSIGN}" = "yes" ]; then - debsign "${BUILDRESULT}/${PKG_SOURCENAME}_${PKG_VERSION}.dsc" + debsign "${BUILDRESULT}/${PKG_SOURCENAME}_${PKG_VERSION}_${ARCHITECTURE}.changes" fi -- cgit v1.2.3