2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2024-12-25 04:31:40 +00:00

-Update ipmitool

-Add gPXE
This commit is contained in:
jbjohnso 2008-11-02 20:08:46 +00:00
parent 2f8121b521
commit 66baf648d7
4 changed files with 154 additions and 0 deletions

BIN
gpxe/gpxe-0.9.5.tar.bz2 Normal file

Binary file not shown.

40
gpxe/gpxe-xcat.spec Normal file
View File

@ -0,0 +1,40 @@
Name: gpxe-xcat
Summary: gPXE - UNDI package
Group: System Environment/Daemons
Version: 0.9.5
Release: 1
License: GPL
BuildRoot: %{_tmppath}/%{pkg}-buildroot
BuildArch: noarch
Source: gpxe-0.9.5.tar.bz2
Patch: register-iscsi-on-tftp.patch
Packager: Jarrod Johnson <jbj-xd@ura.dnsalias.org>
%description
A network bootloader supporting several different protocols. xCAT uses it to provide RFC4173 capability for any PXE compliant x86 system.
%prep
%setup -n gpxe-0.9.5
%patch -p1
%build
make -C src bin/undionly.kpxe
%install
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != '/' ] && rm -rf $RPM_BUILD_ROOT
mkdir -p "$RPM_BUILD_ROOT"/tftpboot
cp src/bin/undionly.kpxe "$RPM_BUILD_ROOT"/tftpboot/
%files
/tftpboot/undionly.kpxe
%clean
%changelog
* Sat Nov 01 2008 Jarrod Johnson <jbj-xd@ura.dnsalias.org>
- Initial packaging

View File

@ -0,0 +1,114 @@
diff -urN gpxe-0.9.5/src/include/usr/iscsiboot.h gpxe-0.9.5-regroot/src/include/usr/iscsiboot.h
--- gpxe-0.9.5/src/include/usr/iscsiboot.h 2008-10-01 13:30:45.000000000 -0400
+++ gpxe-0.9.5-regroot/src/include/usr/iscsiboot.h 2008-10-30 13:19:41.000000000 -0400
@@ -2,5 +2,6 @@
#define _USR_ISCSIBOOT_H
extern int iscsiboot ( const char *root_path );
+extern int iscsireg ( const char *root_path );
#endif /* _USR_ISCSIBOOT_H */
diff -urN gpxe-0.9.5/src/usr/autoboot.c gpxe-0.9.5-regroot/src/usr/autoboot.c
--- gpxe-0.9.5/src/usr/autoboot.c 2008-10-01 13:30:44.000000000 -0400
+++ gpxe-0.9.5-regroot/src/usr/autoboot.c 2008-10-30 13:19:41.000000000 -0400
@@ -135,6 +135,19 @@
}
/**
+ * Register a drive in BIOS (i.e. iSCSI), but don't boot from it
+ *
+ * @v root_path Root path
+ * @ret rc Return status code
+ */
+int reg_root_path ( const char *root_path ) {
+ /* Quick hack */
+ if ( strncmp ( root_path, "iscsi:", 6 ) == 0 ) {
+ return iscsireg ( root_path );
+ } /* TODO: aoereg */
+ return -ENOTSUP;
+}
+/**
* Boot using root path
*
* @v root_path Root path
@@ -160,6 +173,7 @@
*/
static int netboot ( struct net_device *netdev ) {
char buf[256];
+ char ruf[256];
struct in_addr next_server;
int rc;
@@ -190,6 +204,12 @@
fetch_ipv4_setting ( NULL, &next_server_setting, &next_server );
fetch_string_setting ( NULL, &filename_setting, buf, sizeof ( buf ) );
if ( buf[0] ) {
+ /* Going to tftp, but first setup root path hinted BIOS drive if applicable */
+ fetch_string_setting ( NULL, &root_path_setting, ruf, sizeof ( ruf ) );
+ if ( ruf[0] ) {
+ printf("Attempting to register BIOS drive per root path \"%s\"\n",ruf);
+ reg_root_path ( ruf );
+ }
printf ( "Booting from filename \"%s\"\n", buf );
return boot_next_server_and_filename ( next_server, buf );
}
diff -urN gpxe-0.9.5/src/usr/iscsiboot.c gpxe-0.9.5-regroot/src/usr/iscsiboot.c
--- gpxe-0.9.5/src/usr/iscsiboot.c 2008-10-01 13:30:44.000000000 -0400
+++ gpxe-0.9.5-regroot/src/usr/iscsiboot.c 2008-10-30 13:19:57.000000000 -0400
@@ -36,6 +36,56 @@
return NULL;
}
+int iscsireg ( const char *root_path ) {
+ struct scsi_device *scsi;
+ struct int13_drive *drive;
+ int rc;
+
+ scsi = zalloc ( sizeof ( *scsi ) );
+ if ( ! scsi ) {
+ rc = -ENOMEM;
+ goto err_alloc_scsi;
+ }
+ drive = zalloc ( sizeof ( *drive ) );
+ if ( ! drive ) {
+ rc = -ENOMEM;
+ goto err_alloc_drive;
+ }
+
+ printf ( "Configuring iSCSI per %s\n", root_path );
+
+ if ( ( rc = iscsi_attach ( scsi, root_path ) ) != 0 ) {
+ printf ( "Could not attach iSCSI device: %s\n",
+ strerror ( rc ) );
+ goto err_attach;
+ }
+ if ( ( rc = init_scsidev ( scsi ) ) != 0 ) {
+ printf ( "Could not initialise iSCSI device: %s\n",
+ strerror ( rc ) );
+ goto err_init;
+ }
+
+ drive->blockdev = &scsi->blockdev;
+
+ /* FIXME: ugly, ugly hack */
+ struct net_device *netdev = guess_boot_netdev();
+ struct iscsi_session *iscsi =
+ container_of ( scsi->backend, struct iscsi_session, refcnt );
+ ibft_fill_data ( netdev, iscsi );
+
+ register_int13_drive ( drive );
+ printf ( "Registered as BIOS drive %#02x\n", drive->drive );
+ return 0;
+ err_init:
+ iscsi_detach ( scsi );
+ err_attach:
+ free ( drive );
+ err_alloc_drive:
+ free ( scsi );
+ err_alloc_scsi:
+ return rc;
+}
+
int iscsiboot ( const char *root_path ) {
struct scsi_device *scsi;
struct int13_drive *drive;

Binary file not shown.