fdisk_aix.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #if ENABLE_FEATURE_AIX_LABEL
  2. /*
  3. * Copyright (C) Andreas Neuper, Sep 1998.
  4. * This file may be redistributed under
  5. * the terms of the GNU Public License.
  6. */
  7. typedef struct {
  8. unsigned int magic; /* expect AIX_LABEL_MAGIC */
  9. unsigned int fillbytes1[124];
  10. unsigned int physical_volume_id;
  11. unsigned int fillbytes2[124];
  12. } aix_partition;
  13. #define AIX_LABEL_MAGIC 0xc9c2d4c1
  14. #define AIX_LABEL_MAGIC_SWAPPED 0xc1d4c2c9
  15. #define AIX_INFO_MAGIC 0x00072959
  16. #define AIX_INFO_MAGIC_SWAPPED 0x59290700
  17. #define aixlabel ((aix_partition *)MBRbuffer)
  18. /*
  19. Changes:
  20. * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  21. * Internationalization
  22. *
  23. * 2003-03-20 Phillip Kesling <pkesling@sgi.com>
  24. * Some fixes
  25. */
  26. static int aix_other_endian;
  27. static short aix_volumes = 1;
  28. /*
  29. * only dealing with free blocks here
  30. */
  31. static void
  32. aix_info(void)
  33. {
  34. puts(
  35. _("\n\tThere is a valid AIX label on this disk.\n"
  36. "\tUnfortunately Linux cannot handle these\n"
  37. "\tdisks at the moment. Nevertheless some\n"
  38. "\tadvice:\n"
  39. "\t1. fdisk will destroy its contents on write.\n"
  40. "\t2. Be sure that this disk is NOT a still vital\n"
  41. "\t part of a volume group. (Otherwise you may\n"
  42. "\t erase the other disks as well, if unmirrored.)\n"
  43. "\t3. Before deleting this physical volume be sure\n"
  44. "\t to remove the disk logically from your AIX\n"
  45. "\t machine. (Otherwise you become an AIXpert).")
  46. );
  47. }
  48. static int
  49. check_aix_label(void)
  50. {
  51. if (aixlabel->magic != AIX_LABEL_MAGIC &&
  52. aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) {
  53. current_label_type = 0;
  54. aix_other_endian = 0;
  55. return 0;
  56. }
  57. aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
  58. update_units();
  59. current_label_type = label_aix;
  60. partitions = 1016;
  61. aix_volumes = 15;
  62. aix_info();
  63. /*aix_nolabel();*/ /* %% */
  64. /*aix_label = 1;*/ /* %% */
  65. return 1;
  66. }
  67. #endif /* AIX_LABEL */