From e17b5592ae9b2a8c1c79ea0c1c9e2fd04c6ca9da Mon Sep 17 00:00:00 2001 From: Live System User Date: Sat, 6 Apr 2013 11:37:05 +0200 Subject: [PATCH] iPXE-Customization-for-Realtek-Controller-MSI-p67a-gd65 IMAGE_EFI is broken since 2013-03-13 commit fc87adb46c1395b09302085e9d15fcd8ab3c31fe ([efi] Expose downloaded images via EFI_SIMPLE_FILE_SYSTEM_PROTOCOL) --- src/config/general.h | 58 +++++++++++++++++++++---------------------- src/usr/autoboot.c | 66 ++++++++++++++++++++----------------------------- 2 files changed, 68 insertions(+), 69 deletions(-) diff --git a/src/config/general.h b/src/config/general.h index 9f0bb52..5cd65e2 100644 --- a/src/config/general.h +++ b/src/config/general.h @@ -24,14 +24,14 @@ FILE_LICENCE ( GPL2_OR_LATER ); * "iPXE". * */ -#define PRODUCT_NAME "" +#define PRODUCT_NAME "iPXE - gitdate 2013-04-15; commit 0e2ba15a5831fb6d5ddecfb56cb5e927a94bcf95" #define PRODUCT_SHORT_NAME "iPXE" /* * Timer configuration * */ -#define BANNER_TIMEOUT 20 /* Tenths of a second for which the shell +#define BANNER_TIMEOUT 0 /* Tenths of a second for which the shell banner should appear */ /* @@ -54,10 +54,10 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ -#define DOWNLOAD_PROTO_TFTP /* Trivial File Transfer Protocol */ +#undef 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_HTTPS /* Secure Hypertext Transfer Protocol */ +#define DOWNLOAD_PROTO_FTP /* File Transfer Protocol */ #undef DOWNLOAD_PROTO_SLAM /* Scalable Local Area Multicast */ /* @@ -65,18 +65,18 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ -//#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 */ +#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 */ /* * 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 */ +//#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 */ /* * Name resolution modules @@ -92,15 +92,15 @@ FILE_LICENCE ( GPL2_OR_LATER ); * you want to use. * */ -//#define IMAGE_NBI /* NBI image support */ -//#define IMAGE_ELF /* ELF image support */ -//#define IMAGE_MULTIBOOT /* MultiBoot 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_NBI /* NBI image support */ +#define IMAGE_ELF /* ELF image support */ +#define IMAGE_MULTIBOOT /* MultiBoot 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 */ -//#define IMAGE_SDI /* SDI image support */ +#define IMAGE_SDI /* SDI image support */ /* * Command-line commands to include @@ -110,23 +110,23 @@ FILE_LICENCE ( GPL2_OR_LATER ); #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 */ -#define FCMGMT_CMD /* Fibre Channel management commands */ +//#define 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 */ #define DHCP_CMD /* DHCP management commands */ -#define SANBOOT_CMD /* SAN boot commands */ +//#define SANBOOT_CMD /* SAN boot commands */ #define MENU_CMD /* Menu commands */ #define LOGIN_CMD /* Login command */ #define SYNC_CMD /* Sync command */ -//#define NSLOOKUP_CMD /* DNS resolving command */ +#define NSLOOKUP_CMD /* DNS resolving command */ //#define TIME_CMD /* Time commands */ -//#define DIGEST_CMD /* Image crypto digest commands */ +#define DIGEST_CMD /* Image crypto digest commands */ //#define LOTEST_CMD /* Loopback testing commands */ -//#define VLAN_CMD /* VLAN commands */ -//#define PXE_CMD /* PXE commands */ -//#define REBOOT_CMD /* Reboot command */ -//#define IMAGE_TRUST_CMD /* Image trust management commands */ +#define VLAN_CMD /* VLAN commands */ +#define PXE_CMD /* PXE commands */ +#define REBOOT_CMD /* Reboot command */ +#define IMAGE_TRUST_CMD /* Image trust management commands */ /* * ROM-specific options diff --git a/src/usr/autoboot.c b/src/usr/autoboot.c index b2d288e..4c50c3f 100644 --- a/src/usr/autoboot.c +++ b/src/usr/autoboot.c @@ -444,23 +444,6 @@ int autoboot ( void ) { } /** - * Prompt for shell entry - * - * @ret enter_shell User wants to enter shell - */ -static int shell_banner ( void ) { - - /* Skip prompt if timeout is zero */ - if ( BANNER_TIMEOUT <= 0 ) - return 0; - - /* Prompt user */ - printf ( "\n" ); - return ( prompt ( "Press Ctrl-B for the iPXE command line...", - ( BANNER_TIMEOUT * 100 ), CTRL_B ) == 0 ); -} - -/** * Main iPXE flow of execution * * @v netdev Network device, or NULL @@ -491,30 +474,35 @@ void ipxe ( struct net_device *netdev ) { printf ( "\n" ); /* Boot system */ - if ( ( image = first_image() ) != NULL ) { - /* We have an embedded image; execute it */ - image_exec ( image ); - } else if ( shell_banner() ) { - /* User wants shell; just give them a shell */ - shell(); + fetch_string_setting_copy ( NULL, &scriptlet_setting, + &scriptlet ); + if ( scriptlet ) { + /* User has defined a scriptlet; execute it */ + system ( scriptlet ); + free ( scriptlet ); } else { - fetch_string_setting_copy ( NULL, &scriptlet_setting, - &scriptlet ); - if ( scriptlet ) { - /* User has defined a scriptlet; execute it */ - system ( scriptlet ); - free ( scriptlet ); + /* Try booting. If booting fails, offer the + * user another chance to enter the shell. + */ + if ( netdev ) { + netboot ( netdev ); } else { - /* Try booting. If booting fails, offer the - * user another chance to enter the shell. - */ - if ( netdev ) { - netboot ( netdev ); - } else { - autoboot(); + if ( autoboot() != 0 ) { + if ( ( image = first_image() ) != NULL ) { + /* We have an embedded image; execute it */ + image_exec ( image ); + /* The embedded image is a script to fetch + * an IP from the DCHP. It doesn't contain + * any "boot" command. The script has + * finished execution and we can free the + * image and restore the stack. This saves + * us from a "boot" command throwing us + * into an endless execution loop. + */ + unregister_image ( image ); + } } - if ( shell_banner() ) - shell(); - } + shell(); + } } } -- 1.7.11.7