Re: obtaining linux kernel command line from a module

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

 



On Fre, 2010-05-21 at 12:18 +0200, Jason Nymble wrote:
> On 21 May 2010, at 12:08 PM, Jason Nymble wrote:
> > On 21 May 2010, at 12:07 PM, Jason Nymble wrote:
> > 
> >> Is there a way (e.g. exported variable or kernel API) for a kernel module to obtain the linux kernel command line? i.e. the contents as seen from userspace by 'cat /proc/cmdline'
> > 
> > I see linux/init.h has:
> > extern char __initdata boot_command_line[];
> > 
> > Will try that...
> 
> Does not work, neither does saved_command_line, presumably because neither of them are exported (get "Unknown symbol in module" when loading the module)... linux/fs/proc/cmdline.c provides /proc/cmdline, and that just prints saved_command_line variable, but presumably it can use that variable since its not dynamically loaded kernel module.
> 
> Any bright ideas?

Why do you want to look at the kernel commandline in the first place?
Module parameters come at module loading time.

Other than that the not-so-bright "idea": Send a patch to export
saved_command_line (including a good reason to export it to modules) to
LKML and see what people say to it.

	Bernd
-- 
Bernd Petrovitsch                  Email : bernd@xxxxxxxxxxxxxxxxxxx
                     LUGA : http://www.luga.at


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux