summaryrefslogtreecommitdiffstats
path: root/perl-install/devices.pm
Commit message (Expand)AuthorAgeFilesLines
* move mdkinst.clp on hard drive ASAPPascal Rigaux2005-01-031-0/+11
* move device mapper initialisation out of lvm.pm into devices.pm (since it wil...Pascal Rigaux2004-12-291-0/+12
* better english (writing style rather than spoken one)Thierry Vignaud2004-12-131-2/+2
* we don't use /tmp for devices anymorePascal Rigaux2004-11-251-2/+1
* remove some unneeded ";", add some for normalization (as told by perl_checker)Pascal Rigaux2004-11-181-2/+2
* module aes is now named aes-i586 (bugzilla #11588)Pascal Rigaux2004-09-221-1/+1
* - add field {part_number} for partitionsPascal Rigaux2004-09-201-0/+13
* increase the number of loopbacks (needed for mandrakemove where the default (...Pascal Rigaux2004-06-151-1/+1
* - new getSCSI_26() not using /proc/scsi/scsiPascal Rigaux2004-04-301-1/+1
* get rid of the chloop code (not used anymore)Pascal Rigaux2004-04-081-6/+2
* nicer debug error messagePascal Rigaux2004-03-081-4/+3
* one now need cryptoloop and aes when using encryption (kernel 2.6)Pascal Rigaux2004-03-031-0/+2
* add input/micePascal Rigaux2004-02-121-0/+2
* lvm2 uses urandomPascal Rigaux2004-01-131-0/+1
* *** empty log message ***Guillaume Cottenceau2003-12-011-1/+0
* chloop supportGuillaume Cottenceau2003-12-011-2/+7
* (from_devfs)Thierry Vignaud2003-06-241-1/+3
* - move read_proc_partitions_raw() from fsedit.pm to devices.pmThierry Vignaud2003-06-241-2/+18
* perl_checker adaptations + fixesPascal Rigaux2003-04-241-1/+1
* new perl_checker compliancePascal Rigaux2003-04-171-4/+4
* add "vcsa" (for brltty)Pascal Rigaux2003-02-041-0/+1
* remove unused variables or rename them with an underscore (eg: $o becomes $_o)Pascal Rigaux2002-12-041-2/+2
* do not use "local my $F, ...", use "local(my $F, ...) insteadPascal Rigaux2002-12-031-1/+1
* do not use "local *F"Pascal Rigaux2002-12-031-15/+12
* perl_checker adaptationsPascal Rigaux2002-11-271-29/+29
* - add/remove spaces to make perl_checker happyPascal Rigaux2002-11-141-1/+1
* add/remove spaces to make perl_checker happyPascal Rigaux2002-11-131-1/+1
* add or remove spaces where need to please perl_checkerPascal Rigaux2002-11-111-22/+22
* add /dev/ubd/0, /dev/ubd/1... support (thanks to Brian Murrell)Pascal Rigaux2002-11-051-0/+1
* allow creation of "/dev/null" devicePascal Rigaux2002-08-291-0/+1
* use mkdir_p instead of mkdirPascal Rigaux2002-08-281-1/+1
* new devfsd use input/mice rather than input/mouse0 since severalThierry Vignaud2002-08-211-1/+1
* make new perl_checker happy (and that's not easy!)Pascal Rigaux2002-07-311-1/+1
* add functions to_devfs and from_devfs. These only work for devices entriesPascal Rigaux2002-07-191-0/+35
* use c::total_sectors() instead of BLKGETSIZEPascal Rigaux2002-07-071-2/+3
* (find_free_loop): fixPascal Rigaux2002-03-061-6/+4
* (devices::make): following a good advice from Andrej Borsenkow, return thePascal Rigaux2002-02-231-1/+3
* devices::make doesn't mknod with devfsPascal Rigaux2002-02-231-0/+5
* add atibm (thanks to Robin Pollard)Pascal Rigaux2002-02-221-0/+1
* i prefer /(.*?)(\d+)$/ to /(.*\D)(\d+)$/Pascal Rigaux2002-02-121-1/+1
* Fixes on device auto-detection:Till Kamppeter2002-02-121-1/+1
* encrypted filesystem handling:Pascal Rigaux2002-01-151-7/+28
* return value at end of moduleDaouda Lo2001-10-271-3/+2
* ataraid devices supportPascal Rigaux2001-10-021-0/+5
* (make): ensure it never returns a non-absolute namePascal Rigaux2001-09-161-2/+2
* fix mtab reading and pseudo-device usePascal Rigaux2001-09-031-1/+1
* remove fd0H1440 and fd1H1440Pascal Rigaux2001-08-291-2/+0
* add number-only device-name handling (eg: "801" is "sda1")Pascal Rigaux2001-08-141-1/+4
* add /dev/hd[mt] handlingPascal Rigaux2001-08-131-0/+4
* move to MDK::Common, bool->to_boolPascal Rigaux2001-07-241-1/+1
l kwb">$vt_number) or die "setVirtual failed"; unpack "S", $vt; } sub removeXiBSuffix { local $_ = shift; /(\d+)\s*kB?$/i and return $1 * 1024; /(\d+)\s*MB?$/i and return $1 * 1024 * 1024; /(\d+)\s*GB?$/i and return $1 * 1024 * 1024 * 1024; /(\d+)\s*TB?$/i and return $1 * 1024 * 1024 * 1024 * 1024; $_; } sub formatXiB { my ($newnb, $newbase) = @_; $newbase ||= 1; my ($nb, $base); my $decr = sub { ($nb, $base) = ($newnb, $newbase); $base >= 1024 ? ($newbase = $base / 1024) : ($newnb = $nb / 1024); }; foreach ('', N("KB"), N("MB"), N("GB")) { $decr->(); if ($newnb < 1 && $newnb * $newbase < 1) { my $v = $nb * $base; my $s = $v < 10 && int(10 * $v - 10 * int($v)); return int($v) . ($s ? ".$s" : '') . $_; } } int($newnb * $newbase) . N("TB"); } sub formatTime { my ($s, $m, $h) = gmtime($_[0]); if ($h) { sprintf "%02d:%02d", $h, $m; } elsif ($m > 1) { N("%d minutes", $m); } elsif ($m == 1) { N("1 minute"); } else { N("%d seconds", $s); } } sub usingRamdisk { any { /ram3/ } cat_("/proc/mounts") } sub expand_symlinks_but_simple { my ($f) = @_; my $link = readlink($f); my $f2 = expand_symlinks($f); if ($link && $link !~ m|/|) { # put back the last simple symlink $f2 =~ s|\Q$link\E$|basename($f)|e; } $f2 } sub sync { &MDK::Common::System::sync } # Group the list by n. Returns a reference of lists of length n sub group_n_lm { my $n = shift; my @l; push @l, [ splice(@_, 0, $n) ] while @_; @l } sub screenshot_dir__and_move { my ($dir1, $dir2) = ("$::prefix/root", '/tmp/stage2'); if (-e $dir1) { if (-e "$dir2/DrakX-screenshots") { cp_af("$dir2/DrakX-screenshots", $dir1); rm_rf("$dir2/DrakX-screenshots"); } $dir1; } else { $dir2; } } sub take_screenshot { my ($in) = @_; my $dir = screenshot_dir__and_move() . '/DrakX-screenshots'; my $warn; if (!-e $dir) { mkdir $dir or $in->ask_warn('', N("Can't make screenshots before partitioning")), return; $warn = 1; } my $nb = 1; $nb++ while -e "$dir/$nb.png"; system("fb2png /dev/fb0 $dir/$nb.png 0"); $in->ask_warn('', N("Screenshots will be available after install in %s", "/root/DrakX-screenshots")) if $warn; } sub join_lines { my @l; my $s; foreach (@_) { if (/^\s/) { $s .= $_; } else { push @l, $s if $s; $s = $_; } } @l, if_($s, $s); } sub set_alternative { my ($command, $executable) = @_; #- check the existance of $executable as an alternative for $command #- (is this needed???) run_program::rooted_get_stdout($::prefix, 'update-alternatives', '--display', $command) =~ /^\Q$executable /m or return; #- this doesn't handle relative symlink, but neither does update-alternatives ;p symlinkf $executable, "$::prefix/etc/alternatives/$command"; } sub files_exist { and_(map { -f "$::prefix$_" } @_) } sub secured_file { my ($f) = @_; c::is_secure_file($f) or die "can't ensure a safe $f"; $f; } sub set_permissions { my ($file, $perms, $owner, $group) = @_; # We only need to set the permissions during installation to be able to # print test pages. After installation the devfsd daemon does the business # automatically. return 1 unless $::isInstall; if ($owner && $group) { run_program::rooted($::prefix, "/bin/chown", "$owner.$group", $file) or die "Could not start chown!"; } elsif ($owner) { run_program::rooted($::prefix, "/bin/chown", $owner, $file) or die "Could not start chown!"; } elsif ($group) { run_program::rooted($::prefix, "/bin/chgrp", $group, $file) or die "Could not start chgrp!"; } run_program::rooted($::prefix, "/bin/chmod", $perms, $file) or die "Could not start chmod!"; } sub mandrake_release { chomp_(cat_("/etc/mandrake-release")) } 1;