How to modify CGroup in the kernel configuration and then make a new image?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
There are innumerable guides on how to set kernel config options and compile the kernel.
Likely will depend on your distro.
I would be very surprised if you need to for cgroups, but the question is so poorly framed, it is almost impossible to answer.
Thanks for the quick response. This is my first time to explore the Linux kernel source codes as a linux application developer due to my current application software development project's special needs.
I needed to install a third party's software which requires all the CGroups are enabled by defaults in the kernel side so that their application can function correctly. Unfortunately, my system came with all the CGroups disabled by default and all the info directed me to modify kernel configurations and reinstall it again. Luckily, my hardware vendor share the kernel source codes to me but provided no additional helps in this regard which just like you said it depends on our special needs.
In any case, I accidentally resolved my question as below. Let me know if you have any further suggestions.
Step 1: Run the following command which is instructed in the README file of kernel source codes folder.
make O=/home/name/build/kernel menuconfig
Step 2: Wait for "Linux Kernel Configuration Menu" displayed.
Step 3: Select and enter the "General Setup" sub-menu.
Step 4: Select and mark all options in the "Control Group Support"
Step 5: Save and Exit
Step 6: Run the following command to recompile the kernel source codes.
Looks like this should do the job, and be supported as well. Might even have the cgroups options selected as well if you are lucky.
I don't use Ubuntu, but just checked a Linux Mint desktop system, and all the cgroup options were enabled except 2 debug options. I am very surprised Ubuntu doesn't have them.
Looks like this should do the job, and be supported as well. Might even have the cgroups options selected as well if you are lucky.
I don't use Ubuntu, but just checked a Linux Mint desktop system, and all the cgroup options were enabled except 2 debug options. I am very surprised Ubuntu doesn't have them.
Thanks for the info. I will try it as soon as possible and report back my results.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
If you're using Ubuntu, then you probably want to build the kernel the Debian way. Did you check /boot/config-version to see if cgroups are selected? Mine looks like this
Code:
/boot/config-4.9.0-6-amd64:CONFIG_CGROUPS=y
/boot/config-4.9.0-6-amd64:CONFIG_BLK_CGROUP=y
/boot/config-4.9.0-6-amd64:# CONFIG_DEBUG_BLK_CGROUP is not set
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_WRITEBACK=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_SCHED=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_PIDS=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_FREEZER=y
/boot/config-4.9.0-6-amd64:# CONFIG_CGROUP_HUGETLB is not set
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_DEVICE=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_CPUACCT=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_PERF=y
/boot/config-4.9.0-6-amd64:# CONFIG_CGROUP_DEBUG is not set
/boot/config-4.9.0-6-amd64:CONFIG_NETFILTER_XT_MATCH_CGROUP=m
/boot/config-4.9.0-6-amd64:CONFIG_NET_CLS_CGROUP=m
/boot/config-4.9.0-6-amd64:CONFIG_SOCK_CGROUP_DATA=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_NET_PRIO=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_NET_CLASSID=y
Last edited by AwesomeMachine; 03-29-2018 at 09:26 PM.
If you're using Ubuntu, then you probably want to build the kernel the Debian way. Did you check /boot/config-version to see if cgroups are selected? Mine looks like this
Code:
/boot/config-4.9.0-6-amd64:CONFIG_CGROUPS=y
/boot/config-4.9.0-6-amd64:CONFIG_BLK_CGROUP=y
/boot/config-4.9.0-6-amd64:# CONFIG_DEBUG_BLK_CGROUP is not set
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_WRITEBACK=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_SCHED=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_PIDS=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_FREEZER=y
/boot/config-4.9.0-6-amd64:# CONFIG_CGROUP_HUGETLB is not set
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_DEVICE=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_CPUACCT=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_PERF=y
/boot/config-4.9.0-6-amd64:# CONFIG_CGROUP_DEBUG is not set
/boot/config-4.9.0-6-amd64:CONFIG_NETFILTER_XT_MATCH_CGROUP=m
/boot/config-4.9.0-6-amd64:CONFIG_NET_CLS_CGROUP=m
/boot/config-4.9.0-6-amd64:CONFIG_SOCK_CGROUP_DATA=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_NET_PRIO=y
/boot/config-4.9.0-6-amd64:CONFIG_CGROUP_NET_CLASSID=y
My /boot folder has no files in there at all. Is that normal?
My /boot folder has no files in there at all. Is that normal?
Regards,
Heng
Finally successfully recompiled kernel source codes and get some new configuration files created and copied to the /boot folder which includes the following info.
Next step is to reboot the system?
CONFIG_CGROUPS=y
CONFIG_PAGE_COUNTER=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
CONFIG_MEMCG_SWAP_ENABLED=y
CONFIG_BLK_CGROUP=y
CONFIG_DEBUG_BLK_CGROUP=y
CONFIG_CGROUP_WRITEBACK=y
CONFIG_CGROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_CFS_BANDWIDTH is not set
# CONFIG_RT_GROUP_SCHED is not set
CONFIG_CGROUP_PIDS=y
CONFIG_CGROUP_RDMA=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
That's interesting there was nothing in /boot before you installed the new kernel.
I have just learned how to configure and recompile a given kernel source code in Ubuntu. Now, the real problem is to figure out how to boot up this special system with a new given kernel image? To my knowledge, each embedded linux system may have its own customized bootloader and kernel image. Any suggestion on how to tackle these issues next? Again, I am only a newbie of linux application developer.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
Try building the kernel the Debian way, since Ubuntu is a Debian distro. All you have to do is configure the kernel and run from thye sources directory
Code:
$ make deb-pkg
But you must use the kernel-source package from the Ubuntu repos.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.