summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/.perl_checker10
-rw-r--r--tools/Makefile7
-rwxr-xr-xtools/drakx-in-chroot116
-rwxr-xr-xtools/find-drivers-needing-nonfree-firmware94
-rwxr-xr-xtools/gencryptofiles115
-rwxr-xr-xtools/hd_grub.cgi6
-rwxr-xr-xtools/i386/busyboxbin55508 -> 0 bytes
-rwxr-xr-xtools/ia64/elilo.efibin315800 -> 0 bytes
-rwxr-xr-xtools/install-xml-file-list32
-rwxr-xr-xtools/mdkinst_stage2_tool5
-rw-r--r--tools/ppc/README52
-rwxr-xr-xtools/ppc/convert5
-rwxr-xr-xtools/ppc/magic89
-rwxr-xr-xtools/ppc/mapping36
-rw-r--r--tools/serial_probe/serial.c13
-rwxr-xr-xtools/x86_64/busyboxbin74064 -> 0 bytes
16 files changed, 217 insertions, 363 deletions
diff --git a/tools/.perl_checker b/tools/.perl_checker
deleted file mode 100644
index 8dc1d2d7d..000000000
--- a/tools/.perl_checker
+++ /dev/null
@@ -1,10 +0,0 @@
-AutoLoader
-Carp::Heavy
-constant
-Cwd
-Digest::base
-Encode
-File::Path
-Gtk2::Gdk::Keysyms
-IO::Handle
-Pod::Usage \ No newline at end of file
diff --git a/tools/Makefile b/tools/Makefile
index 669b6f987..40194245d 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,7 +1,8 @@
DIRS = serial_probe
-CFLAGS = -Wall
+LDFLAGS = $(shell pkg-config libtirpc --libs)
+CFLAGS = -Wall $(shell pkg-config libtirpc --cflags)
-ARCH := $(shell arch | egrep "(x86_64|sparc64|s390x)")
+ARCH := $(shell arch | grep -E "x86_64")
ifneq ("x$(ARCH)", "x")
LIB_NAME = lib64
else
@@ -10,7 +11,7 @@ endif
.PHONY: clean install $(DIRS)
-all: $(DIRS) xhost+ rpcinfo-flushed
+all: $(DIRS) rpcinfo-flushed
$(DIRS):
make -C $@
diff --git a/tools/drakx-in-chroot b/tools/drakx-in-chroot
index ec11965c6..6565ec9e0 100755
--- a/tools/drakx-in-chroot
+++ b/tools/drakx-in-chroot
@@ -9,30 +9,42 @@ my $prefix_ROOTED = '/mnt';
my $IMAGE_LOCATION_ROOTED = '/tmp/image';
my $MEDIA_LOCATION_ROOTED = '/tmp/media';
my $STAGE2_LOCATION_ROOTED = '/tmp/stage2';
+my $LOOP_MOUNT_POINT = "$SLASH_LOCATION/tmp/loop";
my $LIVE_LOCATION_REL = 'install/stage2/live/';
my $COMPRESSED_LOCATION_REL = 'install/stage2/';
my $COMPRESSED_FILE_REL = $COMPRESSED_LOCATION_REL . 'mdkinst.sqfs';
my $AUTO_INSTALL_ROOTED = '/tmp/auto_inst.cfg.pl';
my $DEFCFG_ROOTED = '/tmp/defcfg.pl';
my $RPMSRATE_ROOTED = '/tmp/rpmsrate';
-my $resolution = '800x600';
-my $repository_uri;
+my $resolution = '1024x768';
+my ($disk_iso_repository, $repository_uri);
@ARGV >= 2 or die "usage: drakx-in-chroot <root of distrib> <dir to install to> [options]\n
\nOptions specific to drakx-in-chroot:
--flang XX use XX locale
- --resolution=XXXxYYYY (eg: --resolution=1024x768)\n
+ --disk-iso path of a distro
+ --resolution=XXXxYYYY (eg: --resolution=800x600)\n
--repository=<path> path of packages repository
--text text mode installer
+ --depth=XX set screen color depth
+ --stage2-update X,Y will mount --bind X on Y
";
(my $repository, my $dir, @ARGV) = @ARGV;
+my ($wrapper);
foreach (@ARGV) {
- $i++;
if (/--resolution=(.*)/) {
$resolution = $1;
+ } elsif (/--disk-iso=(.*)/) {
+ $disk_iso_repository = $1;
} elsif (/--repository=(.*)/) {
$repository_uri = $1;
+ } elsif (/--gdb/) {
+ $wrapper = "gdb -q --args";
+ } elsif (/--strace/) {
+ $wrapper = "strace -e file $ENV{STRACE_OPTIONS}";
+ } elsif (/--depth=(.*)/) {
+ $resolution .= "x$1";
}
}
my ($repository_without_arch, $repository_arch) = basename($repository) eq arch() ? (dirname($repository), '/' . arch()) : ($repository, '');
@@ -44,15 +56,18 @@ if ($>) {
$ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
}
+my @mounts;
+my $_b = before_leaving { sys("$sudo umount $_") foreach reverse @mounts };
+
undef $ENV{TMPDIR}; # prevent packdrake faillure on creating temporary files
if (-d $SLASH_LOCATION) {
- umount_all() == 0 or exit(1);
+ umount_all(1) == 0 or exit(1);
sys("$sudo rm -rf $SLASH_LOCATION/var/lib/rpm $SLASH_LOCATION/dev/mapper");
rm_rf($SLASH_LOCATION);
}
-mkdir_p("$SLASH_LOCATION$_") foreach '/dev', '/dev/usb', '/etc', '/var', '/proc', '/sys', $STAGE2_LOCATION_ROOTED, $MEDIA_LOCATION_ROOTED, $prefix_ROOTED;
+mkdir_p("$SLASH_LOCATION$_") foreach '/dev', '/etc', '/var', '/proc', '/sys', '/run', $STAGE2_LOCATION_ROOTED, $MEDIA_LOCATION_ROOTED, $prefix_ROOTED;
sys("$sudo rm -rf $dir") if $ENV{CLEAN};
-e $dir or sys("$sudo mkdir -p $dir");
@@ -65,20 +80,40 @@ if ($remote_repository) {
sys("curl --silent -o $local_mdkinst $repository/$COMPRESSED_FILE_REL");
mount_mdkinst($local_mdkinst);
} elsif (-d "$repository/$LIVE_LOCATION_REL") {
- sys("$sudo mount -o bind $repository/$LIVE_LOCATION_REL $STAGE2_LOCATION");
+ mount("$repository/$LIVE_LOCATION_REL", $STAGE2_LOCATION, "-o bind");
} elsif (-e "$repository/$COMPRESSED_FILE_REL") {
mount_mdkinst("$repository/$COMPRESSED_FILE_REL");
}
-sys("$sudo mount -o bind $dir $SLASH_LOCATION$prefix_ROOTED");
+mount($dir, "$SLASH_LOCATION$prefix_ROOTED", "-o bind");
$repository_uri ||= $repository_without_arch if !$remote_repository;
-sys("$sudo mount -o bind $repository_uri $SLASH_LOCATION$MEDIA_LOCATION_ROOTED") if $repository_uri;
+mount($repository_uri, "$SLASH_LOCATION$MEDIA_LOCATION_ROOTED", "-o bind") if $repository_uri;
+
+mount('/dev', "$SLASH_LOCATION/dev", " --bind -o ro");
+mount('none', "$SLASH_LOCATION/proc", "-t proc");
+mount('none', "$SLASH_LOCATION/sys", "-t sysfs");
+mount('none', "$SLASH_LOCATION/sys/kernel/debug", "-t debugfs");
+mount('none', "$SLASH_LOCATION/run", "-t tmpfs");
+
+# - Ensure we mount the udev run dir for various extra metadata from udevadm
+# - If dracut has been used (and thus udev has yummy metadata) make sure
+# drakx knows about it when running in the chroot
+# - Also speedup blkid by using its cache
+foreach my $dir (qw(initramfs udev blkid)) {
+ next if !-d "/run/$dir";
+ mkdir_p("$SLASH_LOCATION/run/$dir");
+ mount("/run/$dir", "$SLASH_LOCATION/run/$dir", "-o bind");
+}
+
+if ($disk_iso_repository) {
+ my $repository_arch = $repository_arch || 'i586';
+ mkdir_p($LOOP_MOUNT_POINT);
+ mount($disk_iso_repository, $LOOP_MOUNT_POINT, "-o loop,ro");
+ symlinkf('loop/' . $repository_arch, "$SLASH_LOCATION$IMAGE_LOCATION_ROOTED"); # FIXME: arch()
+}
-sys("$sudo mount -t proc none $SLASH_LOCATION/proc");
-sys("$sudo mount -t sysfs none $SLASH_LOCATION/sys");
symlinkf('media' . $repository_arch, "$SLASH_LOCATION$IMAGE_LOCATION_ROOTED");
create_initial_symlinks();
-create_initial_devices();
apply_stage2_updates();
@@ -90,7 +125,7 @@ mkdir_p("$dir/dev");
eval { cp_af($_, "$dir$_") } foreach qw(/dev/root);
#- if the DISPLAY is remote, we may need to resolve the name:
-eval { cp_af($_, "$SLASH_LOCATION$_") } foreach qw(/etc/resolv.conf);
+eval { cp_af('/etc/resolv.conf', "$SLASH_LOCATION/etc/resolv.conf") };
{
chomp(my $kernel_version = `uname -r`);
@@ -100,14 +135,14 @@ eval { cp_af($_, "$SLASH_LOCATION$_") } foreach qw(/etc/resolv.conf);
}
my $Xnest_pid;
-my $Xnest_bin = find { whereis_binary($_) } 'Xephyr', 'Xnest';
-if (!-f ($SLASH_LOCATION . $AUTO_INSTALL_ROOTED) && $Xnest_bin && (join('', @ARGV) !~ /--text/)) {
+if (!-f ($SLASH_LOCATION . $AUTO_INSTALL_ROOTED) && join('', @ARGV) !~ /--text/) {
+ my $Xnest_bin = find { whereis_binary($_) } 'Xephyr', 'Xnest' or die "Xephyr not found! Please install x11-server-xephyr!\n";
my $DISPLAY = ':8';
$Xnest_pid = fork();
if (!$Xnest_pid) {
exec $Xnest_bin, $DISPLAY, '-ac', ($Xnest_bin eq 'Xephyr' ? '-screen' : '-geometry'), $resolution or die "Xnest failed\n";
}
- $ENV{DISPLAY} = '127.0.0.1' . $DISPLAY;
+ $ENV{DISPLAY} = $DISPLAY;
}
if (my $pid = fork()) {
@@ -117,15 +152,27 @@ if (my $pid = fork()) {
} else {
$ENV{TERM} = 'linux'; # we only have terminfo for terminal "linux"
$ENV{HOME} = '/';
- # to kept sync with gi/mdk-stage1/init.c::env:
- $ENV{LD_LIBRARY_PATH}='/lib:/usr/lib:/mnt/lib:/mnt/usr/lib:/usr/X11R6/lib:/mnt/usr/X11R6/lib:/lib64:/usr/lib64:/usr/X11R6/lib64:/mnt/lib64:/mnt/usr/lib64:/mnt/usr/X11R6/lib64';
+ # to kept sync with mdk-stage1/init.c::env:
+ $ENV{LD_LIBRARY_PATH}='/lib:/usr/lib:/mnt/lib:/mnt/usr/lib:/lib64:/usr/lib64:/mnt/lib64:/mnt/usr/lib64';
if ($remote_repository) {
$ENV{URLPREFIX} = $repository;
}
my $cmd = join(' ', "/usr/bin/runinstall2 --local_install",
+ if_($disk_iso_repository, "--method disk-iso"),
if_($remote_repository, "--method $remote_repository"),
@ARGV);
- exec "$sudo chroot $SLASH_LOCATION $cmd" or die "exec $cmd in $SLASH_LOCATION failed\n";
+ if ($wrapper) {
+ warn qq(GDB USAGE
+Beware that debug info won't be found so on segfault
+just generate a core dump with "gcore" and then
+analyze it offline.
+Thus you sessions will look like:
+(gdb) run
+(gdb) gcore
+(gdb) exit
+);
+ }
+ exec "$sudo $wrapper chroot $SLASH_LOCATION $cmd" or die "exec $cmd in $SLASH_LOCATION failed\n";
}
sub system_verbose { warn join(' ', @_), "\n" if $verbose; system(@_) }
@@ -133,7 +180,7 @@ sub sys { &system_verbose; $? and die qq(running "@_" failed: $?\n) }
sub mount_mdkinst {
my ($mdkinst) = @_;
- sys("$sudo mount -t squashfs -o loop,ro $mdkinst $STAGE2_LOCATION");
+ mount($mdkinst, $STAGE2_LOCATION, "-t squashfs -o loop,ro");
}
sub create_initial_symlinks() {
foreach (cat_or_die("$STAGE2_LOCATION/usr/share/symlinks")) {
@@ -144,21 +191,36 @@ sub create_initial_symlinks() {
symlink $from, $to or die "symlinking $to failed\n";
}
}
+ my $from = "$STAGE2_LOCATION_ROOTED/usr";
+ my $to = "$SLASH_LOCATION/usr";
+ symlink $from, $to or die "symlinking $to failed\n";
+ foreach ('bin', 'sbin', 'lib', 'lib64') {
+ $from = "usr/$_";
+ $to = "$SLASH_LOCATION/$_";
+ symlink $from, $to or die "symlinking $to failed\n";
+ }
}
-sub create_initial_devices() {
- sys("$sudo cp -a /dev/{mem,null,random,urandom} $SLASH_LOCATION/dev");
+sub mount {
+ my ($from, $mntpt, @opts) = @_;
+ push @mounts, $mntpt;
+ sys("$sudo mount $from $mntpt " . join(' ', @opts));
}
-sub umount_all() {
+sub umount_all {
+ my ($b_umount_dev_too) = @_;
my $err;
clean_stage2_updates();
- my @procs = ('/proc/bus/usb', '/proc', '/sys');
- foreach ((map { "$prefix_ROOTED$_" } @procs, ''), @procs, $STAGE2_LOCATION_ROOTED, $MEDIA_LOCATION_ROOTED, $IMAGE_LOCATION_ROOTED) {
+ my @procs = (qw(/proc /sys/kernel/debug /sys /run/udev /run/blkid /run/initramfs /run));
+ # special case for !draklive case (else a 2nd run would fail):
+ if ($b_umount_dev_too && cat_('/proc/mounts') =~ m! $SLASH_LOCATION/dev !) {
+ system_verbose "$sudo umount $SLASH_LOCATION/dev" and rm_rf("$SLASH_LOCATION/dev");
+ }
+ foreach ((map { "$prefix_ROOTED$_" } @procs, '/dev', ''), @procs, $STAGE2_LOCATION_ROOTED, $LOOP_MOUNT_POINT, $MEDIA_LOCATION_ROOTED, $IMAGE_LOCATION_ROOTED) {
my $dir = "$SLASH_LOCATION$_";
rmdir $dir;
if (-d $dir) {
- if (m!/proc/bus/usb! || begins_with($_, $prefix_ROOTED)) {
+ if (m!/sys/kernel/debug! || begins_with($_, $prefix_ROOTED)) {
system_verbose "$sudo umount $dir 2>/dev/null";
next;
}
@@ -205,7 +267,7 @@ sub apply_stage2_updates() {
undef $ARGV[$::i+1];
undef $ARGV[$::i+2];
push @stage2_updates, $dest;
- sys("$sudo mount --bind $file $STAGE2_LOCATION/$dest");
+ mount($file, "$STAGE2_LOCATION/$dest", " --bind");
}
}
} @ARGV;
diff --git a/tools/find-drivers-needing-nonfree-firmware b/tools/find-drivers-needing-nonfree-firmware
new file mode 100755
index 000000000..e8068baee
--- /dev/null
+++ b/tools/find-drivers-needing-nonfree-firmware
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+use MDK::Common;
+use Data::Dumper;
+use Data::Dumper::Perltidy;
+
+my $debug = member('--debug', @ARGV);
+
+my $path = '../../cache';
+my %cache = (
+ version => "$path/version.txt",
+ modules => "$path/modules.txt",
+ firmwares => "$path/firmwares.txt",
+ modinfo => "$path/modinfo.",
+ );
+
+mkdir_p($path) if !-d $path;
+# version of main kernel flavor:
+my $kernel = chomp_(cat_($cache{version}));
+if (!$kernel) {
+ # get regular flavor:
+ ($kernel) = split('\|', chomp_(`urpmq -f kernel-desktop-latest`));
+ # get real package name:
+ $kernel =~ s/-latest//;
+ # drop arch as it confuses urpmq:
+ $kernel =~ s/\.[^.]*$//;
+ output($cache{version}, $kernel);
+}
+warn ">> GOT '$kernel'\n" if $debug;
+
+# list of modules:
+my @modules = cat_($cache{modules});
+if (!@modules) {
+ @modules = grep { /\.ko/ } `urpmq -l $kernel`;
+ output($cache{modules}, @modules);
+}
+@modules = map { chomp; $_ } @modules;
+
+# list of those module firmwares:
+my %firmwares;
+{
+ my @firmwares = cat_($cache{firmwares});
+ if (!@firmwares) {
+ @firmwares = `urpmf --qf '%name-%version-%release.%arch:%files' /lib/firmware/ |sort -u`;
+ output($cache{firmwares}, @firmwares);
+ }
+ %firmwares = map { chomp; s!^(.*):/lib/firmware/!!; $_ => $1 } @firmwares;
+}
+
+#warn Data::Dumper->Dump([ \@modules ], [ 'modules' ]);
+warn Data::Dumper->Dump([ \%firmwares ], [ 'firmwares' ]) if $debug;
+
+# compute list of module that needs nonfree firmwares:
+my @non_free_fw_drivers;
+foreach (uniq(@modules)) {
+ my ($raw) = m!([^/]*)$!;
+ my $cache = $cache{modinfo} . $raw;
+ my @firmwares = cat_($cache);
+ # speedup: cache might exists but being empty:
+ if (!-e $cache) {
+ #warn ">> run '/sbin/modinfo $_ | grep firmware:'\n" if $debug;
+ @firmwares = `/sbin/modinfo $_ | grep firmware:`;
+ output($cache, @firmwares);
+ }
+ @firmwares = map { chomp; s/^.*:\s+//; $_ } @firmwares;
+ next if !@firmwares;
+ warn Data::Dumper->Dump([ \@firmwares ], [ 'firmware' ]) if $debug;
+ if (any { $firmwares{$_} && $firmwares{$_} =~ /nonfree/ } @firmwares) {
+ push @non_free_fw_drivers, $_;
+ #last;
+ }
+}
+
+# cleaning:
+@non_free_fw_drivers = sort map { s!.*/!!; s!\.ko.*$!!; $_ } @non_free_fw_drivers;
+
+#$Data::Dumper::Perltidy::ARGV = '-it=2 -l 100';
+#warn Dumper(\@non_free_fw_drivers) . "\n";
+
+# Pretty dump:
+my $sep = ' ';
+my $s = $sep . 'qw(' . join(' ', @non_free_fw_drivers) . ')';
+$s =~ s/(.{70}\S*)\s+/$1\n$sep/g;
+
+output('list_firmwares.pm',
+ "# generated using $kernel\n",
+ q(# This list is autogenerated ; Do NOT alter manually.
+
+package list_firmwares;
+
+our @modules_with_nonfree_firmware =
+),
+ $s, ";\n\n1;\n");
+
+
diff --git a/tools/gencryptofiles b/tools/gencryptofiles
deleted file mode 100755
index cfa11ee2b..000000000
--- a/tools/gencryptofiles
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/perl
-
-#- Mandriva cryptographic package hdlist and depslist generation tools.
-#- Copyright (C) 1999-2005 Mandriva (fpons@mandriva.com)
-#-
-#- This program is free software; you can redistribute it and/or modify
-#- it under the terms of the GNU General Public License as published by
-#- the Free Software Foundation; either version 2, or (at your option)
-#- any later version.
-#-
-#- This program is distributed in the hope that it will be useful,
-#- but WITHOUT ANY WARRANTY; without even the implied warranty of
-#- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#- GNU General Public License for more details.
-#-
-#- You should have received a copy of the GNU General Public License
-#- along with this program; if not, write to the Free Software
-#- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-#- usage: gencryptofiles <crypto_dir>
-#- build an hdlist and depslist file for crypto, need rpmtools also.
-
-my %resolver = (
- '/bin/sh' => 'bash',
- '/bin/bash' => 'bash',
- '/usr/bin/perl' => 'perl',
- '/usr/bin/perl5' => 'perl',
-
- 'libBrokenLocale.so' => 'glibc',
- 'libICE.so' => 'XFree86-libs',
- 'libSM.so' => 'XFree86-libs',
- 'libX11.so' => 'XFree86-libs',
- 'libXext.so' => 'XFree86-libs',
- 'libXmu.so' => 'XFree86-libs',
- 'libXpm.so' => 'xpm',
- 'libXt.so' => 'XFree86-libs',
- 'libc.so.6' => 'glibc',
- 'libgdbm.so' => 'gdbm',
- 'libgpm.so' => 'gpm',
- 'libm.so' => 'glibc',
- 'libncurses.so' => 'ncurses',
- 'libnsl.so' => 'glibc',
- 'libpam.so' => 'pam',
- 'libpthread.so' => 'glibc',
- 'libreadline.so' => 'readline',
- 'libstdc++-libc6.1-2.so' => 'libstdc++',
- 'libstdc++.so' => 'libstdc++-compat',
- 'libutil.so' => 'glibc',
- 'libz.so' => 'zlib',
- 'smtpdaemon' => 'postfix',
- );
-
-sub gendepslist_crypto {
- my ($dir) = @_;
- my %depslist;
-
- #- get information about each rpm.
- local *DIR;
- opendir DIR, $dir or die "cannot open directory: $!\n";
- while ($_ = readdir DIR) {
- my ($key) = /(.*)\..*\.rpm$/ or next;
- my ($name) = /(.*)-[^-]*-[^-]*-/;
-
- my $size = `rpm -qp --queryformat="%{SIZE}" $dir/$_`;
- my @filelist = split "\n", `rpm -qpl $dir/$_`;
- my @requires = split "\n", `rpm -qpR $dir/$_`;
-
- $depslist{$key} = {
- key => $key,
- size => $size,
- filelist => \@filelist,
- requires => \@requires,
- deps => [],
- };
-
- foreach (@filelist) {
- $resolver{$_} = $name;
- m|.*/([^/]*)$| and $resolver{$1} = $name;
- }
- }
- close DIR;
-
- #- resolve the dependancies.
- foreach my $pkg (values %depslist) {
- foreach (@{$pkg->{requires}}) {
- $resolver{$_} and push(@{$pkg->{deps}}, $resolver{$_}), next;
- m|^([^\s\(]*)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next;
- m|^.*/([^/\s\(]*)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next;
- m|^([^\s\(]*\.so)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next;
- m|^.*/([^\s\(]*\.so)| and $resolver{$1} and push(@{$pkg->{deps}}, $resolver{$1}), next;
- m|^([\w-]*)(?:\s+.*)$| and push(@{$pkg->{deps}}, $1); #- last and default to package name.
- }
- }
-
- #- build depslist-crypto file.
- local *F;
- open F, ">$dir/depslist-crypto" or die "cannot open depslist-crypto file for writing: $!\n";
- foreach (values %depslist) {
- my %deps;
- @deps{@{$_->{deps}}} = ();
- print F "$_->{key} $_->{size} ", join(" ", keys %deps), "\n";
- }
- close F;
-}
-
-sub main {
- my ($dir) = @_;
- -d $dir or die "usage: gencryptofiles <crypto_dir>\n";
- -x "/usr/bin/genhdlist_cz2" or die "I need rpmtools to work (ie /usr/bin/genhdlist_cz2)\n";
-
- print `genhdlist_cz2 -o $dir/hdlist-crypto.cz2 $dir`;
- gendepslist_crypto($dir);
-}
-
-main(@ARGV);
diff --git a/tools/hd_grub.cgi b/tools/hd_grub.cgi
index a160d4c57..ac55b6eaf 100755
--- a/tools/hd_grub.cgi
+++ b/tools/hd_grub.cgi
@@ -31,7 +31,7 @@ sub menu_lst {
timeout 0
default 0
-title Mandriva Install
+title Mageia Install
root ($hd,$grub_partition_number)
kernel $directory/isolinux/alt0/vmlinuz $default_append $default_acpi $default_vga automatic=method:disk,partition:$hd_linux$partition_number,directory:$directory
@@ -60,7 +60,7 @@ sub print_form {
print
p(),
start_form(-name => 'form', -action => $cgi_name, -method => 'get'),
- ul("Please choose the partition where Mandrivalinux is copied.",
+ ul("Please choose the partition where %s is copied.",
li(popup_menu(-name => "hd", -default => 'hd0',
-values => [ 'hd0' .. 'hd3' ],
-labels => { hd0 => '1st BIOS hard drive (usually hda or sda)',
@@ -94,7 +94,7 @@ sub print_form {
})),
),
p(),
- ul("Please enter the directory containing the Mandrivalinux Distribution (relative to the partition chosen above)",
+ ul("Please enter the directory containing the %s Distribution (relative to the partition chosen above)",
li(textfield(-name => 'directory', -default => '/cooker/i586', size => 40)),
),
p(submit(-name => 'Go')),
diff --git a/tools/i386/busybox b/tools/i386/busybox
deleted file mode 100755
index cebd84853..000000000
--- a/tools/i386/busybox
+++ /dev/null
Binary files differ
diff --git a/tools/ia64/elilo.efi b/tools/ia64/elilo.efi
deleted file mode 100755
index 39151b8e3..000000000
--- a/tools/ia64/elilo.efi
+++ /dev/null
Binary files differ
diff --git a/tools/install-xml-file-list b/tools/install-xml-file-list
index f53f6993b..64c70b9c6 100755
--- a/tools/install-xml-file-list
+++ b/tools/install-xml-file-list
@@ -1,5 +1,6 @@
#!/usr/bin/perl
+use FileHandle;
use MDK::Common;
use XML::Parser;
use Data::Dumper;
@@ -18,10 +19,12 @@ if ($>) {
$ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}";
}
+my $verbose;
#$verbose = 1;
my $initial_dir = cwd();
my $ARCH = arch() =~ /i.86/ ? 'i386' : arch();
+$ARCH =~ s/^(arm).*/$1/;
my $LIB = arch() =~ /x86_64/ ? "lib64" : "lib";
my $base_cpio_options = '-pumd --quiet';
@@ -90,7 +93,7 @@ sub valid_cond {
sub add_to_env {
my ($env, $tag, $attr) = @_;
- my %env = map_each { $::a => +{%$::b} } %$env;
+ my %env = map_each { $::a => +{ %$::b } } %$env;
foreach (keys %$attr) {
!$env{$tag}{$_} or die qq(overriding attribute <$tag $_="$env{$tag}{$_}"> with $_="$attr->{$_}"\n);
$env{$tag}{$_} = $attr->{$_};
@@ -147,17 +150,17 @@ sub collect_needed_libraries {
@to_check = ();
}
}
-sub install_needed_libraries {
+sub install_needed_libraries() {
copy_files('', $DEST, [ keys %needed_libraries ], '', '--dereference');
}
sub collect_needed_perl_files {
- my ($local_rep, $dest, @scripts) = @_;
+ my ($local_rep, @scripts) = @_;
my (%local, %global);
foreach my $script (@scripts) {
foreach (`strace -efile perl -cw -I$local_rep $script 2>&1`) {
- my ($f) = /^open\("(.*?)",.*\)\s*=\s*\d+$/ or next;
+ my ($f) = /^open(?:at\([^,]*, |)"(.*?)",.*\)\s*=\s*\d+$/ or next;
if ($f =~ m!^\Q$local_rep\E/(.*)!) {
$local{$1} = 1;
} elsif (begins_with($f, '/dev/')) {
@@ -229,11 +232,11 @@ sub install {
@l = all_files_rec_($l[0]);
}
@l = grep { !m!/(\.svn|CVS)($|/)! } @l;
- if (my $re = $env->{from}{matching}) {
+ if (my $re = expand_macros($env->{from}{matching})) {
@l = grep { eval $re } @l;
}
- collect_needed_libraries(grep { -x $_ } @l);
+ collect_needed_libraries(grep { -f $_ && -x $_ } @l);
chdir $initial_dir;
@l;
@@ -257,7 +260,9 @@ sub install {
} elsif ($expand eq 'binary') {
$disallow_from_dir->();
- my @PATH = qw(/sbin /bin /usr/bin /usr/sbin /usr/X11R6/bin);
+ my @PATH = qw(/usr/sbin /usr/bin /usr/X11R6/bin);
+ unshift(@PATH, "/bin") unless -l "/bin";
+ unshift(@PATH, "/sbin") unless -l "/sbin";
foreach my $name (map { expand_macros($_) } @text_l) {
my @l = grep { -x $_ } map { "$_/$name" } @PATH;
@l or error("can't find binary $name"), next;
@@ -294,20 +299,28 @@ sub install {
push @files, @l;
}
+ } elsif ($expand eq 'perl-bin') {
+ $disallow_from_dir->();
+ $from_dir = '/usr/LIB/perl5/vendor_perl/';
+ @files = @text_l;
} elsif ($expand eq 'perl') {
$disallow_from_dir->();
- $from_dir = '/usr/lib/perl5/vendor_perl/*';
+ $from_dir = '/usr/share/perl5/vendor_perl/';
@files = @text_l;
} elsif ($expand eq 'main-perl') {
$disallow_from_dir->();
$from_dir = $Config{privlib};
@files = @text_l;
+ } elsif ($expand eq 'main-perl-bin') {
+ $disallow_from_dir->();
+ $from_dir = $Config{archlib};
+ @files = @text_l;
} elsif ($expand =~ /collect-perl-files/) {
my (undef, $local, $to) = split(' ', $expand);
@files = @text_l;
warn "collect-perl-files $local $to @files ($env->{filter}{command})\n";
- my ($local_perl_files, $global_perl_files) = collect_needed_perl_files($local, $to, @files);
+ my ($local_perl_files, $global_perl_files) = collect_needed_perl_files($local, @files);
warn "collect-perl-files gave: ", join(' ', @$local_perl_files), "\n";
# warn " and: ", join(' ', @$global_perl_files), "\n";
copy_and_filter($local =~ m!/! ? $local : "$working_dir/$local", "$DEST$to", $local_perl_files, $env->{filter}, '', '--dereference');
@@ -352,6 +365,7 @@ sub apply_filter {
@l = grep { ! -d $_ } @l or next;
if (my $subst = $filter->{subst}) {
+ warn "running substition $subst \n" if $verbose;
system('perl', '-pi', '-e', $subst, @l);
}
if (my $command = $filter->{command}) {
diff --git a/tools/mdkinst_stage2_tool b/tools/mdkinst_stage2_tool
index c1ef5d151..0019ffc86 100755
--- a/tools/mdkinst_stage2_tool
+++ b/tools/mdkinst_stage2_tool
@@ -36,7 +36,10 @@ if [ $ACTION = "--compress" ]; then
[ -d "$LIVE_DIR" ] || error
echo "Creating $COMPRESSED_IMAGE from $LIVE_DIR"
rm -f $STAGE2_DIR/.room
- mksquashfs $LIVE_DIR $COMPRESSED_IMAGE -all-root -noappend >/dev/null || { echo "mksquashfs failed"; exit 1; }
+ if ! mksquashfs $LIVE_DIR $COMPRESSED_IMAGE -all-root -noappend >/dev/null; then
+ echo "mksquashfs failed"
+ exit 1
+ fi
chmod 755 $COMPRESSED_IMAGE
echo foo > $STAGE2_DIR/.room
if [ -s $STAGE2_DIR/.room ]; then
diff --git a/tools/ppc/README b/tools/ppc/README
deleted file mode 100644
index b752395c2..000000000
--- a/tools/ppc/README
+++ /dev/null
@@ -1,52 +0,0 @@
-Mini-Howto on burning Mandrake PPC Bootable CD's for Apple G3/G4 systems
--------------------------------------------------------------------------
-email: John Buswell <johnb@mandrakesoft.com>
-
-To create a disk image simply use the mkINSTALLCD script provided in this
-directory. The path you provide the script should point to the root directory
-for the CD.
-
-For example after you have built the gi install with /export, simply pass
-/export to the script as the distribution path and a name for the image.
-Once the image is built you can use hmount, humount, hdir, hcd and hattrib
-to modify and inspect the image before you commit it to CD-R.
-
-Before you run the script make sure the CD version of iBoot is in the
-iBoot directory below /export (eg. /export/iBoot), if you want to use some
-other directory then simply modify the script. Beware, HFS is not case
-sensitive, so if you already have an INSTALL file you cannot create install.
-
-Currently iBoot sports two trees, one for the install CD and another for
-regular usage. These will be merged shortly and a simply #define can be used
-in the Makefile to implement one or the other from a single binary.
-
-Enjoy!!
-
-
-Addendum: 3/15/2001 Stew Benedict <sbenedict@mandrakesoft.com>
---------------------------------------------------------------------------
-
-A couple of changes.
-
-I've opted to standardize on yaboot, which is user configurable, so the script
-is modified now to use yaboot.
-
-Secondly, since mkhybrid merged with mkisofs, the hybrid images it creates are
-read-only, so one is unable to mount the image and bless the boot directory for
-booting. Consequently, I've included the binary for mkhybrid-1.12b5.4, which
-does work.
-
-
-Addendum: 3/10/2005 Christiaan Welvaart <cjw@daneel.dyndns.org>
--------------------------------------------------------------------------
-
-10.1 and 10.2 ppc isos were generated with mkcd, with the following options
-added to the mkisofs call:
- -T --netatalk -hfs -probe -part -no-desktop \\
- -hfs-volid "$config->{disc}[$i]->{label}" \\
- -map /usr/share/mkcd/hfs_mapping \\
- -magic /usr/share/mkcd/hfs_magic \\
- -hide '*.MacOS' -hide '*.DOS' \\
- -hide-joliet '*.Unix' -hide-joliet '*.MacOS' \\
- -hide-hfs '*.Unix' -hide-hfs '*.DOS' \\
- '-hfs-bless' $builddir/$i/boot \\
diff --git a/tools/ppc/convert b/tools/ppc/convert
deleted file mode 100755
index a2622c630..000000000
--- a/tools/ppc/convert
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-mv $1.orig $1.Unix
-tr "\n" "\r" < $1.Unix > $1.MacOS
-perl -e '@line = <>; $line = join("\r\n", split(/\n/, join("", @line))); print $line; print "\r\n";' < $1.Unix > $1.DOS
diff --git a/tools/ppc/magic b/tools/ppc/magic
deleted file mode 100755
index 91f4193ea..000000000
--- a/tools/ppc/magic
+++ /dev/null
@@ -1,89 +0,0 @@
-#
-# Example magic file for mkhybrid
-#
-# The "message" for the offset MUST be 4 characters for the CREATOR
-# and 4 characters for the TYPE - white space is optional between them.
-# Any other characters on this line are ignored. Continuation lines (starting
-# with '>') are also ignored i.e. only the initial offset lines are used.
-#
-# The continuation lines are given here, but they do not need to exist.
-
-#
-# James Pearson 20/5/98
-
-# Modified by Christian Walther, 2003/01/17:
-# changed gzip to StuffIt Expander
-# added perl & shell script
-
-# off type test message
-
-# GIF
-0 string GIF8 8BIM GIFf
->4 string 7a \b, version 8%s,
->4 string 9a \b, version 8%s,
->6 leshort >0 %hd x
->8 leshort >0 %hd,
-#>10 byte &0x80 color mapped,
-#>10 byte&0x07 =0x00 2 colors
-#>10 byte&0x07 =0x01 4 colors
-#>10 byte&0x07 =0x02 8 colors
-#>10 byte&0x07 =0x03 16 colors
-#>10 byte&0x07 =0x04 32 colors
-#>10 byte&0x07 =0x05 64 colors
-#>10 byte&0x07 =0x06 128 colors
-#>10 byte&0x07 =0x07 256 colors
-
-# JPEG images
-#
-0 ubeshort 0xffd8 8BIM JPEG image data
-
-# StuffIt
-#
-0 string SIT! SIT!SIT!
-
-# standard unix compress
-0 string \037\235 LZIV ZIVU
->2 byte&0x80 >0 block compressed
->2 byte&0x1f x %d bits
-
-# gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
-0 string \037\213 Gzip SITx gzip compressed data
->2 byte <8 \b, reserved method,
->2 byte 8 \b, deflated,
->3 byte &0x01 ASCII,
->3 byte &0x02 continuation,
->3 byte &0x04 extra field,
->3 byte &0x08 original filename,
->3 byte &0x10 comment,
->3 byte &0x20 encrypted,
->4 ledate x last modified: %s,
->8 byte 2 max compression,
->8 byte 4 max speed,
->9 byte =0x00 os: MS-DOS
->9 byte =0x01 os: Amiga
->9 byte =0x02 os: VMS
->9 byte =0x03 os: Unix
->9 byte =0x05 os: Atari
->9 byte =0x06 os: OS/2
->9 byte =0x07 os: MacOS
->9 byte =0x0A os: Tops/20
->9 byte =0x0B os: Win/32
-
-# Postscript
-0 string %! ASPSTEXT
->2 string PS-Adobe- conforming
->>11 string >\0 at level %.3s
->>>15 string EPS - type %s
->>>15 string Query - type %s
->>>15 string ExitServer - type %s
-# Some PCs have the annoying habit of adding a ^D as a document separator
-0 string \004%! ASPS TEXT PostScript document text
->3 string PS-Adobe- conforming
->>12 string >\0 at level %.3s
->>>16 string EPS - type %s
->>>16 string Query - type %s
->>>16 string ExitServer - type %s
-
-# scripts
-0 string #!/usr/bin/perl McPL TEXT
-0 string #!/bin/sh ttxt TEXT
diff --git a/tools/ppc/mapping b/tools/ppc/mapping
deleted file mode 100755
index a84b0019d..000000000
--- a/tools/ppc/mapping
+++ /dev/null
@@ -1,36 +0,0 @@
-# Example filename mapping file
-# Modified by Christian Walther, 2003/01/17
-#
-# EXTN XLate CREATOR TYPE Comment
-COPYING Ascii 'ttxt' 'ttro' "Text File"
-CREDITS Ascii 'ttxt' 'ttro' "Text File"
-README Ascii 'ttxt' 'ttro' "Text File"
-RPM-PGP-KEY Ascii 'ttxt' 'ttro' "Text File"
-VERSION Ascii 'ttxt' 'ttro' "Text File"
-.gz Raw 'SITx' 'Gzip' "GZip Compressed File"
-.sit Raw 'SIT!' 'SITD' "StuffIt Archive"
-.hqx Ascii 'SITx' 'TEXT' "BinHex Encoded File"
-.html Ascii 'MOSS' 'TEXT' "HTML File"
-.htm Ascii 'MOSS' 'TEXT' "HTML File"
-.gif Raw 'ogle' 'GIFf' "GIF Image"
-.jpg Raw 'ogle' 'JPEG' "JPEG Image"
-.tif Raw 'ogle' 'TIFF' "TIFF Image"
-.bz2 Raw 'SITx' 'Bzp2' "BZip2 Compressed File"
-.png Raw 'ogle' 'PNGf' "PNG Image"
-.rpm Raw 'mRPM' 'RPMf' "RPM Software Package"
-.pl Ascii 'McPL' 'TEXT' "Perl Script"
-.pl Ascii 'McPL' 'TEXT' "Perl Module"
-.doc Raw 'MSWD' 'WDBN' "Word file"
-.mov Raw 'TVOD' 'MooV' "QuickTime Movie"
-.txt Ascii 'ttxt' 'TEXT' "Text File"
-.conf Ascii 'ttxt' 'TEXT' "config file"
-.tbxi Raw 'chrp' 'tbxi' "Macintosh Toolbox ROM file"
-.sea Raw 'aust' 'APPL' "Self Expanding Archive"
-.mov Raw 'TVOD' 'MooV' "QuickTime Movie"
-.bin Raw 'ddsk' 'DDim' "Floppy or ramdisk image"
-.img Raw 'ddsk' 'DDim' "Floppy or ramdisk image"
-.b Raw 'UNIX' 'tbxi' "bootstrap"
-yaboot Raw 'UNIX' 'boot' "bootstrap"
-vmlinux Raw 'UNIX' 'boot' "bootstrap"
-.conf Raw 'UNIX' 'conf' "bootstrap"
-* Raw '????' '????' "Unknown"
diff --git a/tools/serial_probe/serial.c b/tools/serial_probe/serial.c
index c84cbcff5..5159c3dae 100644
--- a/tools/serial_probe/serial.c
+++ b/tools/serial_probe/serial.c
@@ -663,7 +663,6 @@ static int parse_pnp_string( unsigned char *pnp_id_string, int pnp_len,
unsigned char *endfield;
unsigned char *temppos;
unsigned char *pnp_string;
- unsigned char end_char;
int no_more_extensions=0;
int stage;
@@ -719,7 +718,6 @@ static int parse_pnp_string( unsigned char *pnp_id_string, int pnp_len,
/* setup end character we are looking for based on the start character */
if (start == p2) {
pnp_id->xlate_6bit = 1;
- end_char = EndPnP2;
/* we need to xlate data in PnP fields */
/* remember to skip the revision fields (bytes 1 and 2 after start) */
temppos=start;
@@ -734,7 +732,6 @@ static int parse_pnp_string( unsigned char *pnp_id_string, int pnp_len,
}
} else {
pnp_id->xlate_6bit = 0;
- end_char = EndPnP1;
}
/* move everything before the start of the PnP block */
@@ -881,7 +878,6 @@ struct device *serialProbe(enum deviceClass probeClass, int probeFlags,
int fd;
int temp;
int pnp_strlen;
- int devicetype=-1;
unsigned char pnp_string[100];
char port[20];
struct termios origattr;
@@ -918,19 +914,11 @@ struct device *serialProbe(enum deviceClass probeClass, int probeFlags,
maj = major(sb.st_rdev);
if (maj != 4 && (maj < 136 || maj > 143)) {
if (ioctl (fd, TIOCLINUX, &twelve) < 0) {
- #ifdef __powerpc__
- // we could have gotten an error for another reason - like EINVAL
- // skipping ttyS0 on PPC - which is where most modems reside
- if (errno == ENOTTY) {
- #endif
if (ioctl (fd, TIOCGSERIAL, &si) >= 0) {
if (si.line > 0) {
console = 1 << si.line;
} else {
console = 0;
- #ifdef __powerpc__
- }
- #endif
}
} else console = 0;
}
@@ -986,7 +974,6 @@ struct device *serialProbe(enum deviceClass probeClass, int probeFlags,
/* try twiddling RS232 control lines and see if it talks to us */
- devicetype=-1;
pnp_strlen = 0;
if (attempt_pnp_retrieve( fd, pnp_string, &pnp_strlen,
sizeof(pnp_string) - 1 ) == PNP_COM_FATAL)
diff --git a/tools/x86_64/busybox b/tools/x86_64/busybox
deleted file mode 100755
index 07df11980..000000000
--- a/tools/x86_64/busybox
+++ /dev/null
Binary files differ