Re: makefs(8): add EFI platform-id for UFI

2017-10-30 Thread YASUOKA Masahiko
On Mon, 30 Oct 2017 16:35:03 +0800
"Michael W. Bombardieri"  wrote:
> On Mon, Oct 30, 2017 at 05:27:29PM +0900, YASUOKA Masahiko wrote:
>> Hi,
>> 
>> I'd like to add a platform-id for EFI boot.
>> 
>> ok?
>> 
>> diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c 
>> b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
>> index 46ec432bc84..376c42f5dc3 100644
>> --- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
>> +++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
>> @@ -104,6 +104,8 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const 
>> char *boot_info)
>>  new_image->system = ET_SYS_PPC;
>>  else if (strcmp(sysname, "macppc") == 0)
>>  new_image->system = ET_SYS_MAC;
>> +else if (strcmp(sysname, "efi") == 0)
>> +new_image->system = ET_SYS_EFI;
>>  else {
>>  warnx("boot disk system must be "
>>"i386, macppc, or powerpc");
> 
> Should efi be added to the warning message too, or changing it to something 
> like
> Unknown boot disk system?

Yes, it should.  Thanks,

Let me update the diff.

diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c 
b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
index 46ec432bc84..125b6d69be0 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
@@ -104,9 +104,11 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const 
char *boot_info)
new_image->system = ET_SYS_PPC;
else if (strcmp(sysname, "macppc") == 0)
new_image->system = ET_SYS_MAC;
+   else if (strcmp(sysname, "efi") == 0)
+   new_image->system = ET_SYS_EFI;
else {
warnx("boot disk system must be "
- "i386, macppc, or powerpc");
+ "i386, macppc, powerpc or efi");
free(temp);
free(new_image);
return 0;
@@ -335,12 +337,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int 
first_sector)
int used_sectors;
int num_entries = 0;
int catalog_sectors;
-   struct boot_catalog_entry *x86_head, *mac_head, *ppc_head,
+   struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *efi_head,
*valid_entry, *default_entry, *temp, *head, **headp, *next;
struct cd9660_boot_image *tmp_disk;
 
headp = NULL;
-   x86_head = mac_head = ppc_head = NULL;
+   x86_head = mac_head = ppc_head = efi_head = NULL;
 
/* If there are no boot disks, don't bother building boot information */
if (TAILQ_EMPTY(>boot_images))
@@ -413,6 +415,9 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int 
first_sector)
case ET_SYS_MAC:
headp = _head;
break;
+   case ET_SYS_EFI:
+   headp = _head;
+   break;
default:
warnx("%s: internal error: unknown system type",
__func__);
diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.h 
b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
index 43483018ef3..f34b19b9ba0 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.h
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
@@ -41,6 +41,7 @@
 #defineET_SYS_X86  0
 #defineET_SYS_PPC  1
 #defineET_SYS_MAC  2
+#defineET_SYS_EFI  0xef
 
 #define ET_BOOT_ENTRY_SIZE 0x20
 
diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
index 12cf499261f..3582dda07e9 100644
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -215,8 +215,9 @@ where
 is one of
 .Ql i386 ,
 .Ql macppc ,
+.Ql powerpc
 or
-.Ql powerpc .
+.Ql efi .
 .It Sy generic-bootimage
 Load a generic boot image into the first 32K of the CD9660 image.
 .It Sy hard-disk-boot



Re: makefs(8): add EFI platform-id for UFI

2017-10-30 Thread Michael W. Bombardieri
On Mon, Oct 30, 2017 at 05:27:29PM +0900, YASUOKA Masahiko wrote:
> Hi,
> 
> I'd like to add a platform-id for EFI boot.
> 
> ok?
> 
> diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c 
> b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
> index 46ec432bc84..376c42f5dc3 100644
> --- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
> +++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
> @@ -104,6 +104,8 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const 
> char *boot_info)
>   new_image->system = ET_SYS_PPC;
>   else if (strcmp(sysname, "macppc") == 0)
>   new_image->system = ET_SYS_MAC;
> + else if (strcmp(sysname, "efi") == 0)
> + new_image->system = ET_SYS_EFI;
>   else {
>   warnx("boot disk system must be "
> "i386, macppc, or powerpc");

Should efi be added to the warning message too, or changing it to something like
Unknown boot disk system?

> @@ -335,12 +337,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int 
> first_sector)
>   int used_sectors;
>   int num_entries = 0;
>   int catalog_sectors;
> - struct boot_catalog_entry *x86_head, *mac_head, *ppc_head,
> + struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *efi_head,
>   *valid_entry, *default_entry, *temp, *head, **headp, *next;
>   struct cd9660_boot_image *tmp_disk;
>  
>   headp = NULL;
> - x86_head = mac_head = ppc_head = NULL;
> + x86_head = mac_head = ppc_head = efi_head = NULL;
>  
>   /* If there are no boot disks, don't bother building boot information */
>   if (TAILQ_EMPTY(>boot_images))
> @@ -413,6 +415,9 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int 
> first_sector)
>   case ET_SYS_MAC:
>   headp = _head;
>   break;
> + case ET_SYS_EFI:
> + headp = _head;
> + break;
>   default:
>   warnx("%s: internal error: unknown system type",
>   __func__);
> diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.h 
> b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
> index 43483018ef3..f527bc56b46 100644
> --- a/usr.sbin/makefs/cd9660/cd9660_eltorito.h
> +++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
> @@ -41,6 +41,7 @@
>  #define  ET_SYS_X86  0
>  #define  ET_SYS_PPC  1
>  #define  ET_SYS_MAC  2
> +#define  ET_SYS_EFI  0xfe
>  
>  #define ET_BOOT_ENTRY_SIZE 0x20
>  
> 



makefs(8): add EFI platform-id for UFI

2017-10-30 Thread YASUOKA Masahiko
Hi,

I'd like to add a platform-id for EFI boot.

ok?

diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c 
b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
index 46ec432bc84..376c42f5dc3 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c
@@ -104,6 +104,8 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, const 
char *boot_info)
new_image->system = ET_SYS_PPC;
else if (strcmp(sysname, "macppc") == 0)
new_image->system = ET_SYS_MAC;
+   else if (strcmp(sysname, "efi") == 0)
+   new_image->system = ET_SYS_EFI;
else {
warnx("boot disk system must be "
  "i386, macppc, or powerpc");
@@ -335,12 +337,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int 
first_sector)
int used_sectors;
int num_entries = 0;
int catalog_sectors;
-   struct boot_catalog_entry *x86_head, *mac_head, *ppc_head,
+   struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *efi_head,
*valid_entry, *default_entry, *temp, *head, **headp, *next;
struct cd9660_boot_image *tmp_disk;
 
headp = NULL;
-   x86_head = mac_head = ppc_head = NULL;
+   x86_head = mac_head = ppc_head = efi_head = NULL;
 
/* If there are no boot disks, don't bother building boot information */
if (TAILQ_EMPTY(>boot_images))
@@ -413,6 +415,9 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int 
first_sector)
case ET_SYS_MAC:
headp = _head;
break;
+   case ET_SYS_EFI:
+   headp = _head;
+   break;
default:
warnx("%s: internal error: unknown system type",
__func__);
diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.h 
b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
index 43483018ef3..f527bc56b46 100644
--- a/usr.sbin/makefs/cd9660/cd9660_eltorito.h
+++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.h
@@ -41,6 +41,7 @@
 #defineET_SYS_X86  0
 #defineET_SYS_PPC  1
 #defineET_SYS_MAC  2
+#defineET_SYS_EFI  0xfe
 
 #define ET_BOOT_ENTRY_SIZE 0x20