Skip to contentSkip to conversation

quik 2.0 fix

PATCH Benjamin Herrenschmidt 2 participants 2 messages Sep 11, 1999 – Sep 12, 1999

lore
Share & tools
lore
#0 lore raw

It took me a while to figure out why my printf's were displaying crazy results until I found out the glibc2.1 dev_t is a long long ! So this fix will make quik correctly recognize the partition number:

quik.c renamed from quik.c.old +1 -1
@@ -521,7 +521,7 @@
 	bootdev[7] += UNIT(st1.st_dev);
     strcpy(spart, bootdev);
     if (PART(st1.st_dev) != 0)
-	sprintf(spart+8, "%d", PART(st1.st_dev));
+	sprintf(spart+8, "%d", (int)PART(st1.st_dev));
 
     if (verbose)
 	printf("Second-stage loader is on %s\n", spart);
Signature · 5 lines
           E-Mail: <mailto:[email protected]>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
#1 lore raw

Nice that fixed the following error from quik in my machine:

# /sbin/quik -v
Second-stage loader is on /dev/sdb0
Config file is on partition 6
Fatal error: Cannot open /dev/sdb0

There are a few problems with gcc 2.95.1 though, the second stage loader gives "Unable to open filesystem" errors reverting to the old files fixed that.
Since my asm skills are nonexistent i can't tell if its a gcc or a quik problem, can someone look at it ?

Kostas Gewrgiou

Quoted 24 lines · Benjamin Herrenschmidt

It took me a while to figure out why my printf's were displaying crazy results until I found out the glibc2.1 dev_t is a long long ! So this fix will make quik correctly recognize the partition number:

quik.c renamed from quik.c.old +1 -1
@@ -521,7 +521,7 @@
 	bootdev[7] += UNIT(st1.st_dev);
     strcpy(spart, bootdev);
     if (PART(st1.st_dev) != 0)
-	sprintf(spart+8, "%d", PART(st1.st_dev));
+	sprintf(spart+8, "%d", (int)PART(st1.st_dev));
 
     if (verbose)
 	printf("Second-stage loader is on %s\n", spart);
Signature · 3 lines
-- 
           E-Mail: <mailto:[email protected]>
BenH.      Web   : <http://calvaweb.calvacom.fr/bh40/>

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/