[Midnightbsd-cvs] mports: make_chroot_tarball.pl: the new approach was fundementally
ctriv at midnightbsd.org
ctriv at midnightbsd.org
Fri Nov 7 16:35:48 EST 2008
Log Message:
-----------
the new approach was fundementally flawed. Go back to the old way.
Modified Files:
--------------
mports/Tools/magus:
make_chroot_tarball.pl (r1.7 -> r1.8)
-------------- next part --------------
Index: make_chroot_tarball.pl
===================================================================
RCS file: /home/cvs/mports/Tools/magus/make_chroot_tarball.pl,v
retrieving revision 1.7
retrieving revision 1.8
diff -L Tools/magus/make_chroot_tarball.pl -L Tools/magus/make_chroot_tarball.pl -u -r1.7 -r1.8
--- Tools/magus/make_chroot_tarball.pl
+++ Tools/magus/make_chroot_tarball.pl
@@ -67,6 +67,7 @@
/boot/screen.4th
/boot/support.4th
/COPYRIGHT
+ /etc
/lib
/libexec
/rescue
@@ -82,6 +83,7 @@
/usr/libdata
/usr/libexec
/usr/sbin
+ /usr/share
/var/account
/var/at
/var/at/jobs
@@ -103,27 +105,16 @@
);
# directories to get out of the tempdir
-my @tempdirs = qw(mnt proc usr/share etc var/named);
+my @tempdirs = qw(mnt proc);
run(qq(/usr/bin/tar -cpf $ballname --exclude '*perl*' @files));
-
-run("mtree -p $tmpdir -f /usr/src/etc/mtree/BSD.root.dist -dU");
-run("mtree -p $tmpdir/usr -f /usr/src/etc/mtree/BSD.usr.dist -dU");
-run("mtree -p $tmpdir/var -f /usr/src/etc/mtree/BSD.var.dist -dU");
-run("mtree -p $tmpdir/var/named -f /usr/src/etc/mtree/BIND.chroot.dist -dU");
-
-run("cd /usr/src/share && make DESTDIR=$tmpdir install");
-run("cd /usr/src/etc && make DESTDIR=$tmpdir distribution");
-
-inject_etc_files($tmpdir);
+mkdir("$tmpdir/$_") for @tempdirs;
run(qq(tar -C $tmpdir -rpf $ballname @tempdirs));
run(qq(bzip2 $ballname));
run(qq(/bin/ls -hl $ballname.bz2));
-# clean this up so the tmpdir can get deleted
-run(qq(chflags 0 $tmpdir/var/empty));
sub run {
my ($command) = @_;
@@ -142,25 +133,3 @@
die "Command \"$command\" returned non-zero ($?)\n";
}
-sub inject_etc_files {
- my ($tempdir) = @_;
-
- my @files = (
- {
- name => 'resolv.conf',
- contents => <<END,
-search emich.edu
-nameserver 164.76.2.251
-nameserver 164.76.2.54
-nameserver 164.76.102.66
-END
- }
- );
-
- foreach my $file (@files) {
- open(my $fh, '>', "$tempdir/etc/$file->{name}") || die "Couldn't open $tempdir/etc/$file->{name}: $!\n";
- print $fh $file->{contents};
- close($fh) || die "Couldn't close $tempdir/etc/$file->{name}: $!\n";
- }
-}
-
More information about the Midnightbsd-cvs
mailing list