Skip to contentSkip to conversation

cgroupsfs: new package

PATCH New Niranjan Reddy 2 participants 3 messages Feb 15, 2016 – Mar 21, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 cgroupsfs: new package

This package consists of scripts that setup cgroups at boot without doing any cgroup management or classification of tasks into cgroups

---
Changes v2 -> v3:
- placed start(),stop() and restart() in seperate functions.
- Changed LICENSE to GPLv3+ and added $(CGROUPFS_PKGDIR) instead of package/cgroupfs/ .
- Added .hash file.
- Removed test condition for mount and umount (suggested by Thomas).

Changes v1 -> v2:
- Changed navigation options in Config.in ( suggested by Arnout).
- Removed CGROUPFS_INSTALL_TARGET and cgroupfs-mount.upstart from cgroupfs.mk file as it was not required.
- Added S30cgroupfs startup script which gets installed to /etc/init.d
- Added details of version,copyright and licence file.

---
 package/Config.in              |  1 +
 package/cgroupfs/Config.in     | 19 +++++++++++++++++++
 package/cgroupfs/S30cgroupfs   | 36 ++++++++++++++++++++++++++++++++++++
 package/cgroupfs/cgroupfs.hash |  2 ++
 package/cgroupfs/cgroupfs.mk   | 23 +++++++++++++++++++++++
 5 files changed, 81 insertions(+)
 create mode 100644 package/cgroupfs/Config.in
 create mode 100644 package/cgroupfs/S30cgroupfs
 create mode 100644 package/cgroupfs/cgroupfs.hash
 create mode 100644 package/cgroupfs/cgroupfs.mk
package/Config.in +1 -0
index a5b31aa..452fd0b 100644
@@ -1571,6 +1571,7 @@ if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
 	source "package/dcron/Config.in"
 	source "package/debianutils/Config.in"
 endif
+	source "package/cgroupfs/Config.in"
 	source "package/dsp-tools/Config.in"
 	source "package/emlog/Config.in"
 	source "package/ftop/Config.in"
package/cgroupfs/Config.in new file +19 -0
new file mode 100644
index 0000000..e0b685c
@@ -0,0 +1,19 @@
+config BR2_PACKAGE_CGROUPFS
+	bool "cgroupfs"
+	depends on !BR2_INIT_SYSTEMD
+	help
+	  cgroupfs mount and umount scripts.
+
+	  requires a Linux kernel >= 3.0 with the following options
+	  enabled:
+
+	  - CONFIG_BLK_CGROUP
+	  - CONFIG_CGROUPS
+	  - CONFIG_CGROUP_CPUACCT
+	  - CONFIG_CGROUP_DEVICE
+	  - CONFIG_CGROUP_FREEZER
+	  - CONFIG_CGROUP_WRITEBACK
+	  - CONFIG_CGROUP_SCHED
+	  - CONFIG_CGROUP_PIDS
+
+	  https://github.com/tianon/cgroupfs-mount
package/cgroupfs/S30cgroupfs new file +36 -0
new file mode 100644
index 0000000..627da2c
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# Set up cgroupfs mounts.
+#
+
+start() {
+	printf "Mounting cgroupfs hierarchy"
+	/usr/bin/cgroupfs-mount
+	[ $? = 0 ] && echo "OK" || echo "FAIL"	
+}
+stop() {
+	printf "Unmounting cgroupfs hierarchy"
+	/usr/bin/cgroupfs-umount
+	[ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart|reload)
+  	restart
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart}"
+	exit 1
+esac
+
+exit $?
package/cgroupfs/cgroupfs.hash new file +2 -0
new file mode 100644
index 0000000..e127e1b
@@ -0,0 +1,2 @@
+# No hash for 7285bf44402029394808339f69f4f293730fc2c6
+none	xxx  cgroupfs-7285bf44402029394808339f69f4f293730fc2c6.tar.gz
package/cgroupfs/cgroupfs.mk new file +23 -0
new file mode 100644
index 0000000..c7ea616
@@ -0,0 +1,23 @@
+################################################################################
+#
+# cgroupfs
+#
+################################################################################
+
+CGROUPFS_VERSION = 7285bf44402029394808339f69f4f293730fc2c6
+CGROUPFS_SITE = $(call github,tianon,cgroupfs-mount,$(CGROUPFS_VERSION))
+CGROUPFS_LICENSE = GPLv3+
+CGROUPFS_LICENSE_FILES = COPYRIGHT
+
+define CGROUPFS_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/cgroupfs-mount $(TARGET_DIR)/usr/bin/cgroupfs-mount
+	$(INSTALL) -D -m 0755 $(@D)/cgroupfs-umount $(TARGET_DIR)/usr/bin/cgroupfs-umount
+endef
+
+define CGROUPFS_INSTALL_INIT_SYSV
+	$(INSTALL) -m 0755 -D $(CGROUPFS_PKGDIR)S30cgroupfs \
+		$(TARGET_DIR)/etc/init.d/S30cgroupfs
+
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.5.0
#1 lore raw

PATCH v3 1/1 cgroupsfs: new package

Hello,

Quoted 4 lines · Niranjan Reddy

This package consists of scripts that setup cgroups at boot without doing any cgroup management or classification of tasks into cgroups

Quoted 8 lines

---
Changes v2 -> v3:
- placed start(),stop() and restart() in seperate functions.
- Changed LICENSE to GPLv3+ and added $(CGROUPFS_PKGDIR) instead of package/cgroupfs/ .
- Added .hash file.
- Removed test condition for mount and umount (suggested by Thomas).

I've done a number of changes:

[Thomas:
- rename to cgroupfs-mount to match upstream
- add proper hash, since hashes should be added for github sourced packages
- fix minor typos in the init script
- fix the license file information.]

And then applied. Note that hashes must be added for github sourced packages, and that you should verify with make legal-info that the license files pointed in the <pkg>_LICENSE_FILES variable actually exist (it wasn't the case in your submission).

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v3 1/1 cgroupsfs: new package

Hello Thomas,

Thanks for the changes and the feedback.

Best Regards,
Niranjan

Quoted 30 lines · Thomas Petazzoni

Hello,

Quoted 4 lines · Niranjan Reddy

This package consists of scripts that setup cgroups at boot without doing any cgroup management or classification of tasks into cgroups

Quoted 8 lines

---
Changes v2 -> v3:
- placed start(),stop() and restart() in seperate functions.
- Changed LICENSE to GPLv3+ and added $(CGROUPFS_PKGDIR) instead of package/cgroupfs/ .
- Added .hash file.
- Removed test condition for mount and umount (suggested by Thomas).

I've done a number of changes:

[Thomas:
- rename to cgroupfs-mount to match upstream
- add proper hash, since hashes should be added for github sourced packages
- fix minor typos in the init script
- fix the license file information.]

And then applied. Note that hashes must be added for github sourced packages, and that you should verify with make legal-info that the license files pointed in the <pkg>_LICENSE_FILES variable actually exist (it wasn't the case in your submission).

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160321/b0fec92e/attachment.html>