chromeos_startup calls firmware-boot-update which might not exist |
||
Issue description
While doing bringup on a new board I was digging through the /sbin/chromeos_startup script.
...and as part of that digging, I found that there's a part that says:
# 'firmware-boot-update' is provided by chromeos-firmware for legacy systems.
# On most new boards, it should be simply an empty file.
firmware-boot-update
On my board nothing provided the "firmware-boot-update" command and thus it didn't exist. This seemed like something I needed to fix.
--
I looked on "kevin" and found that this file was empty (as per the comments) and provided by private firmware. AKA:
$ equery-kevin belongs /usr/sbin/firmware-boot-update
* Searching for /usr/sbin/firmware-boot-update ...
chromeos-base/chromeos-firmware-kevin-0.0.1-r175 (/usr/sbin/firmware-boot-update)
That confused me because I _knew_ I had built a kevin image without any private overlays and it had booted. Indeed, I confirmed that when I went to my public chroot:
$ ls /build/kevin/usr/sbin/firmware-boot-update
ls: cannot access '/build/kevin/usr/sbin/firmware-boot-update': No such file or directory
...so it looks as if it's OK if this file doesn't exist.
--
As far as I can tell the chromeos_startup script isn't setup to die upon errors. ...so when we hit this statement on a board without "firmware-boot-update" it spits an error to stderr (which goes nowhere) and then moves on to the next command.
I guess this is OK, but...
Ick.
...it seems like a bad idea for this script to be unconditionally calling a command that we know might not exist.
I figure there will be opinionated people that will know how they want this fixed (or maybe they really want it not fixed???), so I'll let others decide if they care and how they'd like it fixed.
NOTE: I originally noticed this because I was debugging chromeos_startup and had stderr output straight to the serial port. At first I actually thought that this error was fatal, but I have since come to understand that it's not.
,
Jan 27 2018
I can give some story here. In the very beginning I did plan to detect and run, as something like if [ -x /usr/sbin/firmware-boot-update ]; then /usr/sbin/firmware-boot-update fi But the code reviewers (Mike?) suggested it's better to always have the file (and be empty if no boot update needed) - faster in execution, easier to understand and similar boot path. So I changed the implementation to simply "/usr/sbin/firmware-boot-update" with comments that most files should be zero. However, the file is decided by chromeos-firmware-* ebuild package. It's usually in private overlays, and the public overlay was using a dummy ebuild file. Since all "real" chromeos should have firmware ebuilds in private overlay, we didn't spend too much time fixing this. Now back to the issue. I'm fine if you want to change to chromeos-base/chromeos-firmware in public overlay to include that dummy file. But watch out - then you have to pay attention when creating chromeos-firmware-$BOARD in overlay, since files prepared by two different ebuild packages will cause conflict, and it's usually hard for partners or many googlers (who need to make contribution to the ebuild files) to figure out what to do. It seems to me leaving some error message in an unofficial build image is not a big deal, in comparison to the ebuild migration issues.
,
Jan 29 2018
Ick. I definitely don't want to screw around with having two different ebuilds providing the same file. That's always a hassle. ...so it sorta sounds like this is by design and people want to keep it that way. If that's true, I guess I'd at least prefer to change the comment to indicate that.
,
Jan 30 2018
changing the comment sounds great, maybe even with a link to this issue :)
,
Feb 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/d66fbc595e21a93ebf5a98441f8b18f53f67bc83 commit d66fbc595e21a93ebf5a98441f8b18f53f67bc83 Author: Douglas Anderson <dianders@chromium.org> Date: Tue Feb 06 23:41:23 2018 init: chromeos_startup: Add a comment about firmware-boot-update I recently got confused and spent a little time debugging why firmware-boot-update didn't exist on my board, only to find that the error was non-fatal. Add a comment to avoid future confusion. BUG= chromium:806383 TEST=Put this on a board and see that it still boots Change-Id: Ia91c3339b0be29c01e1e61b330281c71e2b36211 Reviewed-on: https://chromium-review.googlesource.com/902457 Commit-Ready: Douglas Anderson <dianders@chromium.org> Tested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Dan Erat <derat@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [modify] https://crrev.com/d66fbc595e21a93ebf5a98441f8b18f53f67bc83/init/chromeos_startup
,
Feb 6 2018
,
Aug 1
after firmware-boot-update is dropped (i.e., devices using updater3 are EOL'ed), we can: - remove updater3.sh - drop mode=startup - drop mode=todev - since the only updater is updater4 now, consider dropping UPDATER_SCRIPT and always use the single script.
,
Aug 18
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-stumpy-private/+/a6d9bc4b13da02f8c4a7f9cd00a85617641d79b4 commit a6d9bc4b13da02f8c4a7f9cd00a85617641d79b4 Author: Hung-Te Lin <hungte@chromium.org> Date: Sat Aug 18 07:49:41 2018
,
Aug 18
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-lumpy-private/+/33a33e18eaf02cdaaf484d8f5f20a1a7258fb0e6 commit 33a33e18eaf02cdaaf484d8f5f20a1a7258fb0e6 Author: Hung-Te Lin <hungte@chromium.org> Date: Sat Aug 18 07:49:41 2018
,
Aug 18
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-butterfly-private/+/75ed3a427d445e14e01b05ee9b52878ab8a82255 commit 75ed3a427d445e14e01b05ee9b52878ab8a82255 Author: Hung-Te Lin <hungte@chromium.org> Date: Sat Aug 18 07:49:40 2018
,
Aug 28
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-parrot-private/+/6751ac69044dccde23b18f33fce88c320e25c88f commit 6751ac69044dccde23b18f33fce88c320e25c88f Author: Hung-Te Lin <hungte@chromium.org> Date: Tue Aug 28 18:26:44 2018
,
Aug 30
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-parrot-private/+/01ca4bb8ab8b6a6bb2083155e15c1d8af6d5efb3 commit 01ca4bb8ab8b6a6bb2083155e15c1d8af6d5efb3 Author: Hung-Te Lin <hungte@google.com> Date: Thu Aug 30 16:53:15 2018
,
Sep 8
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/firmware/+/3f37125e1b3e15172d3143e0b188e23101edf04c commit 3f37125e1b3e15172d3143e0b188e23101edf04c Author: Hung-Te Lin <hungte@chromium.org> Date: Sat Sep 08 13:49:50 2018 firmware: Drop 'todev' mode. The 'todev' was mainly used by updater v2 generation (alex, zgb; those need to reflash a DEV firmware) and was replaced by crossystem settings since v3, and since then replaced by enable_dev_usb_boot script in vboot_reference repository. We have already revised all documents to use enable_dev_usb_boot instead of running "chromeos-firmwareupdate --mode=todev", and updater v2 has been removed for a long time so it should be fine to drop 'todev' support. BUG= chromium:806383 TEST=make test Change-Id: Ibbd7dd9a6626ea6388ca67f30d4efafd41f0f1d7 Reviewed-on: https://chromium-review.googlesource.com/1180622 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/3f37125e1b3e15172d3143e0b188e23101edf04c/pack_dist/crosutil.sh [modify] https://crrev.com/3f37125e1b3e15172d3143e0b188e23101edf04c/pack_dist/updater4.sh [modify] https://crrev.com/3f37125e1b3e15172d3143e0b188e23101edf04c/pack_dist/common.sh [modify] https://crrev.com/3f37125e1b3e15172d3143e0b188e23101edf04c/pack_dist/updater3.sh
,
Oct 30
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-stout-private/+/6ad09bcc701dbef17d5e1e9d7333fd94cb23e6d0 commit 6ad09bcc701dbef17d5e1e9d7333fd94cb23e6d0 Author: Hung-Te Lin <hungte@chromium.org> Date: Tue Oct 30 15:42:56 2018
,
Oct 30
The following revision refers to this bug: https://chrome-internal.googlesource.com/chromeos/overlays/overlay-parrot-private/+/458181d7005d3332738d14e9d1b1374125e6d86e commit 458181d7005d3332738d14e9d1b1374125e6d86e Author: Hung-Te Lin <hungte@chromium.org> Date: Tue Oct 30 19:03:26 2018
,
Nov 1
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/firmware/+/71a517f90489ebafa322302c2b07c64b09f04930 commit 71a517f90489ebafa322302c2b07c64b09f04930 Author: Hung-Te Lin <hungte@chromium.org> Date: Thu Nov 01 04:59:17 2018 firmware: Remove updater3.sh The Chromebooks using updater3 are now all EOL'ed, and the updater ebuilds are also removed from overlays, so it should be fine to finally remove the updater3 script. BUG= chromium:806383 TEST=make test CQ-DEPEND=CL:*664037, CL:*677811 Change-Id: I3992ecd026491180f28dea317965c30a96d165b5 Reviewed-on: https://chromium-review.googlesource.com/1179740 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [delete] https://crrev.com/f5d5098fa56bdc705d95218ca04a4df784f5f29e/pack/dist/updater3.sh
,
Nov 1
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/49da94ad20ce233d75ee8bf39bf0dccd14137282 commit 49da94ad20ce233d75ee8bf39bf0dccd14137282 Author: Mike Frysinger <vapier@chromium.org> Date: Thu Nov 01 04:59:31 2018 init: chromeos-startup: drop support for firmware-boot-update This is only used by lumpy/stumpy/butterfly/parrot/stout which are EOL. Drop support for executing this script at startup. BUG= chromium:806383 TEST=precq passes Change-Id: I5e5671a18f7cab1654ae3ce63c4b0f984f9003c0 Reviewed-on: https://chromium-review.googlesource.com/1156069 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> [modify] https://crrev.com/49da94ad20ce233d75ee8bf39bf0dccd14137282/init/chromeos_startup
,
Nov 1
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform/firmware/+/844b203aec9cf2353f7d14fca5768baab524f4af commit 844b203aec9cf2353f7d14fca5768baab524f4af Author: Hung-Te Lin <hungte@chromium.org> Date: Thu Nov 01 17:02:16 2018 firmware: Drop 'startup' mode (boot update) and firmware-boot-update The 'startup' mode was mainly used for updating non-Chrome EC without software sync, and only needed by updater v3 (already deprecated). As a result, it should be fine to drop the 'startup' mode' and its supporting files (firmware-boot-update*). BUG= chromium:806383 TEST=make test CQ-DEPEND=CL:1310154 Change-Id: I8b2d08b43e73b6e0453e89a0fe1db2f994047cc3 Reviewed-on: https://chromium-review.googlesource.com/1180621 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> [delete] https://crrev.com/2cd6f5a4299d77480847f5f27676e20aabd719d7/sbin/firmware-boot-update.3 [modify] https://crrev.com/844b203aec9cf2353f7d14fca5768baab524f4af/unittests/crosutil_unittest [modify] https://crrev.com/844b203aec9cf2353f7d14fca5768baab524f4af/pack/dist/crosutil.sh [modify] https://crrev.com/844b203aec9cf2353f7d14fca5768baab524f4af/pack/dist/common.sh [modify] https://crrev.com/844b203aec9cf2353f7d14fca5768baab524f4af/pack/dist/updater4.sh [delete] https://crrev.com/2cd6f5a4299d77480847f5f27676e20aabd719d7/sbin/firmware-boot-update [delete] https://crrev.com/2cd6f5a4299d77480847f5f27676e20aabd719d7/sbin/README
,
Nov 2
all removed :) |
||
►
Sign in to add a comment |
||
Comment 1 by derat@chromium.org
, Jan 27 2018