[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

PATCH, please apply: busybox for m68k broken



Debian boot-floppies for m68k hang in init on bootup.  This is because
of a change in size of struct sysinfo between 2.2 and 2.4 kernels.
Only a problem on m68k, because it aligns 32 bit words to 16 bit
boundaries.  Basically, the struct has some padding which is supposed
to make it 64 bytes long.  For 2.2 kernels it did, but then someone
added more fields and reduced the padding such that it is 64 bytes
on most platforms but 62 bytes on m68k.

busybox has its own copy of struct sysinfo, taken from a 2.4
kernel, but I am running busybox under a 2.2 kernel.  busybox calls
sysinfo() expecting 62 bytes, but gets 64 bytes, which trashes the
stack and hangs init.

I have applied the following patch to my busybox source, which fixes
the problem.

I've brought it to the attention of Jes Sorensen, m68k kernel maintainer,
and he will get the same fix applied to the official kernel source.

Richard


--- busybox-0.51.orig/libbb/libbb.h	Thu Jun  7 15:05:48 2001
+++ busybox-0.51/libbb/libbb.h	Thu Jun  7 14:20:45 2001
@@ -196,6 +196,7 @@
 	unsigned long totalswap;	/* Total swap space size */
 	unsigned long freeswap;		/* swap space still available */
 	unsigned short procs;		/* Number of current processes */
+	unsigned short pad;		/* Needed for m68k */
 	unsigned long totalhigh;	/* Total high memory size */
 	unsigned long freehigh;		/* Available high memory size */
 	unsigned int mem_unit;		/* Memory unit size in bytes */




Reply to: