2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-28 04:09:16 +00:00

Add '%M' to power BOOTIF

Former-commit-id: b73dcada300ada234033e8178a0ee47499df7af5
This commit is contained in:
jbjohnso 2011-09-13 20:23:57 +00:00
parent 85250e697d
commit dee2ca7bc9

View File

@ -1,6 +1,6 @@
diff -ubrN elilo/fs/netfs.c elilo-ipxe/fs/netfs.c
--- elilo/fs/netfs.c 2009-10-26 16:37:05.000000000 -0400
+++ elilo-ipxe/fs/netfs.c 2011-08-17 09:00:20.751301110 -0400
diff -urN elilo-orig/elilo/fs/netfs.c elilo-xcat/elilo/fs/netfs.c
--- elilo-orig/elilo/fs/netfs.c 2009-10-26 16:37:05.000000000 -0400
+++ elilo-xcat/elilo/fs/netfs.c 2011-09-13 10:55:54.713299125 -0400
@@ -66,6 +66,7 @@
typedef struct {
@ -163,9 +163,9 @@ diff -ubrN elilo/fs/netfs.c elilo-ipxe/fs/netfs.c
status = LibInstallProtocolInterfaces(&dev, &NetFsProtocol, netfs, NULL);
if (EFI_ERROR(status)) {
diff -ubrN elilo/fs/netfs.h elilo-ipxe/fs/netfs.h
--- elilo/fs/netfs.h 2003-08-19 12:45:01.000000000 -0400
+++ elilo-ipxe/fs/netfs.h 2011-08-17 08:38:33.242298708 -0400
diff -urN elilo-orig/elilo/fs/netfs.h elilo-xcat/elilo/fs/netfs.h
--- elilo-orig/elilo/fs/netfs.h 2003-08-19 12:45:01.000000000 -0400
+++ elilo-xcat/elilo/fs/netfs.h 2011-09-13 10:55:54.715293964 -0400
@@ -31,6 +31,74 @@
#define NETFS_BOOTFILE_MAXLEN 256
@ -241,9 +241,50 @@ diff -ubrN elilo/fs/netfs.h elilo-ipxe/fs/netfs.h
typedef struct {
EFI_IP_ADDRESS cln_ipaddr;
EFI_IP_ADDRESS srv_ipaddr;
diff -ubrN elilo/Make.defaults elilo-ipxe/Make.defaults
--- elilo/Make.defaults 2011-01-10 16:05:30.000000000 -0500
+++ elilo-ipxe/Make.defaults 2011-08-15 13:07:17.583298861 -0400
diff -urN elilo-orig/elilo/glue_netfs.c elilo-xcat/elilo/glue_netfs.c
--- elilo-orig/elilo/glue_netfs.c 2010-11-09 18:18:41.000000000 -0500
+++ elilo-xcat/elilo/glue_netfs.c 2011-09-13 10:56:27.223300792 -0400
@@ -63,6 +63,7 @@
#define NETFS_KERNEL_LAYER 2
static CHAR16 *hexa=L"0123456789ABCDEF";
+static CHAR16 *hexal=L"0123456789abcdef";
static VOID
convert_mac2hex(UINT8 *hw_addr,INTN l, CHAR16 *str)
@@ -78,6 +79,19 @@
}
static VOID
+convert_mac2hexhyp(UINT8 *hw_addr,INTN l, CHAR16 *str)
+{
+ UINTN i;
+
+ for (i=0 ; i < l; i++) {
+ str[3*i] = hexal[(hw_addr[i] & 0xf0)>>4];
+ str[3*i+1] = hexal[hw_addr[i] & 0x0f];
+ str[3*i+2] = '-';
+ }
+ str[3*l-1]='\0';
+}
+
+static VOID
convert_ip2hex(UINT8 *ip, INTN l, CHAR16 *str)
{
UINTN i;
@@ -164,6 +178,9 @@
set_var(VAR_NETFS_HOSTNAME, info.hostname);
set_var(VAR_NETFS_DOMAINAME, info.domainame);
+ StrCpy(str, L"01-");
+ convert_mac2hexhyp(info.hw_addr,6,str+3);
+ set_var(VAR_NETFS_BOOTIF, str);
if (info.using_pxe) {
DBG_PRT((L"netfs_setdefaults: using_pxe"));
diff -urN elilo-orig/elilo/Make.defaults elilo-xcat/elilo/Make.defaults
--- elilo-orig/elilo/Make.defaults 2011-01-10 16:05:30.000000000 -0500
+++ elilo-xcat/elilo/Make.defaults 2011-09-13 10:55:54.723300721 -0400
@@ -55,9 +55,9 @@
# They are installed as part of the GNU-EFI package installation
#
@ -257,3 +298,14 @@ diff -ubrN elilo/Make.defaults elilo-ipxe/Make.defaults
CDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
TOPDIR =
diff -urN elilo-orig/elilo/vars.h elilo-xcat/elilo/vars.h
--- elilo-orig/elilo/vars.h 2003-08-19 12:48:14.000000000 -0400
+++ elilo-xcat/elilo/vars.h 2011-09-13 10:55:54.725298079 -0400
@@ -45,6 +45,7 @@
#define VAR_NETFS_GATEWAY L'G' /* the gateway obtained by DHCP/PXE */
#define VAR_NETFS_HOSTNAME L'H' /* the hostname obtained by DHCP/PXE */
#define VAR_NETFS_DOMAINAME L'D' /* the domain name obtained by DHCP/PXE */
+#define VAR_NETFS_BOOTIF L'B' /* the hardware address used for DHCP/PXE */
extern INTN set_var(CHAR16 v, CHAR16 *value);
extern CHAR16 * get_var(CHAR16 v);