| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: label.c,v 1.36 2022/06/11 18:27:22 martin Exp $ */ | | 1 | /* $NetBSD: label.c,v 1.37 2022/06/18 13:52:42 martin Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright 1997 Jonathan Stone | | 4 | * Copyright 1997 Jonathan Stone |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -26,27 +26,27 @@ | | | @@ -26,27 +26,27 @@ |
26 | * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE | | 26 | * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE |
27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF | | 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
33 | * THE POSSIBILITY OF SUCH DAMAGE. | | 33 | * THE POSSIBILITY OF SUCH DAMAGE. |
34 | * | | 34 | * |
35 | */ | | 35 | */ |
36 | | | 36 | |
37 | #include <sys/cdefs.h> | | 37 | #include <sys/cdefs.h> |
38 | #if defined(LIBC_SCCS) && !defined(lint) | | 38 | #if defined(LIBC_SCCS) && !defined(lint) |
39 | __RCSID("$NetBSD: label.c,v 1.36 2022/06/11 18:27:22 martin Exp $"); | | 39 | __RCSID("$NetBSD: label.c,v 1.37 2022/06/18 13:52:42 martin Exp $"); |
40 | #endif | | 40 | #endif |
41 | | | 41 | |
42 | #include <sys/types.h> | | 42 | #include <sys/types.h> |
43 | #include <stddef.h> | | 43 | #include <stddef.h> |
44 | #include <assert.h> | | 44 | #include <assert.h> |
45 | #include <errno.h> | | 45 | #include <errno.h> |
46 | #include <stdio.h> | | 46 | #include <stdio.h> |
47 | #include <fcntl.h> | | 47 | #include <fcntl.h> |
48 | #include <util.h> | | 48 | #include <util.h> |
49 | #include <unistd.h> | | 49 | #include <unistd.h> |
50 | #include <sys/dkio.h> | | 50 | #include <sys/dkio.h> |
51 | #include <sys/param.h> | | 51 | #include <sys/param.h> |
52 | #include <sys/bootblock.h> | | 52 | #include <sys/bootblock.h> |
| @@ -522,27 +522,27 @@ renumber_partitions(struct partition_usa | | | @@ -522,27 +522,27 @@ renumber_partitions(struct partition_usa |
522 | | | 522 | |
523 | memcpy(pset->infos, ninfos, sizeof(*pset->infos)*pset->parts->num_part); | | 523 | memcpy(pset->infos, ninfos, sizeof(*pset->infos)*pset->parts->num_part); |
524 | free(ninfos); | | 524 | free(ninfos); |
525 | } | | 525 | } |
526 | | | 526 | |
527 | /* | | 527 | /* |
528 | * Most often used file system types, we offer them in a first level menu. | | 528 | * Most often used file system types, we offer them in a first level menu. |
529 | */ | | 529 | */ |
530 | static const uint edit_fs_common_types[] = | | 530 | static const uint edit_fs_common_types[] = |
531 | { FS_BSDFFS, FS_SWAP, FS_MSDOS, FS_EFI_SP, FS_BSDLFS, FS_EX2FS }; | | 531 | { FS_BSDFFS, FS_SWAP, FS_MSDOS, FS_EFI_SP, FS_BSDLFS, FS_EX2FS }; |
532 | | | 532 | |
533 | /* | | 533 | /* |
534 | * Functions for uncommon file system types - we offer the full list, | | 534 | * Functions for uncommon file system types - we offer the full list, |
535 | * but put FFSv2 and FFSv1 at the front and duplicat FS_MSDOS as | | 535 | * but put FFSv2 and FFSv1 at the front and duplicate FS_MSDOS as |
536 | * EFI system partition. | | 536 | * EFI system partition. |
537 | */ | | 537 | */ |
538 | static void | | 538 | static void |
539 | init_fs_type_ext(menudesc *menu, void *arg) | | 539 | init_fs_type_ext(menudesc *menu, void *arg) |
540 | { | | 540 | { |
541 | struct single_part_fs_edit *edit = arg; | | 541 | struct single_part_fs_edit *edit = arg; |
542 | uint t = edit->info.fs_type; | | 542 | uint t = edit->info.fs_type; |
543 | size_t i, ndx, max = menu->numopts; | | 543 | size_t i, ndx, max = menu->numopts; |
544 | | | 544 | |
545 | if (t == FS_BSDFFS) { | | 545 | if (t == FS_BSDFFS) { |
546 | if (edit->info.fs_sub_type == 2) | | 546 | if (edit->info.fs_sub_type == 2) |
547 | menu->cursel = 0; | | 547 | menu->cursel = 0; |
548 | else | | 548 | else |