summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakautoinst
Commit message (Expand)AuthorAgeFilesLines
* gc no more works at MandrivaThierry Vignaud2008-01-231-1/+1
* fix a couple of emailsThierry Vignaud2008-01-231-1/+1
* bump copyright yearThierry Vignaud2008-01-231-1/+1
* adapt it to new installer layout (#22307)Thierry Vignaud2007-06-181-1/+1
* re-sync after the big svn lossPascal Rigaux2007-04-251-4/+3
* try to cleanup fs.pmPascal Rigaux2005-06-281-4/+4
* - merge network settings in a $net hash (it modifies $o fields too):Olivier Blin2005-06-031-3/+1
* bump copyrigth noticeThierry Vignaud2005-04-251-1/+1
* switch from MandrakeSoft to Mandriva in copyright noticesThierry Vignaud2005-04-211-1/+1
* better english (writing style rather than spoken one)Thierry Vignaud2004-12-131-1/+1
* (create_notebook) follow the same parameter order as gtkappend_page() use andThierry Vignaud2004-09-011-1/+1
* prefer obj->new rather than new obj for gtk+ widgetsThierry Vignaud2004-08-091-29/+29
* perl_checker cleanupThierry Vignaud2004-08-091-1/+1
* perl_checker fixesPascal Rigaux2004-07-211-3/+3
* MandrakeSoft -> MandrakesoftPascal Rigaux2004-07-201-1/+1
* support two-floppies boot style for replay_install disk as well (not nice at ...Guillaume Cottenceau2004-02-261-0/+17
* typo fixThierry Vignaud2004-02-161-1/+1
* do not abuse global namespaceThierry Vignaud2004-02-161-2/+2
* update copyright noticesThierry Vignaud2004-01-221-1/+1
* - kill unused variablesThierry Vignaud2004-01-141-9/+8
* alter message according to interface team suggestionThierry Vignaud2004-01-131-1/+1
* remove mkbootdisk supportPascal Rigaux2004-01-061-1/+1
* don't check *all* for test_pms_all, skip horrible stuffsPascal Rigaux2003-09-301-1/+1
* try again if no floppy (or error during creation of floppy)Francois Pons2003-09-091-5/+9
* fixed missing import of ugtk2Francois Pons2003-09-031-1/+1
* perl_checker compliancePascal Rigaux2003-08-191-9/+9
* switch from gtk2-perl to gtk2-perl-xsThierry Vignaud2003-07-091-1/+1
* perl_checker fixesThierry Vignaud2003-05-231-22/+21
* - clean up embedding; since socket automatically emit plug-added gtk+ signalThierry Vignaud2003-02-241-4/+0
* - clean up embedding; since socket get automatically destroyed on child exitThierry Vignaud2003-02-241-2/+1
* perl_checker fixesThierry Vignaud2003-01-161-13/+14
* "je n'en veux + de cette engeance" (c) pixel :Thierry Vignaud2003-01-161-1/+1
* use ->method syntax for method callPascal Rigaux2002-12-161-1/+1
* minimal perl_checker fixes to have only warningsPascal Rigaux2002-12-101-2/+2
* use gtkflush()Thierry Vignaud2002-12-051-1/+1
* gtk+2 portThierry Vignaud2002-12-051-39/+37
* use ask_warn when I should, and remove a one year old debug statement (???)Guillaume Cottenceau2002-11-211-3/+2
* - standalone.pm :Thierry Vignaud2002-11-181-2/+0
* update copyright yearsThierry Vignaud2002-11-181-1/+1
* replace "_" with "N" and "__" with "N_"Pascal Rigaux2002-11-061-22/+22
* fixe explanation useThierry Vignaud2002-08-251-1/+1
* - explanationsDaouda Lo2002-08-151-0/+1
* replace "kill USR1" with "kill 'USR1'" (and same for USR2)Pascal Rigaux2002-08-051-3/+3
* kill $Log (487 useless lines supressed from drakxtools)Thierry Vignaud2002-08-051-80/+0
* Handle parsing --embedded command line in standalone.pmPascal Rigaux2002-07-311-2/+5
* use $o->{interactiveSteps} instead of @install_steps_auto_install::graphical_...Pascal Rigaux2002-07-301-6/+6
* - Big Move 1: interactive::* hierarchyThierry Vignaud2002-07-231-1/+4
* corrected HASH and ARRAY labeldamien2002-03-061-9/+20
* move /root/* files (ddebug.log, install.log, report.bug,Guillaume Cottenceau2002-01-291-1/+6
* - write the 'common' part of the 'explanations' stuff,Guillaume Cottenceau2002-01-181-1/+8
lass="hl opt">) eq $name and return $dev, $file; } undef; } sub init_device_mapper() { eval { modules::load('dm-mod') }; make('urandom'); my $control = '/dev/mapper/control'; if (! -e $control) { my ($major) = cat_('/proc/devices') =~ /(\d+) misc$/m or return; my ($minor) = cat_('/proc/misc') =~ /(\d+) device-mapper$/m or return; mkdir_p(dirname($control)); syscall_('mknod', $control, c::S_IFCHR() | 0600, makedev($major, $minor)) or die "mknod $control failed: $!"; } } sub entry { my ($type, $major, $minor); local ($_) = @_; if (/^0x([\da-f]{3,4})$/i) { $type = c::S_IFBLK(); ($major, $minor) = unmakedev(hex $1); } elsif (/^sd(.)(\d{0,2})/) { $type = c::S_IFBLK(); $major = 8; $minor = 16 * (ord($1) - ord('a')) + ($2 || 0); } elsif (/^hd(.)(\d{0,2})/) { $type = c::S_IFBLK(); ($major, $minor) = @{ ${{'a' => [3, 0], 'b' => [3, 64], 'c' => [22,0], 'd' => [22,64], 'e' => [33,0], 'f' => [33,64], 'g' => [34,0], 'h' => [34,64], 'i' => [56,0], 'j' => [56,64], 'k' => [57,0], 'l' => [57,64], 'm' => [88,0], 'n' => [88,64], 'o' => [89,0], 'p' => [89,64], 'q' => [90,0], 'r' => [90,64], 's' => [91,0], 't' => [91,64], }}{$1} or internal_error("unknown device $_") }; $minor += $2 || 0; } elsif (/^ram(.*)/) { $type = c::S_IFBLK(); $major = 1; $minor = $1 eq '' ? 1 : $1; } elsif (m|^rd/c(\d+)d(\d+)(p(\d+))?|) { # dac 960 "rd/cXdXXpX" $type = c::S_IFBLK(); $major = 48 + $1; $minor = 8 * $2 + $4; } elsif (m,(ida|cciss)/c(\d+)d(\d+)(?:p(\d+))?,) { # Compaq Smart Array "ida/c0d0{p1}" $type = c::S_IFBLK(); $major = ($1 eq 'ida' ? 72 : 104) + $2; $minor = 16 * $3 + ($4 || 0); } elsif (m,(ataraid)/d(\d+)(?:p(\d+))?,) { # ATA raid "ataraid/d0{p1}" $type = c::S_IFBLK(); $major = 114; $minor = 16 * $1 + ($2 || 0); } elsif (/(.*?)(\d+)$/) { ($type, $major, $minor) = @{ ${{"fd" => [ c::S_IFBLK(), 2, 0 ], "hidbp-mse-" => [ c::S_IFCHR(), 10, 32 ], "lp" => [ c::S_IFCHR(), 6, 0 ], "usb/lp" => [ c::S_IFCHR(), 180, 0 ], "input/event" => [ c::S_IFCHR(), 13, 64 ], "loop" => [ c::S_IFBLK(), 7, 0 ], "md" => [ c::S_IFBLK(), 9, 0 ], "nst" => [ c::S_IFCHR(), 9, 128 ], "sr" => [ c::S_IFBLK(), 11, 0 ], "ttyS" => [ c::S_IFCHR(), 4, 64 ], "ubd/" => [ c::S_IFBLK(), 98, 0 ], }}{$1} }; $minor += $2; } unless ($type) { ($type, $major, $minor) = @{ ${{"aztcd" => [ c::S_IFBLK(), 29, 0 ], "bpcd" => [ c::S_IFBLK(), 41, 0 ], "cdu31a" => [ c::S_IFBLK(), 15, 0 ], "cdu535" => [ c::S_IFBLK(), 24, 0 ], "cm206cd" => [ c::S_IFBLK(), 32, 0 ], "gscd" => [ c::S_IFBLK(), 16, 0 ], "mcd" => [ c::S_IFBLK(), 23, 0 ], "mcdx" => [ c::S_IFBLK(), 20, 0 ], "mem" => [ c::S_IFCHR(), 1, 1 ], "optcd" => [ c::S_IFBLK(), 17, 0 ], "kbd" => [ c::S_IFCHR(), 11, 0 ], "psaux" => [ c::S_IFCHR(), 10, 1 ], "atibm" => [ c::S_IFCHR(), 10, 3 ], "random" => [ c::S_IFCHR(), 1, 8 ], "urandom" => [ c::S_IFCHR(), 1, 9 ], "sbpcd" => [ c::S_IFBLK(), 25, 0 ], "sjcd" => [ c::S_IFBLK(), 18, 0 ], "tty" => [ c::S_IFCHR(), 5, 0 ], "input/mice" => [ c::S_IFCHR(), 13, 63 ], "usbmouse" => [ c::S_IFCHR(), 13, 63 ], #- aka /dev/input/mice "adbmouse" => [ c::S_IFCHR(), 10, 10 ], #- PPC "vcsa" => [ c::S_IFCHR(), 7, 128 ], "zero" => [ c::S_IFCHR(), 1, 5 ], "null" => [ c::S_IFCHR(), 1, 3 ], }}{$_} or internal_error("unknown device $_") }; } ($type, $major, $minor); } sub make($) { local $_ = my $file = $_[0]; if (m!^(.*/dev)/(.*)!) { $_ = $2; } else { $file =~ m|^/| && -e $file or $file = "/dev/$_"; } -e $file and return $file; #- assume nobody takes fun at creating files named as device my ($type, $major, $minor) = entry($_); if ($file =~ m|/dev/| && -e '/dev/.devfsd') { #- argh, creating devices is no good with devfs... #- return the file even if the device file does not exist #- the caller will fail or not, better compatibility than raising an exception here return $file; } #- make a directory for this inode if needed. mkdir_p(dirname($file)); syscall_('mknod', $file, $type | 0600, makedev($major, $minor)) or die "mknod failed (dev $_): $!"; $file; } #- only isomorphic entries are allowed, #- i.e. entries which can go devfs -> normal and normal -> devfs my %to_devfs = ( psaux => 'misc/psaux', usbmouse => 'input/mice', ); my %to_devfs_prefix = ( ttyS => 'tts/', ); sub to_devfs { my ($dev) = @_; if (my $r = $to_devfs{$dev}) { return $r; } elsif ($dev =~ /(.*?)(\d+)$/) { my $r = $to_devfs_prefix{$1}; return "$r$2" if $r; } readlink("/dev/" . $dev); } sub read_proc_partitions_raw() { my (undef, undef, @all) = cat_("/proc/partitions"); grep { $_->{size} != 1 && # skip main extended partition $_->{size} != 0x3fffffff; # skip cdroms (otherwise stops cd-audios) } map { my %l; @l{qw(major minor size dev)} = split; \%l; } @all; } sub from_devfs { my ($dev) = @_; my %from_devfs = reverse %to_devfs; if (my $r = $from_devfs{$dev}) { return $r; } elsif ($dev =~ /(.*?)(\d+)$/) { my %from_devfs_prefix = reverse %to_devfs_prefix; my $r = $from_devfs_prefix{$1}; return "$r$2" if $r; } $dev = "/dev/" . $dev; if (-e $dev) { my ($major, $minor) = unmakedev((stat($dev))[6]); my $r = find { $_->{major} == $major && $_->{minor} == $minor } read_proc_partitions_raw(); $r and return $r->{dev}; } undef; } sub simple_partition_scan { my ($part) = @_; $part->{device} =~ /([hs]d[a-z])(\d+)$/; } sub part_number { my ($part) = @_; (simple_partition_scan($part))[1]; } sub part_prefix { my ($part) = @_; (simple_partition_scan($part))[0]; } 1;