enter_chroot: force jobs=1; locale-gen complains less; profit!

locale-gen has some logic to automagically determine the numbers of CPUs
(and therefore number of jobs). But it also has logic to force jobs to 1
when running locale-archive. The net effect is that we get 1 job, and an
annoying warning along with it:

 * Generating locale-archive: forcing # of jobs to 1

This happens every time we enter the chroot.

Let's just force jobs=1, to workaround locale-gen's internal
disagreements.

BUG=chromium:761153
TEST=`cros_sdk`

Change-Id: Id3f0b8537eb4d987c1e2d94b83c53240750b0d49
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/646763
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/sdk_lib/enter_chroot.sh b/sdk_lib/enter_chroot.sh
index f573700..b2fd0b2 100755
--- a/sdk_lib/enter_chroot.sh
+++ b/sdk_lib/enter_chroot.sh
@@ -225,8 +225,11 @@
     # with long multibyte strings.  Newer setups have this fixed,
     # but locale-gen doesn't need to be run in any locale in the
     # first place, so just go with C to keep it fast.
+    # Force jobs=1 to work around locale-gen weirdness where it simultaneously
+    # wants to and doesn't want to run multiple jobs (and complains about it).
+    # crbug.com/761153
     chroot "${FLAGS_chroot}" env LC_ALL=C locale-gen -q -u \
-      -G "$(printf '%s\n' "${gen_locales[@]}")"
+      -j 1 -G "$(printf '%s\n' "${gen_locales[@]}")"
   fi
 }