summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdinstall/partedit
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-07-03 16:41:30 -0300
committerRenato Botelho <renato@netgate.com>2017-07-03 16:41:30 -0300
commitb91e8edec6ef973706ceba5985379a0aded6a5aa (patch)
tree92c1d3976fd61f447f3e62225141c02b6ef4c320 /usr.sbin/bsdinstall/partedit
parent5fa580e9c45b6668f134701651fa17cad722750e (diff)
parentff3a058c4f832f66c1a779cf9bd05f758ad411d8 (diff)
downloadFreeBSD-src-b91e8edec6ef973706ceba5985379a0aded6a5aa.zip
FreeBSD-src-b91e8edec6ef973706ceba5985379a0aded6a5aa.tar.gz
Merge remote-tracking branch 'origin/releng/11.1' into RELENG_2_5
Diffstat (limited to 'usr.sbin/bsdinstall/partedit')
-rw-r--r--usr.sbin/bsdinstall/partedit/Makefile2
-rw-r--r--usr.sbin/bsdinstall/partedit/gpart_ops.c18
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit_arm64.c6
-rw-r--r--usr.sbin/bsdinstall/partedit/partedit_x86.c8
4 files changed, 19 insertions, 15 deletions
diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile
index 21d842e..7d8f065 100644
--- a/usr.sbin/bsdinstall/partedit/Makefile
+++ b/usr.sbin/bsdinstall/partedit/Makefile
@@ -4,7 +4,7 @@ BINDIR= ${LIBEXECDIR}/bsdinstall
PROG= partedit
LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \
${BINDIR}/partedit ${BINDIR}/scriptedpart
-SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade
+SYMLINKS= ../libexec/bsdinstall/partedit /usr/sbin/sade
LIBADD+= geom ncursesw util dialog m
PARTEDIT_ARCH= ${MACHINE}
diff --git a/usr.sbin/bsdinstall/partedit/gpart_ops.c b/usr.sbin/bsdinstall/partedit/gpart_ops.c
index 89d7529..dc1c95c 100644
--- a/usr.sbin/bsdinstall/partedit/gpart_ops.c
+++ b/usr.sbin/bsdinstall/partedit/gpart_ops.c
@@ -101,14 +101,14 @@ newfs_command(const char *fstype, char *command, int use_default)
if (!use_default) {
int choice;
choice = dlg_checklist("UFS Options", "", 0, 0, 0,
- sizeof(items)/sizeof(items[0]), items, NULL,
+ nitems(items), items, NULL,
FLAG_CHECK, &i);
if (choice == 1) /* Cancel */
return;
}
strcpy(command, "newfs ");
- for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) {
+ for (i = 0; i < (int)nitems(items); i++) {
if (items[i].state == 0)
continue;
if (strcmp(items[i].name, "UFS1") == 0)
@@ -139,7 +139,7 @@ newfs_command(const char *fstype, char *command, int use_default)
if (!use_default) {
int choice;
choice = dlg_checklist("ZFS Options", "", 0, 0, 0,
- sizeof(items)/sizeof(items[0]), items, NULL,
+ nitems(items), items, NULL,
FLAG_CHECK, &i);
if (choice == 1) /* Cancel */
return;
@@ -155,7 +155,7 @@ newfs_command(const char *fstype, char *command, int use_default)
sprintf(command, "%s -o cachefile=%s/zpool.cache ",
command, zfsboot_path);
}
- for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) {
+ for (i = 0; i < (int)nitems(items); i++) {
if (items[i].state == 0)
continue;
if (strcmp(items[i].name, "fletcher4") == 0)
@@ -181,14 +181,14 @@ newfs_command(const char *fstype, char *command, int use_default)
if (!use_default) {
int choice;
choice = dlg_checklist("FAT Options", "", 0, 0, 0,
- sizeof(items)/sizeof(items[0]), items, NULL,
+ nitems(items), items, NULL,
FLAG_RADIO, &i);
if (choice == 1) /* Cancel */
return;
}
strcpy(command, "newfs_msdos ");
- for (i = 0; i < (int)(sizeof(items)/sizeof(items[0])); i++) {
+ for (i = 0; i < (int)nitems(items); i++) {
if (items[i].state == 0)
continue;
if (strcmp(items[i].name, "FAT32") == 0)
@@ -231,7 +231,7 @@ parttypemenu:
dialog_vars.default_item = __DECONST(char *, def_scheme);
cancel = dlg_menu("Partition Scheme",
"Select a partition scheme for this volume:", 0, 0, 0,
- sizeof(items) / sizeof(items[0]), items, &choice, NULL);
+ nitems(items), items, &choice, NULL);
dialog_vars.default_item = NULL;
if (cancel)
@@ -653,7 +653,7 @@ endedit:
"freebsd") == 0)
gpart_partition(pp->lg_name, "BSD");
- for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
+ for (i = 0; i < nitems(items); i++)
if (items[i].text_free)
free(items[i].text);
}
@@ -1191,7 +1191,7 @@ addpartform:
set_default_part_metadata(newpartname, scheme,
items[0].text, items[2].text, newfs);
- for (i = 0; i < (sizeof(items) / sizeof(items[0])); i++)
+ for (i = 0; i < nitems(items); i++)
if (items[i].text_free)
free(items[i].text);
diff --git a/usr.sbin/bsdinstall/partedit/partedit_arm64.c b/usr.sbin/bsdinstall/partedit/partedit_arm64.c
index 5c0fb03..7fe784d 100644
--- a/usr.sbin/bsdinstall/partedit/partedit_arm64.c
+++ b/usr.sbin/bsdinstall/partedit/partedit_arm64.c
@@ -34,8 +34,8 @@
#include "partedit.h"
-/* EFI partition size in KB */
-#define EFI_BOOTPART_SIZE (50 * 1024)
+/* EFI partition size in bytes */
+#define EFI_BOOTPART_SIZE (200 * 1024 * 1024)
#define EFI_BOOTPART_PATH "/boot/boot1.efifat"
const char *
@@ -73,7 +73,7 @@ bootpart_size(const char *scheme)
if (strcmp(scheme, "GPT") != 0)
return (0);
- return ((EFI_BOOTPART_SIZE) * 1024);
+ return (EFI_BOOTPART_SIZE);
}
const char *
diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c
index a600bec..d783217 100644
--- a/usr.sbin/bsdinstall/partedit/partedit_x86.c
+++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c
@@ -32,6 +32,10 @@
#include "partedit.h"
+/* EFI partition size in bytes */
+#define EFI_BOOTPART_SIZE (200 * 1024 * 1024)
+#define EFI_BOOTPART_PATH "/boot/boot1.efifat"
+
static const char *
x86_bootmethod(void)
{
@@ -96,7 +100,7 @@ bootpart_size(const char *scheme)
if (strcmp(x86_bootmethod(), "BIOS") == 0)
return (512*1024);
else
- return (200*1024*1024);
+ return (EFI_BOOTPART_SIZE);
return (0);
}
@@ -134,7 +138,7 @@ partcode_path(const char *part_type, const char *fs_type)
if (strcmp(part_type, "GPT") == 0) {
if (strcmp(x86_bootmethod(), "UEFI") == 0)
- return ("/boot/boot1.efifat");
+ return (EFI_BOOTPART_PATH);
else if (strcmp(fs_type, "zfs") == 0)
return ("/boot/gptzfsboot");
else
OpenPOWER on IntegriCloud