diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-03-20 19:27:10 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-03-20 19:27:10 +0000 |
commit | a10bc69094bf47216b0621e154c4fd6a8ff61689 (patch) | |
tree | ae118e32e17e2ae95964ccdc17be246d57141e01 /perl-install | |
parent | bdbc1b603d0a0cb61bfa3518858bbe333c1a2b16 (diff) | |
download | drakx-a10bc69094bf47216b0621e154c4fd6a8ff61689.tar drakx-a10bc69094bf47216b0621e154c4fd6a8ff61689.tar.gz drakx-a10bc69094bf47216b0621e154c4fd6a8ff61689.tar.bz2 drakx-a10bc69094bf47216b0621e154c4fd6a8ff61689.tar.xz drakx-a10bc69094bf47216b0621e154c4fd6a8ff61689.zip |
no_comment
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/ChangeLog | 5 | ||||
-rw-r--r-- | perl-install/Makefile | 4 | ||||
-rw-r--r-- | perl-install/Makefile.drakxtools | 10 | ||||
-rw-r--r-- | perl-install/detect_devices.pm | 2 | ||||
-rw-r--r-- | perl-install/fs.pm | 6 | ||||
-rw-r--r-- | perl-install/install2.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps_gtk.pm | 2 | ||||
-rw-r--r-- | perl-install/install_steps_interactive.pm | 10 | ||||
-rw-r--r-- | perl-install/loopback.pm | 51 | ||||
-rw-r--r-- | perl-install/share/diskdrake.rc | 1 | ||||
-rwxr-xr-x | perl-install/standalone/diskdrake | 2 |
11 files changed, 57 insertions, 38 deletions
diff --git a/perl-install/ChangeLog b/perl-install/ChangeLog index 7946534be..ce91e1e24 100644 --- a/perl-install/ChangeLog +++ b/perl-install/ChangeLog @@ -34,6 +34,11 @@ * printer.pm: added more features for filter, allow printer to be retrieved without help of printtool id in printcap file (untested). +2000-03-14 Pixel <pixel@mandrakesoft.com> + + * diskdrake.pm (Loopback): handling of the file loopback: test + existence of the file and take its size. + 2000-03-14 François Pons <fpons@mandrakesoft.com> * install_any.pm: corrected for duplicate file on other CD. diff --git a/perl-install/Makefile b/perl-install/Makefile index 5443526d5..4cad2c4d5 100644 --- a/perl-install/Makefile +++ b/perl-install/Makefile @@ -15,8 +15,8 @@ clean: tar-drakxtools: clean $(MAKE) -C ../tools clean cd .. ; rm -rf drakxtools ; cp -af perl-install drakxtools ; cp -af tools/ddcprobe tools/pnp_serial drakxtools - cd ../drakxtools ; rm -rf install* pkgs.pm ftp.pm t.pm */CVS ; mv Makefile.drakxtools Makefile ; mv -f standalone/* share/* . - cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile Makefile.config MonitorsDB CardsNames Newt c ddcprobe pnp_serial po pci_probing resize_fat diskdrake.rc $(STANDALONEPMS) icons *.pm) + cd ../drakxtools ; rm -rf install* pkgs.pm ftp.pm t.pm */CVS ; mv Makefile.drakxtools Makefile ; mv -f standalone/* . + cd .. ; tar cfy drakxtools.tar.bz2 --exclude CVS $(patsubst %,drakxtools/%,Makefile Makefile.config share/MonitorsDB share/CardsNames Newt c ddcprobe pnp_serial share/po pci_probing resize_fat share/diskdrake.rc $(STANDALONEPMS) icons *.pm) cd .. ; rm -rf drakxtools $(DIRS): diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools index 475940106..92c5e6d76 100644 --- a/perl-install/Makefile.drakxtools +++ b/perl-install/Makefile.drakxtools @@ -1,6 +1,6 @@ include Makefile.config -DIRS = ddcprobe pnp_serial po Newt c pci_probing resize_fat +DIRS = ddcprobe pnp_serial share/po Newt c pci_probing resize_fat PREFIX = SBINDEST = $(PREFIX)/usr/sbin ETCDEST = $(PREFIX)/etc/gtk @@ -20,16 +20,16 @@ $(DIRS): $(MAKE) -C $@ install: - install -d $(BINDEST) $(ETCDEST) $(SBINDEST) $(LIBDEST) $(BINX11DEST) $(LIBX11DEST) $(DIRS:%=$(LIBDEST)/%) + install -d $(BINDEST) $(ETCDEST) $(SBINDEST) $(LIBDEST) $(BINX11DEST) $(LIBX11DEST) $(LIBDEST)/po $(DIRS:%=$(LIBDEST)/%) install $(STANDALONEPMS) $(SBINDEST) mv -f $(SBINDEST)/lspcidrake $(BINDEST) install -s ddcprobe/ddcxinfos pnp_serial/pnp_serial $(SBINDEST) ln -s ../../$(patsubst $(PREFIX)/usr%,%,$(SBINDEST))/XFdrake $(BINX11DEST)/Xdrakres for i in *.pm ; do perl -pe '$$_ = "\n" if /\s*use\s+(diagnostics|vars|strict)/' $$i > $(LIBDEST)/$$i ; done - install -m 644 MonitorsDB CardsNames $(LIBX11DEST) - install -m 644 diskdrake.rc $(ETCDEST) - install -m 644 po/*.po $(LIBDEST)/po + install -m 644 share/MonitorsDB share/CardsNames $(LIBX11DEST) + install -m 644 share/diskdrake.rc $(ETCDEST) + install -m 644 share/po/*.po $(LIBDEST)/po install -m 644 $(patsubst %,Newt/%.pm,Newt) $(LIBDEST)/Newt install -m 644 $(patsubst %,c/%.pm,stuff) $(LIBDEST)/c install -m 644 $(patsubst %,pci_probing/%.pm,main pcitable pci_class) $(LIBDEST)/pci_probing diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 8207dadfa..816277cb5 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -52,7 +52,7 @@ sub cdroms() { } sub floppies() { my @ide = map { $_->{device} } grep { $_->{type} eq 'fd' } get() and modules::load("ide-floppy"); - (grep { tryOpen($_) } qw(fd0 fd1)), @ide; + (@ide, grep { tryOpen($_) } qw(fd0 fd1)); } #- example ls120, model = "LS-120 SLIM 02 UHD Floppy" diff --git a/perl-install/fs.pm b/perl-install/fs.pm index ed88ea3ee..11deb20f8 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -292,10 +292,12 @@ sub write($$$$) { local *F; open F, "> $prefix/etc/mtab" or die "error resetting $prefix/etc/mtab"; + my ($floppy) = detect_devices::floppies(); + my @to_add = ( $useSupermount ? - [ split ' ', '/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/fd0 0 0' ] : - [ split ' ', '/dev/fd0 /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ], + [ split ' ', "/mnt/floppy /mnt/floppy supermount fs=vfat,dev=/dev/$floppy 0 0" ] : + [ split ' ', '/dev/$floppy /mnt/floppy auto sync,user,noauto,nosuid,nodev,unhide 0 0' ], [ split ' ', 'none /proc proc defaults 0 0' ], [ split ' ', 'none /dev/pts devpts mode=0620 0 0' ], (map_index { diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 8e7390bca..b666c536e 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -62,7 +62,7 @@ arch() !~ /alpha/ ? ( createBootdisk => [ __("Create a bootdisk"), 1, 0, '', "doInstallStep" ], ) : (), setupBootloader => [ __("Install bootloader"), 1, 1, '', "doInstallStep" ], - configureX => [ __("Configure X"), 1, 0, '', ["formatPartitions", "setupBootloader"] ], + configureX => [ __("Configure X"), 1, 1, '', ["formatPartitions", "setupBootloader"] ], exitInstall => [ __("Exit install"), 0, 0, 'beginner' ], ); for (my $i = 0; $i < @installSteps; $i += 2) { diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index 57424c9ca..b7ce8b00c 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -13,7 +13,7 @@ use common qw(:common :file :functional :system); use partition_table qw(:types); use my_gtk qw(:helpers :wrappers); use Gtk; -#use Gtk::XmHTML; +#-use Gtk::XmHTML; use devices; use fsedit; use modules; diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 18b9e3059..26781f254 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -665,10 +665,11 @@ sub createBootdisk { my ($o, $first_time) = @_; my @l = detect_devices::floppies(); my %l = ( - 'fd0' => __("First drive"), - 'fd1' => __("Second drive"), + 'fd0' => __("First floppy drive"), + 'fd1' => __("Second floppy drive"), 'Skip' => __("Skip"), ); + $l{$_} ||= $_ foreach @l; if ($first_time || @l == 1) { $o->ask_yesorno('', @@ -682,7 +683,6 @@ failures. Would you like to create a bootdisk for your system?"), $o->{mkbootdisk} = $l[0] if !$o->{mkbootdisk} || $o->{mkbootdisk} eq "1"; } else { @l or die _("Sorry, no floppy drive available"); - $l{$_} ||= $_ foreach @l; $o->{mkbootdisk} = ${{reverse %l}}{$o->ask_from_list_('', _("Choose the floppy drive you want to use to make the bootdisk"), @@ -690,7 +690,8 @@ failures. Would you like to create a bootdisk for your system?"), return $o->{mkbootdisk} = '' if $o->{mkbootdisk} eq 'Skip'; } - $o->ask_warn('', _("Insert a floppy in drive %s", $o->{mkbootdisk})); + log::l(">>>> mkbootdisk $o->{mkbootdisk}, $l{$o->{mkbootdisk}}"); + $o->ask_warn('', _("Insert a floppy in drive %s", $l{$o->{mkbootdisk}})); my $w = $o->wait_message('', _("Creating bootdisk")); install_steps::createBootdisk($o); } @@ -1148,6 +1149,7 @@ sub load_thiskind { #- hey, we're allowed to pci probe :) let's do a lot of probing! install_any::ultra66($o); + require pci_probing::main; if (my ($c) = pci_probing::main::probe('AUDIO')) { modules::add_alias("sound", $c->[1]) if pci_probing::main::check($c->[1]); } diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm index 04b3786ae..88623fbe2 100644 --- a/perl-install/loopback.pm +++ b/perl-install/loopback.pm @@ -70,35 +70,44 @@ sub create { $f; } -sub getFree { +sub inspect { my ($part, $prefix) = @_; - if ($part->{isFormatted} || !$part->{notFormatted}) { - $part->{freespace} = $part->{size}; - } elsif (!$part->{freespace}) { - isMountableRW($part) or return; - - my $dir = "/tmp/loopback_tmp"; - if ($part->{isMounted}) { - $dir = ($prefix || '') . $part->{mntpoint}; - } else { - mkdir $dir, 0700; - fs::mount($part->{device}, $dir, type2fs($part->{type}), 'rdonly'); - } - my $buf = ' ' x 20000; - syscall_('statfs', $dir, $buf) or return; - my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf; - $_ *= $blocksize / 512 foreach $size, $free; + isMountableRW($part) or return; - + my $dir = "/tmp/loopback_tmp"; + + if ($part->{isMounted}) { + $dir = ($prefix || '') . $part->{mntpoint}; + } else { + mkdir $dir, 0700; + fs::mount($part->{device}, $dir, type2fs($part->{type}), 'rdonly'); + } + my $h = bless \$dir, "loopback::inspect"; + common::add_f4before_leaving(sub { unless ($part->{isMounted}) { fs::umount($dir); - unlink $dir; + unlink($dir) } + }, $h, 'DESTROY'); + $h; +} + +sub getFree { + my ($dir, $part) = @_; + my ($freespace); - $part->{freespace} = $free; + if ($part->{isFormatted} || !$part->{notFormatted}) { + $freespace = $part->{size}; + } else { + my $buf = ' ' x 20000; + syscall_('statfs', $dir, $buf) or return; + my (undef, $blocksize, $size, undef, $free, undef) = unpack "L2L4", $buf; + $_ *= $blocksize / 512 foreach $free; + + $freespace = $free; } - $part->{freespace} - sum map { $_->{size} } @{$part->{loopback} || []}; + $freespace - sum map { $_->{size} } @{$part->{loopback} || []}; } 1; diff --git a/perl-install/share/diskdrake.rc b/perl-install/share/diskdrake.rc index 198aa9f05..e83ed1025 100644 --- a/perl-install/share/diskdrake.rc +++ b/perl-install/share/diskdrake.rc @@ -31,5 +31,6 @@ widget "*Ext2*" style "red" widget "*Linux swap*" style "green" widget "*Swap*" style "green" widget "*FAT*" style "blue" +widget "*NT NTFS*" style "blue" widget "*Empty*" style "white" widget "*Other*" style "font" diff --git a/perl-install/standalone/diskdrake b/perl-install/standalone/diskdrake index 39a2cf442..f4f1e0d5c 100755 --- a/perl-install/standalone/diskdrake +++ b/perl-install/standalone/diskdrake @@ -22,7 +22,7 @@ # DiskDrake is also based upon the libfdisk and the install from Red Hat Software -use lib qw(.); #/usr/lib/libDrakX); +use lib qw(/usr/lib/libDrakX); use common qw(:common :functional); use diskdrake; use interactive_gtk; |