3
0

fdisk_aix.c 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #if ENABLE_FEATURE_AIX_LABEL
  2. /*
  3. * Copyright (C) Andreas Neuper, Sep 1998.
  4. *
  5. * Licensed under GPLv2, see file LICENSE in this source tree.
  6. */
  7. typedef struct {
  8. uint32_t magic; /* expect AIX_LABEL_MAGIC */
  9. uint32_t fillbytes1[124];
  10. uint32_t physical_volume_id;
  11. uint32_t 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. /*
  18. * Changes:
  19. * 1999-03-20 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  20. * Internationalization
  21. *
  22. * 2003-03-20 Phillip Kesling <pkesling@sgi.com>
  23. * Some fixes
  24. */
  25. // Write-only vars, unfinished code?
  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. aix_partition *aixlabel = (void*)MBRbuffer;
  49. if (aixlabel->magic != AIX_LABEL_MAGIC
  50. && aixlabel->magic != AIX_LABEL_MAGIC_SWAPPED
  51. ) {
  52. current_label_type = LABEL_DOS;
  53. // aix_other_endian = 0;
  54. return 0;
  55. }
  56. // aix_other_endian = (aixlabel->magic == AIX_LABEL_MAGIC_SWAPPED);
  57. update_units();
  58. current_label_type = LABEL_AIX;
  59. g_partitions = 1016;
  60. // aix_volumes = 15;
  61. aix_info();
  62. /*aix_nolabel();*/ /* %% */
  63. /*aix_label = 1;*/ /* %% */
  64. return 1;
  65. }
  66. #endif /* AIX_LABEL */