summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/c/stuff.xs.pm2
-rw-r--r--perl-install/common.pm3
-rw-r--r--perl-install/fs.pm10
-rw-r--r--perl-install/install2.pm18
-rw-r--r--perl-install/install_any.pm41
-rw-r--r--perl-install/install_steps.pm42
-rw-r--r--perl-install/install_steps_gtk.pm61
-rw-r--r--perl-install/install_steps_interactive.pm23
-rw-r--r--perl-install/interactive.pm2
-rw-r--r--perl-install/loopback.pm20
-rw-r--r--perl-install/partition_table.pm3
-rw-r--r--perl-install/partition_table_raw.pm3
-rw-r--r--perl-install/share/themes-mdk.rc83
-rw-r--r--perl-install/share/themes/mdk-button1.pngbin0 -> 85 bytes
-rw-r--r--perl-install/share/themes/mdk-button4.pngbin0 -> 4362 bytes
15 files changed, 233 insertions, 78 deletions
diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm
index 4ed85484a..588d07547 100644
--- a/perl-install/c/stuff.xs.pm
+++ b/perl-install/c/stuff.xs.pm
@@ -799,7 +799,7 @@ headerGetEntry_filenames(h)
@macros = (
[ qw(int S_IFCHR S_IFBLK KDSKBENT KT_SPEC NR_KEYS MAX_NR_KEYMAPS BLKRRPART TIOCSCTTY
HDIO_GETGEO BLKGETSIZE LOOP_GET_STATUS
- MS_MGC_VAL MS_RDONLY O_NONBLOCK SECTORSIZE WNOHANG
+ MS_MGC_VAL MS_RDONLY O_NONBLOCK O_CREAT SECTORSIZE WNOHANG
VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE CDROM_LOCKDOOR CDROMEJECT
) ],
);
diff --git a/perl-install/common.pm b/perl-install/common.pm
index 3d38e91a4..140067284 100644
--- a/perl-install/common.pm
+++ b/perl-install/common.pm
@@ -9,7 +9,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK $printable_chars $sizeof_int $bitof_int
common => [ qw(__ even odd arch min max sqr sum and_ or_ sign product bool invbool listlength bool2text bool2yesno text2bool to_int to_float ikeys member divide is_empty_array_ref is_empty_hash_ref add2hash add2hash_ set_new set_add round round_up round_down first second top uniq translate untranslate warp_text formatAlaTeX formatLines deref) ],
functional => [ qw(fold_left compose map_index grep_index map_each grep_each list2kv map_tab_hash mapn mapn_ difference2 before_leaving catch_cdie cdie) ],
file => [ qw(dirname basename touch all glob_ cat_ output symlinkf chop_ mode typeFromMagic expand_symlinks) ],
- system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file formatTime) ],
+ system => [ qw(sync makedev unmakedev psizeof strcpy gettimeofday syscall_ salt getVarsFromSh setVarsInSh setVarsInCsh substInFile availableRam availableMemory removeXiBSuffix template2file formatTime unix2dos) ],
constant => [ qw($printable_chars $sizeof_int $bitof_int $SECTORSIZE) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -91,6 +91,7 @@ sub set_add($@) { my $o = shift; foreach (@_) { exists $o->{hash}{$_} and next;
sub sync { syscall_('sync') }
sub gettimeofday { my $t = pack "LL"; syscall_('gettimeofday', $t, 0) or die "gettimeofday failed: $!\n"; unpack("LL", $t) }
+sub unix2dos { local $_ = $_[0]; s/\015$//mg; s/$/\015/mg; $_ }
sub remove_spaces { local $_ = shift; s/^ +//; s/ +$//; $_ }
sub mode { my @l = stat $_[0] or die "unable to get mode of file $_[0]: $!\n"; $l[2] }
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index cf6ed3ebf..d4a564b0c 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -85,6 +85,12 @@ sub format_ext2($@) {
run_program::run("mke2fs", @options, devices::make($dev)) or die _("%s formatting of %s failed", "ext2", $dev);
}
+sub format_reiserfs($@) {
+ my ($dev, @options) = @_;
+
+ run_program::run("mkreiserfs", @options, devices::make($dev)) or die _("%s formatting of %s failed", "reiserfs", $dev);
+}
+
sub format_dos($@) {
my ($dev, @options) = @_;
@@ -108,6 +114,8 @@ sub real_format_part {
if (isExt2($part)) {
push @options, "-F" if isLoopback($part);
format_ext2($part->{device}, @options);
+ } elsif (isReiserfs($part)) {
+ format_reiserfs($part->{device}, @options);
} elsif (isDos($part)) {
format_dos($part->{device}, @options);
} elsif (isWin($part)) {
@@ -294,7 +302,7 @@ sub write($$$$) {
my @to_add = (
$useSupermount ?
[ 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 ' ', "/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 986ee9c56..6d301c3fb 100644
--- a/perl-install/install2.pm
+++ b/perl-install/install2.pm
@@ -280,11 +280,6 @@ sub selectInstallClass {
#------------------------------------------------------------------------------
sub partitionDisks {
return install_any::searchAndMount4Upgrade($o) if $o->{isUpgrade};
- return
- $o->{fstab} = [
- { device => "loop7", type => 0x83, size => 2048 * cat_('/dos/lnx4win/size.txt'), mntpoint => "/", isFormatted => 1, isMounted => 1 },
- { device => "/initrd/dos/lnx4win/swapfile", type => 0x82, mntpoint => "swap", isFormatted => 1, isMounted => 1 },
- ] if $o->{lnx4win};
($o->{hd_dev}) = cat_("/proc/mounts") =~ m|/tmp/(\S+)\s+/tmp/hdimage|;
@@ -320,7 +315,7 @@ Then choose action ``Mount point'' and set it to `/'");
}
sub formatPartitions {
- unless ($o->{lnx4win} || $o->{isUpgrade}) {
+ unless ($o->{isUpgrade}) {
$o->choosePartitionsToFormat($o->{fstab});
$o->formatMountPartitions($o->{fstab}) unless $::testing;
eval { $o = $::o = install_any::loadO($o) } if $_[1] == 1;
@@ -333,6 +328,11 @@ sub formatPartitions {
raid::prepare_prefixed($o->{raid}, $o->{prefix});
+ my $d = "/initrd/loopfs/lnx4win";
+ if (-d $d) {
+ install_any::getAndSaveFile("lnx4win/$_", "$d/$_") foreach qw(loadlin.exe linux.pif lnx4win.exe);
+ }
+
#-noatime option for ext2 fs on laptops (do not wake up the hd)
#- Do not update inode access times on this
#- file system (e.g, for faster access on the
@@ -454,13 +454,12 @@ sub addUser {
sub createBootdisk {
modules::write_conf("$o->{prefix}/etc/conf.modules");
- return if $o->{lnx4win};
$o->createBootdisk($_[1] == 1);
}
#------------------------------------------------------------------------------
sub setupBootloader {
- return if $o->{lnx4win} || $::g_auto_install;
+ return if $::g_auto_install;
$o->setupBootloaderBefore if $_[1] == 1;
$o->setupBootloader($_[1] - 1);
@@ -494,6 +493,7 @@ sub main {
install_steps_auto_install::errorInStep();
};
$ENV{SHARE_PATH} ||= "/usr/share";
+ $ENV{DURING_INSTALL} = 1;
$::beginner = $::expert = $::g_auto_install = 0;
@@ -641,7 +641,6 @@ sub main {
modules::read_already_loaded();
eval { modules::load("af_packet") };
- install_any::lnx4win_preinstall() if $o->{lnx4win};
#-the main cycle
my $clicked = 0;
@@ -677,7 +676,6 @@ sub main {
fs::write($o->{prefix}, $o->{fstab}, $o->{manualFstab}, $o->{useSupermount});
modules::write_conf("$o->{prefix}/etc/conf.modules");
- install_any::lnx4win_postinstall($o->{prefix}) if $o->{lnx4win};
install_any::killCardServices();
#- make sure failed upgrade will not hurt too much.
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index d180921bb..507d0b0f1 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -58,7 +58,7 @@ sub changeMedium($$) {
}
sub relGetFile($) {
local $_ = $_[0];
- m|^Mandrake/| and return $_;
+ m,^(Mandrake|lnx4win)/, and return $_;
/\.img$/ and return "images/$_";
my $dir = m|/| ? "mdkinst" : /^(?:compss|compssList|compssUsers|filelist|depslist.*|hdlist.*)$/ ?
"base/": "RPMS$asked_medium/";
@@ -127,13 +127,16 @@ sub getFile {
}
goto &getFile;
}
-sub rewindGetFile() {
- if ($::o->{method} && $::o->{method} eq "ftp") {
- require ftp;
- ftp::rewindGetFile(); #- make sure to reopen connection.
- }
+sub getAndSaveFile {
+ my ($file, $local) = @_;
+ local *F; open F, ">$local" or return;
+ local $/ = \ (16 * 1024);
+ my $f = getFile($file) or return;
+ syswrite F, $_ foreach <$f>;
+ 1;
}
+
#-######################################################################################
#- Post installation RPMS from cdrom only, functions
#-######################################################################################
@@ -457,25 +460,6 @@ sub crypt($) {
crypt ($password, salt(2));
}
-sub lnx4win_preinstall {
- require swap;
- swap::swapon("/dos/lnx4win/swapfile"); #- allow lnx4win to run with a little more memory.
-}
-sub lnx4win_postinstall {
- my ($prefix) = @_;
- my $dir = "/dos/lnx4win";
- my $kernel = "$dir/vmlinuz";
- rename $kernel, "$kernel.old";
- commands::dd("if=$prefix/boot/vmlinuz", "of=$kernel");
- run_program::run("rdev", $kernel, "/dev/loop7");
-
- unlink "$dir/size.txt";
- unlink "$dir/swapsize.txt";
-
- mkdir "$prefix/initrd", 0755;
- symlinkf "/initrd/dos", "$prefix/mnt/dos";
-}
-
sub killCardServices {
my $pid = chop_(cat_("/tmp/cardmgr.pid"));
$pid and kill(15, $pid); #- send SIGTERM
@@ -624,10 +608,9 @@ sub fsck_option() {
sub install_urpmi {
my ($prefix, $method, $mediums) = @_;
- {
- local *F = getFile("depslist");
- output("$prefix/var/lib/urpmi/depslist", <F>);
- }
+
+ getAndSaveFile("depslist", "$prefix/var/lib/urpmi/depslist");
+
my @cfg = map_index {
my $name = $_->{fakemedium};
diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm
index cabd1e724..19affa768 100644
--- a/perl-install/install_steps.pm
+++ b/perl-install/install_steps.pm
@@ -118,11 +118,34 @@ sub setupSCSI {
modules::load_thiskind('scsi');
}
#------------------------------------------------------------------------------
-sub doPartitionDisks($$) {
+sub doPartitionDisks {
my ($o, $hds) = @_;
return if $::testing;
- partition_table::write($_) foreach @$hds;
+
+ if ($o->{lnx4win}) {
+ my @l = sort { $a->{device_windobe} cmp $b->{device_windobe} }
+ grep { isFat($_) } fsedit::get_fstab(@{$o->{hds}}) or die "wow, lnx4win with no fat partitions! hard times :(";
+ my $real_part = @l > 1 && $o->doPartitionDisksLnx4winDev(\@l) || $l[0];
+
+ my $handle = loopback::inspect($real_part) or die _("This partition can't be used for loopback");
+ my $size = loopback::getFree($handle->{dir}, $real_part);
+
+ my $max_linux = 1000 << 11; $max_linux *= 10 if $::expert;
+ my $min_freewin = 100 << 11;
+
+ my $swap = { type => 0x82, loopback_file => '/lnx4win/swapfile', mntpoint => 'swap', size => 64 << 11, device => $real_part, notFormatted => 1 };
+ my $root = { type => 0x83, loopback_file => '/lnx4win/linuxsys.img', mntpoint => '/', size => 0, device => $real_part, notFormatted => 1 };
+ $root->{size} = min($size - $swap->{size} - $min_freewin, $max_linux);
+
+ $o->doPartitionDisksLnx4winSize(\$root->{size}, \$swap->{size}, $size - 2 * $swap->{size}, 2 * $swap->{size});
+
+ push @{$real_part->{loopback}}, $root, $swap;
+ } else {
+ partition_table::write($_) foreach @$hds;
+ }
}
+sub doPartitionDisksLnx4winDev {}
+sub doPartitionDisksLnx4winSize {}
#------------------------------------------------------------------------------
@@ -275,6 +298,9 @@ Consoles 1,3,4,7 may also contain interesting information";
run_program::rooted($o->{prefix}, "chkfontpath", "--remove", "/usr/X11R6/lib/X11/fonts/mdk");
run_program::rooted($o->{prefix}, "chkfontpath", "--add", "/usr/X11R6/lib/X11/fonts/mdk");
+ #- call update-menus at the end of package installation
+ run_program::rooted($o->{prefix}, "update-menus");
+
#- create /etc/sysconfig/desktop file according to user choice and presence of /usr/bin/kdm or /usr/bin/gdm.
my $f = "$o->{prefix}/etc/sysconfig/desktop";
if ($o->{compssUsersChoice}{KDE} && -x "$o->{prefix}/usr/bin/kdm") {
@@ -576,7 +602,7 @@ sub addUser($) {
if $u->{uid} != $u->{oldu} || $u->{gid} != $u->{oldg};
}
require any;
- any::addUsers($o->{prefix}, map { $_->{name} } @l);
+ any::addUsers($o->{prefix}, @l);
}
#------------------------------------------------------------------------------
@@ -668,8 +694,11 @@ sub setupBootloader($) {
return if $::testing;
my $b = $o->{bootloader};
$b->{boot} or $o->ask_warn('', "Can't install aboot, not a bsd disklabel"), return;
-
- run_program::rooted($o->{prefix}, "swriteboot", $b->{boot}, "/boot/bootlx");
+
+ run_program::rooted($o->{prefix}, "swriteboot", $b->{boot}, "/boot/bootlx") or do {
+ cdie "swriteboot failed";
+ run_program::rooted($o->{prefix}, "swriteboot", "-f1", $b->{boot}, "/boot/bootlx");
+ };
run_program::rooted($o->{prefix}, "abootconf", $b->{boot}, $b->{part_nb});
output "$o->{prefix}/etc/aboot.conf",
@@ -677,6 +706,9 @@ sub setupBootloader($) {
map { /$o->{prefix}(.*)/ } eval { glob_("$o->{prefix}/boot/vmlinux*") };
} elsif (arch() =~ /^sparc/) {
silo::install($o->{prefix}, $o->{bootloader});
+ } elsif ($o->{lnx4win}) {
+ local $o->{bootloader}{boot} = first(grep { loopback::carryRootLoopback($_) } @{$o->{fstab}});
+ eval { lilo::install_loadlin($o->{prefix}, $o->{bootloader}, $o->{fstab}) };
} else {
eval { lilo::install($o->{prefix}, $o->{bootloader}, $o->{fstab}) };
my $err = $@;
diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm
index 933ac8368..72f9a3fef 100644
--- a/perl-install/install_steps_gtk.pm
+++ b/perl-install/install_steps_gtk.pm
@@ -92,10 +92,7 @@ sub new($$) {
my $prog = /Xsun/ ? $_ : "XF86_$_";
unless (-x "$dir/XF86_$_") {
unlink $_ foreach glob_("$dir/X*");
- local *F; open F, ">$dir/$prog" or die "failed to write server: $!";
- local $/ = \ (16 * 1024);
- my $f = install_any::getFile("$dir/$prog") or next;
- syswrite F, $_ foreach <$f>;
+ install_any::getAndSaveFile("$dir/$prog", "$dir/$prog") or die "failed to get server: $!";
chmod 0755, "$dir/$prog";
}
if (/FB/) {
@@ -187,9 +184,16 @@ sub selectMouse {
}
#------------------------------------------------------------------------------
-sub doPartitionDisks($$) {
+sub doPartitionDisks {
my ($o, $hds, $raid) = @_;
+ if ($o->{lnx4win}) {
+ eval { install_steps::doPartitionDisks(@_) };
+ $@ =~ /no fat/ or return;
+
+ $o->ask_warn('', _("You don't have any windows partitions!"));
+ delete $o->{lnx4win};
+ }
if ($::beginner && fsedit::is_one_big_fat($hds)) {
#- wizard
my $min_linux = 600 << 11;
@@ -246,9 +250,54 @@ When sure, press Ok."))) {
}
}
+sub doPartitionDisksLnx4winDev {
+ my ($o, $l) = @_;
+ return if $::beginner;
+
+ my ($dev) = $o->ask_from_list('', _("Which partition do you want to use to put Linux4Win?"),
+ [ map { sprintf "%s (%s) [%dMB]", $_->{device_windobe}, $_->{device}, $_->{size} >> 11 } @$l ]
+ ) =~ /\((\S+)\)/;
+ $_->{device} eq $dev and return $_ foreach @$l;
+}
+
+sub doPartitionDisksLnx4winSize {
+ my ($o, $root_size, $swap_size, $max_root_size, $max_swap_size) = @_;
+ return if $::beginner;
+
+ my $w = my_gtk->new('');
+
+ my $root_adj = create_adjustment($max_root_size >> 11, 1, $$root_size >> 11);
+ my $swap_adj = create_adjustment($max_swap_size >> 11, 1, $$swap_size >> 11);
+ my $root_spin = new Gtk::SpinButton($root_adj, 0, 0);
+ my $swap_spin = new Gtk::SpinButton($swap_adj, 0, 0);
+
+ gtkadd($w->{window},
+ gtkpack(new Gtk::VBox(0,20),
+_("Choose the sizes"),
+ create_packtable({},
+ [ _("Root partition size in MB: "), $root_spin ],
+ [ undef, new Gtk::HScrollbar($root_adj) ],
+ [ _("Swap partition size in MB: "), $swap_spin ],
+ [ undef, new Gtk::HScrollbar($swap_adj) ],
+ ),
+ create_okcancel($w)
+ ),
+ );
+ $w->{ok}->grab_focus;
+ $w->main(sub {
+ $$root_size = $root_spin->get_value_as_int << 11;
+ $$swap_size = $swap_spin->get_value_as_int << 11;
+ });
+
+}
+
#------------------------------------------------------------------------------
sub chooseSizeToInstall {
my ($o, $packages, $min_size, $max_size) = @_;
+
+ #- don't ask anything if the difference between min and max is too small
+ return $max_size if $min_size && $max_size / $min_size < 1.01;
+
my ($min, $max) = map { pkgs::correctSize($_ / sqr(1024)) } $min_size, $max_size;
log::l("choosing size to install between $min and $max (really between $min_size and $max_size)");
my $w = my_gtk->new('');
@@ -260,7 +309,7 @@ sub chooseSizeToInstall {
_("Now that you've selected desired groups, please choose
how many packages you want, ranging from minimal to full
installation of each selected groups.") .
- ($::expert ? "\n" . _("You will be able to choose more precisely in next step") : ''),
+ ($o->{compssUsersChoice}{Individual} ? "\n" . _("You will be able to choose more precisely in next step") : ''),
create_packtable({ col_spacings => 10 },
[ _("Choose the size you want to install"), $spin, _("MB"), ],
[ undef, new Gtk::HScrollbar($adj) ],
diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm
index 52d9c4fb1..770758d2a 100644
--- a/perl-install/install_steps_interactive.pm
+++ b/perl-install/install_steps_interactive.pm
@@ -212,7 +212,9 @@ sub choosePartitionsToFormat($$) {
$o->SUPER::choosePartitionsToFormat($fstab);
- my @l = grep { !$_->{isFormatted} && $_->{mntpoint} && !($::beginner && isSwap($_)) } @$fstab;
+ my @l = grep { !$_->{isFormatted} && $_->{mntpoint} && !($::beginner && isSwap($_)) &&
+ (!isFat($_) || $::expert || $_->{toFormat})
+ } @$fstab;
$_->{toFormat} = 1 foreach grep { $::beginner && isSwap($_) } @$fstab;
return if $::beginner && 0 == grep { ! $_->{toFormat} } @l;
@@ -656,7 +658,7 @@ sub addUser {
my ($o, $clicked) = @_;
my $u = $o->{user} ||= {};
if ($::beginner || $o->{security} < 1) {
- add2hash_($u, { name => "mandrake", password => "mandrake", realname => "default" });
+ add2hash_($u, { name => "mandrake", password => "mandrake", realname => "default", icon => translate('automagic') });
$o->{users} ||= [ $u ];
}
$u->{password2} ||= $u->{password} ||= "";
@@ -875,7 +877,11 @@ sub setupBootloader {
my ($o) = @_;
if (arch() =~ /^alpha/) {
$o->ask_yesorno('', _("Do you want to use aboot?"), 1) or return;
- $o->SUPER::setupBootloader;
+ catch_cdie { $o->SUPER::setupBootloader } sub {
+ $o->ask_yesorno('',
+_("Error installing aboot,
+try to force installation even if that destroys the first partition?"));
+ };
} elsif (arch() =~ /^sparc/) {
&setupSILO;
} else {
@@ -997,13 +1003,10 @@ sub generateAutoInstFloppy($) {
my $image = $o->{pcmcia} ? "pcmcia" :
${{ hd => 'hd', cdrom => 'cdrom', ftp => 'network', nfs => 'network', http => 'network' }}{$o->{method}};
-
- if (my $fd = install_any::getFile("$image.img")) {
- my $w = $o->wait_message('', _("Creating auto install floppy"));
- local *OUT;
- open OUT, ">$dev" or log::l("failed to write $dev"), return;
- local $/ = \ (16 * 1024);
- print OUT foreach <$fd>;
+
+ {
+ my $w = $o->wait_message('', _("Creating auto install floppy"));
+ install_any::getAndSaveFile("$image.img", $dev) or log::l("failed to write $dev"), return;
}
fs::mount($dev, "/floppy", "vfat", 0);
substInFile { s/timeout.*//; s/^(\s*append)/$1 kickstart=floppy/ } "/floppy/syslinux.cfg";
diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm
index 55abb5b23..e09838d6b 100644
--- a/perl-install/interactive.pm
+++ b/perl-install/interactive.pm
@@ -93,7 +93,7 @@ sub ask_from_list_ {
sub ask_from_list {
my ($o, $title, $message, $l, $def) = @_;
- @$l == 0 and die '';
+ @$l == 0 and die 'ask_from_list: empty list';
@$l == 1 and return $l->[0];
goto &ask_from_list2;
}
diff --git a/perl-install/loopback.pm b/perl-install/loopback.pm
index baf8acd8f..17e8c40a6 100644
--- a/perl-install/loopback.pm
+++ b/perl-install/loopback.pm
@@ -40,8 +40,8 @@ sub carryRootCreateSymlink {
#- do non-relative link for install, should be changed to relative link before rebooting
symlink "/initrd/loopfs", $mntpoint;
- mkdir "/initrd/loopfs/boot", 0755;
- symlink "/initrd/loopfs/boot", "$prefix/boot";
+ commands::mkdir_("-p", "/initrd/loopfs/lnx4win/boot");
+ symlink "/initrd/loopfs/lnx4win/boot", "$prefix/boot";
}
#- indicate kernel to keep initrd
mkdir "$prefix/initrd", 0755;
@@ -63,18 +63,18 @@ sub create {
eval { commands::mkdir_("-p", dirname($f)) };
- log::l("creating loopback file $f");
-
+ log::l("creating loopback file $f ($part->{size} sectors)");
+ unlink $f;
+
local *F;
- open F, ">$f" or die "failed to create loopback file";
- for (my $nb = $part->{size}; $nb >= 0; $nb -= 8) { #- 8 * 512 = 4096 :)
- print F "\0" x 4096;
- }
+ sysopen F, $f, 2 | c::O_CREAT() or die "failed to create loopback file";
+ sysseek F, ($part->{size} << 9) - 1, 0 or die "failed to create loopback file";
+ syswrite F, "\0" or die "failed to create loopback file";
$f;
}
sub inspect {
- my ($part, $prefix) = @_;
+ my ($part, $prefix, $rw) = @_;
isMountableRW($part) or return;
@@ -86,7 +86,7 @@ sub inspect {
$dir = '';
} else {
mkdir $dir, 0700;
- fs::mount($part->{device}, $dir, type2fs($part->{type}), 'rdonly');
+ fs::mount($part->{device}, $dir, type2fs($part->{type}), !$rw);
}
my $h = before_leaving {
if (!$part->{isMounted} && $dir) {
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 0d9da9cee..09790a2ec 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -7,7 +7,7 @@ use Data::Dumper;
@ISA = qw(Exporter);
%EXPORT_TAGS = (
- types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isSwap isDos isWin isFat isPrimary isNfs isSupermount isRAID isHFS isNT isMountableRW isApplePartMap isLoopback) ],
+ types => [ qw(type2name type2fs name2type fs2type isExtended isExt2 isReiserfs isSwap isDos isWin isFat isPrimary isNfs isSupermount isRAID isHFS isNT isMountableRW isApplePartMap isLoopback) ],
);
@EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
@@ -204,6 +204,7 @@ sub isExtended($) { (arch() !~ /^sparc/ && $_[0]{type} == 5) || $_[0]{type} == 0
sub isRAID($) { $_[0]{type} == 0xfd }
sub isSwap($) { $type2fs{$_[0]{type}} eq 'swap' }
sub isExt2($) { $type2fs{$_[0]{type}} eq 'ext2' }
+sub isReiserfs($) { $type2fs{$_[0]{type}} eq 'reiserfs' }
sub isDos($) { $ {{ 1=>1, 4=>1, 6=>1 }}{$_[0]{type}} }
sub isWin($) { $ {{ 0xb=>1, 0xc=>1, 0xe=>1, 0x1b=>1, 0x1c=>1, 0x1e=>1 }}{$_[0]{type}} }
sub isFat($) { isDos($_[0]) || isWin($_[0]) }
diff --git a/perl-install/partition_table_raw.pm b/perl-install/partition_table_raw.pm
index 603d65f4e..45fbdd424 100644
--- a/perl-install/partition_table_raw.pm
+++ b/perl-install/partition_table_raw.pm
@@ -11,6 +11,7 @@ my @MBR_signatures = (
[ 'empty', 0, "\0\0\0\0" ],
[ 'lilo', 0x2, "LILO" ],
[ 'lilo', 0x6, "LILO" ],
+ [ 'grub', 0x17d, "stage1 \0" ],
[ 'osbs', 0x2, "OSBS" ], #- http://www.prz.tu-berlin.de/~wolf/os-bs.html
[ 'pqmagic', 0xef, "PQV" ],
[ 'BootStar', 0x130, "BootStar:" ],
@@ -18,7 +19,6 @@ my @MBR_signatures = (
[ 'system_commander', 0x1ad, "SYSCMNDRSYS" ],
[ 'Be Os', 0x24, 'Boot Manager' ],
[ 'TimO', 0, 'IBM Thinkpad hibernation partition' ],
- [ 'os2', 0x1c2, "\xA" ],
[ 'dos', 0xa0, "\x25\x03\x4E\x02\xCD\x13" ],
[ 'dos', 0xa0, "\x00\xB4\x08\xCD\x13\x72" ], #- nt2k's
[ 'dos', 0x60, "\xBB\x00\x7C\xB8\x01\x02\x57\xCD\x13\x5F\x73\x0C\x33\xC0\xCD\x13" ], #- nt's
@@ -27,6 +27,7 @@ my @MBR_signatures = (
[ 'freebsd', 0x160, "\x6A\x10\x89\xE6\x48\x80\xCC\x40\xCD\x13" ],
[ 'dummy', 0xAC, "\x0E\xB3\x07\x56\xCD\x10\x5E\xEB" ], #- caldera?
[ 'ranish', 0x100, "\x6A\x10\xB4\x42\x8B\xF4\xCD\x13\x8B\xE5\x73" ],
+ [ 'os2', 0x1c2, "\xA" ],
);
sub typeOfMBR($) { typeFromMagic(devices::make($_[0]), @MBR_signatures) }
diff --git a/perl-install/share/themes-mdk.rc b/perl-install/share/themes-mdk.rc
index c9e31fc62..47be00f67 100644
--- a/perl-install/share/themes-mdk.rc
+++ b/perl-install/share/themes-mdk.rc
@@ -43,6 +43,84 @@ style "checkradiobutton" {
}
}
+style "button"
+{
+ bg[NORMAL] = "#909090"
+
+ engine "pixmap"
+ {
+ image
+ {
+ function = FOCUS
+ recolorable = TRUE
+ overlay_file = "focus.png"
+ overlay_border = { 4, 4, 4, 4 }
+ overlay_stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ detail = "buttondefault"
+ shadow = IN
+ file = "blueHeart-button_def.png"
+ border = { 9, 9, 9, 9 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ shadow = OUT
+ file = "blueHeart-button1.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ recolorable = TRUE
+ state = PRELIGHT
+ shadow = OUT
+ file = "blueHeart-button2.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ recolorable = TRUE
+ state = NORMAL
+ shadow = IN
+ file = "blueHeart-button4.png"
+ border = { 2, 2, 2, 2 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ recolorable = TRUE
+ state = SELECTED
+ shadow = IN
+ file = "blueHeart-button4.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ image
+ {
+ function = BOX
+ recolorable = TRUE
+ state = ACTIVE
+ shadow = IN
+ file = "blueHeart-button4.png"
+ border = { 3, 3, 3, 3 }
+ stretch = TRUE
+ }
+ }
+}
+
style "window"
{
engine "pixmap" {
@@ -85,8 +163,8 @@ style "entry"
style "notebook"
{
- bg[NORMAL] = { 0, 0, 1.0 }
- bg[ACTIVE] = { 0, 0, 0.67 }
+ bg[NORMAL] = { 0.4, 0.4, 0.6 }
+ bg[ACTIVE] = { 0.2, 0.2, 0.4 }
fg[NORMAL] = { 1.0, 1.0, 1.0 }
}
@@ -106,6 +184,7 @@ style "background"
style "steps"
{
+ engine "pixmap" { image { function = FLAT_BOX } }
bg[NORMAL] = { 0.4, 0.4, 0.6 }
fg[NORMAL] = { 1.0, 1.0, 1.0 }
}
diff --git a/perl-install/share/themes/mdk-button1.png b/perl-install/share/themes/mdk-button1.png
new file mode 100644
index 000000000..5d65731bd
--- /dev/null
+++ b/perl-install/share/themes/mdk-button1.png
Binary files differ
diff --git a/perl-install/share/themes/mdk-button4.png b/perl-install/share/themes/mdk-button4.png
new file mode 100644
index 000000000..35b9fa364
--- /dev/null
+++ b/perl-install/share/themes/mdk-button4.png
Binary files differ