From 090dd246360c321806df99c192b36167cc11536c Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Wed, 25 Jan 2012 03:37:39 +0000 Subject: [PATCH] Experimental support for booting CHRP-type PowerPC systems from hard disks. --- sys/boot/powerpc/boot1.chrp/Makefile | 1 - sys/geom/part/g_part_mbr.c | 1 + sys/sys/diskmbr.h | 1 + usr.sbin/bsdinstall/partedit/partedit_powerpc.c | 4 +++- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/boot/powerpc/boot1.chrp/Makefile b/sys/boot/powerpc/boot1.chrp/Makefile index f3f7e4dd32b2..71d0ce6af975 100644 --- a/sys/boot/powerpc/boot1.chrp/Makefile +++ b/sys/boot/powerpc/boot1.chrp/Makefile @@ -10,7 +10,6 @@ INSTALLFLAGS= -b FILES= boot1.hfs SRCS= boot1.c ashldi3.c -INTERNALPROG= NO_MAN= CFLAGS= -ffreestanding -msoft-float -Os \ diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 5e73ee0f7997..126210b5629c 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -123,6 +123,7 @@ static struct g_part_mbr_alias { { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, + { DOSPTYP_PPCBOOT, G_PART_ALIAS_FREEBSD_BOOT }, }; static int diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index 5b62e6468500..0caf0d773e85 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -48,6 +48,7 @@ #define DOSPTYP_NTFS 0x07 /* NTFS partition */ #define DOSPTYP_FAT32 0x0b /* FAT32 partition */ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ +#define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ diff --git a/usr.sbin/bsdinstall/partedit/partedit_powerpc.c b/usr.sbin/bsdinstall/partedit/partedit_powerpc.c index 13d25360bb6c..ef23eb6120dc 100644 --- a/usr.sbin/bsdinstall/partedit/partedit_powerpc.c +++ b/usr.sbin/bsdinstall/partedit/partedit_powerpc.c @@ -67,7 +67,7 @@ is_scheme_bootable(const char *part_type) { size_t bootpart_size(const char *part_type) { - if (strcmp(part_type, "APM") == 0) + if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0) return (800*1024); return (0); } @@ -81,6 +81,8 @@ const char * partcode_path(const char *part_type) { if (strcmp(part_type, "APM") == 0) return ("/boot/boot1.hfs"); + if (strcmp(part_type, "MBR") == 0) + return ("/boot/boot1.elf"); return (NULL); }