fdisk_aix.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #if ENABLE_FEATURE_AIX_LABEL
  2. /*
  3. * Copyright (C) Andreas Neuper, Sep 1998.
  4. *
  5. * Licensed under GPLv2, see file LICENSE in this tarball for details.
  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 smallint aix_other_endian; /* bool */
  27. static smallint aix_volumes = 1; /* max 15 */
  28. /*
  29. * only dealing with free blocks here
  30. */
  31. static void
  32. aix_info(void)
  33. {
  34. puts("\n"
  35. "There is a valid AIX label on this disk.\n"
  36. "Unfortunately Linux cannot handle these disks at the moment.\n"
  37. "Nevertheless some advice:\n"
  38. "1. fdisk will destroy its contents on write.\n"
  39. "2. Be sure that this disk is NOT a still vital part of a volume group.\n"
  40. " (Otherwise you may erase the other disks as well, if unmirrored.)\n"
  41. "3. Before deleting this physical volume be sure to remove the disk\n"
  42. " logically from your AIX machine. (Otherwise you become an AIXpert).\n"
  43. );
  44. }
  45. static int
  46. check_aix_label(void)
  47. {
  48. if (aixlabel->magic != AIX_LABEL_MAGIC &&
  49. aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED) {
  50. current_label_type = 0;
  51. aix_other_endian = 0;
  52. return 0;
  53. }
  54. aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
  55. update_units();
  56. current_label_type = LABEL_AIX;
  57. g_partitions = 1016;
  58. aix_volumes = 15;
  59. aix_info();
  60. /*aix_nolabel();*/ /* %% */
  61. /*aix_label = 1;*/ /* %% */
  62. return 1;
  63. }
  64. #endif /* AIX_LABEL */