fix/update debootstrap (thereby updating fakeroot)
fakeroot is used to create devices.tar.gz now (thanks to aszlig)
This commit is contained in:
parent
aa583c8cf4
commit
ef9a15a5a4
@ -1,55 +1,68 @@
|
|||||||
{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget }:
|
{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget, coreutils, fakeroot }:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
devices = fetchurl {
|
# USAGE like this: debootstrap sid /tmp/target-chroot-directory
|
||||||
url = mirror://gentoo/distfiles/devices.tar.gz;
|
|
||||||
sha256 = "0j4yhajmlgvbksr2ij0dm7jy3q52j3wzhx2fs5lh05i1icygk4qd";
|
# There is also cdebootstrap now. Is that easier to maintain?
|
||||||
|
|
||||||
|
makedev = stdenv.mkDerivation {
|
||||||
|
name = "makedev-for-debootstrap";
|
||||||
|
src = fetchurl {
|
||||||
|
url = http://ftp.de.debian.org/debian/pool/main/m/makedev/makedev_2.3.1.orig.tar.gz;
|
||||||
|
sha256 = "1yhxlj2mhn1nqkx1f0sn0bl898nf28arxxa4lgp7hdrb5cpp36c5";
|
||||||
|
};
|
||||||
|
patches = [
|
||||||
|
(fetchurl {
|
||||||
|
url = "http://ftp.de.debian.org/debian/pool/main/m/makedev/makedev_2.3.1-89.diff.gz";
|
||||||
|
sha256 = "1zbifw2jkq6471fb67y893nq4lq009xbfbi57jbjwxnhqmrppcy9";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
# TODO install man
|
||||||
|
installPhase = ''
|
||||||
|
ensureDir $out/sbin
|
||||||
|
ls -l
|
||||||
|
t=$out/sbin/MAKEDEV
|
||||||
|
cp MAKEDEV $t
|
||||||
|
chmod +x $t
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "debootstrap-1.0.10lenny";
|
|
||||||
|
name = "debootstrap-1.0.42";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
# I'd like to use the source. However it's lacking the lanny script ?
|
# git clone git://git.debian.org/d-i/debootstrap.git
|
||||||
url = mirror://debian/pool/main/d/debootstrap/debootstrap_1.0.10lenny1_all.deb;
|
# I'd like to use the source. However it's lacking the lanny script ? (still true?)
|
||||||
sha256 = "a70af8e3369408ce9d6314fb5219de73f9523b347b75a3b07ee17ea92c445051";
|
url = http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.42.tar.gz;
|
||||||
|
sha256 = "0a5azl22wz1q92b2c91zlpz6krd7wqyi63yk87vyczp363ml0nz0";
|
||||||
};
|
};
|
||||||
|
# unpackPhase = ''
|
||||||
|
# dpkg-deb --extract "$src" .
|
||||||
|
# '';
|
||||||
|
|
||||||
buildInputs = [ dpkg gettext gawk perl ];
|
buildInputs = [ dpkg gettext gawk perl ];
|
||||||
|
|
||||||
unpackPhase = ''
|
|
||||||
dpkg-deb --extract "$src" .
|
|
||||||
'';
|
|
||||||
|
|
||||||
buildPhase = ":";
|
buildPhase = ":";
|
||||||
|
|
||||||
patches = [
|
# If you have to update the patch for functions a vim regex like this
|
||||||
# replace /usr/* and /sbin/* executables by @executable@ so that they can be replaced by substitute
|
# can help you identify which lines are used to write scripts on TARGET and
|
||||||
# Be careful not to replace code being run in the debian chroot !
|
# which should /bin/ paths should be replaced:
|
||||||
./subst.patch
|
# \<echo\>\|\/bin\/\|^\s*\<cat\>\|EOF\|END
|
||||||
];
|
|
||||||
|
|
||||||
# from deb
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp -r . $out; cd $out
|
|
||||||
t=bin/debootstrap
|
|
||||||
mkdir -p bin man/man8
|
|
||||||
cat >> $t << EOF
|
|
||||||
#!/bin/sh
|
|
||||||
export DEBOOTSTRAP_DIR=$out/usr/share/debootstrap
|
|
||||||
# mount and other tools must be found in chroot. So add default debain paths!
|
|
||||||
# TODO only add paths which are required by the scripts!
|
|
||||||
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
||||||
$out/usr/sbin/debootstrap "\$@"
|
|
||||||
EOF
|
|
||||||
chmod +x $t
|
|
||||||
mv usr/share/man/man8/debootstrap.8.gz man/man8
|
|
||||||
|
|
||||||
set -x
|
sed -i \
|
||||||
for file in usr/share/debootstrap/functions usr/sbin/debootstrap; do
|
-e 's@/usr/bin/id@id@' \
|
||||||
|
-e 's@/usr/bin/dpkg@${dpkg}/bin/dpkg@' \
|
||||||
|
-e 's@/usr/bin/sha@${coreutils}/bin/sha@' \
|
||||||
|
-e 's@/bin/sha@${coreutils}/bin/sha@' \
|
||||||
|
debootstrap
|
||||||
|
|
||||||
|
|
||||||
|
for file in functions debootstrap; do
|
||||||
substituteInPlace "$file" \
|
substituteInPlace "$file" \
|
||||||
--subst-var-by gunzip "$(type -p gunzip)" \
|
--subst-var-by gunzip "$(type -p gunzip)" \
|
||||||
--subst-var-by bunzip "$(type -p bunzip)" \
|
--subst-var-by bunzip "$(type -p bunzip)" \
|
||||||
@ -61,28 +74,36 @@ stdenv.mkDerivation {
|
|||||||
--subst-var-by uname "$(type -p uname)" \
|
--subst-var-by uname "$(type -p uname)" \
|
||||||
--subst-var-by wget "${wget}/bin/wget"
|
--subst-var-by wget "${wget}/bin/wget"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
sed -i \
|
||||||
|
-e 's@\<wget\>@${wget}/bin/wget@' \
|
||||||
|
functions
|
||||||
|
|
||||||
|
d=$out/share/debootstrap
|
||||||
|
ensureDir $out/{share/debootstrap,bin}
|
||||||
|
|
||||||
|
${fakeroot}/bin/fakeroot -- make devices.tar.gz MAKEDEV=${makedev}/sbin/MAKEDEV
|
||||||
|
|
||||||
|
cp -r . $d
|
||||||
|
|
||||||
|
cat >> $out/bin/debootstrap << EOF
|
||||||
|
#!/bin/sh
|
||||||
|
export DEBOOTSTRAP_DIR="''${DEBOOTSTRAP_DIR:-$d}"
|
||||||
|
# mount and other tools must be found in chroot. So add default debain paths!
|
||||||
|
# TODO only add paths which are required by the scripts!
|
||||||
|
export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
|
exec $d/debootstrap "\$@"
|
||||||
|
EOF
|
||||||
|
chmod +x $out/bin/debootstrap
|
||||||
|
|
||||||
|
ensureDir $out/man/man8
|
||||||
|
mv debootstrap.8 $out/man/man8
|
||||||
'';
|
'';
|
||||||
|
|
||||||
/* build from source:
|
passthru = {
|
||||||
installPhase = ''
|
inherit makedev;
|
||||||
cp ${devices} devices.tar.gz
|
};
|
||||||
mkdir -p $out/{bin,man/man8};
|
|
||||||
cp debootstrap.8 $out/man/man8
|
|
||||||
sed -i \
|
|
||||||
-e 's@-o root@@' \
|
|
||||||
-e 's@-g root@@' \
|
|
||||||
-e 's@chown@true@' \
|
|
||||||
Makefile
|
|
||||||
make pkgdetails debootstrap-arch
|
|
||||||
make DESTDIR="''\${out}" install-arch
|
|
||||||
t=$out/bin/debootstrap
|
|
||||||
cat >> $t << EOF
|
|
||||||
#!/bin/sh
|
|
||||||
DEBOOTSTRAP_DIR=$out/usr/share/debootstrap $out/usr/sbin/debootstrap "\$@"
|
|
||||||
EOF
|
|
||||||
chmod +x $t
|
|
||||||
'';
|
|
||||||
*/
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Tool to create a Debian system in a chroot";
|
description = "Tool to create a Debian system in a chroot";
|
||||||
|
@ -1,13 +1,21 @@
|
|||||||
{stdenv, fetchurl}:
|
{stdenv, fetchurl, utillinux}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
name = "fakeroot-1.18.1";
|
name = "fakeroot-1.18.4";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://ftp.de.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.18.1.orig.tar.bz2;
|
url = https://launchpad.net/ubuntu/+archive/primary/+files/fakeroot_1.18.4.orig.tar.bz2;
|
||||||
sha256 = "0h5jsw715a9hv32cb1m1bajy26l7xxrbgrk6qk1b6m91lxh6rnw9";
|
sha256 = "18mydrz49n7ic7147pikkpdb96x00s9wisdk6hrc75ll7vx9wd8a";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buildInputs = [ utillinux /* provides getopt */ ];
|
||||||
|
|
||||||
|
postUnpack = ''
|
||||||
|
for prog in getopt; do
|
||||||
|
sed -i "s@getopt@$(type -p getopt)@g" ${name}/scripts/fakeroot.in
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://fakeroot.alioth.debian.org/;
|
homepage = http://fakeroot.alioth.debian.org/;
|
||||||
description = "Give a fake root environment through LD_PRELOAD";
|
description = "Give a fake root environment through LD_PRELOAD";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user