Import debootstrap-1.0.67 as wip/debootstrap.

debootstrap is a tool which will install a Debian or Ubuntu base system into a
subdirectory of another, already installed system.

To setup a Debian "wheezy" chroot on NetBSD/amd64 system:

host# debootstrap --arch=amd64 wheezy /emul/wheezy
host# cp /usr/pkg/share/debootstrap/libfakesyscall-amd64.so /emul/wheezy
host# chroot /emul/wheezy /bin/bash
debian# export LD_PRELOAD=/libfakesyscall-amd64.so
debian# apt-get moo
This commit is contained in:
Tobias Nygren 2015-03-21 23:37:21 +00:00 committed by Thomas Klausner
parent 37a7dd095b
commit 35bc0e8f33
12 changed files with 573 additions and 0 deletions

2
debootstrap/DESCR Normal file
View File

@ -0,0 +1,2 @@
debootstrap is a tool which will install a Debian or Ubuntu base system into a
subdirectory of another, already installed system.

12
debootstrap/MESSAGE Normal file
View File

@ -0,0 +1,12 @@
===========================================================================
$NetBSD: MESSAGE,v 1.1 2015/03/21 23:37:21 tnn2 Exp $
To setup a Debian "wheezy" chroot on NetBSD/amd64 system:
host# debootstrap --arch=amd64 wheezy /emul/wheezy
host# cp ${PREFIX}/share/debootstrap/libfakesyscall-amd64.so /emul/wheezy
host# chroot /emul/wheezy /bin/bash
debian# export LD_PRELOAD=/libfakesyscall-amd64.so
debian# apt-get moo
===========================================================================

81
debootstrap/Makefile Normal file
View File

@ -0,0 +1,81 @@
# $NetBSD: Makefile,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
DISTNAME= debootstrap_1.0.67
PKGNAME= ${DISTNAME:S/_/-/}
CATEGORIES= sysutils emulators
MASTER_SITES= ${MASTER_SITE_DEBIAN:=pool/main/d/debootstrap/}
DISTFILES= ${DEFAULT_DISTFILES} ${DEBIAN_KEYRING_DEB} ${UBUNTU_KEYRING_DEB}
DEBIAN_KEYRING_DEB= debian-archive-keyring_2014.3_all.deb
UBUNTU_KEYRING_DEB= ubuntu-archive-keyring_2012.05.19-2_all.deb
SITES.${DEBIAN_KEYRING_DEB}= ${MASTER_SITE_DEBIAN:=pool/main/d/debian-archive-keyring/}
SITES.${UBUNTU_KEYRING_DEB}= ${MASTER_SITE_DEBIAN:=pool/main/u/ubuntu-keyring/}
MAINTAINER= tnn@NetBSD.org
HOMEPAGE= http://wiki.debian.org/Debootstrap
COMMENT= Debian GNU/Linux (and Ubuntu) cross-bootstrapping utility
LICENSE= mit
DEPENDS+= wget-[0-9]*:../../net/wget
DEPENDS+= gnupg-[0-9]*:../../security/gnupg
WRKSRC= ${WRKDIR}/${PKGNAME_NOREV}
USE_LANGUAGES= # none
USE_TOOLS+= gmake xzcat tar bash:run
CHECK_SHLIBS_SKIP= share/debootstrap/libfakesyscall-i386.so \
share/debootstrap/libfakesyscall-amd64.so
REPLACE_BASH= debootstrap
SUBST_CLASSES+= fix-paths
SUBST_STAGE.fix-paths= pre-configure
SUBST_MESSAGE.fix-paths= Fixing absolute paths.
SUBST_FILES.fix-paths= Makefile
SUBST_SED.fix-paths= -e 's,/usr/,${PREFIX}/,g'
SUBST_CLASSES+= fix-paths2
SUBST_STAGE.fix-paths2= pre-configure
SUBST_MESSAGE.fix-paths2= Fixing absolute paths.
SUBST_FILES.fix-paths2= debootstrap
SUBST_SED.fix-paths2= -e 's,@PREFIX@,${PREFIX},g'
SUBST_CLASSES+= fix-paths3
SUBST_STAGE.fix-paths3= pre-configure
SUBST_MESSAGE.fix-paths3= Fixing absolute paths.
SUBST_FILES.fix-paths3= scripts/*
# Provide a dummy /sbin/init
SUBST_SED.fix-paths3= -e 's,mv "$$TARGET/sbin/start-stop-daemon" "$$TARGET/sbin/start-stop-daemon.REAL",mv "$$TARGET/sbin/init" "$$TARGET/sbin/init.REAL"; ln -s /bin/true "$$TARGET/sbin/init"; &,g'
SUBST_SED.fix-paths3+= -e 's,/usr/share/keyrings,${PREFIX}/share/debootstrap,g'
.include "../../mk/bsd.prefs.mk"
# XXX devices.tar.gz generation stuff needs root on Linux
.if ${OPSYS} == "Linux"
PKG_DESTDIR_SUPPORT= destdir
NOT_FOR_UNPRIVILEGED= yes
.endif
post-extract:
.for keyring_deb in ${DEBIAN_KEYRING_DEB} ${UBUNTU_KEYRING_DEB}
cd ${WRKDIR} && ar x ${keyring_deb}
mkdir ${WRKDIR}/${keyring_deb:S/.deb//}
cd ${WRKDIR}/${keyring_deb:S/.deb//} && ${XZCAT} ../data.tar.xz | ${TAR} xf -
.endfor
cp ${FILESDIR}/* ${WRKDIR}
set -e; cd ${WRKDIR}; for uue in *.uue; do uudecode $$uue; done
post-build:
rm -f ${WRKSRC}/scripts/*.orig
post-install:
${INSTALL_DATA} ${WRKDIR}/${DEBIAN_KEYRING_DEB:S/.deb//}/usr/share/keyrings/debian-archive-keyring.gpg ${DESTDIR}${PREFIX}/share/debootstrap/debian-archive-keyring.gpg
${INSTALL_DATA} ${WRKDIR}/${UBUNTU_KEYRING_DEB:S/.deb//}/usr/share/keyrings/ubuntu-archive-keyring.gpg ${DESTDIR}${PREFIX}/share/debootstrap/ubuntu-archive-keyring.gpg
.for f in libfakesyscall-i386.so libfakesyscall-amd64.so libfakesyscall.c
${INSTALL_DATA} ${WRKDIR}/${f} ${DESTDIR}${PREFIX}/share/debootstrap/${f}
.endfor
.if ${OPSYS} == "NetBSD"
${INSTALL_DATA} ${WRKDIR}/devices.tar.gz ${DESTDIR}${PREFIX}/share/debootstrap/devices.tar.gz
.endif
.include "../../mk/bsd.pkg.mk"

51
debootstrap/PLIST Normal file
View File

@ -0,0 +1,51 @@
@comment $NetBSD: PLIST,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
sbin/debootstrap
share/debootstrap/debian-archive-keyring.gpg
share/debootstrap/devices.tar.gz
share/debootstrap/functions
share/debootstrap/libfakesyscall.c
share/debootstrap/libfakesyscall-i386.so
share/debootstrap/libfakesyscall-amd64.so
share/debootstrap/scripts/breezy
share/debootstrap/scripts/dapper
share/debootstrap/scripts/edgy
share/debootstrap/scripts/etch
share/debootstrap/scripts/etch-m68k
share/debootstrap/scripts/feisty
share/debootstrap/scripts/gutsy
share/debootstrap/scripts/hardy
share/debootstrap/scripts/hoary
share/debootstrap/scripts/hoary.buildd
share/debootstrap/scripts/intrepid
share/debootstrap/scripts/jaunty
share/debootstrap/scripts/jessie
share/debootstrap/scripts/karmic
share/debootstrap/scripts/lenny
share/debootstrap/scripts/lucid
share/debootstrap/scripts/maverick
share/debootstrap/scripts/natty
share/debootstrap/scripts/oldstable
share/debootstrap/scripts/oneiric
share/debootstrap/scripts/potato
share/debootstrap/scripts/precise
share/debootstrap/scripts/quantal
share/debootstrap/scripts/raring
share/debootstrap/scripts/sarge
share/debootstrap/scripts/sarge.buildd
share/debootstrap/scripts/sarge.fakechroot
share/debootstrap/scripts/saucy
share/debootstrap/scripts/sid
share/debootstrap/scripts/squeeze
share/debootstrap/scripts/stable
share/debootstrap/scripts/stretch
share/debootstrap/scripts/testing
share/debootstrap/scripts/trusty
share/debootstrap/scripts/unstable
share/debootstrap/scripts/utopic
share/debootstrap/scripts/vivid
share/debootstrap/scripts/warty
share/debootstrap/scripts/warty.buildd
share/debootstrap/scripts/wheezy
share/debootstrap/scripts/woody
share/debootstrap/scripts/woody.buildd
share/debootstrap/ubuntu-archive-keyring.gpg

14
debootstrap/distinfo Normal file
View File

@ -0,0 +1,14 @@
$NetBSD: distinfo,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
SHA1 (debian-archive-keyring_2014.3_all.deb) = 7f16adc03d5e2f21afba8ae843d1ed5d7ef9c14a
RMD160 (debian-archive-keyring_2014.3_all.deb) = 13fec7c8c07af16742af3ddae29422726d341cc1
Size (debian-archive-keyring_2014.3_all.deb) = 40060 bytes
SHA1 (debootstrap_1.0.67.tar.gz) = c56b3da681b23208c3ed13a59f941342df61d349
RMD160 (debootstrap_1.0.67.tar.gz) = 8c953ffd053f6583d4c3299567f63767ffa0bbf2
Size (debootstrap_1.0.67.tar.gz) = 61863 bytes
SHA1 (ubuntu-archive-keyring_2012.05.19-2_all.deb) = 256efaf11b6408bc31c105c4e63fd925e7e8f05c
RMD160 (ubuntu-archive-keyring_2012.05.19-2_all.deb) = f9d8e97c3ded064eb26bfacedbb950d1eb1a2d01
Size (ubuntu-archive-keyring_2012.05.19-2_all.deb) = 18178 bytes
SHA1 (patch-Makefile) = 021a7732eb6f6b8e99f0011402d73d6c07d295ad
SHA1 (patch-debootstrap) = a923299ffa8f5e3c85bf6262c7113300e70ea05d
SHA1 (patch-functions) = 22e2ef8b01df7f764d5c7c2417663ba35d41215f

View File

@ -0,0 +1,24 @@
$NetBSD: devices.tar.gz.uue,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
begin 644 devices.tar.gz
M'XL(`%7B#54``^V<;6[B,!"&<Y3>H/8XCL^#FFA!!;+*1W>[I]_8$.A2B9(I
M@_QJY_F3JD(:.P_CL1V3NGDKI#&F-,'[Z9JXO*:_+7GC7&6MC?^WQ@53>/&6
M38S]L.J>GHJN;8=KG_NU;IKM(QKT6.KF[;E?[T1C3/YM".%K_[9RP5;1OR6C
M_A]!]/_2[OMVVXC%,(9,]=G[)__6FU#9^#VQCJI0.+$6?>!>_B\[!\+L?QC>
MQ6)P_#MGD?W;.[=2C.B_[D;1`I#\EY?>Z9I_*IW+R__KKKEZDP[]*!'S_ZNN
M?1>6?ULB^B?$_!?6S_)/T^>!_4/E_W[<BLYLD_^J6E+_*5ZS\G];_:?3%83H
M_T_3M9(Q6/X)V?]4O$!(]7_;_I",P9C_DP^9C?^W^0^(X_]K_[[K!6-$_V59
M+O'OC`5<_TV=0/3?K?9U*S@%Y/B?*@">?^,K1/^C\!?@,/]?YM]9:/]0ZS_)
MO;\(9_Y75@3H?_(.F/_]4&_V@C$X_D-`]$^0X__DOQVO=OY[,/P[&S+;_UOF
M'VK\G_PW72<7@^7?(];_DW^H_9^^'?>UX(C%\6\JQ/6_A]S_78WUILW-?V[/
M_Y;X)RS_N\WOILO-/^3X/^<_0?E/^?\R;*4:S?'O'>+^_]&_P\K_5/\%9ZR\
M^H^X_O.0S_]3_N?FWWE<_X3E/]7_W/Q#S_\)RO]<_Z4:S:K_)>#SOW/]A_*?
MZK_@C@4O_Q'W_SSD^9^4_[GY1Y[_$Y;_5/]S\P\]_R<H_W/]EVHTK_X#[_\Y
MK/Q/]5_P9O/R'WG_SSRDZ??@E/^Y^4>>_Q.6_U3_<_,//?\G*/]S_9=J-*_^
M`^__.:S\7]>R3X!9YS]S^_W7+?ZC][E#('SP+[9GQ?,/N/X[^X?:_SOZ%UNS
M\/P#UO^S?ZCUW]&_V.WF^0=<_YW]0]7_M/X7C&$LF;#P]W]5&0J2/I@8T??_
M'.;_@C$X_GVP!4D?3(RH_\/Z7S`&*__=E/_2!Q,CZO^T_I>*P?#OXOOB2/I@
M8D3]/]?]3]$8R?\-[W_\Y_TO;J[_HDW[[_TKBJ(HBJ(HBJ(HBJ(HBJ(HBJ(H
2BJ(HBJ(HBH++7[=0]:``>```
`
end

View File

@ -0,0 +1,147 @@
begin 644 libfakesyscall-amd64.so
M?T5,1@(!`0````````````,`/@`!````X`4```````!```````````@+````
M`````````$``.``&`$``'``9``$````%````````````````````````````
M````````O`<```````"\!P``````````(````````0````8```#`!P``````
M`,`'(```````P`<@``````!``@```````$@"```````````@```````"````
M!@```-@'````````V`<@``````#8!R```````-`!````````T`$````````(
M``````````0````$````D`$```````"0`0```````)`!````````)```````
M```D``````````0`````````4.5T9`0````@!P```````"`'````````(`<`
M```````D`````````"0`````````!`````````!1Y71D!@``````````````
M```````````````````````````````````````````(``````````0````4
M`````P```$=.50!\68T^>AYP1:?'R5ZNO0%F`%FT]P`````#````#P````P`
M```&````!P````````````````````X````#````!`````D````+````````
M``T`````````"@````4````"````"`````,````(`````0````8```"*Q"`!
M``1@"0@````*````#0```$)%U>R[XY)\>$WR#]AQ6!RYC?$.ZM/O#DOP*1``
M`````````````````````````````````````P`*`)@%````````````````
M```<````(`````````````````````````![````$@``````````````````
M```````!````(`````````````````````````!A````(```````````````
M```````````X````(`````````````````````````!2````(@``````````
M``````````````"3````$`#Q_P`*(`````````````````"F````$`#Q_P@*
M(`````````````````"#````$@`,`!`'`````````P````````":````$`#Q
M_P`*(``````````````````0````$@`*`)@%```````````````````6````
M$@`-`!0'``````````````````!U````$@`,`.`&````````*0``````````
M7U]G;6]N7W-T87)T7U\`7VEN:70`7V9I;FD`7TE435]D97)E9VES=&5R5$U#
M;&]N951A8FQE`%])5$U?<F5G:7-T97)434-L;VYE5&%B;&4`7U]C>&%?9FEN
M86QI>F4`7TIV7U)E9VES=&5R0VQA<W-E<P!P<F-T;`!S>7-C86QL`&UO=6YT
M`&QI8F,N<V\N-@!?961A=&$`7U]B<W-?<W1A<G0`7V5N9`!'3$E"0U\R+C(N
M-0```````````@`````````"``$``0`!``$``0`!``$````!``$`B0```!``
M````````=1II"0```@"K`````````,`'(```````"`````````"P!@``````
M`,@'(```````"`````````!P!@```````/@)(```````"`````````#X"2``
M`````*@)(```````!@````(``````````````+`)(```````!@````0`````
M`````````+@)(```````!@````4``````````````,`)(```````!@````8`
M`````````````,@)(```````!@````<``````````````.@)(```````!P``
M``,``````````````/`)(```````!P````<``````````````$B#[`CH/P``
M`$B#Q`C#`````````````/\U(@0@`/\E)`0@``\?0`#_)2($(`!H`````.G@
M_____R4:!"``:`$```#IT/___TB#[`A(BP7%`R``2(7`=`+_T$B#Q`C#D)"0
MD)"0D)"02(T%``0@`$B-/?(#(`!52"GX2(GE2(/X#G<"7<-(BP6$`R``2(7`
M=/)=_^`/'T``2(T%R0,@`$B-/<(#(`!52"GX2(GE2,'X`TB)PDC!ZC](`=!(
MB<9(T?YU`EW#2(L57`,@`$B%TG3R7?_B#Q]``(`]B0,@``!U)TB#/4<#(```
M54B)Y70,2(L]:@,@`.@]____Z&C___]=Q@5@`R```?/#9F9F9F8N#Q^$````
M``!(@ST8`2```'0?2(L%]P(@`$B%P'0354B-/0(!(`!(B>7_T%WI5____^E2
M____D)`QP(/_#W0@2(/L"$V)P4F)R$B)T4B)\HG^OYT```#HO?[__TB#Q`CS
MPP\?@``````QP,.02(/L"$B#Q`C#`````1L#.R0````#````D/[__T````#`
M____:````/#___^``````````!0``````````7I2``%X$`$;#`<(D`$``"0`
M```<````2/[__S``````#A!&#AA*#PMW"(``/QH[*C,D(@`````4````1```
M`%#___\I`````$L.$%P."``4````7````&C___\#````````````````````
M`````+`&````````<`8```````````````````$`````````B0`````````,
M`````````)@%````````#0`````````4!P```````!D`````````P`<@````
M```;``````````@`````````&@````````#(!R```````!P`````````"```
M```````$`````````+@!````````]?[_;P`````(`@````````4`````````
ML`,````````&`````````$@"````````"@````````"W``````````L`````
M````&``````````#`````````-`)(````````@`````````P`````````!0`
M````````!P`````````7`````````&@%````````!P````````"H!```````
M``@`````````P``````````)`````````!@`````````_O__;P````"(!```
M`````/___V\``````0````````#P__]O`````&@$````````^?__;P`````#
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````````````````````````````````````````-@'(```````
M`````````````````````,8%````````U@4```````#X"2```````$=#0SH@
M*$1E8FEA;B`T+C<N,BTU*2`T+C<N,@``+G-Y;71A8@`N<W1R=&%B`"YS:'-T
M<G1A8@`N;F]T92YG;G4N8G5I;&0M:60`+F=N=2YH87-H`"YD>6YS>6T`+F1Y
M;G-T<@`N9VYU+G9E<G-I;VX`+F=N=2YV97)S:6]N7W(`+G)E;&$N9'EN`"YR
M96QA+G!L=``N:6YI=``N=&5X=``N9FEN:0`N96A?9G)A;65?:&1R`"YE:%]F
M<F%M90`N:6YI=%]A<G)A>0`N9FEN:5]A<G)A>0`N:F-R`"YD>6YA;6EC`"YG
M;W0`+F=O="YP;'0`+F1A=&$`+F)S<P`N8V]M;65N=```````````````````
M````````````````````````````````````````````````````````````
M```````````;````!P````(`````````D`$```````"0`0```````"0`````
M```````````````$````````````````````,@````4````"`````````+@!
M````````N`$```````!0``````````0`````````"``````````$````````
M`"X```#V__]O`@`````````(`@````````@"````````0``````````$````
M``````@````````````````````X````"P````(`````````2`(```````!(
M`@```````&@!````````!0````(````(`````````!@`````````0`````,`
M```"`````````+`#````````L`,```````"W`````````````````````0``
M`````````````````$@```#___]O`@````````!H!````````&@$````````
M'@`````````$``````````(``````````@````````!5````_O__;P(`````
M````B`0```````"(!````````"``````````!0````$````(````````````
M````````9`````0````"`````````*@$````````J`0```````#`````````
M``0`````````"``````````8`````````&X````$`````@````````!H!0``
M`````&@%````````,``````````$````"P````@`````````&`````````!X
M`````0````8`````````F`4```````"8!0````````X`````````````````
M```$````````````````````<P````$````&`````````+`%````````L`4`
M```````P````````````````````$``````````0`````````'X````!````
M!@````````#@!0```````.`%````````-`$``````````````````!``````
M``````````````"$`````0````8`````````%`<````````4!P````````D`
M```````````````````$````````````````````B@````$````"````````
M`"`'````````(`<````````D````````````````````!```````````````
M`````)@````!`````@````````!(!P```````$@'````````=```````````
M``````````@```````````````````"B````#@````,`````````P`<@````
M``#`!P````````@````````````````````(````````````````````K@``
M``\````#`````````,@'(```````R`<````````(````````````````````
M"````````````````````+H````!`````P````````#0!R```````-`'````
M````"`````````````````````@```````````````````"_````!@````,`
M````````V`<@``````#8!P```````-`!````````!0`````````(````````
M`!``````````R`````$````#`````````*@)(```````J`D````````H````
M````````````````"``````````(`````````,T````!`````P````````#0
M"2```````-`)````````*`````````````````````@`````````"```````
M``#6`````0````,`````````^`D@``````#X"0````````@`````````````
M```````(````````````````````W`````@````#```````````*(```````
M``H````````(````````````````````!````````````````````.$````!
M````,``````````````````````*````````'`````````````````````$`
M`````````0`````````1`````P`````````````````````````<"@``````
M`.H````````````````````!`````````````````````0````(`````````
M````````````````"!(```````!`!0```````!L````K````"``````````8
M``````````D````#`````````````````````````$@7````````Y0$`````
M``````````````$`````````````````````````````````````````````
M`````````````P`!`)`!`````````````````````````P`"`+@!````````
M`````````````````P`#``@"`````````````````````````P`$`$@"````
M`````````````````````P`%`+`#`````````````````````````P`&`&@$
M`````````````````````````P`'`(@$`````````````````````````P`(
M`*@$`````````````````````````P`)`&@%````````````````````````
M`P`*`)@%`````````````````````````P`+`+`%````````````````````
M`````P`,`.`%`````````````````````````P`-`!0'````````````````
M`````````P`.`"`'`````````````````````````P`/`$@'````````````
M`````````````P`0`,`'(````````````````````````P`1`,@'(```````
M`````````````````P`2`-`'(````````````````````````P`3`-@'(```
M`````````````````````P`4`*@)(````````````````````````P`5`-`)
M(````````````````````````P`6`/@)(````````````````````````P`7
M```*(````````````````````````P`8```````````````````````!````
M`@`,`.`%```````````````````1````!`#Q_P`````````````````````<
M`````0`2`-`'(``````````````````I`````@`,```&````````````````
M```^`````@`,`#`&``````````````````!1`````@`,`'`&````````````
M``````!G`````0`7```*(````````0````````!V`````0`1`,@'(```````
M``````````"=`````@`,`+`&``````````````````"I`````0`0`,`'(```
M``````````````#(````!`#Q_P`````````````````````1````!`#Q_P``
M``````````````````#9`````0`/`+@'``````````````````#G`````0`2
M`-`'(`````````````````#S`````0`6`/@)(````````````````````0``
M`0#Q_]@'(``````````````````)`0```0`6```*(``````````````````5
M`0```0#Q_]`)(``````````````````K`0``(```````````````````````
M``!'`0``$`#Q_P`*(`````````````````!.`0``$@`-`!0'````````````
M``````!4`0``$@`,`.`&````````*0````````!:`0``$@`,`!`'````````
M`P````````!@`0``$@````````````````````````!U`0``(```````````
M``````````````"$`0``$`#Q_P@*(`````````````````")`0``$`#Q_P`*
M(`````````````````"5`0``(`````````````````````````"I`0``(```
M``````````````````````##`0``(@````````````````````````#?`0``
M$@`*`)@%````````````````````8V%L;%]G;6]N7W-T87)T`&-R='-T=69F
M+F,`7U]*0U)?3$E35%]?`&1E<F5G:7-T97)?=&U?8VQO;F5S`')E9VES=&5R
M7W1M7V-L;VYE<P!?7V1O7V=L;V)A;%]D=&]R<U]A=7@`8V]M<&QE=&5D+C8P
M.3(`7U]D;U]G;&]B86Q?9'1O<G-?875X7V9I;FE?87)R87E?96YT<GD`9G)A
M;65?9'5M;7D`7U]F<F%M95]D=6UM>5]I;FET7V%R<F%Y7V5N=')Y`&QI8F9A
M:V5S>7-C86QL+F,`7U]&4D%-15]%3D1?7P!?7TI#4E]%3D1?7P!?7V1S;U]H
M86YD;&4`7T193D%-24,`7U]434-?14Y$7U\`7T=,3T)!3%]/1D93151?5$%"
M3$5?`%])5$U?9&5R96=I<W1E<E1-0VQO;F5486)L90!?961A=&$`7V9I;FD`
M<')C=&P`;6]U;G0`<WES8V%L;$!`1TQ)0D-?,BXR+C4`7U]G;6]N7W-T87)T
M7U\`7V5N9`!?7V)S<U]S=&%R=`!?2G9?4F5G:7-T97)#;&%S<V5S`%])5$U?
M<F5G:7-T97)434-L;VYE5&%B;&4`7U]C>&%?9FEN86QI>F5`0$=,24)#7S(N
*,BXU`%]I;FET`$-L
`
end

View File

@ -0,0 +1,109 @@
begin 644 libfakesyscall-i386.so
M?T5,1@$!`0````````````,``P`!````8`0``#0```"P"````````#0`(``&
M`"@`'``9``$```````````````````"(!@``B`8```4`````$````0```(@&
M``"(%@``B!8``"0!```H`0``!@`````0```"````E`8``)06``"4%@``Z```
M`.@````&````!`````0```#T````]````/0````D````)`````0````$````
M4.5T9.P%``#L!0``[`4``"0````D````!`````0```!1Y71D````````````
M```````````````&````!`````0````4`````P```$=.50#^8<311<C*E29!
M/1:-+\6'1@3L7@,````.````"P````8````*````````````````````#0``
M``,````$````"``````````,`````@````D````%`````0````<````#````
M!P````(````&````B@0@`0#$8`D'````"0````P```!"1=7LN^.2?'A-\@_8
M<5@<N8WQ#NK3[PY+\"D0`````````````````````!P``````````````"``
M``!2```````````````B`````0``````````````(````'L`````````````
M`!(```!A```````````````@````.```````````````(````),```"L%P``
M`````!``\?^F````L!<````````0`/'_@P```-`%```#````$@`,`)H```"L
M%P```````!``\?\0````[`,````````2``H`%@```-0%````````$@`-`'4`
M``"`!0``3P```!(`#```7U]G;6]N7W-T87)T7U\`7VEN:70`7V9I;FD`7TE4
M35]D97)E9VES=&5R5$U#;&]N951A8FQE`%])5$U?<F5G:7-T97)434-L;VYE
M5&%B;&4`7U]C>&%?9FEN86QI>F4`7TIV7U)E9VES=&5R0VQA<W-E<P!P<F-T
M;`!S>7-C86QL`&UO=6YT`&QI8F,N<V\N-@!?961A=&$`7U]B<W-?<W1A<G0`
M7V5N9`!'3$E"0U\R+C``1TQ)0D-?,BXQ+C,````````"`````P```````0`!
M``$``0`!``$``0````$``@")````$``````````0:6D-```#`*L````0````
M<Q]I"0```@"U`````````(@6```(````C!8```@```"H%P``"````'P7```&
M`0``@!<```8"``"$%P``!@,``(@7```&!0``C!<```8&``"<%P``!P(``*`7
M```'`P``I!<```<$``!5B>53@^P$Z`````!;@<.8$P``BY/T____A=)T!>@R
M````6%O)PP``````````````````_[,$````_Z,(`````````/^C#````&@`
M````Z>#_____HQ````!H"````.G0_____Z,4````:!````#IP/___U6)Y5/H
M$@$``('#)Q,``(/L%(V#'P```(V3'````"G0@_@&=P:#Q!1;7<.+@^S___^%
MP'3PB10D_]#KZ8UT)@!5B>53Z-(```"!P^<2``"#[!2-@QP```"-DQP````I
MT,'X`HG!P>D?`<C1^'4&@\046UW#BXO\____A<ET\(E$)`2)%"3_T>OEC;0F
M`````%6)Y5/H@@```('#EQ(``(/L%("['`````!U)(N#\/___X7`=`Z+@Q@`
M``")!"3H#?___^@X____QH,<`````8/$%%M=PXUT)@"-O"<`````58GE4^@R
M````@<-'$@``@^P4BY,`____A=)T%8N#^/___X7`=`N-DP#___^)%"3_T(/$
M%%M=Z27___^+'"3#D%,QP(/L*(M4)##H[/___X'#`1(``(/Z#W0PBT0D0(E4
M)`3'!"2L````B40D%(M$)#R)1"00BT0D.(E$)`R+1"0TB40D".B&_O__@\0H
M6\.0,<##D%6)Y5.#[`3H`````%N!P[`1``!96\G#``$;`SL@`````P```#3^
M__\\````E/___V````#D____A````!0``````````7I2``%\"`$;#`0$B`$`
M`"`````<````\/W__T``````#@A&#@Q*#PMT!'@`/QH[*C(D(B````!`````
M+/___T\`````00X(@P)%#C`"1PX(0<,.!````!````!D````6/___P,`````
M`````````$`%``#P!`````````$```")````#````.P#```-````U`4``!D`
M``"(%@``&P````0````:````C!8``!P````$````!````!@!``#U_O]O9`$`
M``4```"$`@``!@```*0!```*````P0````L````0`````P```)`7```"````
M&````!0````1````%P```-0#```1````E`,``!(```!`````$P````@```#^
M__]O9`,``/___V\!````\/__;T8#``#Z__]O`P``````````````````````
M````````````````````````````````````````````````````````````
M`)06`````````````#8$``!&!```5@0``*@7``!'0T,Z("A$96)I86X@-"XW
M+C(M-2D@-"XW+C(``"YS>6UT86(`+G-T<G1A8@`N<VAS=')T86(`+FYO=&4N
M9VYU+F)U:6QD+6ED`"YG;G4N:&%S:``N9'EN<WEM`"YD>6YS='(`+F=N=2YV
M97)S:6]N`"YG;G4N=F5R<VEO;E]R`"YR96PN9'EN`"YR96PN<&QT`"YI;FET
M`"YT97AT`"YF:6YI`"YE:%]F<F%M95]H9'(`+F5H7V9R86UE`"YI;FET7V%R
M<F%Y`"YF:6YI7V%R<F%Y`"YJ8W(`+F1Y;F%M:6,`+F=O=``N9V]T+G!L=``N
M9&%T80`N8G-S`"YC;VUM96YT````````````````````````````````````
M```````````````````;````!P````(```#T````]````"0`````````````
M``0`````````,@````4````"````&`$``!@!``!,````!``````````$````
M!````"X```#V__]O`@```&0!``!D`0``0`````0`````````!`````0````X
M````"P````(```"D`0``I`$``.`````%`````0````0````0````0`````,`
M```"````A`(``(0"``#!```````````````!`````````$@```#___]O`@``
M`$8#``!&`P``'`````0``````````@````(```!5````_O__;P(```!D`P``
M9`,``#`````%`````0````0`````````9`````D````"````E`,``)0#``!`
M````!``````````$````"````&T````)`````@```-0#``#4`P``&`````0`
M```+````!`````@```!V`````0````8```#L`P``[`,``"8`````````````
M``0`````````<0````$````&````(`0``"`$``!````````````````0````
M!````'P````!````!@```&`$``!@!```=`$`````````````$`````````""
M`````0````8```#4!0``U`4``!<```````````````0`````````B`````$`
M```"````[`4``.P%```D```````````````$`````````)8````!`````@``
M`!`&```0!@``>```````````````!`````````"@````#@````,```"(%@``
MB`8```0```````````````0`````````K`````\````#````C!8``(P&```$
M```````````````$`````````+@````!`````P```)`6``"0!@``!```````
M````````!`````````"]````!@````,```"4%@``E`8``.@````%````````
M``0````(````Q@````$````#````?!<``'P'```4```````````````$````
M!````,L````!`````P```)`7``"0!P``&```````````````!`````0```#4
M`````0````,```"H%P``J`<```0```````````````0`````````V@````@`
M```#````K!<``*P'```$```````````````$`````````-\````!````,```
M``````"L!P``'````````````````0````$````1`````P``````````````
MR`<``.@```````````````$``````````0````(``````````````!`-``"`
M`P``&P```"L````$````$`````D````#``````````````"0$```Z0$`````
M`````````0```````````````````````````````````/0``````````P`!
M```````8`0````````,``@``````9`$````````#``,``````*0!````````
M`P`$``````"$`@````````,`!0``````1@,````````#``8``````&0#````
M`````P`'``````"4`P````````,`"```````U`,````````#``D``````.P#
M`````````P`*```````@!`````````,`"P``````8`0````````#``P`````
M`-0%`````````P`-``````#L!0````````,`#@``````$`8````````#``\`
M`````(@6`````````P`0``````",%@````````,`$0``````D!8````````#
M`!(``````)06`````````P`3``````!\%P````````,`%```````D!<`````
M```#`!4``````*@7`````````P`6``````"L%P````````,`%P``````````
M```````#`!@``0``````````````!`#Q_PP```"0%@````````$`$@`9````
M8`0````````"``P`+@```*`$`````````@`,`$$```#P!`````````(`#`!7
M````K!<```$````!`!<`9@```(P6`````````0`1`(T```!`!0````````(`
M#`"9````B!8````````!`!``N```````````````!`#Q_P$`````````````
M``0`\?_)````A`8````````!``\`UP```)`6`````````0`2`.,```![!0``
M``````(`#`#Y````J!<````````!`!8`!@$``)06`````````0#Q_P\!``"L
M%P````````$`%@`;`0``D!<````````!`/'_,0$`````````````(````$T!
M``"L%P```````!``\?]4`0``U`4````````2``T`6@$``(`%``!/````$@`,
M`&`!`````````````"(```!\`0``T`4```,````2``P`@@$`````````````
M(````)$!``"P%P```````!``\?^6`0`````````````2````J0$``*P7````
M````$`#Q_[4!`````````````"````#)`0`````````````@````XP$``.P#
M````````$@`*``!C<G1S='5F9BYC`%]?2D-27TQ)4U1?7P!D97)E9VES=&5R
M7W1M7V-L;VYE<P!R96=I<W1E<E]T;5]C;&]N97,`7U]D;U]G;&]B86Q?9'1O
M<G-?875X`&-O;7!L971E9"XU-S,P`%]?9&]?9VQO8F%L7V1T;W)S7V%U>%]F
M:6YI7V%R<F%Y7V5N=')Y`&9R86UE7V1U;6UY`%]?9G)A;65?9'5M;7E?:6YI
M=%]A<G)A>5]E;G1R>0!L:6)F86ME<WES8V%L;"YC`%]?1E)!345?14Y$7U\`
M7U]*0U)?14Y$7U\`7U]X.#8N9V5T7W!C7W1H=6YK+F)X`%]?9'-O7VAA;F1L
M90!?1%E.04U)0P!?7U1-0U]%3D1?7P!?1TQ/0D%,7T]&1E-%5%]404),15\`
M7TE435]D97)E9VES=&5R5$U#;&]N951A8FQE`%]E9&%T80!?9FEN:0!P<F-T
M;`!?7V-X85]F:6YA;&EZ94!`1TQ)0D-?,BXQ+C,`;6]U;G0`7U]G;6]N7W-T
M87)T7U\`7V5N9`!S>7-C86QL0$!'3$E"0U\R+C``7U]B<W-?<W1A<G0`7TIV
M7U)E9VES=&5R0VQA<W-E<P!?251-7W)E9VES=&5R5$U#;&]N951A8FQE`%]I
$;FET`&ES
`
end

View File

@ -0,0 +1,40 @@
#define _GNU_SOURCE
#include <sys/syscall.h>
#include <dlfcn.h>
#include <errno.h>
#include <unistd.h>
#ifndef PR_SET_NAME
#define PR_SET_NAME 15
#endif
/*
* This library override some problematic Linux syscalls while debootstrap runs.
*
* To build:
* gcc -O2 -fPIC -shared -m64 -o libfakesyscall-amd64.so libfakesyscall.c
* gcc -O2 -fPIC -shared -m32 -o libfakesyscall-i386.so libfakesyscall.c
*/
/*
* NetBSD does not emulate prctl(2), pretend it works for PR_SET_NAME.
* Needed by some of the Debian base tools.
*/
int prctl(int option, unsigned long arg2, unsigned long arg3,
unsigned long arg4, unsigned long arg5) {
if (option == PR_SET_NAME) {
return 0;
}
return syscall(SYS_prctl, option, arg2, arg3, arg4, arg5);
}
/*
* NetBSD does not emulate this and we don't want the chroot to mess
* with mounts anyway.
*/
int mount(const char *source, const char *target,
const char *filesystemtype, unsigned long mountflags,
const void *data) {
return 0;
}

View File

@ -0,0 +1,19 @@
$NetBSD: patch-Makefile,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
Allow user-destdir installation
--- Makefile.orig 2014-12-30 04:00:48.000000000 +0000
+++ Makefile
@@ -20,10 +20,10 @@ install:
mkdir -p $(DESTDIR)/usr/sbin
cp -a scripts/* $(DSDIR)/scripts/
- install -o root -g root -m 0644 functions $(DSDIR)/
+ install -m 0644 functions $(DSDIR)/
sed 's/@VERSION@/$(VERSION)/g' debootstrap >$(DESTDIR)/usr/sbin/debootstrap
- chown root:root $(DESTDIR)/usr/sbin/debootstrap
+# chown root:root $(DESTDIR)/usr/sbin/debootstrap
chmod 0755 $(DESTDIR)/usr/sbin/debootstrap
ifeq ($(shell uname),Linux)

View File

@ -0,0 +1,58 @@
$NetBSD: patch-debootstrap,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
--- debootstrap.orig 2014-09-25 04:44:06.000000000 +0000
+++ debootstrap
@@ -14,7 +14,7 @@ if [ -z "$DEBOOTSTRAP_DIR" ]; then
if [ -x /debootstrap/debootstrap ]; then
DEBOOTSTRAP_DIR=/debootstrap
else
- DEBOOTSTRAP_DIR=/usr/share/debootstrap
+ DEBOOTSTRAP_DIR=@PREFIX@/share/debootstrap
fi
fi
@@ -29,7 +29,7 @@ KEYRING=""
DISABLE_KEYRING=""
VARIANT=""
ARCH=""
-HOST_ARCH=""
+HOST_ARCH="$(uname -m)"
HOST_OS=""
KEEP_DEBOOTSTRAP_DIR=""
USE_DEBIANINSTALLER_INTERACTION=""
@@ -407,7 +407,7 @@ elif in_path udpkg && \
elif [ -e $DEBOOTSTRAP_DIR/arch ]; then
HOST_ARCH=`cat $DEBOOTSTRAP_DIR/arch`
fi
-HOST_OS="$HOST_ARCH"
+#HOST_OS="$HOST_ARCH"
# basic host OS guessing for non-Debian systems
if [ -z "$HOST_OS" ]; then
case `uname` in
@@ -423,6 +423,9 @@ if [ -z "$HOST_OS" ]; then
FreeBSD*)
HOST_OS=freebsd
;;
+ NetBSD)
+ HOST_OS=netbsd
+ ;;
esac
fi
@@ -454,7 +457,7 @@ elif doing_variant scratchbox; then
[ "x$SB2_TARGET" != "x" ] || error 1 SBOXTARGETREQ "No scratchbox target configured for $TARGET"
CHROOT_CMD="sb2 -eR -t $SB2_TARGET"
else
- CHROOT_CMD="chroot $TARGET"
+ CHROOT_CMD="chroot $TARGET /usr/bin/env LD_PRELOAD=/debootstrap/libfakesyscall-${ARCH}.so"
fi
if [ -z "$SHA_SIZE" ]; then
@@ -485,6 +488,7 @@ fi
if [ "$TARGET" != "" ]; then
mkdir -p "$TARGET/debootstrap"
+ cp @PREFIX@/share/debootstrap/libfakesyscall* $TARGET/debootstrap
fi
###########################################################################

View File

@ -0,0 +1,16 @@
$NetBSD: patch-functions,v 1.1 2015/03/21 23:37:22 tnn2 Exp $
--- functions.orig 2015-01-06 04:00:50.000000000 +0000
+++ functions
@@ -1011,6 +1011,11 @@ setup_proc () {
mount -t linprocfs proc $TARGET/proc
fi
;;
+ netbsd)
+ umount_on_exit /dev
+ umount_on_exit /proc
+ mount -t procfs -o linux proc $TARGET/proc
+ ;;
hurd*)
;;
*)