From 959a1722faec6b30510c788c49dcb4b7cb96d1e0 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Fri, 20 Feb 2004 00:03:26 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'V10_0_21mdk'. --- rescue/.cvsignore | 2 - rescue/Makefile | 16 - rescue/aliases | 4 - rescue/devices.pl | 53 ---- rescue/dirs | 8 - rescue/drvinst | 87 ------ rescue/guessmounts | 107 ------- rescue/install_bootloader | 47 --- rescue/kernel_read_part.c | 26 -- rescue/list | 141 --------- rescue/list.alpha | 1 - rescue/list.i386 | 14 - rescue/list.ia64 | 8 - rescue/list.ppc | 9 - rescue/list.sparc | 2 - rescue/list.x86_64 | 10 - rescue/lsparts | 127 -------- rescue/make_rescue_img | 133 -------- rescue/rescue-doc | 61 ---- rescue/restore_ms_boot | 108 ------- rescue/tree/bin/insmod | 2 - rescue/tree/bin/login | 2 - rescue/tree/boot/grub/menu.lst | 5 - rescue/tree/etc/fstab | 4 - rescue/tree/etc/group | 1 - rescue/tree/etc/host.conf | 2 - rescue/tree/etc/hosts | 1 - rescue/tree/etc/inittab | 14 - rescue/tree/etc/issue | 27 -- rescue/tree/etc/oem | 674 ---------------------------------------- rescue/tree/etc/oem-all | 676 ----------------------------------------- rescue/tree/etc/passwd | 3 - rescue/tree/etc/profile | 24 -- rescue/tree/etc/rc.reboot | 8 - rescue/tree/etc/rc.sysinit | 48 --- rescue/tree/etc/resolv.conf | 2 - rescue/tree/sbin/fakeshutdown | 39 --- rescue/tree/sbin/modprobe | 56 ---- rescue/tree/usr/lib/CVS. | 0 39 files changed, 2552 deletions(-) delete mode 100644 rescue/.cvsignore delete mode 100644 rescue/Makefile delete mode 100644 rescue/aliases delete mode 100644 rescue/devices.pl delete mode 100644 rescue/dirs delete mode 100755 rescue/drvinst delete mode 100755 rescue/guessmounts delete mode 100755 rescue/install_bootloader delete mode 100644 rescue/kernel_read_part.c delete mode 100644 rescue/list delete mode 100644 rescue/list.alpha delete mode 100644 rescue/list.i386 delete mode 100644 rescue/list.ia64 delete mode 100644 rescue/list.ppc delete mode 100644 rescue/list.sparc delete mode 100644 rescue/list.x86_64 delete mode 100755 rescue/lsparts delete mode 100755 rescue/make_rescue_img delete mode 100755 rescue/rescue-doc delete mode 100755 rescue/restore_ms_boot delete mode 100755 rescue/tree/bin/insmod delete mode 100755 rescue/tree/bin/login delete mode 100644 rescue/tree/boot/grub/menu.lst delete mode 100644 rescue/tree/etc/fstab delete mode 100644 rescue/tree/etc/group delete mode 100644 rescue/tree/etc/host.conf delete mode 100644 rescue/tree/etc/hosts delete mode 100644 rescue/tree/etc/inittab delete mode 100644 rescue/tree/etc/issue delete mode 100755 rescue/tree/etc/oem delete mode 100755 rescue/tree/etc/oem-all delete mode 100644 rescue/tree/etc/passwd delete mode 100644 rescue/tree/etc/profile delete mode 100755 rescue/tree/etc/rc.reboot delete mode 100755 rescue/tree/etc/rc.sysinit delete mode 100644 rescue/tree/etc/resolv.conf delete mode 100755 rescue/tree/sbin/fakeshutdown delete mode 100755 rescue/tree/sbin/modprobe delete mode 100644 rescue/tree/usr/lib/CVS. (limited to 'rescue') diff --git a/rescue/.cvsignore b/rescue/.cvsignore deleted file mode 100644 index c1a06f76b..000000000 --- a/rescue/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -rescue_stage2.bz2 -kernel_read_part diff --git a/rescue/Makefile b/rescue/Makefile deleted file mode 100644 index bbc0d7dda..000000000 --- a/rescue/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -ARCH := $(patsubst i%86,i386,$(shell uname -m)) -ARCH := $(patsubst sparc%,sparc,$(ARCH)) - - -ROOTDEST = /export - -all: rescue_stage2.bz2 - -install: rescue_stage2.bz2 - cp -f $< $(ROOTDEST)/Mandrake/base - -rescue_stage2.bz2: kernel_read_part list list.$(ARCH) drvinst guessmounts lsparts rescue-doc make_rescue_img - ./make_rescue_img - -clean: - rm -f rescue_stage2.bz2 kernel_read_part diff --git a/rescue/aliases b/rescue/aliases deleted file mode 100644 index eae42f0ce..000000000 --- a/rescue/aliases +++ /dev/null @@ -1,4 +0,0 @@ -/bin/zcat gzip -/bin/gunzip gzip -/bin/rpm /usr/bin/rpm-dynamic -/bin/vi vim-minimal diff --git a/rescue/devices.pl b/rescue/devices.pl deleted file mode 100644 index 7159a5f90..000000000 --- a/rescue/devices.pl +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/perl - -@ARGV == 1 && chdir $ARGV[0] or die "usage: devices.pl \n"; - -if ($>) { $sudo = "sudo"; $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; } - -foreach () { - chomp; - my ($typ, $maj, $min, @l) = split; - foreach (@l) { - my @l2 = do { - if (my ($prefix, $ini, $end) = /(.*)(\d+)-(\d+)$/) { - map { "$prefix$_" } $ini .. $end; - } else { - $_; - } - }; - system("$sudo mknod $_ $typ $maj " . $min++) foreach @l2; - } -} - -__DATA__ -c 5 1 console -b 2 0 fd0-1 -c 1 2 kmem -b 7 0 loop0-15 -c 1 1 mem -c 1 3 null -c 1 4 port -b 1 1 ram -b 1 0 ram0-19 -b 1 0 ramdisk -c 1 8 random -b 11 0 scd0-7 -c 0 0 stderr -c 0 0 stdin -c 0 0 stdout -c 5 0 tty -c 4 0 tty0-9 -c 4 64 ttyS0-3 -c 1 9 urandom -c 1 5 zero -b 3 0 hda hda1-16 -b 3 64 hdb hdb1-16 -b 22 0 hdc hdc1-16 -b 22 64 hdd hdd1-16 -b 33 0 hde hde1-16 -b 33 64 hdf hdf1-16 -b 34 0 hdg hdg1-16 -b 34 64 hdh hdh1-16 -b 8 0 sda sda1-15 sdb sdb1-15 sdc sdc1-15 sdd sdd1-15 sde sde1-15 sdf sdf1-15 sdg sdg1-15 sdh sdh1-15 -c 10 144 nvram -c 9 0 st0-15 diff --git a/rescue/dirs b/rescue/dirs deleted file mode 100644 index cb5d6a250..000000000 --- a/rescue/dirs +++ /dev/null @@ -1,8 +0,0 @@ -/mnt/cdrom -/mnt/disk -/mnt/floppy -/lib -/tmp -/modules -/proc -/dev diff --git a/rescue/drvinst b/rescue/drvinst deleted file mode 100755 index 9f533918e..000000000 --- a/rescue/drvinst +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/perl - -# -# Guillaume Cottenceau (gc@mandrakesoft.com) -# -# Copyright 2000 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -local $_ = join '', @ARGV; - -"@ARGV" =~ /-h/ and die "usage: drivers_install [drivertype1 drivertype2..]\n"; - - -sub pci_probe { - my @l; - foreach (`/usr/bin/lspcidrake -v`) { - push @l, do { - if (/^(\S+)\s*: (.+) \[([^\]]+)/) { - { driver => $1, description => $2, type => $3 }; - } elsif (/^(\S+)\s*: (.+)/) { - { driver => $1, description => $2, type => 'NOT_DEFINED' }; - } else { - next; - } - }; - } - @l; -} - -sub install_module($$) { - my ($driver, $descr) = @_; - print "Installing driver $driver (for \"$descr\")\n"; - system("/sbin/modprobe", $driver) and print "\tfailed\n"; - my $already_usb if 0; - if (!$already_usb && $driver =~ /usb/) { - $already_usb = 1; - print "Installing driver usbkdb\n"; - system('/sbin/modprobe', 'usbkbd') and print "\tfailed\n"; - print "Installing driver keybdev\n"; - system('/sbin/modprobe', 'keybdev') and print "\tfailed\n"; - } -} - - -#- start -foreach $card (pci_probe()) { - $card->{type} eq "DISPLAY_VGA" and next; - $card->{driver} eq "unknown" and next; - $card->{driver} =~ "Card:" and next; - - if (!@ARGV || grep { $card->{type} =~ /$_/i } @ARGV) { - install_module($card->{driver}, $card->{description}); - } -} - - - -#------------------------------------------------- -#- $Log$ -#- Revision 1.6 2002/09/10 10:07:23 gc -#- drvinst is broken when we don't -v -#- -#- Revision 1.5 2001/09/27 16:00:05 gc -#- don't install usb keyboard drivers more than once -#- -#- Revision 1.4 2001/09/27 15:57:55 gc -#- try to fix usb keyboards -#- -#- Revision 1.3 2001/03/29 11:33:28 gc -#- test for "Card:" and not install, some videoboards are not reported as DISPLAY_VGA :-( -#- -#- Revision 1.2 2001/02/12 18:42:17 uid553 -#- pixelization -#- -#- Revision 1.1 2001/02/12 14:31:10 uid535 -#- - add lspci, lspcidrake, vim-minimal -#- - better /etc/issue -#- - better PS1 -#- - write embryonic tool (installation of detected drivers according to pci cards) -#- diff --git a/rescue/guessmounts b/rescue/guessmounts deleted file mode 100755 index b879ca13f..000000000 --- a/rescue/guessmounts +++ /dev/null @@ -1,107 +0,0 @@ -#!/usr/bin/perl -# -# Guillaume Cottenceau (gc@mandrakesoft.com) -# -# Copyright 2001 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# - - -sub cat_ { local *F; open F, $_[0] or return; my @l = ; wantarray() ? @l : join '', @l } -sub chomp_ { my @l = map { my $l = $_; chomp $l; $l } @_; wantarray() ? @l : $l[0] } - - -my @mounts = cat_('/proc/mounts'); -grep { (split)[1] =~ m|^/mnt$| } @mounts and print("/mnt is already mounted (according to /proc/mounts)\n"), exit 0; - - -system('drvinst'); #- class2text seems broken, I can't detect easily only modules for SCSI storage :-( - -print "\nPlease wait, trying to find your root device...\n"; - -my $target = '/mnt'; --d $target || mkdir($target) or die "couldn't create $target\n"; - - -my (undef, undef, @parts) = cat_('/proc/partitions'); - -my @fstab; -my $root; - -M: foreach (@parts) { - my $dev = (split)[3] or next; - $dev = "/dev/$dev"; - - foreach my $fs ('ext3', 'ext2', 'reiserfs', 'xfs', 'jfs') { - my $where = $target; - if (!system("mount -t $fs $dev $where 2>/dev/null")) { - if (-r "$where/etc/fstab" && -r "$where/etc/mandrake-release") { - print "=> found a Mandrake root partition on $dev\n=> type $fs, version `", - chomp_(cat_ "$where/etc/mandrake-release"), - "'\n"; - @fstab = cat_("$where/etc/fstab"); - $root = $dev; - last M; - } else { - system('umount', $where) and die "error unmounting $where\n"; - } - last; - } - } -} - -if ($root) { - print "\nMounting other partitions from fstab on $target...\n"; - foreach (@fstab) { - next if /^\s*#/; - my ($dev, $where, $type, $opts) = split; - next if (!$type || $dev eq 'none' || $opts =~ /noauto/ || - $type =~ /^(supermount|swap|nfs)$/ || - $where eq '/' || - $where =~ m,proc|cdrom|floppy|/mnt/zip, - ); - $opts = join(',', grep { !/codepage=/ && !/iocharset/ } split(',', $opts)); #- vfat opts, we don't have the modules in rescue - $where = "$target$where"; - -d $where || mkdir($where) or die "couldn't create $where\n"; - print "\t$dev on $where type $type\n"; - system("mount -t $type $dev $where -o $opts"); - system("cp -f /etc/mtab $target/etc/mtab"); #- to allow a nice chrooted "mount" or "df" - } - print "\nYour system is ready on $target.\n\n"; -} else { - die "Could not find your root device :-(.\n"; -} - - - -#------------------------------------------------- -#- $Log$ -#- Revision 1.6 2003/08/03 21:50:06 prigaux -#- - copy /etc/mtab to /mnt/etc/mtab to have a nice chrooted "mount" or "df" -#- - some perl_checker compliance -#- -#- Revision 1.5 2001/11/05 17:03:54 gc -#- honours hash in /etc/fstab to disable lines -#- -#- Revision 1.4 2001/10/24 22:34:01 gc -#- - add a GUI to the rescue -#- - provide guessmounts with better efficiency and output, go to console, and reboot -#- - provide install_bootloader which runs lilo from /mnt if it seems safe -#- - add lsparts to rescue, which prints partitions with detected types -#- -#- Revision 1.3 2001/09/07 18:22:54 gc -#- ext3, xfs, jfs -#- -#- Revision 1.2 2001/06/10 22:41:21 prigaux -#- pixelization (tested!) -#- -#- Revision 1.1 2001/06/10 21:08:33 gc -#- - add 'guessmounts' that mimics RH's detecting of partitions when rescue starts -#- -#- diff --git a/rescue/install_bootloader b/rescue/install_bootloader deleted file mode 100755 index 8bbd6886c..000000000 --- a/rescue/install_bootloader +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/perl -# -# Guillaume Cottenceau (gc@mandrakesoft.com) -# -# Copyright 2001 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# - - -sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = ; wantarray ? @l : join '', @l } -sub chomp_ { my @l = map { my $l = $_; chomp $l; $l } @_; wantarray ? @l : $l[0] } - -system('guessmounts') and die; - -#- this is dangerous, try to take care -my @mounts = cat_('/proc/mounts'); -grep { (split)[1] =~ m|^/mnt$| } @mounts or die "Your root device isn't mounted on /mnt (according to /proc/mounts)\n"; --x '/mnt/sbin/lilo' or die "/mnt/sbin/lilo isn't executable, exiting.\n"; --r '/mnt/etc/lilo.conf' or die "/mnt/etc/lilo.conf isn't readable, exiting.\n"; -cat_('/mnt/etc/mandrake-release') =~ /Mandrake/ or die "/mnt/etc/mandrake-release doesn't contain 'Mandrake', exiting.\n"; - -print "About to re-install Boot Loader of following Mandrake distro:\n\t", - chomp_(cat_ "/mnt/etc/mandrake-release"), - "\n=> ok? "; - =~ /^n/i and exit 0; - -exec '/mnt/sbin/lilo', '-r', '/mnt'; - -die "error: couldn't exec /mnt/sbin/lilo.\n"; - - -#------------------------------------------------- -#- $Log$ -#- Revision 1.1 2001/10/24 22:34:01 gc -#- - add a GUI to the rescue -#- - provide guessmounts with better efficiency and output, go to console, and reboot -#- - provide install_bootloader which runs lilo from /mnt if it seems safe -#- - add lsparts to rescue, which prints partitions with detected types -#- -#- -#- diff --git a/rescue/kernel_read_part.c b/rescue/kernel_read_part.c deleted file mode 100644 index 279dfe787..000000000 --- a/rescue/kernel_read_part.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include - -void die(char *msg) -{ - perror(msg); - exit(1); -} - -void kernel_read(char *dev) -{ - int fd; - if ((fd = open(dev, O_RDONLY)) == -1) die("can't open device"); - ioctl(fd, BLKRRPART, 0); - close(fd); -} - -int main(int argc, char **argv) -{ - if (argc != 2) { - fprintf(stderr, "usage: kernel_read_part \n"); - exit(1); - } - kernel_read(argv[1]); -} diff --git a/rescue/list b/rescue/list deleted file mode 100644 index 13ac32c3a..000000000 --- a/rescue/list +++ /dev/null @@ -1,141 +0,0 @@ -/bin/bash -/bin/cat -/bin/chmod -/bin/chown -/bin/cp -/bin/date -/bin/dd -/bin/df -/bin/dmesg -/bin/false -/bin/grep -/bin/gzip -/usr/bin/bzip2 -/usr/bin/bunzip2 -/usr/bin/bzcat -/usr/bin/packdrake -/usr/bin/parsehdlist -/bin/hostname -/bin/kill -/bin/ln -/bin/loadkeys -/usr/bin/du -/usr/lib/kbd -/bin/ls -/bin/mkdir -/bin/mknod -/bin/mount -/bin/mount -/bin/mv -/bin/ping -/bin/ps -/bin/pwd -/bin/rm -/bin/rmdir -/bin/setserial -/sbin/lsmod -/sbin/lsmod.old -/bin/cpio -/usr/bin/diff -/bin/sh -/bin/sleep -/bin/sync -/bin/touch -/bin/tar -/bin/true -/bin/umount -/etc/inputrc -/etc/termcap -/LIB/libnss_files-* -/LIB/libnss_files.so.2 -/sbin/debugfs -/sbin/e2fsck -/sbin/fdisk -/sbin/fsck.ext2 -/sbin/fsck.ext3 -/sbin/halt -/sbin/ifconfig -/sbin/init -/sbin/insmod -/sbin/insmod.old -/sbin/ldconfig -/sbin/mingetty -/sbin/mkdosfs -/sbin/mkfs.ext2 -/sbin/reboot -/sbin/rmmod -/sbin/rmmod.old -/sbin/shutdown -/usr/bin/strace -/sbin/route -/sbin/mkswap -/sbin/swapoff -/sbin/swapon -/sbin/tune2fs -/sbin/update -/usr/bin/cmp -/usr/bin/cut -/usr/bin/eject -/usr/bin/fdformat -/usr/bin/file -/usr/bin/find -/usr/bin/ftp -/usr/bin/head -/usr/bin/hexedit -/usr/bin/less -/usr/bin/less.bin -/usr/bin/loadkeys -/usr/bin/reset -/usr/bin/split -/usr/bin/tail -/usr/bin/tee -/usr/bin/telnet -/usr/bin/tset -/usr/sbin/chroot -/usr/sbin/parted -/usr/share/misc/file/magic -/usr/share/terminfo/l/linux -/var/run/utmp -/sbin/killall5 -/usr/bin/perl -/usr/bin/perl5 -/usr/bin/perlPERL_VERSION -/bin/sort -/usr/bin/md5sum -/etc/protocols -/etc/services -/bin/rpm -/sbin/mkraid -/usr/lib/rpm/rpmrc -/usr/lib/rpm/macros -/usr/lib/rpm/rpmpopt-* -/usr/bin/rpm2cpio -/usr/bin/rpmdb -/usr/lib/rpm/rpmd -/usr/bin/rpme -/usr/lib/rpm/rpme -/usr/bin/rpmi -/usr/lib/rpm/rpmi -/usr/bin/rpmu -/usr/lib/rpm/rpmu -/usr/bin/rpmquery -/usr/lib/rpm/rpmq -/usr/bin/rpmverify -/usr/lib/rpm/rpmv -/usr/lib/perl5/PERL_VERSION/strict.pm -/usr/lib/perl5/PERL_VERSION/vars.pm -/usr/lib/perl5/PERL_VERSION/warnings/register.pm -/usr/lib/perl5/PERL_VERSION/warnings.pm -/usr/lib/perl5/PERL_VERSION/Carp.pm -/usr/lib/perl5/PERL_VERSION/Exporter.pm -/usr/lib/perl5/vendor_perl/5.8.2/packdrake.pm -/usr/bin/lspci -/usr/share/pci.ids -/usr/bin/lspcidrake -/usr/share/ldetect-lst/pcitable -/usr/share/ldetect-lst/usbtable -/bin/vim-minimal -/LIB/libnss_dns.so.2 -/LIB/libresolv.so.2 -/bin/mt -/sbin/stinit diff --git a/rescue/list.alpha b/rescue/list.alpha deleted file mode 100644 index af48e87a9..000000000 --- a/rescue/list.alpha +++ /dev/null @@ -1 +0,0 @@ -/sbin/sfdisk diff --git a/rescue/list.i386 b/rescue/list.i386 deleted file mode 100644 index 8f9dea605..000000000 --- a/rescue/list.i386 +++ /dev/null @@ -1,14 +0,0 @@ -/usr/bin/gpart -/sbin/resize2fs -/sbin/resize_reiserfs -/sbin/rescuept -/usr/sbin/grub -/usr/sbin/grub-install -/sbin/reiserfsck -/sbin/fsck.jfs -/sbin/fsck.xfs -/sbin/xfs_repair -/sbin/sfdisk -/boot/grub/stage[12] -/usr/lib/perl5/PERL_VERSION/i386-linux-thread-multi/CORE/libperl.so -/usr/lib/extipl/aldebaran.bin diff --git a/rescue/list.ia64 b/rescue/list.ia64 deleted file mode 100644 index dbce6bb33..000000000 --- a/rescue/list.ia64 +++ /dev/null @@ -1,8 +0,0 @@ -/sbin/resize2fs -/sbin/mkreiserfs -/sbin/reiserfsck -/usr/sbin/fsck.xfs -/usr/sbin/xfs_repair -/sbin/sfdisk -/usr/sbin/efibootmgr -/usr/lib/perl5/PERL_VERSION/ia64-linux-thread-multi/CORE/libperl.so diff --git a/rescue/list.ppc b/rescue/list.ppc deleted file mode 100644 index d81d4a268..000000000 --- a/rescue/list.ppc +++ /dev/null @@ -1,9 +0,0 @@ -/usr/lib/perl5/PERL_VERSION/ppc-linux-thread-multi/CORE/libperl.so -/sbin/pdisk -/usr/sbin/ybin -/usr/sbin/mkofboot -/usr/lib/yaboot/ofboot -/usr/lib/yaboot/yaboot -/usr/sbin/ofpath -/sbin/nvsetenv -/usr/bin/hformat diff --git a/rescue/list.sparc b/rescue/list.sparc deleted file mode 100644 index 2eff55cec..000000000 --- a/rescue/list.sparc +++ /dev/null @@ -1,2 +0,0 @@ -/sbin/silo -/sbin/sfdisk diff --git a/rescue/list.x86_64 b/rescue/list.x86_64 deleted file mode 100644 index 9cef38a4f..000000000 --- a/rescue/list.x86_64 +++ /dev/null @@ -1,10 +0,0 @@ -/usr/bin/gpart -/sbin/resize2fs -/sbin/resize_reiserfs -/sbin/rescuept -/sbin/mkreiserfs -/sbin/reiserfsck -/sbin/fsck.xfs -/sbin/xfs_repair -/sbin/sfdisk -/usr/lib/perl5/PERL_VERSION/x86_64-linux-thread-multi/CORE/libperl.so diff --git a/rescue/lsparts b/rescue/lsparts deleted file mode 100755 index 2346ee134..000000000 --- a/rescue/lsparts +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/perl -# -# Main author Pascal Rigaux (pixel@mandrakesoft.com) -# Put together by Guillaume Cottenceau (gc@mandrakesoft.com) -# -# Copyright 1999,2000,2001 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# -# This code is extracted from DrakX, the Mandrake Linux graphical installer. -# http://www.mandrakelinux.com/drakx/ -# Open development rulz, find CVS here: -# http://www.mandrakelinux.com/cgi-bin/cvsweb.cgi/gi/ -# -# Detects partition types using signatures -# - -sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = ; wantarray ? @l : join '', @l } - -sub arch() { - my $t = `uname -m`; - chomp $t; - $t; -} - -# from Perl Cookbook / Pleac -# http://pleac.sourceforge.net/pleac_perl/numbers.html#AEN121 -sub commify { - my $text = reverse $_[0]; - $text =~ s/(\d\d\d)(?=\d)(?!\d*\.)/$1,/g; - return scalar reverse $text; -} - -my @partitions_signatures = ( - [ 0x8e, 0, "HM\1\0" ], - [ 0x83, 0x438, "\x53\xEF" ], - [ 0x183, 0x10034, "ReIsErFs" ], - [ 0x183, 0x10034, "ReIsEr2Fs" ], - [ 0x283, 0, 'XFSB', 0x200, 'XAGF', 0x400, 'XAGI' ], - [ 0x383, 0x8000, 'JFS1' ], - [ 0x82, 4086, "SWAP-SPACE" ], - [ 0x82, 4086, "SWAPSPACE2" ], - [ 0x7, 0x1FE, "\x55\xAA", 0x3, "NTFS" ], - [ 0xc, 0x1FE, "\x55\xAA", 0x52, "FAT32" ], -arch() !~ /^sparc/ ? ( - [ 0x6, 0x1FE, "\x55\xAA", 0x36, "FAT" ], -) : (), -); - -sub typeFromMagic { - my $f = shift; - local *F; sysopen F, $f, 0 or return; - - my $tmp; - M: foreach (@partitions_signatures) { - my ($name, @l) = @$_; - while (@l) { - my ($offset, $signature) = splice(@l, 0, 2); - sysseek(F, $offset, 0) or next M; - sysread(F, $tmp, length $signature); - $tmp eq $signature or next M; - } - return $name; - } - return -1; -} - -my %type2name = ( - 0x1 => 'DOS 12-bit FAT', - 0x4 => 'DOS 16-bit FAT (up to 32M)', - 0x5 => 'DOS 3.3+ Extended Partition', - 0x6 => 'DOS FAT16', - 0x7 => 'NTFS (or HPFS)', - 0xb => 'Win98 FAT32', - 0xc => 'Win98 FAT32, LBA-mapped', - 0xe => 'Win95: DOS 16-bit FAT, LBA-mapped', - 0xf => 'Win95: Extended partition, LBA-mapped', - 0x82 => 'Linux Swap', - 0x83 => 'Ext2', - 0x183 => 'ReiserFS', - 0x283 => 'XFS', - 0x383 => 'JFS', - 0x85 => 'Linux extended partition', - 0x87 => 'NTFS volume set', - 0x8e => 'Linux LVM', - -1 => 'unknown' - ); - - -my $params = join '', @ARGV; - -$params =~ /-h/ and die "usage: lsparts [-v]\n"; -$params =~ /-v/ and $verbose = 1; - - -my (undef, undef, @parts) = cat_('/proc/partitions'); - -P: foreach (@parts) { - my (undef, undef, $blocks, $dev) = split or next; - my %skip_conditions = ( - "Skipping <$dev> because too little blocks ($blocks)" => ($blocks <= 1), - "Skipping <$dev> because doesn't end with a number (e.g. seems to not be a partition)" => ($dev !~ /\d$/), - ); - $skip_conditions{$_} and ($verbose and print(STDERR $_, "\n")), next P foreach keys %skip_conditions; - my $type = typeFromMagic("/dev/$dev"); - $type and printf "$dev: %6s Mbytes, type <0x%0x> (%s)\n", commify($blocks >> 10), $type, $type2name{$type}; -} - - -#------------------------------------------------- -#- $Log$ -#- Revision 1.2 2002/01/10 21:28:15 gc -#- better looking output of type of partition (%x => %0x) -#- -#- Revision 1.1 2001/10/24 22:34:01 gc -#- - add a GUI to the rescue -#- - provide guessmounts with better efficiency and output, go to console, and reboot -#- - provide install_bootloader which runs lilo from /mnt if it seems safe -#- - add lsparts to rescue, which prints partitions with detected types -#- -# diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img deleted file mode 100755 index 8afbb4d4e..000000000 --- a/rescue/make_rescue_img +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/perl - -use MDK::Common; -use lib "../perl-install"; -use keyboard; - -$lib = (arch() =~ /x86_64/ ? "lib64" : "lib"); -$tmp = "/tmp/rescue_tmp"; -$mnt = "/tmp/rescue_stage2_img"; -$mke2fs = "/sbin/mke2fs -q -m 0 -F -s 1"; -$rescue = "rescue_stage2"; - -if ($>) { - $sudo = "sudo"; - $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; -} - -BEGIN { undef *_; } -sub __ { print @_, "\n"; system(@_); } -sub _ { __ @_; $? and die; } - -sub install_raw { - s|^/|| foreach @_; - _ "tar c -C / @_ | tar x -C $tmp" if @_; -} -sub install_deref { - s|^/|| foreach @_; - _ "tar c -C / --dereference @_ | tar x -C $tmp" if @_; -} - -sub install_l { - my @l = @_; - - @l = uniq(map { chomp_($_) } @l); - push @l, - `ldd @l 2>/dev/null | grep "=>" | perl -pe 's/.*=> //; s/ .*//; s,^/lib/.*?/,/lib/,'`; - - my ($deref, $raw) = partition { /lib.*\.so/ || readlink("/$_") =~ m|/etc/alternatives| } uniq(map { chomp_($_) } @l); - install_raw(@$raw); - install_deref(@$deref); -} - -sub installown($$) { - my ($own, $dir) = @_; - return if -e "$tmp$dir$own"; - mkdir_p("$tmp$dir"); - _ "cp -a $own $tmp$dir"; -} - -_ "$sudo rm -rf $tmp" if -e $tmp; -_ "mkdir $tmp"; -_ 'find . -name "*~" | xargs rm -f'; -foreach (cat_("dirs")) { - chomp; - mkdir_p("$tmp$_"); -} -_ "cp -a tree/* $tmp"; -_ "find $tmp -name 'CVS*' | xargs rm -rf"; -_ "perl devices.pl $tmp/dev"; - -install_raw(keyboard::loadkeys_files()); -my %keytable_conflicts; -my @less_important_keytables = qw(am_old am_phonetic no-dvorak fr_CH-latin1); -foreach (keyboard::loadkeys_files()) { - my ($dir, $fname) = (dirname($_), basename($_)); - my ($name) = $fname =~ /(.*)\.kmap\.gz/ or next; - next if member($name, @less_important_keytables); - if (my ($short) = $name =~ m|(.+?)[\W_]|) { - $keytable_conflicts{$short} and warn("conflict between $keytable_conflicts{$short} and $name for short name $short (choosing the first)\n"), next; - $keytable_conflicts{$short} = $name; - # create the short name based on the long one - symlinkf($fname, "$tmp$dir/$short.kmap.gz"); - } -} - -my $perl_version = join ".", unpack "C3", $^V; -@files = map { chomp; s/PERL_VERSION/$perl_version/g; s|/LIB/|/$lib/|g; $_ } (cat_("list"), cat_(`../tools/specific_arch list`)); -@files = `ls -d @files`; -$? == 0 or exit 1; - -install_l(@files); - -foreach (cat_("aliases")) { - chomp; my ($f, $dest) = split; - symlink $dest, "$tmp$f"; -} - --e "../kernel/all.modules" or die "use ./update_kernel in gi/kernel first\n"; - -chomp($main = `cat ../kernel/all.kernels/.main`); - -_ "cp ../kernel/all.modules/modules.cz-$main $tmp/modules/modules.cz"; -_ "cp ../kernel/all.modules/$main/modules.dep $tmp/modules"; - -installown("drvinst", "/usr/bin"); -installown("guessmounts", "/usr/bin"); -installown("install_bootloader", "/usr/bin"); -if (arch() =~ /^i.86/) { - installown("restore_ms_boot", "/usr/bin"); -} -installown("lsparts", "/usr/bin"); -installown("rescue-doc", "/usr/bin"); -_ "cd ../mdk-stage1 && make rescue-gui"; -installown("../mdk-stage1/rescue-gui", "/usr/bin"); - -#- note that on biarch systems, we may need to have both /lib and /lib64 -__ "strip $tmp/{lib,$lib,bin,sbin}/* $tmp/usr/{bin,sbin}/* 2>/dev/null"; - -exit 0 if $ARGV[0]; - -if (arch() =~ /ppc/) { - #- xfs module on PPC is 4MB! - need room to unpack it - $size = `du -s $tmp | cut -f1` + 4096; #- add 4MB of free space -} else { - $size = `du -s $tmp | cut -f1` + 2048; #- add 2MB of free space -} - -mkdir_p($mnt); -__ "$sudo umount $rescue 2>/dev/null"; - -_ "dd if=/dev/zero of=$rescue bs=1k count=$size"; -_ "$mke2fs $rescue"; -_ "$sudo mount -t ext2 $rescue $mnt -o loop"; -_ "rmdir $mnt/lost+found"; - -_ "$sudo chown -R root.root $tmp"; -_ "$sudo cp -a $tmp/* $mnt"; -_ "$sudo rm -rf $tmp"; - -_ "$sudo umount $rescue"; -_ "rmdir $mnt"; - -_ "bzip2 -f -9 $rescue"; diff --git a/rescue/rescue-doc b/rescue/rescue-doc deleted file mode 100755 index 1791966cb..000000000 --- a/rescue/rescue-doc +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/perl - -sub output { my $f = shift; local *F; open F, ">$f" or die "output in file $f failed: $!\n"; print F foreach @_; } - -output('/tmp/rescue-doc-contents', q( - Information regarding problems not directly addressed - by this rescue. - - -Are you certain "rescue mode" is the best tool for your specific -problem? - -The rescue system on this CD is a very basic text-based -environment for rescuing systems that no longer boot. You will -not find an easy-to-use graphical environment in this rescue -system, nor the Mandrake detection/configuration libraries. - - -The vast majority of problems that can affect a Linux system are -much easier to repair on a running system than by booting into -"rescue mode". In fact, there are very few problems which aren't -easier to resolve in the comfortable environment of a fully -installed Mandrake Linux system than in this spartan "rescue -system" shell. Some of the most common problems include: - -- bad or missing X (video display) configuration -- adding/removing/reconfiguring hardware -- repairing problems caused by installing third-party software - with the "--force" and "--nodeps" options - -The general rule of thumb is: "If you can boot into the Linux -system without using rescue mode or this CD, there is no real -reason to use the rescue CD". - - -However, if you can no longer boot into the system, the rescue -system is the right tool. Some common examples include: - -- If you previously changed some parameters in the /etc/fstab and - the system will no longer boot, fix the offending line while in - rescue mode, then try to boot normally into your system. - -- If the problem cannot be completely resolved in rescue mode - (for example, if you need to reconfigure the video display), - just modify what's necessary to boot into a running system, - then complete the fix from there. - -In case you have found a new problem which should be handled by -"rescue mode" but currently isn't, please report it to -. - -For more information on troubleshooting a Mandrake Linux system, -please consult the official manuals, the documentation on -MandrakeLinux.com, MandrakeUser.org, troubleshooting articles on -MandrakeForum.com, or the MandrakeExpert.com support forum. - - -)); - -exec 'less /tmp/rescue-doc-contents'; - diff --git a/rescue/restore_ms_boot b/rescue/restore_ms_boot deleted file mode 100755 index 0d674af99..000000000 --- a/rescue/restore_ms_boot +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/perl -# -# Guillaume Cottenceau (gc@mandrakesoft.com) -# -# Copyright 2002 MandrakeSoft -# -# This software may be freely redistributed under the terms of the GNU -# public license. -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# - -sub arch() { - my $t = `uname -m`; - chomp $t; - $t; -} -sub if_($@) { - my $b = shift; - $b or return (); - wantarray || @_ <= 1 or die("if_ called in scalar context with more than one argument " . join(":", caller())); - wantarray ? @_ : $_[0]; -} -sub cat_ { local *F; open F, $_[0] or $_[1] ? die "cat of file $_[0] failed: $!\n" : return; my @l = ; wantarray ? @l : join '', @l } -sub member { my $e = shift; foreach (@_) { $e eq $_ and return 1 } 0 } - -@known_boot_loaders = qw(lilo grub yaboot); - -# keep this in sync with DrakX -@MBR_signatures = ( - [ 'empty', 0, "\0\0\0\0" ], - [ 'grub', 0x6, "GRUB" ], - [ 'grub', 0, "\xEBG", 0x17d, "stage1 \0" ], - [ 'grub', 0, "\xEBH", 0x17e, "stage1 \0" ], - [ 'grub', 0, "\xEBH", 0x18a, "stage1 \0" ], - [ 'grub', 0, "\xEBH", 0x181, "GRUB \0" ], - [ 'lilo', 0x2, "LILO" ], - [ 'lilo', 0x6, "LILO" ], -if_(arch() =~ /ppc/, - map { [ 'yaboot', 0, "PM", 0x200 * $_ + 0x10, "bootstrap\0" ] } 0 .. 61 -), -); - -sub typeFromMagic { - my $f = shift; - local *F; sysopen F, $f, 0 or return; - - my $tmp; - M: foreach (@MBR_signatures) { - my ($name, @l) = @$_; - while (@l) { - my ($offset, $signature) = splice(@l, 0, 2); - sysseek(F, $offset, 0) or next M; - sysread(F, $tmp, length $signature); - $tmp eq $signature or next M; - } - return $name; - } - return 0; -} - - -my (undef, undef, @parts) = cat_('/proc/partitions'); - -my @possibilities; - -P: foreach (@parts) { - my (undef, undef, $blocks, $dev) = split or next; - next if $blocks <= 1; - my $type = typeFromMagic("/dev/$dev"); - $type && member($type, @known_boot_loaders) and push @possibilities, [ $dev, $type ]; -} - -my $choice; - -if (!@possibilities) { - print "No known Linux bootloader has been found, nothing to do.\n"; -} elsif (@possibilities == 1) { - print "I've found a Linux bootloader only on [0]>.\n\n"; - $choice = $possibilities[0]; -} else { - print "I've found the following Linux bootloaders:\n"; - my $i; - print "\t", ++$i, ": <$_->[1]> \ton <$_->[0]>\n" foreach @possibilities; - print "\n"; - print "Which disk/partition do you want to overwrite with the Windows bootloader?\n"; - print "\t "; - !~ /^(\d+)$/i && $1 >= 1 and $choice = $possibilities[$1-1]; -} - -if ($choice) { - print "I'm going to overwrite bootloader on [0]> with -Windows bootloader. - -Ok? "; - =~ /^n/i and exit 0; - - system("/bin/dd if=/usr/lib/extipl/aldebaran.bin of=/dev/$choice->[0]\n") and print "\tFailed!\n"; -} - -#------------------------------------------------- -#- $Log$ -#- Revision 1.1 2002/02/27 13:31:30 gc -#- add "restore Windows Boot Loader" to rescue -#- -#- diff --git a/rescue/tree/bin/insmod b/rescue/tree/bin/insmod deleted file mode 100755 index 49b298142..000000000 --- a/rescue/tree/bin/insmod +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "Use modprobe instead" diff --git a/rescue/tree/bin/login b/rescue/tree/bin/login deleted file mode 100755 index 4b2816926..000000000 --- a/rescue/tree/bin/login +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -exec /bin/bash --login diff --git a/rescue/tree/boot/grub/menu.lst b/rescue/tree/boot/grub/menu.lst deleted file mode 100644 index 1af0c85e3..000000000 --- a/rescue/tree/boot/grub/menu.lst +++ /dev/null @@ -1,5 +0,0 @@ -timeout 0 - -title oem -kernel (hd0,0)/boot/vmlinuz ramdisk_size=32000 hd vga=788 fbeginner oem -initrd (hd0,0)/boot/hd.rdz diff --git a/rescue/tree/etc/fstab b/rescue/tree/etc/fstab deleted file mode 100644 index fbafb7801..000000000 --- a/rescue/tree/etc/fstab +++ /dev/null @@ -1,4 +0,0 @@ -/dev/ram3 / ext2 defaults 1 1 -/dev/fd0 /mnt/floppy auto defaults,noauto 0 0 -none /proc proc defaults,noauto,ro 0 0 -/dev/cdrom /mnt/cdrom auto defaults,noauto 0 0 diff --git a/rescue/tree/etc/group b/rescue/tree/etc/group deleted file mode 100644 index 5ba713c83..000000000 --- a/rescue/tree/etc/group +++ /dev/null @@ -1 +0,0 @@ -root::0:root diff --git a/rescue/tree/etc/host.conf b/rescue/tree/etc/host.conf deleted file mode 100644 index 1a8c1e151..000000000 --- a/rescue/tree/etc/host.conf +++ /dev/null @@ -1,2 +0,0 @@ -order hosts,bind -multi on diff --git a/rescue/tree/etc/hosts b/rescue/tree/etc/hosts deleted file mode 100644 index a9bbdee7f..000000000 --- a/rescue/tree/etc/hosts +++ /dev/null @@ -1 +0,0 @@ -127.0.0.1 mandrake-rescue diff --git a/rescue/tree/etc/inittab b/rescue/tree/etc/inittab deleted file mode 100644 index 0348c66f4..000000000 --- a/rescue/tree/etc/inittab +++ /dev/null @@ -1,14 +0,0 @@ -#Inittab for Mandrake Rescue Disk -#Author: Daouda Lo -id:3:initdefault: - -si::sysinit:/etc/rc.sysinit -re:6:wait:/etc/rc.reboot -ca:12345:ctrlaltdel:/sbin/fakeshutdown - -1:12345:respawn:/bin/bash --login -2:23:respawn:/sbin/mingetty tty2 -3:23:respawn:/sbin/mingetty tty3 -4:23:respawn:/sbin/mingetty tty4 -5:23:respawn:/sbin/mingetty tty5 -6:23:respawn:/sbin/mingetty tty6 diff --git a/rescue/tree/etc/issue b/rescue/tree/etc/issue deleted file mode 100644 index 474055034..000000000 --- a/rescue/tree/etc/issue +++ /dev/null @@ -1,27 +0,0 @@ - - -    -            -               -               -             -  `----'          -        -      -     [2[1;37;4 -      -     -    Mandrake Linux Rescue Disk -      -      -     -       - - -Mandrake Linux release 9.2 - -Use loadkeys to change your keyboard layout (eg: loadkeys fr) -Use modprobe to load modules (eg: modprobe snd-card-fm801) -Use drvinst to install drivers according to detected devices -Use lsparts to list your partitions with types - diff --git a/rescue/tree/etc/oem b/rescue/tree/etc/oem deleted file mode 100755 index 7b87a4560..000000000 --- a/rescue/tree/etc/oem +++ /dev/null @@ -1,674 +0,0 @@ -#!/usr/bin/perl - -if (shift(@ARGV) ne '-f') { - print "Call it with option -f, but don't fear loosing all your data, this command is dangerous!"; - print " -usage: /etc/oem -f [options] -where [options] are: - server : allow server installalation - boot_entries=entry1,...,entryN : set boot entries to use, - the first one is the default one - no