summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMystery Man <unknown@mandriva.org>2005-06-09 10:06:35 +0000
committerMystery Man <unknown@mandriva.org>2005-06-09 10:06:35 +0000
commit1ccd3bc7282c17470266bed8cb0244a1b64d59fe (patch)
treef4e880d019f33cf60f226be98398ea43a57878c6
parent8ea9beca90c410e12593fedfb6e741dbdf8795d0 (diff)
downloaddrakx-MDK10-LACIE.tar
drakx-MDK10-LACIE.tar.gz
drakx-MDK10-LACIE.tar.bz2
drakx-MDK10-LACIE.tar.xz
drakx-MDK10-LACIE.zip
This commit was manufactured by cvs2svn to create tag 'MDK10-LACIE'.MDK10-LACIE
-rw-r--r--globetrotter/README9
-rw-r--r--globetrotter/doc/BUILD4
-rw-r--r--globetrotter/hwprofile7
-rwxr-xr-xglobetrotter/make_live87
-rw-r--r--globetrotter/move.pm6
5 files changed, 82 insertions, 31 deletions
diff --git a/globetrotter/README b/globetrotter/README
index 3c6509b36..7052212b3 100644
--- a/globetrotter/README
+++ b/globetrotter/README
@@ -16,15 +16,14 @@ updated from cooker:
- misc bug fixes:
o drakconf-10-13mdk
- o {drakxtools,harddrake}*-10-34mdk
- o mdkonline-1.0-7mdk
+ o {drakxtools,harddrake}*-10-34.2mdk
+ o mdkonline-1.1-2.1.100mdk
o menudrake-0.7.4-8mdk
- o netprofile-0.6.3-1.1mdk (for fixed profiles)
o perl-Libconf*-0.33-2mdk
- o rpmdrake-2.1.3-4mdk
+ o rpmdrake-2.1.3-5mdk
o initscripts-7.06-49.1mdk:
* usb starting when usb host drivers were loaded by initrd
- * globetrotter support
+ * fix larsen on laptops
- root=LABEL=foobar and boot from USB support:
o mkinitrd-3.5.18-10mdk
o bootloader-utils-1.7-1mdk
diff --git a/globetrotter/doc/BUILD b/globetrotter/doc/BUILD
index 5dbba396e..108c44650 100644
--- a/globetrotter/doc/BUILD
+++ b/globetrotter/doc/BUILD
@@ -19,6 +19,10 @@ lftp -u a,a ftp://kameha:/~/../nplanel/rpm/prop/RPMS/i586/
doble [A-Z] | xargs rm -f
doble [a-g] | xargs rm -f
doble [h-z] | xargs rm -f
+- run "gendistrib --noclean /export"
- plug the LaCie disk
+- check out the whole gi cvs module
+- run "C_DRAKX=1 make c" in gi/perl-install
+- go into gi/globetrotter
- run make_live --partition --format --install --post in order to
prepare the disk
diff --git a/globetrotter/hwprofile b/globetrotter/hwprofile
index 32cb99efe..b22ff0c8b 100644
--- a/globetrotter/hwprofile
+++ b/globetrotter/hwprofile
@@ -28,7 +28,9 @@ use network::netconnect;
my $id = "MDK" . md5_hex(join("", (map { (split)[1] } cat_("/proc/bus/pci/devices"))));
my $netcnx = {};
-my $is_first_boot = !glob_("/etc/netprofile/profiles/MDK*");
+
+# first boot wizard:
+!glob_("/etc/netprofile/profiles/MDK*") and system('/usr/sbin/mdkmove');
# create hardware profile if needed:
if (! -d "/etc/netprofile/profiles/$id") {
@@ -40,8 +42,5 @@ if (! -d "/etc/netprofile/profiles/$id") {
$netcnx->{PROFILE} = $id;
eval { network::netconnect::set_profile($netcnx) };
-# first boot wizard:
-$is_first_boot and system('/usr/sbin/mdkmove');
-
# redo ldconfig cache for libGL (since we've both ATI and NVIDIA GLX packages):
system("/sbin/ldconfig");
diff --git a/globetrotter/make_live b/globetrotter/make_live
index 4f5a6e2ef..00c560c78 100755
--- a/globetrotter/make_live
+++ b/globetrotter/make_live
@@ -31,6 +31,13 @@ foreach (@ARGV) {
}
}
+my $rescue;
+
+if ($0 =~ /restore_globetrotter/) {
+ %options = (install => 1, post => 1);
+ $rescue = 1;
+}
+
@ARGV = @new_ARGV;
my @suggestions = (
@@ -95,15 +102,29 @@ sub formatdisk {
run_program::get_stdout('service', 'usb', 'start');
}
+my $pkg_dev;
+if ($rescue) {
+ system("mount -t tmpfs none /tmp");
+ # let be able to see USB devices:
+ system("mount -t usbfs none /proc/bus/usb");
+ system("modprobe usb-storage; modprobe sd_mod");
+ # let be able to detect SCSI hds:
+ mkdir("/sys");
+ system("mount -t sysfs none /sys");
-my $kernel_version = do {
- #my @l = glob_('/export/Mandrake/RPMS/kernel-enterprise-2.6*');
- my @l = glob_('/export/Mandrake/RPMS/kernel-2.6*');
- @l >= 1 or die "can't find kernel";
- @l <= 1 or die "too many kernels";
- first(`rpm -qp --qf '%{name}' $l[0]` =~ /kernel-(.*)/);
-};
+ my ($all_hds, $hd, $other) = get_hds();
+ print "Looking for the package partition\n";
+ my @parts = partition_table::get_normal_parts($hd);
+ my $pkg_dev = find { member(fs::type2fs($_), qw(ext2 ext3)) && chomp_(`e2label /dev/$_->{device} 2>/dev/root`) eq "MDK-PKGS" } @parts;
+ die "I cannot find the package partition which is needed in order to restore the system!" if is_empty_hash_ref($pkg_dev) || !$pkg_dev->{device};
+ my $root = find { member(fs::type2fs($_), qw(ext2 ext3)) && chomp_(`e2label /dev/$_->{device} 2>/dev/root`) eq "MDK-ROOT" } @parts;
+ $root = find { $_->{device} eq "sda1" } @parts if is_empty_hash_ref($root);
+ die "I cannot find any hard disk to restore!" if is_empty_hash_ref($root) || !$root->{device};
+ print "Please wait, disk reinstallation is in progress, this can take quite some time\n";
+ print "Formating $root->{device}\n";
+ system("mkfs.ext2 /dev/$root->{device} > /dev/null\n");
+}
sub installPackages() {
local $::testing = undef;
@@ -140,7 +161,15 @@ sub installPackages() {
};
undef *c::kernel_version;
- *c::kernel_version = sub { $kernel_version };
+ *c::kernel_version = sub {
+ #my @l = glob_('/export/Mandrake/RPMS/kernel-enterprise-2.6*');
+ my @l = glob_('/export/Mandrake/RPMS/kernel-2.6*');
+ @l >= 1 or die "can't find kernel";
+ @l <= 1 or die "too many kernels";
+ first(`rpm -qp --qf '%{name}' $l[0]` =~ /kernel-(.*)/);
+ };
+
+ my $kernel_version = c::kernel_version();
print "INSTALLING\n";
install_any::setPackages(my $o = $::o =
@@ -148,6 +177,8 @@ sub installPackages() {
prefix => $::prefix,
meta_class => 'desktop',
default_packages => [
+ #- for screenshots:
+ qw(fb2png),
qw(XFree86-server XFree86-xfs XFree86-FBDev),
qw(openssh-server), #- fred wants it
qw(alsa-utils cdialog newt),
@@ -156,6 +187,7 @@ sub installPackages() {
qw(acpi acpid), #- so that removing acpi=ht will work
qw(mountloop), #- crypted folders
qw(mandrake-doc-en mandrake-doc-fr mandrake-doc-drakxtools-en mandrake-doc-drakxtools-fr),
+ qw(autologin),
qw(synaptics),
#- network conf:
qw(wireless-tools pcmcia-cs),
@@ -190,7 +222,7 @@ sub installPackages() {
qw(devfsd dynamic harddrake hotplug magicdev mandrake-globetrotter netprofile),
qw(gnome2),
qw(alsa-utils),
- qw(ipw2100 ipw2100_kernel), # ipw2100_kernel-$kernel_version,
+ qw(ipw2100 ipw2100_kernel ipw2100_kernel-2.6.3.13mdk), # ipw2100_kernel-$kernel_version,
#- fonts:
qw(XFree86-100dpi-fonts XFree86-75dpi-fonts),
qw(fonts-bitmap-tscii fonts-hebrew-elmar),
@@ -204,18 +236,21 @@ sub installPackages() {
$compssUsersChoice{qq(LOCALES"$_")} = 1 foreach lang::langsLANGUAGE({ all => 1 });
pkgs::setSelectedFromCompssList($o->{packages}, \%compssUsersChoice, 4, 0);
- use Data::Dumper;
- output("/tmp/pkgs1", Dumper($o->{packages}));
+
+ my $unselect = sub {
+ my ($pkg) = @_;
+ my $p = pkgs::packageByName($o->{packages}, $pkg);
+ pkgs::unselectPackage($o->{packages}, $p) if $p;
+ };
# unselect some packages whose services fsck up the box and whose services are not enabled by appropriate tools:
# (shorewall must be deselected before iptables is)
- foreach (qw(at hpoj shorewall iptables ntp tmdns zcip )) {
- my $p = pkgs::packageByName($o->{packages}, $_);
- pkgs::unselectPackage($o->{packages}, $p) if $p;
- }
+ $unselect->($_) foreach qw(at hpoj shorewall iptables ntp tmdns zcip );
+
+ # unselect uim since uim IM break first time wizard when selecting english:
+ $unselect->($_) foreach qw(uim-applet uim libuim0);
my @toInstall = pkgs::packagesToInstall($o->{packages});
- output("/tmp/pkgs2", Dumper([ map { $_->name } @toInstall ]));
local $ENV{DURING_INSTALL} = 1;
$ENV{LD_LIBRARY_PATH} = "/lib:/usr/lib:/usr/X11R6/lib:/usr/lib/qt3/lib";
pkgs::install($::prefix, 0, \@toInstall, $o->{packages});
@@ -268,6 +303,7 @@ my $fstab = [ fsedit::get_all_fstab($all_hds) ];
# we need to mount every fs we want to see into /etc/fstab !!!
fs::mount_part($_, $::prefix) foreach sort { $a->{mntpoint} cmp $b->{mntpoint} } @$fstab;
+symlink("$::prefix/mnt/packages", "/export") if $rescue;
eval {
print "Installing packages\n";
@@ -288,6 +324,19 @@ fs::write_fstab($all_hds, $::prefix);
append_to_file("$::prefix/etc/fstab", "none /dev/pts devpts mode=0620 0 0");
doRootSubst("$::prefix/etc/fstab");
+my ($home) = grep { $_->{mntpoint} eq "/home" } @parts;
+my ($mnt_pkgs) = grep { $_->{mntpoint} eq "/mnt/packages" } @parts;
+run_program::run('tune2fs', '-L', "MDK-HOME", "/dev/$home->{device}") if $home;
+run_program::run('tune2fs', '-L', "MDK-PKGS", "/dev/$mnt_pkgs->{device}") if $mnt_pkgs;
+
+substInFile {
+ s!defaults\s!defaults,ro ! if m!/mnt/packages!;
+ s!defaults\s!defaults,umask=0000 ! if m!/mnt/share!;
+ s!/dev/$home->{device}!LABEL=MDK-HOME!g;
+ s!/dev/$mnt_pkgs->{device}!LABEL=MDK-PKGS!g;
+} "$::prefix/etc/fstab";
+
+
#-------------------------------------------------------------------
#- Bootloader
print "Configuring bootloader\n";
@@ -352,7 +401,7 @@ if ($options{post}) {
push @files, (map { "/etc/X11/$_" } qw(XF86Config XF86Config-4)),
(map { "/etc/sysconfig/$_" } qw(keyboard harddrake2/previous_hw harddisks)),
(map { "/etc/$_" } qw(modprobe.conf modprobe.devfs modprobe.preload modules modules.conf modules.devfs)),
- qw(/etc/asound.state /etc/fstab /etc/ld.so.conf/GL.conf);
+ qw(/etc/asound.state /etc/fstab /etc/ld.so.conf/GL.conf /etc/shorewall/);
output($prof_cfg, join("\n", sort @files));
@@ -399,7 +448,7 @@ unlink $_ foreach glob("$::prefix/core.*");
#
-system("rsync -rvltp /export/ $::prefix/mnt/packages/");
+system("rsync -rvltp /export/ $::prefix/mnt/packages/") if !$rescue;
unlink $_ foreach glob("$::prefix/var/lib/urpmi/*");
run_program::rooted($::prefix, 'urpmi.addmedia', '-h', 'main', 'file:///mnt/packages/Mandrake/RPMS');
run_program::rooted($::prefix, 'urpmi.addmedia', '-h', 'contrib', 'file:///mnt/packages/Mandrake/RPMS2');
@@ -407,4 +456,4 @@ run_program::rooted($::prefix, 'urpmi.addmedia', '-h', 'contrib', 'file:///mnt/p
# for fast test replaying:
run_program::rooted($::prefix, 'tar', 'cfj', '/root/etc.tar.bz2', '/etc');
-fs::umount_all($fstab, $::prefix);
+eval { fs::umount_all($fstab, $::prefix) } or system("umount $::prefix");
diff --git a/globetrotter/move.pm b/globetrotter/move.pm
index c61f3649b..dfd1e6352 100644
--- a/globetrotter/move.pm
+++ b/globetrotter/move.pm
@@ -1,6 +1,6 @@
package move; # $Id$
-#- Copyright (c) 2004 MandrakeSoft
+#- Copyright (c) 2004 Mandrakesoft
#-
#- This program is free software; you can redistribute it and/or modify
#- it under the terms of the GNU General Public License as published by
@@ -126,7 +126,7 @@ after_autoconf:
eval { &$f() };
$o->ask_warn(N("Error"), [
N("An error occurred, but I don't know how to handle it nicely.
-Continue at your own risk."), formatError($@) ]) if $@;
+Continue at your own risk."). formatError($@) || $@ ]) if $@;
}
}
system("killall XFree86");
@@ -146,7 +146,7 @@ sub automatic_xconf {
local $o->{mouse}{device} = 'mouse';
require Xconfig::default;
- $o->{raw_X} = Xconfig::default::configure({ KEYBOARD => 'uk' }, $o->{mouse}); #- using uk instead of us for now to have less warnings
+ $o->{raw_X} = Xconfig::default::configure(class_discard->new, { KEYBOARD => 'uk' }, $o->{mouse}); #- using uk instead of us for now to have less warnings
require Xconfig::main;
require class_discard;