chromeos-common-script: Add project quota

Enable prjquota for stateful filesystem when the board is compiled
with USE flag prjquota.

BUG=b:169097008
TEST=On hatch, USE="prjquota" emerge-hatch chromeos-common-script:
Check project feature is enabled.
Re-emerge without the USE flag, check the project feature is removed.
Check emering with flag on eve (using kernel 4.4) throw an error.

Cq-Depend: chromium:2437093
Change-Id: I4ff8c57eb243121904ad83325d1e45aa14ca3766
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/2437193
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: Gwendal Grignou <gwendal@chromium.org>
Commit-Queue: Gwendal Grignou <gwendal@chromium.org>
diff --git a/chromeos-base/chromeos-common-script/chromeos-common-script-9999.ebuild b/chromeos-base/chromeos-common-script/chromeos-common-script-9999.ebuild
index e9cc305..7dfe8c8 100644
--- a/chromeos-base/chromeos-common-script/chromeos-common-script-9999.ebuild
+++ b/chromeos-base/chromeos-common-script/chromeos-common-script-9999.ebuild
@@ -19,7 +19,9 @@
 LICENSE="BSD-Google"
 SLOT="0"
 KEYWORDS="~*"
-IUSE="direncryption fsverity"
+IUSE="direncryption fsverity kernel-3_18 kernel-4_4 prjquota"
+
+REQUIRED_USE="prjquota? ( !kernel-4_4 !kernel-3_18 )"
 
 DEPEND=""
 
@@ -38,4 +40,9 @@
 			"${D}/usr/share/misc/chromeos-common.sh" ||
 			die "Can not set fs-verity in common library"
 	fi
+	if use prjquota; then
+		sed -i '/local prjquota_enabled=/s/false/true/' \
+			"${D}/usr/share/misc/chromeos-common.sh" ||
+			die "Can not set project quota in common library"
+	fi
 }