The task is to write a own boot parameter in the linux kernel that activates printk under the kernel initiation.

The Linux kernel version that is edited is 4.16.7 (buildroot 2018.11.2) and my understanding is that the boot parameter should work in the same way as debug and quiet. The C-file I edit is main.c (buildroot-2018.11.2/output/build/linux-4.16.7/init/main.c) My code so far:

 static int __init myparam_kernel(char *str)
    printk(KERN_DEBUG "Debug message shown!\n");
    pr_info("HELLO WORLD \n");
    return 0;
early_param("mindebug", mindebug_kernel);

Then I make linux-rebuild from the buildroots main catalog and start up the qemu and run the dmesg command and get a lots of lines printed, but nothing from my boot parameter.

I have tried to check the log level for printing is correct and it should be printing everything, So I assume that something in my code that is a bit off.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.