From 38f7f8427f6300ccacb464a9d3b95e89d6f83ffc Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 29 Nov 2004 17:53:54 +0000 Subject: - drop oem & recovery code (which was broken) - will be replaced with a root password + user accounts + network configuration a la drakfirsttime --- docs/README | 79 ---- make_boot_img | 1 - mdk-stage1/disk.c | 71 ---- mdk-stage1/disk.h | 3 - mdk-stage1/stage1.c | 9 +- mdk-stage1/tools.c | 1 - perl-install/bootloader.pm | 27 -- perl-install/install2.pm | 18 - perl-install/install_steps.pm | 4 +- perl-install/install_steps_gtk.pm | 2 +- perl-install/install_steps_interactive.pm | 10 +- rescue/.cvsignore | 1 - rescue/Makefile | 2 +- rescue/kernel_read_part.c | 26 -- rescue/tree/boot/grub/menu.lst | 5 - rescue/tree/etc/oem | 674 ----------------------------- rescue/tree/etc/oem-all | 676 ------------------------------ rescue/tree/etc/rc.sysinit | 2 - tools/oem-prepare | 477 --------------------- 19 files changed, 9 insertions(+), 2079 deletions(-) delete mode 100644 rescue/kernel_read_part.c delete mode 100644 rescue/tree/boot/grub/menu.lst delete mode 100755 rescue/tree/etc/oem delete mode 100755 rescue/tree/etc/oem-all delete mode 100755 tools/oem-prepare diff --git a/docs/README b/docs/README index 3d230af4f..6c8307707 100644 --- a/docs/README +++ b/docs/README @@ -276,82 +276,3 @@ replaces stage1, and init then monitors stage2) have a look at gi/docs/object_class.fig - -******************************************************************************** -* OEM ************************************************************************** -******************************************************************************** -> I am a system OEM in Bangalore,India selling systems bundled with -> Mandrakelinux. The problem is that with every system I sell, I need to -> install & configure the system which takes HOURS!. Can I do a diskcopy -> instead? -> -> Please Help. This is a major bottleneck for me. - -many solutions: - -- make an install on drive hdb, then : - dd if=/dev/hdb of=/dev/hdc - but you should make sure the hardware is *REALLY* identical. - -- try the oem feature - 3. - burn a cd out of *latest* cooker or 8.0 and above. - - boot on it telling "oem" to syslinux - !! it will destroy every data on the harddrive or - resize (or use free space) if *ONLY* one fat partition is defined !! - - you now have a very automated install matrix - (duplicate it with "dd if=/dev/hdb of=/dev/hdc bs=1M count=730") - - put the harddrive in the oem box, the user will now have an *very* automated - install, just asking the root password and user password, and some other - question according its hardware. - - 4. just like 3. but you may have to mount /cdrom after typing rescue on - syslinux prompt (oem script do it automatically if a automatic boot nfs - network has been done as server is known). under /cdrom may be anything - as long as it provides an installation tree of Mandrakelinux. - after that run oem script by typing "/etc/oem -f" for normal installation - or "/etc/oem -f server" for server installation (normal with server installed). - - 5. (just like 3. without burning a cd, doing the first part by hand) - have a look at the /etc/oem script on the rescue and do it by hand... - - -cu Pixel, fpons. - - -comments: -1. maybe copy unnecessary things -> take too long - solution -> use bs=8k count=xxxx -2. kernel_reread can be found on the new rescue, source is also at end of this -mail. This solution works with one partition. Can be easily enhanced to many -primary partitions... For extended partitions, more complicated, but not much :) -3. has just been added in latest cooker. It may still have some pb. The main -current limitation is IDE only, though it can be fixed easily for special cases. - --------------------------------------------------------------------------------- -#include -#include -#include - -void die(char *msg) -{ - perror(msg); - exit(1); -} - -void kernel_read(char *dev) -{ - int fd; - if ((fd = open(dev, O_RDONLY)) == -1) die("can't open device"); - ioctl(fd, BLKRRPART, 0); - close(fd); -} - -int main(int argc, char **argv) -{ - if (argc != 2) { - fprintf(stderr, "usage: kernel_read_part \n"); - exit(1); - } - kernel_read(argv[1]); -} diff --git a/make_boot_img b/make_boot_img index a6dd190d0..c4c85b4fe 100755 --- a/make_boot_img +++ b/make_boot_img @@ -203,7 +203,6 @@ sub entries_append { my @entries = ( (map { $_->[0] => "$automatic $default_acpi $_->[1]" } group_by2(@simple_entries)), acpi => "$automatic $default_vga", - if_(member($type, "cdrom", "all"), oem => "automatic=method:cdrom $default_vga $default_acpi rescue oem",), if_($type eq "all", all => "pcmcia $default_vga $default_acpi"), ); diff --git a/mdk-stage1/disk.c b/mdk-stage1/disk.c index 1060cd199..8318bb6f4 100644 --- a/mdk-stage1/disk.c +++ b/mdk-stage1/disk.c @@ -315,74 +315,3 @@ enum return_type disk_prepare(void) return RETURN_BACK; return disk_prepare(); } - -#ifndef MANDRAKE_MOVE -int -process_recovery(void) -{ - char ** medias, ** medias_models; - int count, i; - - log_message("trying the automatic recovery of oem installs"); - - count = get_disks(&medias, &medias_models); - - for (i=0; i 'image', - label => 'restore', - kernel_or_dev => "/boot/restore/vmlinuz", - initrd => "/boot/restore/all.rdz", - append => "$cmdline recovery", #- the restore entry is a recovery entry - if_($vga, vga => $vga), - }); - } - } else { - log::l("no restore bootloader need to be used on $hd_install_path"); - } - } - my @kernels = get_kernels_and_labels() or die "no kernel installed"; foreach my $kernel (@kernels) { diff --git a/perl-install/install2.pm b/perl-install/install2.pm index 5d006aa17..2a64574db 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -381,7 +381,6 @@ sub main { map_each { my ($n, $v) = @_; my $f = ${{ - oem => sub { $::oem = $v }, lang => sub { $o->{locale}{lang} = $v }, flang => sub { $o->{locale}{lang} = $v; push @auto, 'selectLanguage' }, method => sub { $o->{method} = $v }, @@ -399,8 +398,6 @@ sub main { testing => sub { $::testing = 1 }, patch => sub { $patch = 1 }, defcfg => sub { $cfg = $v }, - recovery => sub { $::recovery = 1 }, - restore => sub { $::restore = 1 }, newt => sub { $o->{interactive} = "newt" }, text => sub { $o->{interactive} = "newt" }, stdio => sub { $o->{interactive} = "stdio" }, @@ -534,9 +531,6 @@ sub main { #- oem patch should be read before to still allow patch or defcfg. eval { $o = $::o = install_any::loadO($o, "install/patch-oem.pl"); log::l("successfully read oem patch") }; - #- recovery mode should be read early to allow default parameter to be taken. - eval { $o = $::o = install_any::loadO($o, "install/recovery.cfg"); log::l("successfully read recovery") } if $::recovery; - $@ and $::recovery = 0; #- avoid keeping recovery if there was a problem reading the recovery.cfg file. #- patch should be read after defcfg in order to take precedance. eval { $o = $::o = install_any::loadO($o, $cfg); log::l("successfully read default configuration: $cfg") } if $cfg; eval { $o = $::o = install_any::loadO($o, "patch"); log::l("successfully read patch") } if $patch; @@ -580,14 +574,6 @@ sub main { $o->{meta_class} eq 'powerpackplus' and $o->{meta_class} = 'server'; log::l("meta_class $o->{meta_class}"); - if ($::oem) { - $o->{partitioning}{use_existing_root} = 1; - $o->{compssListLevel} = 4; - push @auto, 'selectInstallClass', 'doPartitionDisks', 'choosePackages', 'configureTimezone', 'exitInstall'; - } - if ($::recovery) { - push @auto, 'selectLanguage', 'selectInstallClass', 'selectMouse', 'selectKeyboard', 'doPartitionDisks', 'formatPartitions', 'miscellaneous', 'choosePackages', 'configureTimezone'; - } foreach (@auto) { my $s = $o->{steps}{/::(.*)/ ? $1 : $_} or next; @@ -650,10 +636,6 @@ sub main { $o->{modules_conf}->write; detect_devices::install_addons($o->{prefix}); - #- save recovery file if needed (ie disk style install). - $o->{method} eq 'disk' and - output($o->{prefix} . any::hdInstallPath() . '/install/recovery.cfg', install_any::g_auto_install(1)); - #- mainly for auto_install's #- do not use run_program::xxx because it doesn't leave stdin/stdout unchanged system("bash", "-c", $o->{postInstallNonRooted}) if $o->{postInstallNonRooted}; diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 716a5c66b..0752c50d5 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -211,7 +211,7 @@ sub doPartitionDisksAfter { die N("You must have a FAT partition mounted in /boot/efi"); } - if ($o->{partitioning}{use_existing_root} && !$::recovery) { + if ($o->{partitioning}{use_existing_root}) { #- ensure those partitions are mounted so that they are not proposed in choosePartitionsToFormat fs::mount_part($_, $o->{prefix}) foreach sort { $a->{mntpoint} cmp $b->{mntpoint} } grep { $_->{mntpoint} && maybeFormatted($_) } @{$o->{fstab}}; @@ -267,7 +267,7 @@ sub choosePartitionsToFormat($$) { $_->{mntpoint} or next; add2hash_($_, { toFormat => $_->{notFormatted} }) if $_->{fs_type}; #- eg: don't set toFormat for isRawRAID (0xfd) - $_->{$::recovery ? 'toFormat' : 'toFormatUnsure'} ||= member($_->{mntpoint}, '/', '/usr'); + $_->{toFormatUnsure} ||= member($_->{mntpoint}, '/', '/usr'); if (!$_->{toFormat}) { my $fs_type = fs::type::fs_type_from_magic($_); diff --git a/perl-install/install_steps_gtk.pm b/perl-install/install_steps_gtk.pm index d8e11ac25..e7ab57d7a 100644 --- a/perl-install/install_steps_gtk.pm +++ b/perl-install/install_steps_gtk.pm @@ -559,7 +559,7 @@ sub installPackages { my ($method, $medium) = @_; #- if not using a cdrom medium or an iso image, always abort. - return if !install_any::method_allows_medium_change($method) || $::oem; + return if !install_any::method_allows_medium_change($method); my $name = pkgs::mediumDescr($o->{packages}, $medium); local $| = 1; print "\a"; diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index ddb61d568..40ab337bb 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -82,16 +82,14 @@ sub acceptLicense { my $r = $::testing ? 'Accept' : 'Refuse'; - ($::recovery ? - $o->ask_yesorno('', N("Do you want to recover your system?"), 0) : - $o->ask_from_({ title => N("License agreement"), + $o->ask_from_({ title => N("License agreement"), cancel => N("Quit"), messages => formatAlaTeX(install_messages::main_license() . "\n\n\n" . install_messages::warning_about_patents()), interactive_help_id => 'acceptLicense', more_buttons => [ [ N("Release Notes"), sub { $o->ask_warn(N("Release Notes"), $o->{release_notes}) }, 1 ] ], callbacks => { ok_disabled => sub { $r eq 'Refuse' } }, }, - [ { list => [ N_("Accept"), N_("Refuse") ], val => \$r, type => 'list', format => sub { translate($_[0]) } } ])) + [ { list => [ N_("Accept"), N_("Refuse") ], val => \$r, type => 'list', format => sub { translate($_[0]) } } ]) or do { if ($::globetrotter) { system("killall XFree86"); @@ -450,7 +448,7 @@ sub choosePackages { #- this is done at the very beginning to take into account #- selection of CD by user if using a cdrom. - $o->chooseCD($packages) if install_any::method_allows_medium_change($o->{method}) && !$::oem; + $o->chooseCD($packages) if install_any::method_allows_medium_change($o->{method}); my $w = $o->wait_message('', N("Looking for available packages...")); my $availableC = &install_steps::choosePackages; @@ -741,7 +739,7 @@ sub installPackages { my ($method, $medium) = @_; #- if not using a cdrom medium or an iso image, always abort. - return if !install_any::method_allows_medium_change($method) || $::oem; + return if !install_any::method_allows_medium_change($method); my $name = pkgs::mediumDescr($o->{packages}, $medium); local $| = 1; print "\a"; diff --git a/rescue/.cvsignore b/rescue/.cvsignore index b5f45186d..c660273e8 100644 --- a/rescue/.cvsignore +++ b/rescue/.cvsignore @@ -1,2 +1 @@ rescue.clp -kernel_read_part diff --git a/rescue/Makefile b/rescue/Makefile index 591676a70..c08d21c75 100644 --- a/rescue/Makefile +++ b/rescue/Makefile @@ -5,7 +5,7 @@ all: rescue.clp install: rescue.clp cp -f $< $(STAGE2_DEST) -rescue.clp: kernel_read_part list list.$(ARCH) drvinst guessmounts lsparts rescue-doc make_rescue_img +rescue.clp: list list.$(ARCH) drvinst guessmounts lsparts rescue-doc make_rescue_img ./make_rescue_img clean: diff --git a/rescue/kernel_read_part.c b/rescue/kernel_read_part.c deleted file mode 100644 index 279dfe787..000000000 --- a/rescue/kernel_read_part.c +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include -#include - -void die(char *msg) -{ - perror(msg); - exit(1); -} - -void kernel_read(char *dev) -{ - int fd; - if ((fd = open(dev, O_RDONLY)) == -1) die("can't open device"); - ioctl(fd, BLKRRPART, 0); - close(fd); -} - -int main(int argc, char **argv) -{ - if (argc != 2) { - fprintf(stderr, "usage: kernel_read_part \n"); - exit(1); - } - kernel_read(argv[1]); -} diff --git a/rescue/tree/boot/grub/menu.lst b/rescue/tree/boot/grub/menu.lst deleted file mode 100644 index 1af0c85e3..000000000 --- a/rescue/tree/boot/grub/menu.lst +++ /dev/null @@ -1,5 +0,0 @@ -timeout 0 - -title oem -kernel (hd0,0)/boot/vmlinuz ramdisk_size=32000 hd vga=788 fbeginner oem -initrd (hd0,0)/boot/hd.rdz diff --git a/rescue/tree/etc/oem b/rescue/tree/etc/oem deleted file mode 100755 index 7b87a4560..000000000 --- a/rescue/tree/etc/oem +++ /dev/null @@ -1,674 +0,0 @@ -#!/usr/bin/perl - -if (shift(@ARGV) ne '-f') { - print "Call it with option -f, but don't fear loosing all your data, this command is dangerous!"; - print " -usage: /etc/oem -f [options] -where [options] are: - server : allow server installalation - boot_entries=entry1,...,entryN : set boot entries to use, - the first one is the default one - no