--- ./kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c.orig 2006-04-07 17:39:08.000000000 -0700 +++ ./kexec-tools-1.101/kexec/arch/ppc64/kexec-ppc64.c 2006-04-07 17:36:34.000000000 -0700 @@ -40,7 +40,7 @@ static struct exclude_range exclude_range[MAX_MEMORY_RANGES]; static unsigned long long rmo_top; -static unsigned int platform; +static unsigned int platform = PLATFORM_PSERIES_LPAR; static struct memory_range memory_range[MAX_MEMORY_RANGES]; static struct memory_range base_memory_range[MAX_MEMORY_RANGES]; unsigned long long memory_max = 0; @@ -179,8 +179,13 @@ static int get_devtree_details(unsigned DIR *dir, *cdir; FILE *file; struct dirent *dentry; + struct stat sbuf; + int n, i = 0; + if (!stat("/proc/device-tree/chosen/linux,htab-base", &sbuf)) + platform = PLATFORM_PSERIES; + if ((dir = opendir(device_tree)) == NULL) { perror(device_tree); return -1; @@ -201,26 +206,6 @@ static int get_devtree_details(unsigned } if (strncmp(dentry->d_name, "chosen", 6) == 0) { - /* get platform details from /chosen node */ - strcat(fname, "/linux,platform"); - if ((file = fopen(fname, "r")) == NULL) { - perror(fname); - closedir(cdir); - closedir(dir); - return -1; - } - if (fread(&platform, sizeof(int), 1, file) != 1) { - perror(fname); - fclose(file); - closedir(cdir); - closedir(dir); - return -1; - } - fclose(file); - - memset(fname, 0, sizeof(fname)); - strcpy(fname, device_tree); - strcat(fname, dentry->d_name); strcat(fname, "/linux,kernel-end"); if ((file = fopen(fname, "r")) == NULL) { perror(fname);