~ubuntu-branches/ubuntu/quantal/grub2/quantal-proposed

« back to all changes in this revision

Viewing changes to debian/patches/4k_sectors.patch

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-04-03 18:15:58 UTC
  • Revision ID: package-import@ubuntu.com-20120403181558-lgozxphywuov7ne8
Tags: 1.99-21ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Adjust for default Ubuntu boot options ("quiet splash").
  - Default to hiding the menu; holding down Shift at boot will show it.
  - Set a monochromatic theme and an appropriate background for Ubuntu.
  - Apply Ubuntu GRUB Legacy changes to legacy update-grub script.
  - Fix backslash-escaping in merge_debconf_into_conf.
  - Remove "GNU/Linux" from default distributor string.
  - Add crashkernel option.
  - Bypass menu unless other OSes are installed or Shift is pressed.
  - Allow Shift to interrupt 'sleep --interruptible'.
  - Reduce visual clutter in normal mode.
  - Remove verbose messages printed before reading configuration.
  - Suppress kernel/initrd progress messages, except in recovery mode.
  - Show the boot menu if the previous boot failed.
  - Don't generate device.map during grub-install or grub-mkconfig.
  - Adjust upgrade version checks for Ubuntu.
  - Suppress "GRUB loading" message unless Shift is held down.
  - Adjust versions of grub-doc and grub-legacy-doc conflicts.
  - Fix LVM/RAID probing in the absence of /boot/grub/device.map.
  - Look for .mo files in /usr/share/locale-langpack first.
  - Build-depend on qemu-kvm rather than qemu-system for grub-pc tests.
  - Check hardware support before using gfxpayload=keep.
  - Put second and subsequent Linux menu entries in a submenu.
  - Preferred resolution detection for VBE.
  - Set vt.handoff=7 for smooth handoff to kernel graphical mode.
  - Update default/grub.md5sum to include maverick's default md5sum.
  - In recovery mode, add nomodeset to the Linux kernel arguments, and
    remove the 'set gfxpayload=keep' command.
  - Skip Windows os-prober entries on Wubi systems, and suppress the menu
    by default if those are the only other-OS entries.
  - Handle probing striped DM-RAID devices.
  - Replace 'single' by 'recovery' when friendly-recovery is installed.
  - Use qemu -no-kvm in tests for now to work around LP #947597.
  - Disable cursor as early as possible in grub_main.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
Description: Support non-512B sectors and agglomerate reads
2
2
Author: Vladimir Serbinenko <phcoder@gmail.com>
3
3
Origin: backport, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3325
 
4
Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3709
4
5
Forwarded: not-needed
5
6
Applied-Upstream: http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/3325
6
7
Last-Update: 2012-04-02
491
492
 
492
493
   /* First of all, check if the region is within the disk.  */
493
494
   if (grub_disk_adjust_range (disk, &sector, &offset, size) != GRUB_ERR_NONE)
494
 
@@ -399,126 +496,125 @@
 
495
@@ -399,126 +496,126 @@
495
496
       return grub_errno;
496
497
     }
497
498
 
700
701
-  grub_free (tmp_buf);
701
702
+      while (l)
702
703
+       {
703
 
+         (disk->read_hook) (s, o,
704
 
+                            ((l > GRUB_DISK_SECTOR_SIZE)
705
 
+                             ? GRUB_DISK_SECTOR_SIZE
706
 
+                             : l));
 
704
+         grub_size_t cl;
 
705
+         cl = GRUB_DISK_SECTOR_SIZE - o;
 
706
+         if (cl > l)
 
707
+           cl = l;
 
708
+         (disk->read_hook) (s, o, cl);
707
709
+         s++;
708
 
+         l -= GRUB_DISK_SECTOR_SIZE - o;
 
710
+         l -= cl;
709
711
+         o = 0;
710
712
+       }
711
713
+    }
712
714
 
713
715
   return grub_errno;
714
716
 }
715
 
@@ -528,25 +624,31 @@
 
717
@@ -528,25 +625,31 @@
716
718
                 grub_off_t offset, grub_size_t size, const void *buf)
717
719
 {
718
720
   unsigned real_offset;
748
750
              != GRUB_ERR_NONE)
749
751
            {
750
752
              disk->partition = part;
751
 
@@ -554,7 +656,7 @@
 
753
@@ -554,7 +657,7 @@
752
754
            }
753
755
          disk->partition = part;
754
756
 
757
759
          if (len > size)
758
760
            len = size;
759
761
 
760
 
@@ -565,7 +667,7 @@
 
762
@@ -565,7 +668,7 @@
761
763
          if ((disk->dev->write) (disk, sector, 1, tmp_buf) != GRUB_ERR_NONE)
762
764
            goto finish;
763
765
 
766
768
          buf = (char *) buf + len;
767
769
          size -= len;
768
770
          real_offset = 0;
769
 
@@ -575,8 +677,8 @@
 
771
@@ -575,8 +678,8 @@
770
772
          grub_size_t len;
771
773
          grub_size_t n;
772
774
 
777
779
 
778
780
          if ((disk->dev->write) (disk, sector, n, buf) != GRUB_ERR_NONE)
779
781
            goto finish;
780
 
@@ -599,6 +701,8 @@
 
782
@@ -599,6 +702,8 @@
781
783
 {
782
784
   if (disk->partition)
783
785
     return grub_partition_get_len (disk->partition);