debootstrap is a tool which will install a Debian base system into

a subdirectory of another, already installed system. It doesn't require an
installation CD, just access to a Debian repository.

In FreeBSD, you can use debootstrap to install Debian GNU/kFreeBSD into
a subdirectory of your existing FreeBSD installation (i386 or amd64)
and then run Debian GNU/kFreeBSD (i386 or amd64) in a jail or chroot.

WWW:	http://wiki.debian.org/Debootstrap
This commit is contained in:
Martin Matuska 2011-02-26 21:25:04 +00:00
parent 7b8c36db2c
commit 902bd6db11
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=269849
8 changed files with 186 additions and 0 deletions

View file

@ -147,6 +147,7 @@
SUBDIR += dcfldd
SUBDIR += dd_rescue
SUBDIR += ddrescue
SUBDIR += debootstrap
SUBDIR += decomment
SUBDIR += deleted
SUBDIR += deltup

View file

@ -0,0 +1,38 @@
# New ports collection makefile for: debootstrap
# Date created: 2011-02-26
# Whom: Martin Matuska <mm@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= debootstrap
PORTVERSION= 1.0.28
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_DEBIAN}
MASTER_SITE_SUBDIR= pool/main/d/${PORTNAME}
DISTNAME= ${PORTNAME}_${PORTVERSION}
MAINTAINER= mm@FreeBSD.org
COMMENT= Install Debian base system into a directory
RUN_DEPENDS= ${LOCALBASE}/bin/wget:${PORTSDIR}/ftp/wget
WRKSRC= ${WRKDIR}/${PORTNAME}
NO_BUILD= yes
USE_GMAKE= yes
MAKE_ARGS= DESTDIR="${PREFIX}"
MAN8= debootstrap.8
ONLY_FOR_ARCHS= i386 amd64
ONLY_FOR_ARCHS_REASON= Debian GNU/kFreeBSD available only for i386 and amd64
post-patch:
@${REINPLACE_CMD} -e 's,/usr/share,${PREFIX}/share,g' \
${WRKSRC}/debootstrap
post-install:
@${INSTALL_MAN} ${WRKSRC}/debootstrap.8 \
${MAN8PREFIX}/man/man8/debootstrap.8
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (debootstrap_1.0.28.tar.gz) = e01dd19e1f364fa5b7130e1fbec67b930576885e3c79d74223b203c5e6fc1a95
SIZE (debootstrap_1.0.28.tar.gz) = 54832

View file

@ -0,0 +1,40 @@
--- Makefile.orig 2011-01-20 23:53:15.000000000 +0100
+++ Makefile 2011-02-26 21:33:51.766311773 +0100
@@ -3,31 +3,23 @@
MAKEDEV := /sbin/MAKEDEV
-ifneq ($(shell uname),GNU)
-all: devices.tar.gz
-else
all:
-endif
clean:
rm -f devices.tar.gz
rm -rf dev
-DSDIR=$(DESTDIR)/usr/share/debootstrap
+DSDIR=$(PREFIX)/share/debootstrap
install:
mkdir -p $(DSDIR)/scripts
- mkdir -p $(DESTDIR)/usr/sbin
+ mkdir -p $(PREFIX)/sbin
cp -a scripts/* $(DSDIR)/scripts/
- install -o root -g root -m 0644 functions $(DSDIR)/
+ install -o root -g wheel -m 0644 functions $(DSDIR)/
- sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap
- chown root:root $(DESTDIR)/usr/sbin/debootstrap
- chmod 0755 $(DESTDIR)/usr/sbin/debootstrap
-
-ifneq ($(shell uname),GNU)
- install -o root -g root -m 0644 devices.tar.gz $(DSDIR)/
-endif
+ sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(PREFIX)/sbin/debootstrap
+ chown root:wheel $(PREFIX)/sbin/debootstrap
+ chmod 0755 $(PREFIX)/sbin/debootstrap
devices.tar.gz:
rm -rf dev

View file

@ -0,0 +1,11 @@
--- debootstrap.orig 2011-02-26 21:36:23.197635062 +0100
+++ debootstrap 2011-02-26 21:50:23.274213717 +0100
@@ -384,6 +384,8 @@
if [ "$ARCH" != "" ]; then
true
+elif [ "`uname -s`" = "FreeBSD" ]; then
+ ARCH=kfreebsd-`/sbin/sysctl -n hw.machine_arch`
elif [ -x /usr/bin/dpkg ] && \
/usr/bin/dpkg --print-architecture >/dev/null 2>&1; then
ARCH=`/usr/bin/dpkg --print-architecture`

View file

@ -0,0 +1,50 @@
--- functions.orig 2011-02-22 01:25:08.000000000 +0100
+++ functions 2011-02-26 21:46:35.811100782 +0100
@@ -232,7 +232,11 @@
# args: dest checksum size
local expchecksum="$2"
local expsize="$3"
- relchecksum=`sha${SHA_SIZE}sum < "$1" | sed 's/ .*$//'`
+ if [ "`uname -s`" = "FreeBSD" ]; then
+ relchecksum=`sha${SHA_SIZE} < "$1"`
+ else
+ relchecksum=`sha${SHA_SIZE}sum < "$1" | sed 's/ .*$//'`
+ fi
relsize=`wc -c < "$1"`
if [ "$expsize" -ne "$relsize" ] || [ "$expchecksum" != "$relchecksum" ]; then
return 1
@@ -510,9 +514,9 @@
local i=
if [ "$normi" != "" ]; then
i="$normi"
- elif [ -x /bin/bunzip2 ] && [ "$bz2i" != "" ]; then
+ elif [ -x /bin/bunzip2 -o -x /usr/bin/bunzip2 ] && [ "$bz2i" != "" ]; then
i="$bz2i"
- elif [ -x /bin/gunzip ] && [ "$gzi" != "" ]; then
+ elif [ -x /bin/gunzip -o -x /usr/bin/gunzip ] && [ "$gzi" != "" ]; then
i="$gzi"
fi
if [ "$i" != "" ]; then
@@ -538,11 +542,11 @@
ext="$ext $normi ."
i="$normi"
fi
- if [ -x /bin/bunzip2 ] && [ "$bz2i" != "" ]; then
+ if [ -x /bin/bunzip2 -o -x /usr/bin/bunzip2 ] && [ "$bz2i" != "" ]; then
ext="$ext $bz2i bz2"
i="${i:-$bz2i}"
fi
- if [ -x /bin/gunzip ] && [ "$gzi" != "" ]; then
+ if [ -x /bin/gunzip -o -x /usr/bin/gunzip ] && [ "$gzi" != "" ]; then
ext="$ext $gzi gz"
i="${i:-$gzi}"
fi
@@ -676,7 +680,7 @@
for c in $COMPONENTS; do
local path="dists/$SUITE/$c/binary-$ARCH/Packages"
local pkgdest="$TARGET/$($DLDEST pkg "$SUITE" "$c" "$ARCH" "$m" "$path")"
- if [ -x /bin/gunzip ] && get "$m/${path}.gz" "${pkgdest}.gz"; then
+ if [ -x /bin/gunzip -o -x /usr/bin/gunzip ] && get "$m/${path}.gz" "${pkgdest}.gz"; then
rm -f "$pkgdest"
gunzip "$pkgdest.gz"
elif get "$m/$path" "$pkgdest"; then

View file

@ -0,0 +1,9 @@
debootstrap is a tool which will install a Debian base system into
a subdirectory of another, already installed system. It doesn't require an
installation CD, just access to a Debian repository.
In FreeBSD, you can use debootstrap to install Debian GNU/kFreeBSD into
a subdirectory of your existing FreeBSD installation (i386 or amd64)
and then run Debian GNU/kFreeBSD (i386 or amd64) in a jail or chroot.
WWW: http://wiki.debian.org/Debootstrap

View file

@ -0,0 +1,35 @@
sbin/debootstrap
share/debootstrap/functions
share/debootstrap/scripts/sarge
share/debootstrap/scripts/sid
share/debootstrap/scripts/hoary.buildd
share/debootstrap/scripts/hardy
share/debootstrap/scripts/intrepid
share/debootstrap/scripts/etch
share/debootstrap/scripts/woody
share/debootstrap/scripts/sarge.buildd
share/debootstrap/scripts/unstable
share/debootstrap/scripts/karmic
share/debootstrap/scripts/etch-m68k
share/debootstrap/scripts/hoary
share/debootstrap/scripts/potato
share/debootstrap/scripts/warty.buildd
share/debootstrap/scripts/lenny
share/debootstrap/scripts/maverick
share/debootstrap/scripts/stable
share/debootstrap/scripts/dapper
share/debootstrap/scripts/testing
share/debootstrap/scripts/feisty
share/debootstrap/scripts/sarge.fakechroot
share/debootstrap/scripts/breezy
share/debootstrap/scripts/squeeze
share/debootstrap/scripts/warty
share/debootstrap/scripts/jaunty
share/debootstrap/scripts/gutsy
share/debootstrap/scripts/lucid
share/debootstrap/scripts/natty
share/debootstrap/scripts/woody.buildd
share/debootstrap/scripts/edgy
share/debootstrap/scripts/wheezy
@dirrm share/debootstrap/scripts
@dirrm share/debootstrap