Re: Upgrade script for libata transition
* Ben Hutchings <ben@decadent.org.uk> [2009-12-29 12:06]:
> Linux kernel packages for "squeeze" will use libata-based drivers in
> preference to old-style IDE drivers. On some systems this will change
Some comments:
- Machines needing the DELO boot loader are no longer supported but
I guess it doesn't hurt to have it there.
(BTW, is there a reason we list all these boot loaders in
temp.image.plain/postinst?)
- Support for CoLo is needed (Cobalt machines). A patch is below.
It generates a good boot config. Hmm, actually, there is a
problem: it won't boot. mips/mipsel don't use a ramdisk and the
kernel doesn't like root=UUID=... I guess the solution is to
convert hdaX to sdaX. Comments? (The same problem applies to
delo/arcboot but there we could simply skip the UUID conversion
since the machines use SCSI anyway and so have always used sdaX)
- I wonder if you should run "update-initramfs -u" on machines
where flash-kernel is installed and `flash-kernel --supported` is true
(the root device is stored in the ramdisk).
- grub1_update on line 308 has:
if (defined(my $new_value = kernel_update($value))) {
Don't you have to pass $map to kernel_update() as the 2nd paramter?
--- upgrade 2010-01-11 19:22:06.000000000 +0000
+++ colo2 2010-01-11 20:26:51.000000000 +0000
@@ -819,6 +819,36 @@
}
}
+### colo
+
+sub colo_list {
+ my ($file) = @_;
+ while (<$file>) {
+ # If CoLo is not configured to use the generic symlink, ignore it.
+ if (/^load.*vmlinux-/) {
+ return ();
+ }
+ if (/^execute root=(\S+)/) {
+ return $1;
+ }
+ }
+ return ();
+}
+
+sub colo_update {
+ my ($old, $new, $map) = @_;
+ while (<$old>) {
+ my $text = $_;
+ if (/^mount hda/) {
+ $text = "# CoLo uses hda rather than sda to refer to the disk\n$text";
+ }
+ if (/^execute root=(\S+)(.*)/) {
+ $text = "# $text" . "execute root=" . $map->{$1} . "$2\n";
+ }
+ $new->print($text);
+ }
+}
+
### Filesystem relabelling
sub ext2_label {
@@ -974,7 +1004,11 @@
{packages => 'aboot',
path => '/etc/aboot.conf',
list => \&aboot_list,
- update => \&aboot_update});
+ update => \&aboot_update},
+ {packages => 'colo',
+ path => '/boot/default.colo',
+ list => \&colo_list,
+ update => \&colo_update});
my %bdev_map = ();
my @matched_configs = ();
--
Martin Michlmayr
http://www.cyrius.com/
Reply to: