3 * author: hackbard@hackdaworld.dyndns.org
9 * fake the machine type discovered by "uname -m" call.
10 * this is possibly needed by some crossbuilds, where packages try to determine
11 * the host or target architecture with the help of uname output.
15 * insmod fake_utsname.o mname="<machine_type>"
16 * where <machine_type> could be:
22 #include <linux/kernel.h>
23 #include <linux/module.h>
24 #include <linux/utsname.h>
25 #include <linux/string.h>
27 #define UTSNAME_M_LEN 65
29 /* if there is no define ... */
30 #ifndef FAKE_M_UTSNAME
31 #define FAKE_M_UTSNAME "sparc64"
34 MODULE_LICENSE("GPL v2");
36 char mname_orig[UTSNAME_M_LEN];
37 char *mname=FAKE_M_UTSNAME;
39 MODULE_PARM(mname,"s");
41 int init_module(void) {
44 memset(mname_orig,0,UTSNAME_M_LEN);
45 memcpy(mname_orig,system_utsname.machine,sizeof(system_utsname.machine));
47 memcpy(system_utsname.machine,mname,i);
48 memset(system_utsname.machine+i,0,UTSNAME_M_LEN-i);
53 void cleanup_module(void) {
55 memcpy(system_utsname.machine,mname_orig,UTSNAME_M_LEN);