2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-11-21 17:11:45 +00:00

-Add ipxe variants of most patches (ignoring hdboot and old kvm workaround for now)

Former-commit-id: fa6396d64cbcee40b1306ac3aa17f99267706d30
This commit is contained in:
jbjohnso 2010-11-12 15:57:37 +00:00
parent 5d53d6dc0f
commit 399756e203
8 changed files with 2094 additions and 0 deletions

14
gpxe/ipxe-branding.patch Normal file
View File

@ -0,0 +1,14 @@
diff -urN ipxe/src/config/general.h ipxe-branded/src/config/general.h
--- ipxe/src/config/general.h 2010-11-11 14:09:48.052334980 -0500
+++ ipxe-branded/src/config/general.h 2010-11-12 09:33:37.493584218 -0500
@@ -24,8 +24,8 @@
* "iPXE".
*
*/
-#define PRODUCT_NAME ""
-#define PRODUCT_SHORT_NAME "iPXE"
+#define PRODUCT_NAME "xCAT Network Boot Agent"
+#define PRODUCT_SHORT_NAME "xNBA"
/*
* Timer configuration

View File

@ -0,0 +1,11 @@
diff -urN ipxe-expandfilename/src/arch/i386/include/bzimage.h ipxe-cmdlinesize/src/arch/i386/include/bzimage.h
--- ipxe-expandfilename/src/arch/i386/include/bzimage.h 2010-11-11 14:09:48.042334268 -0500
+++ ipxe-cmdlinesize/src/arch/i386/include/bzimage.h 2010-11-12 10:47:08.086084309 -0500
@@ -137,6 +137,6 @@
#define BZI_STACK_SIZE 0x1000
/** Maximum size of command line */
-#define BZI_CMDLINE_SIZE 0x100
+#define BZI_CMDLINE_SIZE 0x7FF
#endif /* _BZIMAGE_H */

78
gpxe/ipxe-config.patch Normal file
View File

@ -0,0 +1,78 @@
diff -urN ipxe-branded/src/config/general.h ipxe-configged/src/config/general.h
--- ipxe-branded/src/config/general.h 2010-11-12 09:33:37.493584218 -0500
+++ ipxe-configged/src/config/general.h 2010-11-12 09:50:59.112334015 -0500
@@ -40,7 +40,7 @@
*/
#define NET_PROTO_IPV4 /* IPv4 protocol */
-#undef NET_PROTO_FCOE /* Fibre Channel over Ethernet protocol */
+#define NET_PROTO_FCOE /* Fibre Channel over Ethernet protocol */
/*
* PXE support
@@ -57,7 +57,7 @@
#define DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */
#define DOWNLOAD_PROTO_HTTP /* Hypertext Transfer Protocol */
#undef DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */
-#undef DOWNLOAD_PROTO_FTP /* File Transfer Protocol */
+#define DOWNLOAD_PROTO_FTP /* File Transfer Protocol */
#undef DOWNLOAD_PROTO_TFTM /* Multicast Trivial File Transfer Protocol */
#undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */
@@ -66,18 +66,18 @@
*
*/
-//#undef SANBOOT_PROTO_ISCSI /* iSCSI protocol */
-//#undef SANBOOT_PROTO_AOE /* AoE protocol */
-//#undef SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */
-//#undef SANBOOT_PROTO_FCP /* Fibre Channel protocol */
+#define SANBOOT_PROTO_ISCSI /* iSCSI protocol */
+#define SANBOOT_PROTO_AOE /* AoE protocol */
+#define SANBOOT_PROTO_IB_SRP /* Infiniband SCSI RDMA protocol */
+#define SANBOOT_PROTO_FCP /* Fibre Channel protocol */
/*
* 802.11 cryptosystems and handshaking protocols
*
*/
-#define CRYPTO_80211_WEP /* WEP encryption (deprecated and insecure!) */
-#define CRYPTO_80211_WPA /* WPA Personal, authenticating with passphrase */
-#define CRYPTO_80211_WPA2 /* Add support for stronger WPA cryptography */
+#undef CRYPTO_80211_WEP /* WEP encryption (deprecated and insecure!) */
+#undef CRYPTO_80211_WPA /* WPA Personal, authenticating with passphrase */
+#undef CRYPTO_80211_WPA2 /* Add support for stronger WPA cryptography */
/*
* Name resolution modules
@@ -99,9 +99,9 @@
//#define IMAGE_MULTIBOOT /* MultiBoot image support */
//#define IMAGE_AOUT /* a.out image support */
//#define IMAGE_WINCE /* WinCE image support */
-//#define IMAGE_PXE /* PXE image support */
-//#define IMAGE_SCRIPT /* iPXE script image support */
-//#define IMAGE_BZIMAGE /* Linux bzImage image support */
+#define IMAGE_PXE /* PXE image support */
+#define IMAGE_SCRIPT /* iPXE script image support */
+#define IMAGE_BZIMAGE /* Linux bzImage image support */
//#define IMAGE_COMBOOT /* SYSLINUX COMBOOT image support */
//#define IMAGE_EFI /* EFI image support */
@@ -113,7 +113,7 @@
#define NVO_CMD /* Non-volatile option storage commands */
#define CONFIG_CMD /* Option configuration console */
#define IFMGMT_CMD /* Interface management commands */
-#define IWMGMT_CMD /* Wireless interface management commands */
+#undef IWMGMT_CMD /* Wireless interface management commands */
#define FCMGMT_CMD /* Fibre Channel management commands */
#define ROUTE_CMD /* Routing table management commands */
#define IMAGE_CMD /* Image management commands */
@@ -123,7 +123,7 @@
#undef TIME_CMD /* Time commands */
#undef DIGEST_CMD /* Image crypto digest commands */
#undef LOTEST_CMD /* Loopback testing commands */
-//#undef PXE_CMD /* PXE commands */
+#undef PXE_CMD /* PXE commands */
/*
* Error message tables to include

1789
gpxe/ipxe-droppackets.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
diff -urN ipxe-undinetchange/src/core/exec.c ipxe-expandfilename/src/core/exec.c
--- ipxe-undinetchange/src/core/exec.c 2010-11-11 14:09:48.062345190 -0500
+++ ipxe-expandfilename/src/core/exec.c 2010-11-12 10:40:03.943584358 -0500
@@ -94,7 +94,7 @@
* The expanded command line is allocated with malloc() and the caller
* must eventually free() it.
*/
-static char * expand_command ( const char *command ) {
+char * expand_command ( const char *command ) {
char *expcmd;
char *start;
char *end;
diff -urN ipxe-undinetchange/src/usr/autoboot.c ipxe-expandfilename/src/usr/autoboot.c
--- ipxe-undinetchange/src/usr/autoboot.c 2010-11-12 10:31:31.972972171 -0500
+++ ipxe-expandfilename/src/usr/autoboot.c 2010-11-12 10:44:23.972334241 -0500
@@ -33,6 +33,8 @@
#include <usr/dhcpmgmt.h>
#include <usr/imgmgmt.h>
#include <usr/autoboot.h>
+char * expand_command ( const char *command );
+
/** @file
*
@@ -97,6 +99,8 @@
uri_encode ( filename, buf + strlen ( buf ),
sizeof ( buf ) - strlen ( buf ), URI_PATH );
filename = buf;
+ } else { /* I don't think it could hurt the tftp case, but might as well stay out of a codepath I don't intend to rigorously test */
+ filename = expand_command(filename);
}
/* Download and boot image */

141
gpxe/ipxe-machyp.patch Normal file
View File

@ -0,0 +1,141 @@
diff -urN ipxe-cmdlinesize/src/core/settings.c ipxe-machyp/src/core/settings.c
--- ipxe-cmdlinesize/src/core/settings.c 2010-11-11 14:09:48.062345190 -0500
+++ ipxe-machyp/src/core/settings.c 2010-11-12 10:49:22.822334798 -0500
@@ -1321,6 +1321,72 @@
}
/**
+ * Parse and store value of hex string setting, hyphen delimited
+ *
+ * @v settings Settings block
+ * @v setting Setting to store
+ * @v value Formatted setting data
+ * @ret rc Return status code
+ */
+static int storef_hexhyp ( struct settings *settings, struct setting *setting,
+ const char *value ) {
+ char *ptr = ( char * ) value;
+ uint8_t bytes[ strlen ( value ) ]; /* cannot exceed strlen(value) */
+ unsigned int len = 0;
+
+ while ( 1 ) {
+ bytes[len++] = strtoul ( ptr, &ptr, 16 );
+ switch ( *ptr ) {
+ case '\0' :
+ return store_setting ( settings, setting, bytes, len );
+ case '-' :
+ ptr++;
+ break;
+ default :
+ return -EINVAL;
+ }
+ }
+}
+/**
+ * Fetch and format value of hex string setting with hypphen delimiter
+ *
+ * @v settings Settings block, or NULL to search all blocks
+ * @v setting Setting to fetch
+ * @v buf Buffer to contain formatted value
+ * @v len Length of buffer
+ * @ret len Length of formatted value, or negative error
+ */
+static int fetchf_hexhyp ( struct settings *settings, struct setting *setting,
+ char *buf, size_t len ) {
+ int raw_len;
+ int check_len;
+ int used = 0;
+ int i;
+
+ raw_len = fetch_setting_len ( settings, setting );
+ if ( raw_len < 0 )
+ return raw_len;
+
+ {
+ uint8_t raw[raw_len];
+
+ check_len = fetch_setting ( settings, setting, raw,
+ sizeof ( raw ) );
+ if ( check_len < 0 )
+ return check_len;
+ assert ( check_len == raw_len );
+
+ if ( len )
+ buf[0] = 0; /* Ensure that a terminating NUL exists */
+ for ( i = 0 ; i < raw_len ; i++ ) {
+ used += ssnprintf ( ( buf + used ), ( len - used ),
+ "%s%02x", ( used ? "-" : "" ),
+ raw[i] );
+ }
+ return used;
+ }
+}
+/**
* Fetch and format value of hex string setting
*
* @v settings Settings block, or NULL to search all blocks
@@ -1366,6 +1432,12 @@
.storef = storef_hex,
.fetchf = fetchf_hex,
};
+/** A hex-string setting, hyphen delimited */
+struct setting_type setting_type_hexhyp __setting_type = {
+ .name = "hexhyp",
+ .storef = storef_hexhyp,
+ .fetchf = fetchf_hexhyp,
+};
/**
* Parse and store value of UUID setting
diff -urN ipxe-cmdlinesize/src/include/ipxe/settings.h ipxe-machyp/src/include/ipxe/settings.h
--- ipxe-cmdlinesize/src/include/ipxe/settings.h 2010-11-11 14:09:48.132334810 -0500
+++ ipxe-machyp/src/include/ipxe/settings.h 2010-11-12 10:50:51.433584483 -0500
@@ -227,6 +227,7 @@
extern struct setting_type setting_type_uint16 __setting_type;
extern struct setting_type setting_type_uint32 __setting_type;
extern struct setting_type setting_type_hex __setting_type;
+extern struct setting_type setting_type_hexhyp __setting_type;
extern struct setting_type setting_type_uuid __setting_type;
extern struct setting ip_setting __setting;
@@ -243,6 +244,7 @@
extern struct setting uuid_setting __setting;
extern struct setting next_server_setting __setting;
extern struct setting mac_setting __setting;
+extern struct setting machyp_setting __setting;
extern struct setting busid_setting __setting;
extern struct setting user_class_setting __setting;
diff -urN ipxe-cmdlinesize/src/net/netdev_settings.c ipxe-machyp/src/net/netdev_settings.c
--- ipxe-cmdlinesize/src/net/netdev_settings.c 2010-11-11 14:09:48.132334810 -0500
+++ ipxe-machyp/src/net/netdev_settings.c 2010-11-12 10:49:22.822334798 -0500
@@ -38,6 +38,11 @@
.description = "MAC address",
.type = &setting_type_hex,
};
+struct setting machyp_setting __setting = {
+ .name = "machyp",
+ .description = "MAC address",
+ .type = &setting_type_hexhyp,
+};
struct setting busid_setting __setting = {
.name = "busid",
.description = "Bus ID",
@@ -58,7 +63,7 @@
struct net_device *netdev = container_of ( settings, struct net_device,
settings.settings );
- if ( setting_cmp ( setting, &mac_setting ) == 0 ) {
+ if (( setting_cmp ( setting, &mac_setting ) == 0 ) || ( setting_cmp ( setting, &machyp_setting ) == 0 )) {
if ( len != netdev->ll_protocol->ll_addr_len )
return -EINVAL;
memcpy ( netdev->ll_addr, data, len );
@@ -84,7 +89,7 @@
struct device_description *desc = &netdev->dev->desc;
struct dhcp_netdev_desc dhcp_desc;
- if ( setting_cmp ( setting, &mac_setting ) == 0 ) {
+ if (( setting_cmp ( setting, &mac_setting ) == 0 ) || ( setting_cmp ( setting, &machyp_setting ) == 0 )) {
if ( len > netdev->ll_protocol->ll_addr_len )
len = netdev->ll_protocol->ll_addr_len;
memcpy ( data, netdev->ll_addr, len );

View File

@ -0,0 +1,16 @@
Allegedly some UNDI stacks don't cope well with interrupts. This patch pretty
much turns the world into a polling world. This is relatively hideous, but a
fairly short lifetime.
diff -urN ipxe-xnbaclass/src/arch/i386/drivers/net/undinet.c ipxe-undinetchange/src/arch/i386/drivers/net/undinet.c
--- ipxe-xnbaclass/src/arch/i386/drivers/net/undinet.c 2010-11-11 14:09:48.042334268 -0500
+++ ipxe-undinetchange/src/arch/i386/drivers/net/undinet.c 2010-11-12 10:37:01.332334042 -0500
@@ -258,7 +258,7 @@
"nop\n\t"
"nop\n\t"
"cli\n\t" ) : : );
- return;
+ //return;
}
/* Start ISR processing */

12
gpxe/ipxe-xnbaclass.patch Normal file
View File

@ -0,0 +1,12 @@
diff -urN ipxe-droppackets/src/net/udp/dhcp.c ipxe-xnbaclass/src/net/udp/dhcp.c
--- ipxe-droppackets/src/net/udp/dhcp.c 2010-11-11 14:09:48.142334824 -0500
+++ ipxe-xnbaclass/src/net/udp/dhcp.c 2010-11-12 10:35:08.482334675 -0500
@@ -79,7 +79,7 @@
DHCP_CLIENT_ARCHITECTURE, DHCP_ARCH_CLIENT_ARCHITECTURE,
DHCP_CLIENT_NDI, DHCP_ARCH_CLIENT_NDI,
DHCP_VENDOR_CLASS_ID, DHCP_ARCH_VENDOR_CLASS_ID,
- DHCP_USER_CLASS_ID, DHCP_STRING ( 'i', 'P', 'X', 'E' ),
+ DHCP_USER_CLASS_ID, DHCP_STRING ( 'x', 'N', 'B', 'A' ),
DHCP_PARAMETER_REQUEST_LIST,
DHCP_OPTION ( DHCP_SUBNET_MASK, DHCP_ROUTERS, DHCP_DNS_SERVERS,
DHCP_LOG_SERVERS, DHCP_HOST_NAME, DHCP_DOMAIN_NAME,