Skip to content

Instantly share code, notes, and snippets.

@xdel
Last active April 20, 2020 03:11
Show Gist options
  • Save xdel/0bdb43531b93fb7c99da28f3664f17e2 to your computer and use it in GitHub Desktop.
Save xdel/0bdb43531b93fb7c99da28f3664f17e2 to your computer and use it in GitHub Desktop.
Quick patch for HP linux BIOS updater kernel module (remember to create /usr/tmp for HP userspace util)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,10 @@
#obj-m := mymod.o
obj-m := xwbios.o
-clean:
- rm -f *.o *.ko
+KDIR ?= /lib/modules/`uname -r`/build
+
+default:
+ $(MAKE) -C $(KDIR) M=$$PWD
-install:
- mkdir -p /opt/hp/hp-lxbios/xwkernel
- cp xwbios.ko /opt/hp/hp-lxbios/xwkernel/
+clean:
+ rm -rf *.o *.ko .tmp_versions .*o.cmd
--- a/xwbios.c
+++ b/xwbios.c
@@ -97,7 +97,7 @@
// Module function declarations
//static ssize_t xwbios_read( struct file *file, char __user *buf,
//size_t len, loff_t *ppos );
-static int xwbios_ioctl(struct inode *ip, struct file *fp, unsigned int cmd, unsigned long arg);
+static long xwbios_ioctl(struct file *fp, unsigned int cmd, unsigned long arg);
static ssize_t xwbios_write( struct file *file, const char __user *data,
size_t len, loff_t *ppos );
@@ -196,7 +196,7 @@
}
#if defined(KERNEL_64bit)
-static int xwbios_ioctl( struct inode *ip, struct file *fp,
+static long xwbios_ioctl(struct file *fp,
unsigned cmd, unsigned long arg)
{
xwprintk((KERN_INFO "xwbios: xwbios_ioctl called \n"));
@@ -213,7 +213,7 @@
struct file *fp)
#endif
#else // 32 bit kernel
-static int xwbios_ioctl( struct inode *ip, struct file *fp,
+static long xwbios_ioctl(struct file *fp,
unsigned cmd, unsigned long arg)
#endif
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment