chromeos-install fails if --dst not specified on amd64-generic
Reported by
jrbarnette@chromium.org,
Jan 5 2018
|
||
Issue description
Chrome Version:
OS: Chrome OS
What steps will reproduce the problem?
(1) Build and boot an amd64-generic image.
(2) Run "chromeos-install" without arguments
What is the expected result?
System should complain that "--dst" was required.
What happens instead?
You get the following output
cros-disks stop/waiting
/usr/sbin/chromeos-install: 258: /usr/sbin/chromeos-install: dev: parameter not set
The root cause of the problem is apparently this code in
chromeos-common.sh:
get_fixed_dst_drive() {
local dev rootdev
if [ -n "${DEFAULT_ROOTDEV}" ]; then
# No " here, the variable may contain wildcards.
for rootdev in ${DEFAULT_ROOTDEV}; do
dev="/dev/$(basename "${rootdev}")"
if [ -b "${dev}" ]; then
break
else
dev=""
fi
done
fi
echo "${dev}"
}
If DEFAULT_ROOTDEV isn't set, then "${dev}" will be uninitialized.
The script runs with `-u` set, so the unset variable is an error.
,
Jan 6 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/platform2/+/fcaade8aa42fff7f145186f251991dc3da5fcf2f commit fcaade8aa42fff7f145186f251991dc3da5fcf2f Author: Congbin Guo <guocb@chromium.org> Date: Sat Jan 06 07:59:09 2018 installer: script error when install amd64-generic w/o --dst When `chromeos-install` installs amd64-generic image without --dst option, it fails due to an uninitalized variable. In this change, I just set the variable to an empty string, and the script can give more readable error message to users to require --dst option. BUG= chromium:799335 TEST=I rebuit the amd64-generic image with the change and ran `chromeos-install` on my device. It failed and tip users to specify --dst. Then I ran `chromeos-install --dst /dev/mmcblk1`. It installed the image successfuly. Change-Id: Ib94d012381c0c054bf276f6a8b037a14f88ed667 Reviewed-on: https://chromium-review.googlesource.com/853279 Commit-Ready: Congbin Guo <guocb@chromium.org> Tested-by: Congbin Guo <guocb@chromium.org> Reviewed-by: Richard Barnette <jrbarnette@google.com> [modify] https://crrev.com/fcaade8aa42fff7f145186f251991dc3da5fcf2f/installer/share/chromeos-common.sh
,
Jan 8 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by gu...@chromium.org
, Jan 5 2018Status: Started (was: Untriaged)