Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: show.c

Issue 1662003: Add our Chrome OS Type GUIDs to the list that gpt recognizes. (Closed)
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sys_gpt.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /*- 1 /*-
2 * Copyright (c) 2002 Marcel Moolenaar 2 * Copyright (c) 2002 Marcel Moolenaar
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 static uuid_t efi_slice = GPT_ENT_TYPE_EFI; 60 static uuid_t efi_slice = GPT_ENT_TYPE_EFI;
61 static uuid_t mslinux = GPT_ENT_TYPE_MS_BASIC_DATA; 61 static uuid_t mslinux = GPT_ENT_TYPE_MS_BASIC_DATA;
62 static uuid_t freebsd = GPT_ENT_TYPE_FREEBSD; 62 static uuid_t freebsd = GPT_ENT_TYPE_FREEBSD;
63 static uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS; 63 static uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS;
64 static uuid_t linuxswap = GPT_ENT_TYPE_LINUX_SWAP; 64 static uuid_t linuxswap = GPT_ENT_TYPE_LINUX_SWAP;
65 static uuid_t msr = GPT_ENT_TYPE_MS_RESERVED; 65 static uuid_t msr = GPT_ENT_TYPE_MS_RESERVED;
66 static uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP; 66 static uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP;
67 static uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS; 67 static uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS;
68 static uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM; 68 static uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
69 static uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS; 69 static uuid_t zfs = GPT_ENT_TYPE_FREEBSD_ZFS;
70 static uuid_t chrome_kernel = GPT_ENT_TYPE_CHROMEOS_KERNEL;
71 static uuid_t chrome_rootfs = GPT_ENT_TYPE_CHROMEOS_ROOTFS;
72 static uuid_t chrome_future = GPT_ENT_TYPE_CHROMEOS_RESERVED;
70 static char buf[80]; 73 static char buf[80];
71 char *s; 74 char *s;
72 75
73 if (show_uuid) 76 if (show_uuid)
74 goto unfriendly; 77 goto unfriendly;
75 78
76 if (uuid_equal(t, &efi_slice, NULL)) 79 if (uuid_equal(t, &efi_slice, NULL))
77 return ("EFI System"); 80 return ("EFI System");
78 if (uuid_equal(t, &boot, NULL)) 81 if (uuid_equal(t, &boot, NULL))
79 return ("FreeBSD boot"); 82 return ("FreeBSD boot");
80 if (uuid_equal(t, &swap, NULL)) 83 if (uuid_equal(t, &swap, NULL))
81 return ("FreeBSD swap"); 84 return ("FreeBSD swap");
82 if (uuid_equal(t, &ufs, NULL)) 85 if (uuid_equal(t, &ufs, NULL))
83 return ("FreeBSD UFS/UFS2"); 86 return ("FreeBSD UFS/UFS2");
84 if (uuid_equal(t, &vinum, NULL)) 87 if (uuid_equal(t, &vinum, NULL))
85 return ("FreeBSD vinum"); 88 return ("FreeBSD vinum");
86 if (uuid_equal(t, &zfs, NULL)) 89 if (uuid_equal(t, &zfs, NULL))
87 return ("FreeBSD ZFS"); 90 return ("FreeBSD ZFS");
88 91
89 if (uuid_equal(t, &freebsd, NULL)) 92 if (uuid_equal(t, &freebsd, NULL))
90 return ("FreeBSD legacy"); 93 return ("FreeBSD legacy");
91 if (uuid_equal(t, &mslinux, NULL)) 94 if (uuid_equal(t, &mslinux, NULL))
92 return ("Linux/Windows"); 95 return ("Linux/Windows");
93 if (uuid_equal(t, &linuxswap, NULL)) 96 if (uuid_equal(t, &linuxswap, NULL))
94 return ("Linux swap"); 97 return ("Linux swap");
95 if (uuid_equal(t, &msr, NULL)) 98 if (uuid_equal(t, &msr, NULL))
96 return ("Windows reserved"); 99 return ("Windows reserved");
97 if (uuid_equal(t, &hfs, NULL)) 100 if (uuid_equal(t, &hfs, NULL))
98 return ("Apple HFS"); 101 return ("Apple HFS");
102 if (uuid_equal(t, &chrome_kernel, NULL))
103 return ("Chrome OS kernel");
104 if (uuid_equal(t, &chrome_rootfs, NULL))
105 return ("Chrome OS rootfs");
106 if (uuid_equal(t, &chrome_future, NULL))
107 return ("Chrome OS reserved");
99 108
100 unfriendly: 109 unfriendly:
101 uuid_to_string(t, &s, NULL); 110 uuid_to_string(t, &s, NULL);
102 strlcpy(buf, s, sizeof buf); 111 strlcpy(buf, s, sizeof buf);
103 free(s); 112 free(s);
104 return (buf); 113 return (buf);
105 } 114 }
106 115
107 static void 116 static void
108 show(int fd __unused) 117 show(int fd __unused)
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 continue; 239 continue;
231 } 240 }
232 241
233 show(fd); 242 show(fd);
234 243
235 gpt_close(fd); 244 gpt_close(fd);
236 } 245 }
237 246
238 return (0); 247 return (0);
239 } 248 }
OLDNEW
« no previous file with comments | « no previous file | sys_gpt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698