Re: [Etherboot-developers] Fix for "kernel" undefined in a FreeBSD mode
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: Doug A. <amb...@wh...> - 2001-02-26 20:18:46
|
Ken Yap writes: | Ah thanks. I missed this one. Please mention the version number when | reporting bugs in future so that I don't wrongly accuse you of being out | of date. Okay, here are a couple of more changes for FreeBSD based on Etherboot version 4.7.20. The first is a change to the Makefile in the src directory so that if built on FreeBSD enable FreeBSD support options in Etherboot. This way if someone builds it on a FreeBSD machine they shouldn't have to change the Config file to boot a FreeBSD kernel. The only thing a FreeBSD user needs to build this is gmake. The second change is to make life easier. Unfortunately FreeBSD uses the vendor option tag for swap definition. The existing hack for FreeBSD is okay assuming you have swap defined then you can get into the more advanced Etherboot options. However, if you don't want any swap and don't define it then you can't get into those options. So if FreeBSD is defined just set vendorext_isvalid to true. This doesn't seem to have caused any trouble for people that I've heard of. BTW I suggested the prior hack. Thanks, Doug A. *** Makefile.orig Thu Feb 22 14:07:37 2001 --- Makefile Thu Feb 22 14:24:37 2001 *************** *** 93,98 **** --- 93,101 ---- CFLAGS32+= -DVERSION_MAJOR=$(VERSION_MAJOR) \ -DVERSION_MINOR=$(VERSION_MINOR) \ -DVERSION=\"$(VERSION)\" -DRELOC=$(RELOCADDR) $(OLDGAS) + ifeq "$(shell uname -s)" "FreeBSD" + CFLAGS32+= -DIMAGE_FREEBSD -DELF_IMAGE -DAOUT_IMAGE + endif LCONFIG+= -DRELOC=$(RELOCADDR) IDENT32= '$(VERSION) $(@F) Etherboot (GPL)' *** main.c.orig Thu Feb 22 14:24:48 2001 --- main.c Thu Feb 22 14:30:16 2001 *************** *** 984,990 **** --- 984,1000 ---- memset(motd, 0, sizeof(motd)); #endif end_of_rfc1533 = NULL; + #ifdef IMAGE_FREEBSD + /* yes this is a pain FreeBSD uses this for swap, however, + there are cases when you don't want swap and then + you want this set to get the extra features so lets + just set if dealing with FreeBSD. I haven't run into + any troubles with this but I have without it + */ + vendorext_isvalid = 1; + #else vendorext_isvalid = 0; + #endif if (memcmp(p, rfc1533_cookie, 4)) return(0); /* no RFC 1533 header found */ p += 4; *************** *** 1047,1057 **** hostnamelen = *(p + 1); } else if (c == RFC1533_VENDOR_MAGIC - #ifndef IMAGE_FREEBSD /* since FreeBSD uses tag 128 for swap definition */ && TAG_LEN(p) >= 6 && !memcmp(p+2,vendorext_magic,4) && p[6] == RFC1533_VENDOR_MAJOR - #endif ) vendorext_isvalid++; #ifdef IMAGE_FREEBSD --- 1057,1065 ---- |