FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Hardened

 
 
LinkBack Thread Tools
 
Old 01-04-2011, 12:53 PM
Radek Vykydal
 
Default Use NM for ibft configuration (#634016)

---
isys/iface.h | 1 -
loader/net.c | 50 ++------------------------------------------------
network.py | 4 +++-
scripts/mk-images | 2 ++
4 files changed, 7 insertions(+), 50 deletions(-)

diff --git a/isys/iface.h b/isys/iface.h
index 6344212..f7d073e 100644
--- a/isys/iface.h
+++ b/isys/iface.h
@@ -102,7 +102,6 @@ typedef struct _iface_t {
uint64_t flags;
int ipv4method;
int ipv6method;
- int isiBFT;
} iface_t;

/* Function prototypes */
diff --git a/loader/net.c b/loader/net.c
index 8349b9d..c7d0115 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -239,29 +239,9 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
if (loaderData->ipinfo_set && loaderData->ipv4 != NULL) {
/* this is iBFT configured device */
if (!strncmp(loaderData->ipv4, "ibft", 4)) {
- char *devmacaddr = iface_mac2str(loaderData->netDev);
iface->ipv4method = IPV4_IBFT_METHOD;
- iface->isiBFT = 1;
-
- /* Problems with getting the info from iBFT or iBFT uses dhcp*/
- if(!devmacaddr || !ibft_present()){
- iface->ipv4method = IPV4_DHCP_METHOD;
- logMessage(INFO, "iBFT is not present");
- }
-
- /* MAC address doesn't match */
- else if(strcasecmp(ibft_iface_mac(), devmacaddr)){
- iface->ipv4method = IPV4_DHCP_METHOD;
- logMessage(INFO, "iBFT doesn't know what NIC to use - falling back to DHCP");
- }
- else if(ibft_iface_dhcp()){
- iface->ipv4method = IPV4_IBFT_DHCP_METHOD;
- logMessage(INFO, "iBFT is configured to use DHCP");
- }
- if(devmacaddr) free(devmacaddr);
- }
/* this is how we specify dhcp */
- else if (!strncmp(loaderData->ipv4, "dhcp", 4)) {
+ } else if (!strncmp(loaderData->ipv4, "dhcp", 4)) {
iface->dhcptimeout = loaderData->dhcpTimeout;
iface->ipv4method = IPV4_DHCP_METHOD;
} else if (inet_pton(AF_INET, loaderData->ipv4, &addr) >= 1) {
@@ -330,24 +310,6 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
}
#endif

- /* iBFT configured DNS */
- if(iface->ipv4method == IPV4_IBFT_METHOD){
- if(iface->numdns<MAXNS){
- if(ibft_iface_dns1() && inet_pton(AF_INET, ibft_iface_dns1(), &addr)>=1){
- iface->dns[iface->numdns] = strdup(ibft_iface_dns1());
- iface->numdns++;
- logMessage(INFO, "adding iBFT dns server %s", ibft_iface_dns1());
- }
- }
- if(iface->numdns<MAXNS){
- if(ibft_iface_dns2() && inet_pton(AF_INET, ibft_iface_dns2(), &addr)>=1){
- iface->dns[iface->numdns] = strdup(ibft_iface_dns2());
- iface->numdns++;
- logMessage(INFO, "adding iBFT dns server %s", ibft_iface_dns2());
- }
- }
- }
-
if (loaderData->dns) {
char * buf;
char ret[INET6_ADDRSTRLEN+1];
@@ -1318,15 +1280,7 @@ int writeEnabledNetInfo(iface_t *iface) {

if (!FL_NOIPV4(flags)) {
if (iface->ipv4method == IPV4_IBFT_METHOD) {
- /* When initrd and NM support iBFT, we should just write
- * BOOTPROTO=ibft and let NM deal with it. Until than,
- * just use static and do it ourselves. */
- fprintf(fp, "BOOTPROTO=static
");
- if(ibft_iface_ip()) fprintf(fp, "IPADDR=%s
", ibft_iface_ip());
- if(ibft_iface_mask()) fprintf(fp, "NETMASK=%s
", ibft_iface_mask());
- if(ibft_iface_gw()) fprintf(fp, "GATEWAY=%s
", ibft_iface_gw());
- } else if (iface->ipv4method == IPV4_IBFT_DHCP_METHOD) {
- fprintf(fp, "BOOTPROTO=dhcp
");
+ fprintf(fp, "BOOTPROTO=ibft
");
} else if (iface->ipv4method == IPV4_DHCP_METHOD) {
fprintf(fp, "BOOTPROTO=dhcp
");
} else if (iface->ipv4method == IPV4_MANUAL_METHOD) {
diff --git a/network.py b/network.py
index 8774b14..4c2e07b 100644
--- a/network.py
+++ b/network.py
@@ -831,7 +831,9 @@ class Network:

dev = self.netdevices[nic]

- if networkStorageDevice.host_address:
+ if dev.get('BOOTPROTO') == 'ibft':
+ netargs += "ip=ibft"
+ elif networkStorageDevice.host_address:
if self.hostname:
hostname = self.hostname
else:
diff --git a/scripts/mk-images b/scripts/mk-images
index 9e0e025..b1d9d3e 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -807,6 +807,8 @@ makeinitrd() {
( cd $IMGPATH/usr/share/dbus-1/system-services
cp -a org.freedesktop.nm_dispatcher.service $MBD_DIR/usr/share/dbus-1/system-services
)
+ # for BOOTPROTO=ibft option
+ instbin $IMGPATH /usr/sbin/iscsiadm $MBD_DIR /usr/sbin/iscsiadm

# mdadm
instbin $IMGPATH /usr/sbin/mdadm $MBD_DIR /sbin/mdadm
--
1.7.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 01-10-2011, 01:21 PM
Radek Vykydal
 
Default Use NM for ibft configuration (#634016)

---
isys/iface.h | 1 -
loader/net.c | 50 ++------------------------------------------------
network.py | 4 +++-
scripts/mk-images | 2 ++
4 files changed, 7 insertions(+), 50 deletions(-)

diff --git a/isys/iface.h b/isys/iface.h
index 6344212..f7d073e 100644
--- a/isys/iface.h
+++ b/isys/iface.h
@@ -102,7 +102,6 @@ typedef struct _iface_t {
uint64_t flags;
int ipv4method;
int ipv6method;
- int isiBFT;
} iface_t;

/* Function prototypes */
diff --git a/loader/net.c b/loader/net.c
index fa3d4dd..7f5809e 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -239,29 +239,9 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
if (loaderData->ipinfo_set && loaderData->ipv4 != NULL) {
/* this is iBFT configured device */
if (!strncmp(loaderData->ipv4, "ibft", 4)) {
- char *devmacaddr = iface_mac2str(loaderData->netDev);
iface->ipv4method = IPV4_IBFT_METHOD;
- iface->isiBFT = 1;
-
- /* Problems with getting the info from iBFT or iBFT uses dhcp*/
- if(!devmacaddr || !ibft_present()){
- iface->ipv4method = IPV4_DHCP_METHOD;
- logMessage(INFO, "iBFT is not present");
- }
-
- /* MAC address doesn't match */
- else if(strcasecmp(ibft_iface_mac(), devmacaddr)){
- iface->ipv4method = IPV4_DHCP_METHOD;
- logMessage(INFO, "iBFT doesn't know what NIC to use - falling back to DHCP");
- }
- else if(ibft_iface_dhcp()){
- iface->ipv4method = IPV4_IBFT_DHCP_METHOD;
- logMessage(INFO, "iBFT is configured to use DHCP");
- }
- if(devmacaddr) free(devmacaddr);
- }
/* this is how we specify dhcp */
- else if (!strncmp(loaderData->ipv4, "dhcp", 4)) {
+ } else if (!strncmp(loaderData->ipv4, "dhcp", 4)) {
iface->dhcptimeout = loaderData->dhcpTimeout;
iface->ipv4method = IPV4_DHCP_METHOD;
} else if (inet_pton(AF_INET, loaderData->ipv4, &addr) >= 1) {
@@ -330,24 +310,6 @@ void setupIfaceStruct(iface_t * iface, struct loaderData_s * loaderData) {
}
#endif

- /* iBFT configured DNS */
- if(iface->ipv4method == IPV4_IBFT_METHOD){
- if(iface->numdns<MAXNS){
- if(ibft_iface_dns1() && inet_pton(AF_INET, ibft_iface_dns1(), &addr)>=1){
- iface->dns[iface->numdns] = strdup(ibft_iface_dns1());
- iface->numdns++;
- logMessage(INFO, "adding iBFT dns server %s", ibft_iface_dns1());
- }
- }
- if(iface->numdns<MAXNS){
- if(ibft_iface_dns2() && inet_pton(AF_INET, ibft_iface_dns2(), &addr)>=1){
- iface->dns[iface->numdns] = strdup(ibft_iface_dns2());
- iface->numdns++;
- logMessage(INFO, "adding iBFT dns server %s", ibft_iface_dns2());
- }
- }
- }
-
if (loaderData->dns) {
char * buf;
char ret[INET6_ADDRSTRLEN+1];
@@ -1320,15 +1282,7 @@ int writeEnabledNetInfo(iface_t *iface) {

if (!FL_NOIPV4(flags)) {
if (iface->ipv4method == IPV4_IBFT_METHOD) {
- /* When initrd and NM support iBFT, we should just write
- * BOOTPROTO=ibft and let NM deal with it. Until than,
- * just use static and do it ourselves. */
- fprintf(fp, "BOOTPROTO=static
");
- if(ibft_iface_ip()) fprintf(fp, "IPADDR=%s
", ibft_iface_ip());
- if(ibft_iface_mask()) fprintf(fp, "NETMASK=%s
", ibft_iface_mask());
- if(ibft_iface_gw()) fprintf(fp, "GATEWAY=%s
", ibft_iface_gw());
- } else if (iface->ipv4method == IPV4_IBFT_DHCP_METHOD) {
- fprintf(fp, "BOOTPROTO=dhcp
");
+ fprintf(fp, "BOOTPROTO=ibft
");
} else if (iface->ipv4method == IPV4_DHCP_METHOD) {
fprintf(fp, "BOOTPROTO=dhcp
");
} else if (iface->ipv4method == IPV4_MANUAL_METHOD) {
diff --git a/network.py b/network.py
index 8774b14..4c2e07b 100644
--- a/network.py
+++ b/network.py
@@ -831,7 +831,9 @@ class Network:

dev = self.netdevices[nic]

- if networkStorageDevice.host_address:
+ if dev.get('BOOTPROTO') == 'ibft':
+ netargs += "ip=ibft"
+ elif networkStorageDevice.host_address:
if self.hostname:
hostname = self.hostname
else:
diff --git a/scripts/mk-images b/scripts/mk-images
index 9e0e025..b1d9d3e 100755
--- a/scripts/mk-images
+++ b/scripts/mk-images
@@ -807,6 +807,8 @@ makeinitrd() {
( cd $IMGPATH/usr/share/dbus-1/system-services
cp -a org.freedesktop.nm_dispatcher.service $MBD_DIR/usr/share/dbus-1/system-services
)
+ # for BOOTPROTO=ibft option
+ instbin $IMGPATH /usr/sbin/iscsiadm $MBD_DIR /usr/sbin/iscsiadm

# mdadm
instbin $IMGPATH /usr/sbin/mdadm $MBD_DIR /sbin/mdadm
--
1.7.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 10:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org