diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | pbuilder-checkparams | 9 | ||||
-rw-r--r-- | pbuilder-modules | 50 | ||||
-rwxr-xr-x | pbuilder-user-mode-linux | 2 |
4 files changed, 45 insertions, 24 deletions
@@ -1,5 +1,13 @@ 2002-09-16 Junichi Uekawa <dancer@debian.org> + * pbuilder-user-mode-linux (BUILDING_DSC_FILE): use --internal-build-uml + + * pbuilder-modules (extractbuildplace): change to do less things + when INTERNAL_BUILD_UML is specified. + (cleanbuildplace): add check for INTERNAL_BUILD_UML + + * pbuilder-checkparams (--internal-build-uml): new option. + * Makefile (install): add pbuilder-buildpackage-funcs to install target * pbuilder-buildpackage (PACKAGENAME): add id tag for calling showbuildbanner diff --git a/pbuilder-checkparams b/pbuilder-checkparams index c9d2a4d..2068291 100755 --- a/pbuilder-checkparams +++ b/pbuilder-checkparams @@ -25,6 +25,8 @@ BASEBUILDPLACE="$BUILDPLACE" BUILDPLACE="$BUILDPLACE/$$" CHROOTEXEC="chroot $BUILDPLACE " +#default value for this option is !empty! +INTERNAL_BUILD_UML="" while [ -n "$1" ]; do case "$1" in @@ -106,11 +108,18 @@ while [ -n "$1" ]; do TIMEOUT_TIME="$2" shift; shift; ;; + ## internal options. --internal-chrootexec) # specify custom chrootexec function -- this is internal debugging function CHROOTEXEC="$2" shift; shift; ;; + --internal-build-uml) + # specify this option if I am running inside UML. + echo " -> Running in pbuilder-user-mode-linux mode" + INTERNAL_BUILD_UML="yes" + shift; + ;; --help) showhelp ;; diff --git a/pbuilder-modules b/pbuilder-modules index 30c49c7..4878e63 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -120,10 +120,12 @@ function cleanbuildplace () { if [ "$?" -ne 0 ]; then echo " -> Aborting with an error"; fi - if [ -d "$BUILDPLACE" ]; then - echo " -> cleaning the build env " - rm -rf "$BUILDPLACE" - fi; + if [ ! "${INTERNAL_BUILD_UML}" = "yes" ]; then + if [ -d "$BUILDPLACE" ]; then + echo " -> cleaning the build env " + rm -rf "$BUILDPLACE" + fi; + fi } function umountproc_cleanbuildplace () { @@ -166,28 +168,30 @@ EOF function extractbuildplace () { # after calling this function, umountproc, and cleanbuildplace # needs to be called. Please trap it. - cleanbuildplace - echo "Building the build Environment" - echo " -> extracting base.tgz" - if ! mkdir -p "$BUILDPLACE"; then - echo "E: failed to build the directory to chroot" - exit 1 - fi - if [ ! -f "$BASETGZ" ]; then - echo "E: failed to find $BASETGZ, have you done <pbuilder create> to create your base tarball yet?" - exit 1 - fi - if ! (cd "$BUILDPLACE" && tar xfzp "$BASETGZ"); then - echo "E: failed to extract $BASETGZ to $BUILDPLACE" - exit 1 + if [ ! "${INTERNAL_BUILD_UML}" = "yes" ]; then + cleanbuildplace + echo "Building the build Environment" + echo " -> extracting base.tgz" + if ! mkdir -p "$BUILDPLACE"; then + echo "E: failed to build the directory to chroot" + exit 1 + fi + if [ ! -f "$BASETGZ" ]; then + echo "E: failed to find $BASETGZ, have you done <pbuilder create> to create your base tarball yet?" + exit 1 + fi + if ! (cd "$BUILDPLACE" && tar xfzp "$BASETGZ"); then + echo "E: failed to extract $BASETGZ to $BUILDPLACE" + exit 1 + fi + echo " -> copying/creating local configuration" + for a in hosts hostname resolv.conf; do + cp $( readlink -f /etc/$a ) "$BUILDPLACE/etc/$a"; + done fi mountproc - mkdir -p "$BUILDPLACE/tmp/buildd" - echo " -> copying/creating local configuration" - for a in hosts hostname resolv.conf; do - cp $( readlink -f /etc/$a ) "$BUILDPLACE/etc/$a"; - done hostname -f > "$BUILDPLACE/etc/mailname" + mkdir -p "$BUILDPLACE/tmp/buildd" if [ -n "$DISTRIBUTION" ]; then installaptlines diff --git a/pbuilder-user-mode-linux b/pbuilder-user-mode-linux index f6d3b29..961ce20 100755 --- a/pbuilder-user-mode-linux +++ b/pbuilder-user-mode-linux @@ -58,7 +58,7 @@ cat <<SHELL > /tmp/ubd1/tmp/chrootshell SHELL chmod a+x /tmp/ubd1/tmp/chrootshell chroot /tmp/ubd1/ /tmp/chrootshell -pbuilder build --buildplace /tmp/ubd1/tmp/1 ${BUILDING_DSC_FILE} +pbuilder build --buildplace /tmp/ubd1/ --internal-build-uml ${BUILDING_DSC_FILE} EOF chmod a+x ${INSIDE_PBUILDER} |