#define _MACH_classic 0x00000400 /* RPCG RPX-Classic 8xx board */
#define _MACH_oak 0x00000800 /* IBM "Oak" 403 eval. board */
#define _MACH_walnut 0x00001000 /* IBM "Walnut" 405GP eval. board */
+#define _MACH_bplan 0x00002000 /* Pegasos/Efika, broken partition #s */
struct bi_record {
unsigned long tag; /* tag ID */
#endif /* _PPC_BOOTINFO_H */
+extern int _machine;
+
/*
* Local variables:
* c-file-style: "k&r"
#include "fs.h"
#include "errors.h"
#include "debug.h"
+#include "bootinfo.h"
#define FAST_VERSION
#define MAX_READ_RANGE 256
/* Open the OF device for the entire disk */
strncpy(buffer, dev_name, 1020);
- strcat(buffer, ":0");
+ if (_machine != _MACH_bplan)
+ strcat(buffer, ":0");
DEBUG_F("<%s>\n", buffer);
#include "fs.h"
#include "errors.h"
#include "debug.h"
+#include "bootinfo.h"
#include "reiserfs/reiserfs.h"
/* Exported in struct fs_t */
else
INFO->partition_offset = 0;
- sprintf( buffer, "%s:%d", dev_name, 0 ); /* 0 is full disk in OF */
+ strncpy(buffer, dev_name, 1020);
+ if (_machine != _MACH_bplan)
+ strcat(buffer, ":0"); /* 0 is full disk in (non-buggy) OF */
+
file->of_device = prom_open( buffer );
DEBUG_F( "Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
buffer, file_name, INFO->partition_offset );
#include "xfs/xfs.h"
#include "errors.h"
#include "debug.h"
+#include "bootinfo.h"
#define SECTOR_BITS 9
else
partition_offset = 0;
- sprintf(buffer, "%s:%d", dev_name, 0); /* 0 is full disk in OF */
+ strncpy(buffer, dev_name, 1020);
+ if (_machine != _MACH_bplan)
+ strcat(buffer, ":0"); /* 0 is full disk in (non-buggy) OF */
DEBUG_F("Trying to open dev_name=%s; filename=%s; partition offset=%Lu\n",
buffer, file_name, partition_offset);
file->of_device = prom_open(buffer);
#include "linux/iso_fs.h"
#include "debug.h"
#include "errors.h"
+#include "bootinfo.h"
#include "byteorder.h"
/* We currently don't check the partition type, some users
unsigned int prom_blksize, iso_root_block;
strncpy(block_buffer, device, 2040);
- strcat(block_buffer, ":0");
+ if (_machine != _MACH_bplan)
+ strcat(block_buffer, ":0");
/* Open device */
disk = prom_open(block_buffer);
root = prom_finddevice("/");
if (root != 0) {
static char model[256];
- if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
+ if (prom_getprop(root, "CODEGEN,vendor", model, 256) > 0 &&
+ !strncmp("bplan", model, 5))
+ _machine = _MACH_bplan;
+ else if (prom_getprop(root, "device_type", model, 256 ) > 0 &&
!strncmp("chrp", model, 4))
_machine = _MACH_chrp;
else {
struct bootp_packet *packet;
int rc = 0;
struct boot_fspec_t fspec = *orig_fspec;
- char *cfgpath = (_machine == _MACH_chrp) ? "/etc/" : "";
+ char *cfgpath = (_machine == _MACH_chrp || _machine == _MACH_bplan) ? "/etc/" : "";
int flen;
int minlen;
prom_printf("%s: Unable to parse\n", bootdevice);
return -1;
}
+ if (_machine == MACH_bplan)
+ boot.part++;
DEBUG_F("After parse_device_path: dev=%s, part=%d, file=%s\n",
boot.dev, boot.part, boot.file);
if (!conf_given) {
- if (_machine == _MACH_chrp)
+ if (_machine == _MACH_chrp || machine == _MACH_bplan)
boot.file = "/etc/";
else if (strlen(boot.file)) {
if (!strncmp(boot.file, "\\\\", 2))