From 126777bc019a54afb4ec51299f2cf9d2841698aa Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 25 Apr 2007 12:26:16 +0000 Subject: re-sync after the big svn loss --- rescue/.cvsignore | 1 - rescue/Makefile | 22 +++++++++++++++++---- rescue/NEWS | 3 +++ rescue/aliases | 2 -- rescue/devices.pl | 7 ++++--- rescue/drvinst | 2 +- rescue/guessmounts | 20 ++++++++++++++++--- rescue/install_bootloader | 2 +- rescue/list.xml | 39 ++++++++++++++++++------------------- rescue/lsparts | 2 +- rescue/make_partimage_save_rest_all | 17 ++++++++-------- rescue/make_rescue_img | 27 +++++++++---------------- rescue/partimage_whole_disk | 2 +- rescue/restore_ms_boot | 5 +++-- rescue/tree/etc/rc.sysinit | 13 +------------ rescue/tree/sbin/modprobe | 6 +++--- rescue/tree/usr/share/symlinks | 1 - 17 files changed, 89 insertions(+), 82 deletions(-) delete mode 100644 rescue/.cvsignore create mode 100644 rescue/NEWS (limited to 'rescue') diff --git a/rescue/.cvsignore b/rescue/.cvsignore deleted file mode 100644 index c660273e8..000000000 --- a/rescue/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -rescue.clp diff --git a/rescue/Makefile b/rescue/Makefile index 9721a68dc..da37d0f0d 100644 --- a/rescue/Makefile +++ b/rescue/Makefile @@ -1,12 +1,26 @@ include ../Makefile.config -all: rescue.clp +VERSION=1.4 +PRODUCT=drakx-installer-rescue -install: rescue.clp +RESCUE = rescue.sqfs + +all: $(RESCUE) + +install: $(RESCUE) cp -f $< $(STAGE2_DEST) -rescue.clp: list.xml drvinst guessmounts lsparts rescue-doc make_rescue_img +$(RESCUE): list.xml drvinst guessmounts lsparts rescue-doc make_rescue_img DISTRIB_DESCR=$(DISTRIB_DESCR) ./make_rescue_img +tar: + rm -rf $(PRODUCT)*.tar* $(PRODUCT)-$(VERSION) + mkdir -p $(PRODUCT)-$(VERSION)/tools + svn export -q . $(PRODUCT)-$(VERSION)/rescue + cp ../Makefile.config $(PRODUCT)-$(VERSION)/ + cp ../tools/install-xml-file-list $(PRODUCT)-$(VERSION)/tools + tar cfj $(PRODUCT)-$(VERSION).tar.bz2 $(PRODUCT)-$(VERSION) + rm -rf $(PRODUCT)-$(VERSION) + clean: - rm -f rescue.clp kernel_read_part + rm -f $(RESCUE) kernel_read_part diff --git a/rescue/NEWS b/rescue/NEWS new file mode 100644 index 000000000..ea8a80faf --- /dev/null +++ b/rescue/NEWS @@ -0,0 +1,3 @@ +Version 1.4 - 4 April 2007, by Pascal "Pixel" Rigaux + +- zcat and gunzip can't be symlinks anymore, they are scripts diff --git a/rescue/aliases b/rescue/aliases index cec7b82ba..0e0a4af31 100644 --- a/rescue/aliases +++ b/rescue/aliases @@ -1,5 +1,3 @@ -/bin/zcat gzip -/bin/gunzip gzip /bin/vi vim-minimal /sbin/lsmod lsmod-25 /sbin/rmmod rmmod-25 diff --git a/rescue/devices.pl b/rescue/devices.pl index 79308508a..0d4a8f77f 100644 --- a/rescue/devices.pl +++ b/rescue/devices.pl @@ -2,8 +2,6 @@ @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; @@ -15,7 +13,10 @@ foreach () { $_; } }; - system("$sudo mknod $_ $typ $maj " . $min++) foreach @l2; + foreach (@l2) { + my $cmd = "mknod-m600 $_ $typ $maj " . $min++; + system($cmd) == 0 or die "$cmd failed\n"; + } } } diff --git a/rescue/drvinst b/rescue/drvinst index 78c6f5c74..cc7fb4fa2 100755 --- a/rescue/drvinst +++ b/rescue/drvinst @@ -12,7 +12,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -use lib qw(../perl-install /usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use common; use detect_devices; diff --git a/rescue/guessmounts b/rescue/guessmounts index 3f3a4e208..4699e3f79 100755 --- a/rescue/guessmounts +++ b/rescue/guessmounts @@ -12,10 +12,11 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -use lib qw(../perl-install /usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use common; use fs; use fs::proc_partitions; +use fs::type; my @proc_mounts = fs::read_fstab('', '/proc/mounts'); @@ -33,11 +34,24 @@ print STDERR "\nPlease wait, trying to find your root device...\n"; mkdir_p($target); +my @parts = map { + $_->{device} = delete $_->{dev}; + put_in_hash($_, fs::type::type_subpart_from_magic($_)); +} fs::proc_partitions::read_raw(); +my ($raid_parts, $normal_parts) = partition { isRawRAID($_) } @parts; + +if (@$raid_parts) { + require raid; + raid::detect_during_install_once(@$raid_parts); + my $raids = raid::get_existing(@$raid_parts); + push @$normal_parts, @$raids; +} + my @fstab; my $root; -foreach (fs::proc_partitions::read_raw()) { - my $dev = devices::make($_->{dev}); +foreach (@$normal_parts) { + my $dev = devices::make($_->{device}); my $fs = find { system("mount -t $_ $dev $target 2>/dev/null") == 0; diff --git a/rescue/install_bootloader b/rescue/install_bootloader index 24ab7e382..e8bc04ad8 100755 --- a/rescue/install_bootloader +++ b/rescue/install_bootloader @@ -12,7 +12,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -use lib qw(../perl-install /usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use common; use bootloader; use fs; diff --git a/rescue/list.xml b/rescue/list.xml index 65f04a8c5..e9b29a456 100644 --- a/rescue/list.xml +++ b/rescue/list.xml @@ -20,12 +20,15 @@ find file md5sum - gzip + gzip zcat gunzip bzip2 bunzip2 bzcat df du - packdrake parsehdlist + + vol_id + + cpio ftp tar rsync ssh scp @@ -35,7 +38,7 @@ dmesg chroot sleep - sync update + sync eject mount umount @@ -55,7 +58,7 @@ fsck.xfs xfs_repair resize_reiserfs reiserfsck mkswap swapoff swapon - + fsck.jfs @@ -67,9 +70,14 @@ - fdisk gpart sfdisk + fdisk gpart rescuept + testdisk + + sfdisk + + pdisk @@ -144,7 +152,7 @@ - perl -Mkeyboard -I../perl-install -le 'print foreach keyboard::loadkeys_files()' + perl -Mkeyboard -I/usr/lib/libDrakX -le 'print foreach keyboard::loadkeys_files()' @@ -194,11 +202,6 @@ ARCH-linux/POSIX.pm ARCH-linux/XSLoader.pm - - - packdrake.pm - MDV/Packdrakeng.pm - @@ -222,15 +225,8 @@ *table.gz - - - modules.cz - modules.dep - - - - + rescue-doc drvinst lsparts guessmounts install_bootloader @@ -242,9 +238,12 @@ partimage_whole_disk + + raid.pm + - + rescue-gui diff --git a/rescue/lsparts b/rescue/lsparts index 9f0fac925..e1e866db4 100755 --- a/rescue/lsparts +++ b/rescue/lsparts @@ -16,7 +16,7 @@ # Detects partition types using signatures # -use lib qw(../perl-install /usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use common; use fs::type; use fs::proc_partitions; diff --git a/rescue/make_partimage_save_rest_all b/rescue/make_partimage_save_rest_all index 20d0673b6..a51af14da 100755 --- a/rescue/make_partimage_save_rest_all +++ b/rescue/make_partimage_save_rest_all @@ -7,9 +7,10 @@ rpm=$1 ; shift partimage_dir=$1 ; shift +data_dir=$1 ; shift if [ -n "$partimage_dir" ]; then - first_data_dir="$partimage_dir$1" + first_data_dir="$partimage_dir$data_dir" [ -d "$first_data_dir" ] || { echo "can't find $first_data_dir" @@ -25,7 +26,7 @@ rm -rf .tmp mkdir -p .tmp/isolinux cp -f /usr/lib/syslinux/isolinux.bin ../isolinux/alt0/* .tmp/isolinux -PARTIMAGE_DIR="$@" PARTIMAGE_RPM=$rpm DISTRIB_DESCR="partimage save/restore all" ./make_rescue_img || exit 1 +PARTIMAGE_RPM=$rpm DISTRIB_DESCR="partimage save/restore all" ./make_rescue_img || exit 1 mkdir -p .tmp/install/stage2 mv -f rescue.clp .tmp/install/stage2 @@ -44,21 +45,19 @@ label save_all append initrd=all.rdz $common_para save_all label rest_all kernel vmlinuz - append initrd=all.rdz $common_para rest_all keepmounted + append initrd=all.rdz $common_para rest_all keepmounted BOX=$data_dir label rescue kernel vmlinuz append initrd=all.rdz $common_para EOF if [ $action = rest_all -a -n "$partimage_dir" ]; then - for i in $*; do - dir=`dirname $i` - mkdir -p .tmp$dir - ln -s $partimage_dir$i .tmp$dir - done + dir=`dirname $data_dir` + mkdir -p .tmp$dir + ln -s $partimage_dir$data_dir .tmp$dir fi - mkisofs -f -o part_$action.iso -r -J -hide-rr-moved -nobak -cache-inodes -publisher Mandriva -V 'mdk part save/rest' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .tmp + genisoimage -f -o part_$action.iso -r -J -hide-rr-moved -nobak -cache-inodes -publisher Mandriva -V 'mdk part save/rest' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table .tmp mkcd --addmd5 part_$action.iso done diff --git a/rescue/make_rescue_img b/rescue/make_rescue_img index 170bbcbd6..996025373 100755 --- a/rescue/make_rescue_img +++ b/rescue/make_rescue_img @@ -1,16 +1,14 @@ #!/usr/bin/perl use MDK::Common; -use lib "../perl-install"; +use lib "/usr/lib/libDrakX"; use keyboard; my $lib = (arch() =~ /x86_64/ ? "lib64" : "lib"); my $tmp = "/tmp/rescue_tmp"; -my $rescue = "rescue.clp"; +my $rescue = "rescue.sqfs"; -my $sudo = ''; if ($>) { - $sudo = "sudo"; $ENV{PATH} = "/sbin:/usr/sbin:$ENV{PATH}"; } @@ -28,7 +26,7 @@ sub installown($$) { sub install_perl_script { my ($script, $dir) = @_; my @gi_modules; - foreach (`../tools/get-needed-drakx-modules ../perl-install /usr/lib/libDrakX $script`) { + foreach (`../tools/get-needed-drakx-modules /usr/lib/libDrakX /usr/lib/libDrakX $script`) { chomp; my ($local, $dest) = split "\t"; installown($local, dirname($dest || $local)); @@ -38,24 +36,17 @@ sub install_perl_script { system('../tools/simplify-drakx-modules', @gi_modules, "$tmp$dir/$script"); } -_ "$sudo rm -rf $tmp" if -e $tmp; +_ "rm -rf $tmp" if -e $tmp; _ "mkdir $tmp"; _ 'find . -name "*~" | xargs rm -f'; mkdir_p($tmp . chomp_($_)) foreach cat_("dirs"); _ "cp -a tree/* $tmp"; -_ "find $tmp -name 'CVS*' | xargs rm -rf"; +_ "find $tmp -name .svn | xargs rm -rf"; _ "perl devices.pl $tmp/dev"; _ "mkfifo $tmp/dev/initctl"; substInFile { s/DISTRIB_DESCR/$ENV{DISTRIB_DESCR}/ } "$tmp/etc/issue"; -{ - _ "cd ../mdk-stage1 && make rescue-gui dhcp-client"; - -e "../kernel/all.kernels" or die "use ./update_kernel in gi/kernel first\n"; - - $ENV{MAIN_KERNEL} = chomp_(`cat ../kernel/RPMS/.main`); - - _ "../tools/install-xml-file-list list.xml $tmp"; -} +_ "../tools/install-xml-file-list list.xml $tmp"; my %keytable_conflicts; my @less_important_keytables = qw(am_old am_phonetic no-dvorak fr_CH-latin1); @@ -111,8 +102,8 @@ EOF } "$tmp/etc/rc.sysinit"; } -_ "$sudo chown root.root -R $tmp/*"; - exit 0 if $ARGV[0]; -_ "mkisofs -quiet -D -R $tmp | create_compressed_fs - 65536 $rescue 200 2>/dev/null"; +_ "mksquashfs $tmp $rescue -all-root -noappend >/dev/null"; +_ "chmod 755 $rescue"; +_ "rm -rf $tmp"; diff --git a/rescue/partimage_whole_disk b/rescue/partimage_whole_disk index 8f4e65971..91c92ac70 100755 --- a/rescue/partimage_whole_disk +++ b/rescue/partimage_whole_disk @@ -1,6 +1,6 @@ #!/usr/bin/perl -use lib qw(/usr/lib/libDrakX ../perl-install); +use lib qw(/usr/lib/libDrakX); use standalone; use fsedit; use fs::format; diff --git a/rescue/restore_ms_boot b/rescue/restore_ms_boot index b31fd112e..1f8cc2907 100755 --- a/rescue/restore_ms_boot +++ b/rescue/restore_ms_boot @@ -12,15 +12,16 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # -use lib qw(../perl-install /usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use common; use bootloader; use fs; use fs::proc_partitions; +use partition_table::raw; my @choices = map { - my $type = typeFromMagic(devices::make($_->{dev})); + my $type = partition_table::raw::typeOfMBR($_->{dev}); if_($type && member($type, bootloader::main_method_choices()) , [ $_->{dev}, $type ]); } fs::proc_partitions::read_raw(); diff --git a/rescue/tree/etc/rc.sysinit b/rescue/tree/etc/rc.sysinit index 893efb338..e6da12ea0 100755 --- a/rescue/tree/etc/rc.sysinit +++ b/rescue/tree/etc/rc.sysinit @@ -12,23 +12,12 @@ ln -s /tmp/stage2/etc/* /etc 2>/dev/null rm -f /dev ; cp -a /tmp/stage2/dev /dev -mkdir /mnt /var/log - -mkdir /proc -action "Mounting proc filesystem" mount -n -t proc /proc /proc - -if grep -q sysfs /proc/filesystems; then - mkdir /sys - action "Mounting sysfs on /sys" mount -t sysfs none /sys -fi +mkdir -p /mnt /var/log >/etc/mtab mount -f / mount -f /proc -#- free up stage1 memory -umount /stage1/proc/bus/usb /stage1/proc /stage1 - # Set the hostname. action "Setting hostname rescue" hostname rescue echo rescue > /etc/HOSTNAME diff --git a/rescue/tree/sbin/modprobe b/rescue/tree/sbin/modprobe index 774101d7c..b8d6aecb2 100755 --- a/rescue/tree/sbin/modprobe +++ b/rescue/tree/sbin/modprobe @@ -13,7 +13,7 @@ sub load_deps($) { my ($file) = @_; local *F; - open F, $file or log::l("error opening $file: $!"), return 0; + open F, $file or warn "error opening $file: $!\n", return 0; foreach () { my ($f, $deps) = split ':'; push @{$deps{$f}}, split ' ', $deps; @@ -41,7 +41,7 @@ sub load { $conf{$name}{loaded} and return; eval { load($_, 'prereq') } foreach @{$deps{$name}}; - system("packdrake -x /modules/modules.cz* /tmp $name$module_extension"); + system("gzip -dc /modules/$name$module_extension.gz > /tmp/$name$module_extension"); -r "/tmp/$name$module_extension" or die "can't find module $name\n"; system("/sbin/insmod /tmp/$name$module_extension"); my $retval = $?; @@ -49,7 +49,7 @@ sub load { $retval and die("insmod $name failed"); } -!@ARGV || $ARGV[0] =~ /-h/ and die "usage: modprobe []\n"; +!@ARGV || $ARGV[0] =~ /^-?-h/ and die "usage: modprobe []\n"; read_already_loaded(); load_deps("/modules/modules.dep"); diff --git a/rescue/tree/usr/share/symlinks b/rescue/tree/usr/share/symlinks index 1c34ff204..5862fb8ac 100644 --- a/rescue/tree/usr/share/symlinks +++ b/rescue/tree/usr/share/symlinks @@ -6,6 +6,5 @@ /etc/rc.sysinit /lib /lib64 -/modules /sbin /usr -- cgit v1.2.1