LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 05-29-2017, 06:28 AM   #1
sarah55
LQ Newbie
 
Registered: May 2017
Posts: 1

Rep: Reputation: Disabled
Unhappy using debugfs to modify module argument


Hi,
i'm trying to use debugfs in order to modify a module argument.
i have an argument from type integer, i want to be able to change the corresponding file in the debugfs bug i get BUG: unable to handle kernel paging request at 0000000000ece008
and the module crashes.
i think i'm doing it wrong.
can someone point me to a good example of how to create a file in debugfs for an integer value, and using this modification to change a module argument?

Thanks.
 
Old 06-01-2017, 01:14 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Hello,
Setting module parameters is quite easy. However, you typically do not do it by debugfs, but by sysfs.

How to do it in short:
Quote:
static int myparam = 1;
module_param(myparam, int, S_IRUGO|S_IWUSR);
You should be able to set it both when loading the module and by writing in /sys/modules/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
modify ip option field by netfilter loadable kernel module kikilinux Programming 0 05-15-2014 10:44 PM
modify module parameters after suspend.. how? m_kane Linux - General 2 03-11-2012 03:42 AM
[SOLVED] shell scripting: value of argument dissapears depending on argument order akelder Programming 5 03-21-2011 11:27 PM
Pass argument to module in grub Racuel Linux - Kernel 1 04-21-2009 10:27 PM
message sending failed : Error[22 ] invalid argument .....but each and every argument rakeshranjanjha Linux - Software 2 01-07-2008 11:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration