Re: Is there any way to add an attribute under sysfs at the “platform” level?
On Mon, Jun 19, 2017 at 08:55:22AM +0800, Greg KH wrote: > On Sun, Jun 18, 2017 at 05:38:36PM +0300, Roman Storozhenko wrote: > > Hello everybody! > > > > I am trying to modify "pcspkr" driver undere linux kernel source tree. I > > added a new line there: > > > > sample_id_dir = kobject_create_and_add("devices/platform/pcspkr/sample", > > NULL); > > Ick, really? What are you trying to do with "raw" kobjects? I am trying to add "read/write" attribute under "devices/platform/pcspkr". Just for educational purposes. Didn't find another way to do it. > > > It works and creates kobject without errors. I checked this in the driver > > code and in the dmesg output. But "sample" catalog isn't appear under > > "/sys/devices/platform/pcspkr/". > > Are you sure? Odds are you really did create a kobject with that name, > but note, the name will have '/' characters in it :) > > If you want a kobject in a specific directory, you have to give it the > parent kobject directory directly, you can not give a "path" to the > kobject name, sorry, that's not how it works. > > The kobject documentation should help you out here, have you read it? > > good luck! I have read documentation about sysfs and kobject. Now I am going to re-read it again. Thanks, Greg. > > greg k-h ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Is there any way to add an attribute under sysfs at the “platform” level?
Hello everybody! I am trying to modify "pcspkr" driver undere linux kernel source tree. I added a new line there: sample_id_dir = kobject_create_and_add("devices/platform/pcspkr/sample", NULL); It works and creates kobject without errors. I checked this in the driver code and in the dmesg output. But "sample" catalog isn't appear under "/sys/devices/platform/pcspkr/". What is wrong with that code ? Thanks in advance, Roman Storozhenko ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Is there any way to save just the 'Kernel Hacking' subsection instead of entire .config
Hello everybody! As you know there is a great script "merge_config.sh". It allows to override a predefined set of .config keys with the values stored in a file. For example: scripts/kconfig/merge_config.sh -m -r .config ~/kernel/conf_mixins/.config_deb Now, I want to turn on all of the options in the "Kernel Hacking" submenu and save only that options to a separate file ".config_deb". But how can I do this? I see three options: 1) Do it manually checking the match between every option title in "Kernel Hacking" submenu and a key in .config. It is a hard way. 2) Turn off all debug options. Save them in one file. Turn on all debug options and save them to other file. Then make diff on these two files, format it and save to .config_deb. It is a better way, but not ideal. Is there any other ways to handle this task? Thanks in advance, Roman Storozhenko ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Update a newly-created '.config' file with some predefined values
On Tue, May 30, 2017 at 12:28:34PM +0300, Roman Storozhenko wrote: > Hello everybody, > > I have a host machine and I have a VM machine running CentOS 7 with 3.x. > There is > a kernel source tree on the host. I have made 'make menuconfig', > populated all options that I want to have in my custom kernel and as a > result got a '.config' file. Then I copied a centos-default distro config > file from my VM's > 'boot' catalog to my host's kernel source tree catalog. So now I have > two files in my source tree: '.config' and '.config.old'. I am able to > see difference between them using the following command: > > scripts/diffconfig .config.old .config | less > > But is there anyway to update values in '.config' file with the > apropriate values from '.config.old' file? > I just want to make sure that all modules will be included in a > new custom kernel. > > Thanks in advance, > Roman I have found a solution. There is a script: scripts/kconfig/merge_config.sh It allows to mix many configuration files in a base config. For example: scripts/kconfig/merge_config.sh -m -r .config ~/kernel/conf_mixins/.config_deb There are kernel options in .config_deb that include some debugging to the kernel default .config. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Update a newly-created '.config' file with some predefined values
Hello everybody, I have a host machine and I have a VM machine running CentOS 7 with 3.x. There is a kernel source tree on the host. I have made 'make menuconfig', populated all options that I want to have in my custom kernel and as a result got a '.config' file. Then I copied a centos-default distro config file from my VM's 'boot' catalog to my host's kernel source tree catalog. So now I have two files in my source tree: '.config' and '.config.old'. I am able to see difference between them using the following command: scripts/diffconfig .config.old .config | less But is there anyway to update values in '.config' file with the apropriate values from '.config.old' file? I just want to make sure that all modules will be included in a new custom kernel. Thanks in advance, Roman ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Does anyone have experience about linux kernel dev and test in QEMU?
On Tue, May 23, 2017 at 12:29:09AM +, Douglas Su wrote: > I used to develop and test kernel driver in virtual box with full Linux > Debian installed. It works but not efficient due to that I have to install a > full functional Linux distribution. > > Previously, in this mail list, I noted some friends said that to accelerate > the development process by using QEMU, a lightweight and fast VM than QEMU. > After some searching works, however, I barely find any reading material or > tutorial about the details of using QEMU in kernel development, especially > the driver development. > > Can anyone give a clue? Hello, Douglas. There is a great video about the topic on youtube: Kernel Recipes 2015 - Speed up your kernel development cycle with QEMU - Stefan Hajnoczi https://www.youtube.com/watch?v=PBY9l97-lto > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: I want write more important things
> Hello, > I am interested in wrinting code in Linux kernel and I started write kernel > modules. I have some basics about kernel development- I red Robert's Love > book. My the biggest project with kernel code is simple module, which create > char device which can execute commands as root. Actually I'm reading Linux > device drivers 3rd edition. And I haven't any idea what I could doing. I have > many ebooks about kernel, but I prefer learn by writing some code. Sorry for > my banal question (propably you haven't many time), but when someone answer > me, I will be very very thankful. I would suggest you to: 1) Complete eudyptula challenge. It contains 20 kernel-related tasks. I have completed 8th task and awaiting to response and I want to say that this is a very good challenge for newbies. 2) Pick one of the areas in which you want to participate in. It might be virtualization, networking, storage, drivers, etc.. Any of that. Go to the appropriate kernel bug tracker, pick a bug and then try to reproduce it, fix it and send it as a patch. I tried many different strategies in last 8 months, but it seems that this one is the most obvious and efficient. After you complete it you will know enough to continue without any advices ) ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: I want write more important things
> Hello, > I am interested in wrinting code in Linux kernel and I started write kernel > modules. I have some basics about kernel development- I red Robert's Love > book. My the biggest project with kernel code is simple module, which create > char device which can execute commands as root. Actually I'm reading Linux > device drivers 3rd edition. And I haven't any idea what I could doing. I have > many ebooks about kernel, but I prefer learn by writing some code. Sorry for > my banal question (propably you haven't many time), but when someone answer > me, I will be very very thankful. I would suggest you to: 1) Complete eudyptula challenge. It contains 20 kernel-related tasks. I have completed 8th task and awaiting to response and I want to say that this is a very good challenge for newbies. 2) Pick one of the areas in which you want to participate in. It might be virtualization, networking, storage, drivers, etc.. Any of that. Go to the appropriate kernel bug tracker, pick a bug and then try to reproduce it, fix it and send it as a patch. I tried many different strategies in last 8 months, but it seems that this one is the most obvious and efficient. After you complete it you will know enough to continue without any advices ) ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies