diff options
author | sjg <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
commit | d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2 (patch) | |
tree | b04f4bd7cd887f50e7d98af35f46b9834ff86c80 /usr.sbin/bsdinstall/partedit | |
parent | 3c8e37b1d04827f33c0c9a7594bd1b1ef7cdb3d3 (diff) | |
parent | 4fbde208c6460d576f64d6dc3cdc6cab085a4283 (diff) | |
download | FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.zip FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.tar.gz |
Merge head from 7/28
Diffstat (limited to 'usr.sbin/bsdinstall/partedit')
-rw-r--r-- | usr.sbin/bsdinstall/partedit/Makefile | 14 | ||||
-rw-r--r-- | usr.sbin/bsdinstall/partedit/partedit_powerpc.c | 25 | ||||
-rw-r--r-- | usr.sbin/bsdinstall/partedit/partedit_x86.c | 2 | ||||
-rw-r--r-- | usr.sbin/bsdinstall/partedit/sade.8 | 5 |
4 files changed, 28 insertions, 18 deletions
diff --git a/usr.sbin/bsdinstall/partedit/Makefile b/usr.sbin/bsdinstall/partedit/Makefile index 328259c..fb75888 100644 --- a/usr.sbin/bsdinstall/partedit/Makefile +++ b/usr.sbin/bsdinstall/partedit/Makefile @@ -5,8 +5,8 @@ PROG= partedit LINKS= ${BINDIR}/partedit ${BINDIR}/autopart \ ${BINDIR}/partedit ${BINDIR}/scriptedpart SYMLINKS= ${BINDIR}/partedit /usr/sbin/sade -DPADD= ${LIBGEOM} ${LIBUTIL} ${LIBDIALOG} ${LIBM} -LDADD= -lgeom -lutil -ldialog -lm +DPADD= ${LIBGEOM} ${LIBNCURSESW} ${LIBUTIL} ${LIBDIALOG} ${LIBM} +LDADD= -lgeom -lncursesw -lutil -ldialog -lm PARTEDIT_ARCH= ${MACHINE} .if ${MACHINE} == "i386" || ${MACHINE} == "amd64" @@ -22,14 +22,4 @@ SRCS= diskeditor.c partedit.c gpart_ops.c partedit_${PARTEDIT_ARCH}.c \ WARNS?= 3 MAN= sade.8 -.include <src.opts.mk> - -.if ${MK_NCURSESW} == "no" -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else -DPADD+= ${LIBNCURSESW} -LDADD+= -lncursesw -.endif - .include <bsd.prog.mk> diff --git a/usr.sbin/bsdinstall/partedit/partedit_powerpc.c b/usr.sbin/bsdinstall/partedit/partedit_powerpc.c index 4fa2e05..77c682a 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_powerpc.c +++ b/usr.sbin/bsdinstall/partedit/partedit_powerpc.c @@ -60,7 +60,8 @@ is_scheme_bootable(const char *part_type) { if (strcmp(platform, "ps3") == 0 && strcmp(part_type, "GPT") == 0) return (1); if (strcmp(platform, "chrp") == 0 && - (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0)) + (strcmp(part_type, "MBR") == 0 || strcmp(part_type, "BSD") == 0 || + strcmp(part_type, "GPT") == 0)) return (1); return (0); @@ -68,13 +69,28 @@ is_scheme_bootable(const char *part_type) { size_t bootpart_size(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0) return (800*1024); + if (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0) + return (800*1024); return (0); } const char * bootpart_type(const char *scheme) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + + if (strcmp(platform, "chrp") == 0) + return ("prep-boot"); + if (strcmp(platform, "powermac") == 0) + return ("apple-boot"); + return ("freebsd-boot"); } @@ -85,9 +101,14 @@ bootcode_path(const char *part_type) { const char * partcode_path(const char *part_type) { + size_t platlen = sizeof(platform); + if (strlen(platform) == 0) + sysctlbyname("hw.platform", platform, &platlen, NULL, -1); + if (strcmp(part_type, "APM") == 0) return ("/boot/boot1.hfs"); - if (strcmp(part_type, "MBR") == 0) + if (strcmp(part_type, "MBR") == 0 || + (strcmp(platform, "chrp") == 0 && strcmp(part_type, "GPT") == 0)) return ("/boot/boot1.elf"); return (NULL); } diff --git a/usr.sbin/bsdinstall/partedit/partedit_x86.c b/usr.sbin/bsdinstall/partedit/partedit_x86.c index 156674b..b458475 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_x86.c +++ b/usr.sbin/bsdinstall/partedit/partedit_x86.c @@ -69,7 +69,7 @@ bootpart_size(const char *scheme) { return (0); if (strcmp(platform, "BIOS") == 0) - return (64*1024); + return (512*1024); else return (800*1024); diff --git a/usr.sbin/bsdinstall/partedit/sade.8 b/usr.sbin/bsdinstall/partedit/sade.8 index 441ddc0..79df079 100644 --- a/usr.sbin/bsdinstall/partedit/sade.8 +++ b/usr.sbin/bsdinstall/partedit/sade.8 @@ -64,12 +64,11 @@ installer. It was replaced in with the equivalent part of .Xr bsdinstall 8 . .Sh AUTHORS -.An Nathan Whitehorn Aq nwhitehorn@FreeBSD.org +.An Nathan Whitehorn Aq Mt nwhitehorn@FreeBSD.org .Sh BUGS The utility misses a lot of nice features, such as tools for manipulating .Xr gmirror 8 or -.Xr zfs 8 -. +.Xr zfs 8 . These will be added later. |