HomeSort by: relevance | last modified time | path
    Searched refs:gpt (Results 1 - 25 of 68) sorted by relevancy

1 2 3

  /src/tests/sbin/gpt/
Makefile 5 TESTSDIR= ${TESTSBASE}/sbin/gpt
10 FILES= gpt.empty.show.normal gpt.backup gpt.removepart.show.normal
11 FILES+= gpt.2part.show.uuid gpt.2part.show.normal gpt.2part.show.label
12 FILES+= gpt.resizedisk.show.normal gpt.resizepart.show.normal
13 FILES+= gpt.disklabel gpt.disklabel.show.norma
    [all...]
t_gpt.sh 35 disk=gpt.disk
85 silence gpt create "$disk"
86 match "$(partaddmsg 1 34 1024)" gpt add -t efi -s 1024 "$disk"
87 match "$(partaddmsg 2 1058 9150)" gpt add "$disk"
92 file "$src/gpt.2part.show.normal" gpt show "$disk"
93 file "$src/gpt.2part.show.uuid" gpt show -u "$disk"
117 echo "^$disk: Recovered $1 GPT [a-z]* from $2\$"
121 echo -n "^gpt: $disk: Partition $1 unknown type MSDOS,
    [all...]
  /src/sbin/gpt/
recover.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/recover.c,v 1.8 2005/08/31 01:47:19 marcel Exp $");
49 #include "gpt.h"
68 recover_gpt_hdr(gpt_t gpt, int type, off_t last)
74 if (gpt_add_hdr(gpt, type, last) == -1)
79 dgpt = &gpt->gpt;
80 dtbl = gpt->tbl;
81 sgpt = gpt->tpg;
82 stbl = gpt->lbt;
87 dgpt = &gpt->tpg
    [all...]
resizedisk.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
51 #include "gpt.h"
71 * relocate the secondary GPT based on the following criteria:
82 resizedisk(gpt_t gpt, off_t sector, off_t size __unused, bool quiet)
91 last = gpt->mediasz / gpt->secsz - 1;
96 gpt_warnx(gpt, "specified number of sectors %jd"
102 mbrmap = map_find(gpt, MAP_TYPE_PMBR);
104 gpt_warnx(gpt, "No valid PMBR found");
109 gpt->gpt = map_find(gpt, MAP_TYPE_PRI_GPT_HDR)
    [all...]
map.h 28 * $FreeBSD: src/sbin/gpt/map.h,v 1.6 2005/08/31 01:47:19 marcel Exp $
54 struct gpt;
56 struct map *map_add(struct gpt *, off_t, off_t, int, void *, int);
57 struct map *map_alloc(struct gpt *, off_t, off_t, off_t);
58 struct map *map_find(struct gpt *, int);
59 struct map *map_first(struct gpt *);
60 struct map *map_last(struct gpt *);
61 off_t map_resize(struct gpt *, struct map *, off_t, off_t);
62 off_t map_free(struct gpt *, off_t, off_t);
63 int map_init(struct gpt *, off_t)
    [all...]
gpt.c 35 __FBSDID("$FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $");
38 __RCSID("$NetBSD: gpt.c,v 1.91 2025/02/23 20:47:19 christos Exp $");
60 #include "gpt.h"
247 gpt_read(gpt_t gpt, off_t lba, size_t count)
252 count *= gpt->secsz;
257 ofs = lba * gpt->secsz;
258 if (lseek(gpt->fd, ofs, SEEK_SET) == ofs &&
259 read(gpt->fd, buf, count) == (ssize_t)count)
267 gpt_write(gpt_t gpt, map_t map
485 gpt_t gpt; local in function:gpt_open
    [all...]
create.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $");
52 #include "gpt.h"
72 create(gpt_t gpt, u_int parts, int force, int primary_only, int active)
74 off_t last = gpt_last(gpt);
78 map = map_find(gpt, MAP_TYPE_MBR);
81 gpt_warnx(gpt, "Device contains a MBR");
91 if (map_find(gpt, MAP_TYPE_PMBR) == NULL) {
92 if (map_free(gpt, 0LL, 1LL) == 0) {
93 gpt_warnx(gpt, "No room for the PMBR");
96 mbr = gpt_read(gpt, 0LL, 1)
    [all...]
destroy.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/destroy.c,v 1.6 2005/08/31 01:47:19 marcel Exp $");
49 #include "gpt.h"
69 destroy(gpt_t gpt, int force __unused, int recoverable)
73 pri_hdr = map_find(gpt, MAP_TYPE_PRI_GPT_HDR);
74 sec_hdr = map_find(gpt, MAP_TYPE_SEC_GPT_HDR);
75 pmbr = map_find(gpt, MAP_TYPE_PMBR);
78 gpt_warnx(gpt, "Device doesn't contain a GPT");
83 gpt_warnx(gpt, "Recoverability not possible");
88 memset(pri_hdr->map_data, 0, gpt->secsz)
    [all...]
resize.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
50 #include "gpt.h"
69 resize(gpt_t gpt, u_int entry, off_t alignment, off_t sectors,
79 if (gpt_hdr(gpt) == NULL)
83 ent = gpt_ent_primary(gpt, i);
85 gpt_warnx(gpt, "Entry at index %u is unused", entry);
89 alignsecs = alignment / gpt->secsz;
91 for (map = map_first(gpt); map != NULL; map = map->map_next) {
96 gpt_warnx(gpt, "Could not find map entry corresponding "
106 gpt_warnx(gpt,
    [all...]
restore.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/create.c,v 1.11 2005/08/31 01:47:19 marcel Exp $");
52 #include "gpt.h"
71 gpt_warnx(gpt, "proplib failure"); \
76 restore_mbr(gpt_t gpt, struct mbr *mbr, prop_dictionary_t mbr_dict, off_t last)
128 restore_ent(gpt_t gpt, prop_dictionary_t gpt_dict, void *secbuf,
138 gpt_warnx(gpt, "%s: not able to convert to an UUID", s);
143 gpt_warnx(gpt, "%s: not able to convert to an UUID", s);
162 gpt_warnx(gpt, "Entity index out of bounds %u > %u\n",
166 memcpy((char *)secbuf + gpt->secsz + ((i - 1) * sizeof(ent)),
172 restore(gpt_t gpt, const char *infile, int force
    [all...]
set.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
49 #include "gpt.h"
70 cmd_set(gpt_t gpt, int argc, char *argv[])
81 if (gpt == NULL || gpt_attr_get(gpt, &attributes) == -1)
85 if (gpt == NULL || gpt_human_get(gpt, &start) == -1)
89 if (gpt == NULL || gpt_uint_get(gpt, &entry) == -1)
104 for (m = map_first(gpt); m != NULL; m = m->map_next)
    [all...]
unset.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
49 #include "gpt.h"
70 cmd_unset(gpt_t gpt, int argc, char *argv[])
81 if (gpt == NULL || gpt_attr_get(gpt, &attributes) == -1)
85 if (gpt == NULL || gpt_human_get(gpt, &start) == -1)
89 if (gpt == NULL || gpt_uint_get(gpt, &entry) == -1)
101 for (m = map_first(gpt); m != NULL; m = m->map_next)
    [all...]
add.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $");
51 #include "gpt.h"
84 add(gpt_t gpt, off_t alignment, off_t block, off_t sectors, off_t size __unused,
94 if ((hdr = gpt_hdr(gpt)) == NULL)
100 gpt_warnx(gpt, "index %u out of range (%u max)",
107 ent = gpt_ent_primary(gpt, i);
109 gpt_warnx(gpt, "Entry at index %u is not free", entry);
113 /* Find empty slot in GPT table. */
115 ent = gpt_ent_primary(gpt, i);
120 gpt_warnx(gpt, "No available table entries")
    [all...]
biosboot.c 66 #include "gpt.h"
92 read_boot(gpt_t gpt, const char *bootpath)
112 gpt_warn(gpt, "Can't allocate memory for bootpath");
116 if ((buf = malloc((size_t)gpt->secsz)) == NULL) {
117 gpt_warn(gpt, "Can't allocate memory for sector");
123 gpt_warn(gpt, "Can't open `%s'", bp);
128 gpt_warnx(gpt, "The bootcode in `%s' does not match the"
134 gpt_warn(gpt, "Error reading from `%s'", bp);
151 set_bootable(gpt_t gpt, map_t map, map_t tbl, unsigned int i)
166 return gpt_write_crc(gpt, map, tbl)
    [all...]
header.c 49 #include "gpt.h"
68 header(gpt_t gpt)
75 gpt_show_num("Media Size", (uintmax_t)gpt->mediasz);
76 printf("Sector Size: %u\n", gpt->secsz);
79 (uintmax_t)(gpt->mediasz / gpt->secsz));
83 map = map_find(gpt, MAP_TYPE_PRI_GPT_HDR);
85 printf("- GPT Header not found\n");
91 printf("- GPT Header Revision: %u.%u\n", revision >> 16,
97 printf("- Number of GPT Entries: %u\n", le32toh(hdr->hdr_entries))
    [all...]
uuid.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $");
49 #include "gpt.h"
69 gpt_t gpt; member in struct:uuidctx
83 gpt_uuid_generate(ctx->gpt, uuidstore);
95 gpt_uuid_generate(ctx->gpt, uuidstore);
100 cmd_uuid(gpt_t gpt, int argc, char *argv[])
107 if (gpt == NULL)
114 ctx.gpt = gpt;
129 if (gpt_add_find(gpt, &find, ch) == -1
    [all...]
type.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $");
49 #include "gpt.h"
77 cmd_type(gpt_t gpt, int argc, char *argv[])
94 if (gpt == NULL || gpt_uuid_get(gpt, &newtype) == -1)
103 if (gpt == NULL || gpt_add_find(gpt, &find, ch) == -1)
111 if (gpt == NULL || gpt_uuid_is_nil(newtype) || argc != optind)
114 return gpt_change_ent(gpt, &find, change, &newtype);
migrate.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/migrate.c,v 1.16 2005/09/01 02:42:52 marcel Exp $");
59 #include "gpt.h"
122 freebsd_fstype_to_gpt_type(gpt_t gpt, u_int i __unused, u_int fstype)
136 gpt_warnx(gpt, "Unknown FreeBSD partition (%d)", fstype);
142 netbsd_fstype_to_gpt_type(gpt_t gpt, u_int i, u_int fstype)
164 gpt_warnx(gpt, "Partition %u unknown type %s, "
171 migrate_disklabel(gpt_t gpt, off_t start, struct gpt_ent *ent,
180 buf = gpt_read(gpt, start + LABELSECTOR, 1);
182 gpt_warn(gpt, "Error reading label");
189 gpt_warnx(gpt, "MBR partition without disklabel")
    [all...]
gpt_private.h 37 struct gpt { struct
44 struct map *tbl, *lbt, *gpt, *tpg; member in struct:gpt
map.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/map.c,v 1.6 2005/08/31 01:47:19 marcel Exp $");
45 #include "gpt.h"
80 "primary gpt header",
81 "secondary gpt header",
82 "primary gpt table",
83 "secondary gpt table",
84 "gpt partition",
97 map_add(gpt_t gpt, off_t start, off_t size, int type, void *data, int alloc)
104 for (n = gpt->mediamap; n; n = n->map_next)
109 n = gpt->mediamap
    [all...]
label.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/label.c,v 1.3 2006/10/04 18:20:25 marcel Exp $");
49 #include "gpt.h"
78 name_from_file(gpt_t gpt, void *v)
93 gpt_warn(gpt, "Can't open `%s'", fn);
100 gpt_warn(gpt, "Can't copy string");
105 gpt_warn(gpt, "Can't label from `%s'", fn);
124 cmd_label(gpt_t gpt, int argc, char *argv[])
137 if (name_from_file(gpt, &name) == -1)
141 if (gpt_name_get(gpt, &name) == -1)
150 if (gpt_add_find(gpt, &find, ch) == -1
    [all...]
Makefile 2 # $FreeBSD: src/sbin/gpt/Makefile,v 1.7 2005/09/01 02:49:20 marcel Exp $
7 PROG= gpt
8 SRCS= add.c biosboot.c create.c destroy.c gpt.c header.c label.c map.c \
11 MAN= gpt.8
13 #LINKS= ${BINDIR}/gpt ${BINDIR}/gptlabel
14 #MLINKS= gpt.8 gptlabel.8
remove.c 33 __FBSDID("$FreeBSD: src/sbin/gpt/remove.c,v 1.10 2006/10/04 18:20:25 marcel Exp $");
49 #include "gpt.h"
76 cmd_remove(gpt_t gpt, int argc, char *argv[])
86 if (gpt_add_find(gpt, &find, ch) == -1)
92 return gpt_change_ent(gpt, &find, change, NULL);
  /src/tools/gpt/
Makefile 3 HOSTPROGNAME= ${_TOOL_PREFIX}gpt
4 HOST_SRCDIR= sbin/gpt
  /src/distrib/utils/embedded/files/
resize_gpt 31 gpt -H resizedisk -q ${BLOCK_DEVICE}
32 gpt -H resize -a 4m -i 2 -q ${BLOCK_DEVICE}

Completed in 37 milliseconds

1 2 3