[SLOF] [PATCH slof 02/10] disk-label: Support Linux GPT partition type

Alexey Kardashevskiy aik at ozlabs.ru
Tue Dec 31 14:04:49 AEDT 2019


This adds support for:
"Linux filesystem data" 	0FC63DAF-8483-4772-8E79-3D69D8477DE4

Previously, Linux used the same GUID for the data partitions as Windows
(Basic data partition: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7).
The new GUID (Linux filesystem data: 0FC63DAF-8483-4772-8E79-3D69D8477DE4)
was defined jointly by GPT fdisk and GNU.

Source:
https://en.wikipedia.org/wiki/GUID_Partition_Table#cite_note-linwin-40

Signed-off-by: Alexey Kardashevskiy <aik at ozlabs.ru>
---
 slof/fs/packages/disk-label.fs | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/slof/fs/packages/disk-label.fs b/slof/fs/packages/disk-label.fs
index 068a1a88c109..790d43374162 100644
--- a/slof/fs/packages/disk-label.fs
+++ b/slof/fs/packages/disk-label.fs
@@ -390,6 +390,12 @@ EBD0A0A2 B9E5 4433 87C068B6B72699C7 GPT-BASIC-DATA-PARTITION uuid!
    GPT-BASIC-DATA-PARTITION uuid=
 ;
 
+\ Linux filesystem data 	0FC63DAF-8483-4772-8E79-3D69D8477DE4
+CREATE GPT-LINUX-PARTITION 10 allot
+0FC63DAF 8483 4772 8E793D69D8477DE4 GPT-LINUX-PARTITION uuid!
+: gpt-linux-partition? ( -- true|false )
+   block gpt-part-entry>part-type-guid
+   GPT-LINUX-PARTITION uuid=
 ;
 
 \
@@ -455,7 +461,7 @@ EBD0A0A2 B9E5 4433 87C068B6B72699C7 GPT-BASIC-DATA-PARTITION uuid!
    1+ 1 ?DO
       seek-pos 0 seek drop
       block gpt-part-size read drop
-      gpt-basic-data-partition? IF
+      gpt-basic-data-partition? gpt-linux-partition? or IF
          debug-disk-label? IF ." GPT BASIC DATA partition found " cr THEN
          block gpt-part-entry>first-lba x at -le       ( first-lba )
          dup to part-start                          ( first-lba )
-- 
2.17.1



More information about the SLOF mailing list