Skip to contentSkip to conversation

chromium_40.0.2214.91: API keys update

PATCH In review Trevor Woerner 2 participants 5 messages Jan 5, 2016 – Jan 6, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 chromium_40.0.2214.91: API keys update

Add more information to the "disable-api-keys-info-bar" PACKAGECONFIG description regarding another way to disable the "Google API keys are missing" warning.

---
 recipes-browser/chromium/chromium_40.0.2214.91.bb | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
recipes-browser/chromium/chromium_40.0.2214.91.bb +7 -1
index 4694506..6fddcc7 100644
@@ -45,7 +45,13 @@ SRC_URI = "\
 # * disable-api-keys-info-bar: (off by default)
 #       This disables the info bar that warns: "Google API keys are missing".
 #       With some builds, missing API keys are considered OK, so the bar needs
-#       to go.
+#       to go. Conversely, if Chromium is compiled with this option off and
+#       the user wishes to disable the warning, the following lines can be
+#       added to the "google-chrome" script (see patchset) before the
+#       chromium binary is called:
+#           export GOOGLE_API_KEY="no"
+#           export GOOGLE_DEFAULT_CLIENT_ID="no"
+#           export GOOGLE_DEFAULT_CLIENT_SECRET="no"
 #
 # * component-build: (off by default)
 #       Enables component build mode. By default, all of Chromium (with the
Signature · 1 line
2.7.0.rc3
#1 lore raw

PATCH 2/3 chromium: update run script for early run

If the chromium run-helper script (google-chrome) is run as part of a (sysvinit) init script, shell variables $USER and $HOME will not be set (leading to unwanted behaviour).

Replace the use of $USER with whoami and replace the use of $HOME with the OE bitbake variable ROOT_HOME.

In this way the chromium run-helper script will work as expected in both instances (as part of an init script and from the cmdline).

---
 recipes-browser/chromium/chromium/google-chrome   | 4 ++--
 recipes-browser/chromium/chromium_40.0.2214.91.bb | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
recipes-browser/chromium/chromium/google-chrome +2 -2
index b1ec288..b5c2541 100644
@@ -4,8 +4,8 @@ export CHROME_DEVEL_SANDBOX=/usr/sbin/chrome-devel-sandbox
 export LD_LIBRARY_PATH=/usr/lib/chromium
 
 CHROME_EXTRA_ARGS=""
-if [ "${USER}" = "root" ] ; then
-	CHROME_EXTRA_ARGS="${CHROME_EXTRA_ARGS} --user-data-dir=${HOME}/.chromium/"
+if [ "`whoami`" = "root" ] ; then
+	CHROME_EXTRA_ARGS="${CHROME_EXTRA_ARGS} --user-data-dir=ROOT_HOME/.chromium/"
 fi
 
 /usr/bin/chromium/chrome ${CHROME_EXTRA_ARGS} $@
recipes-browser/chromium/chromium_40.0.2214.91.bb +3 -0
index 6fddcc7..e138628 100644
@@ -221,6 +221,9 @@ do_install_append() {
         # the dummy "CHROME_EXTRA_ARGS" line
         sed -i "s/^CHROME_EXTRA_ARGS=\"\"/CHROME_EXTRA_ARGS=\"${CHROMIUM_EXTRA_ARGS}\"/" ${D}${bindir}/google-chrome
 
+        # update ROOT_HOME with the root user's $HOME
+        sed -i "s#ROOT_HOME#${ROOT_HOME}#" ${D}${bindir}/google-chrome
+
 	# Always adding this libdir (not just with component builds), because the
         # LD_LIBRARY_PATH line in the google-chromium script refers to it
         install -d ${D}${libdir}/${BPN}/
Signature · 1 line
2.7.0.rc3
#2 lore raw

Re: [meta-browser][PATCH 2/3] chromium: update run script for early run

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Op 05-01-16 om 22:15 schreef Trevor Woerner:

Quoted 9 lines

If the chromium run-helper script (google-chrome) is run as part of a (sysvinit) init script, shell variables $USER and $HOME will not be set (leading to unwanted behaviour).

Replace the use of $USER with whoami and replace the use of $HOME with the OE bitbake variable ROOT_HOME.

In this way the chromium run-helper script will work as expected in both instances (as part of an init script and from the cmdline).

Doesn't this break running chrome as a regular non-root user?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: GPGTools - http://gpgtools.org

iD8DBQFWjQOHMkyGM64RGpERAoGFAJ9QCcfdD8qzAo/Orq/cWJFrBBLfrwCggkqR PUswbLTWhJPanSY8u/1kfGM=
=4mmY
-----END PGP SIGNATURE-----

#3 lore raw

Re: [meta-browser][PATCH 2/3] chromium: update run script for early run

Quoted 5 lines · Koen Kooi

Op 05-01-16 om 22:15 schreef Trevor Woerner:

Quoted 3 lines

If the chromium run-helper script (google-chrome) is run as part of a (sysvinit) init script, shell variables $USER and $HOME will not be set (leading to unwanted behaviour).

Quoted 8 lines
Quoted 4 lines

Replace the use of $USER with whoami and replace the use of $HOME with the OE bitbake variable ROOT_HOME.

In this way the chromium run-helper script will work as expected in

both

Quoted 1 line

instances (as part of an init script and from the cmdline).

Doesn't this break running chrome as a regular non-root user?

I haven't tested that, but on inspection it doesn't. I'm not changing the _behaviour_ of the /usr/bin/google-chrome script, I'm only changing the tools it uses to do what it's already doing.

The /bin/sh script has an "if" clause looking to see if the person running it is root, if so it adds an extra parameter (--user-data-dir=...) to the invocation of the actual /usr/bin/chromium/chrome binary.

Prior to this patch the script was using $USER and $HOME and I've simply changed those to be whoami and at build time changing a placeholder from ROOT_HOME to whatever you've defined in your OE environment to be the root user's home.

Basically I'm building a kiosk and I want chrome to start automatically (via a sysvinit script) on startup. When /usr/bin/google-chrome is invoked as part of a sysvinit script I have found that neither $USER nor $HOME are defined, so this clause (which is needed in my case) isn't invoked.

#4 lore raw

PATCH 3/3 chromium: add kiosk-mode PACKAGECONFIG

In reply to Trevor Woerner

If you are creating a kiosk, then enable this PACKAGECONFIG and the browser will start up fullscreen and without menu bars etc.

---
 recipes-browser/chromium/chromium.inc             | 1 +
 recipes-browser/chromium/chromium_40.0.2214.91.bb | 6 ++++++
 2 files changed, 7 insertions(+)
recipes-browser/chromium/chromium.inc +1 -0
index 716988d..5e8aba6 100644
@@ -25,6 +25,7 @@ PACKAGECONFIG[disable-api-keys-info-bar] = ""
 PACKAGECONFIG[ignore-lost-context] = ""
 PACKAGECONFIG[impl-side-painting] = ""
 PACKAGECONFIG[use-egl] = ""
+PACKAGECONFIG[kiosk-mode] = ""
 
 GYP_DEFINES += "${ARMFPABI} release_extra_cflags='-Wno-error=unused-local-typedefs' sysroot=''"
 
recipes-browser/chromium/chromium_40.0.2214.91.bb +6 -0
index e138628..dd42903 100644
@@ -77,6 +77,11 @@ SRC_URI = "\
 #       development stages, it can improve performance See
 #       http://www.chromium.org/developers/design-documents/impl-side-painting
 #       for more.
+#
+# * kiosk-mode: (off by default)
+#       Enable this option if you want your browser to start up full-screen,
+#       without any menu bars, without any clutter, and without any initial
+#       start-up indicators.
 SRC_URI += "\
         ${@bb.utils.contains('PACKAGECONFIG', 'ignore-lost-context', 'file://chromium-40/0001-Remove-accelerated-Canvas-support-from-blacklist.patch', '', d)} \
         ${@bb.utils.contains('PACKAGECONFIG', 'impl-side-painting', 'file://chromium-40/0002-Add-Linux-to-impl-side-painting-whitelist.patch', '', d)} \
@@ -86,6 +91,7 @@ CHROMIUM_EXTRA_ARGS ?= " \
 	${@bb.utils.contains('PACKAGECONFIG', 'use-egl', '--use-gl=egl', '', d)} \
 	${@bb.utils.contains('PACKAGECONFIG', 'ignore-lost-context', '--gpu-no-context-lost', '', d)} \
 	${@bb.utils.contains('PACKAGECONFIG', 'impl-side-painting', '--enable-gpu-rasterization --enable-impl-side-painting', '', d)} \
+	${@bb.utils.contains('PACKAGECONFIG', 'kiosk-mode', '--start-fullscreen --kiosk --no-first-run', '', d)} \
 "
 
 # Conditionally add ozone-wayland and its patches to the Chromium sources
Signature · 1 line
2.7.0.rc3