OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
4.2 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../util-linux/fdisk-devfs.patch
  5. # Copyright (C) 2008 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. # Copyright (C) 1998 - 2003 Clifford Wolf
  8. #
  9. # More information can be found in the files COPYING and README.
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. # --- SDE-COPYRIGHT-NOTE-END ---
  18. --- ./fdisk/fdisk.c.orig 2002-10-11 22:50:24.000000000 +0200
  19. +++ ./fdisk/fdisk.c 2002-10-11 22:55:30.000000000 +0200
  20. @@ -198,8 +198,8 @@
  21. " fdisk -l [-b SSZ] [-u] DISK List partition table(s)\n"
  22. " fdisk -s PARTITION Give partition size(s) in blocks\n"
  23. " fdisk -v Give fdisk version\n"
  24. -"Here DISK is something like /dev/hdb or /dev/sda\n"
  25. -"and PARTITION is something like /dev/hda7\n"
  26. +"Here DISK is something like /dev/discs/disc0/disc\n"
  27. +"and PARTITION is something like /dev/discs/disc0/part1\n"
  28. "-u: give Start and End in sector (instead of cylinder) units\n"
  29. "-b 2048: (for certain MO disks) use 2048-byte sectors\n");
  30. break;
  31. @@ -207,10 +207,7 @@
  32. /* msg in cases where fdisk used to probe */
  33. message = _(
  34. "Usage: fdisk [-l] [-b SSZ] [-u] device\n"
  35. -"E.g.: fdisk /dev/hda (for the first IDE disk)\n"
  36. -" or: fdisk /dev/sdc (for the third SCSI disk)\n"
  37. -" or: fdisk /dev/eda (for the first PS/2 ESDI drive)\n"
  38. -" or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)\n"
  39. +"E.g.: fdisk /dev/discs/disc0/disc (for the first disk)\n"
  40. " ...\n");
  41. break;
  42. case unable_to_open:
  43. @@ -1473,11 +1470,14 @@
  44. long megabytes = bytes/1000000;
  45. if (megabytes < 10000)
  46. - printf(_("\nDisk %s: %ld MB, %lld bytes\n"),
  47. - disk_device, megabytes, bytes);
  48. + printf(_("\nDisk %s:%c%ld MB, %lld bytes\n%s"),
  49. + disk_device, strlen(disk_device)>30 ? '\n' : ' ',
  50. + megabytes, bytes, strlen(disk_device)>30 ? "\n" : "");
  51. else
  52. - printf(_("\nDisk %s: %ld.%ld GB, %lld bytes\n"),
  53. - disk_device, megabytes/1000, (megabytes/100)%10, bytes);
  54. + printf(_("\nDisk %s:%c%ld.%ld GB, %lld bytes\n%s"),
  55. + disk_device, strlen(disk_device)>30 ? '\n' : ' ',
  56. + megabytes/1000, (megabytes/100)%10, bytes,
  57. + strlen(disk_device)>30 ? "\n" : "");
  58. printf(_("%d heads, %d sectors/track, %d cylinders"),
  59. heads, sectors, cylinders);
  60. if (units_per_sector == 1)
  61. --- ./fdisk/partname.c.orig 2002-07-07 14:16:43.000000000 +0200
  62. +++ ./fdisk/partname.c 2002-10-11 22:50:24.000000000 +0200
  63. @@ -3,6 +3,8 @@
  64. #include <string.h>
  65. #include "common.h"
  66. +int partname_short_name = 0;
  67. +
  68. /*
  69. * return partition name - uses static storage unless buf is supplied
  70. */
  71. @@ -43,5 +45,11 @@
  72. char *
  73. partname(char *dev, int pno, int lth) {
  74. - return partnamebf(dev, pno, lth, 0, NULL);
  75. + static char buf[20];
  76. + if ( ! partname_short_name ) {
  77. + return partnamebf(dev, pno, lth, 0, NULL);
  78. + } else {
  79. + sprintf(buf,"Partition %-2u",pno);
  80. + return buf;
  81. + }
  82. }
  83. --- ./fdisk/cfdisk.c.orig 2002-10-11 22:50:24.000000000 +0200
  84. +++ ./fdisk/cfdisk.c 2002-10-11 22:50:24.000000000 +0200
  85. @@ -93,8 +93,8 @@
  86. #define VERSION UTIL_LINUX_VERSION
  87. -#define DEFAULT_DEVICE "/dev/hda"
  88. -#define ALTERNATE_DEVICE "/dev/sda"
  89. +#define DEFAULT_DEVICE "/dev/discs/disc0/disc"
  90. +#define ALTERNATE_DEVICE "/dev/hda"
  91. /* With K=1024 we have `binary' megabytes, gigabytes, etc.
  92. Some misguided hackers like that.
  93. --- ./fdisk/sfdisk.c.orig 2002-07-07 02:07:43.000000000 +0200
  94. +++ ./fdisk/sfdisk.c 2002-10-11 22:50:24.000000000 +0200
  95. @@ -2229,7 +2229,7 @@
  96. usage(void) {
  97. version();
  98. printf(_("Usage: %s [options] device ...\n"), PROGNAME);
  99. - puts (_("device: something like /dev/hda or /dev/sda"));
  100. + puts (_("device: something like /dev/discs/disc0/disc"));
  101. puts (_("useful options:"));
  102. puts (_(" -s [or --show-size]: list size of a partition"));
  103. puts (_(" -c [or --id]: print or change partition Id"));