Got errors when executing /usr/sbin/chromeos-recovery in recovery mode

1,550 views
Skip to first unread message

Jeff Chuang

unread,
May 22, 2015, 6:31:36 AM5/22/15
to chromiu...@chromium.org
Dear all,

I am porting Chromium OS to an ARM platform.
I have made embedded features Chromium OS booted on the platform.
Currently, I am working on recovery mode and get errors when executing the expression "chroot /usb /usr/sbin/chromeos-recovery /dev/mmcblk0" of recovery_init.sh.
The error messages are as follows:
     + echo 1
    + chroot /usb /usr/sbin/chromeos-recovery /dev/mmcblk0
    initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
    WARNING: Secondary GPT header is invalid
    WARNING: One of the GPT headers/entries is invalid
    WARNING: Secondary GPT header is invalid
    WARNING: One of the GPT headers/entries is invalid

    Error: can not determine destination device. Specify --dst yourself.
    + local install_status=1
    + [ 1 -ne 0 ]
    + dlog WARNING!!! Installation of software failed. Displaying hw diagnostics
    + echo WARNING!!! Installation of software failed. Displaying hw diagnostics
    + tee -a /dev/tty2 /dev/ttyS2
Could you tell me where can I find the sources of chromeos-recovery?
Any suggestions for this problem is appreciate.
Thank you

BR,
Jeff



Richard Barnette

unread,
May 22, 2015, 11:03:23 AM5/22/15
to Jeff Chuang, chromiu...@chromium.org
On 5/22/15 3:31 AM, Jeff Chuang wrote:
> Dear all,
>
> I am porting Chromium OS to an ARM platform.
> I have made embedded features Chromium OS booted on the platform.
> Currently, I am working on recovery mode and get errors when executing
> the expression "chroot /usb /usr/sbin/chromeos-recovery /dev/mmcblk0" of
> recovery_init.sh.

Using a recovery image may not be what you want.
A recovery image is simply a special image that boots
from removable storage like a USB stick or SD card and
invokes chromeos-install automatically. It's most useful
if you have users that need to be able to boot and install
automatically on their own.

As a developer, recovery isn't useful unless your device
doesn't have a terminal interface where you can log in
and type shell commands. If you can boot from an SD card,
log in at a terminal, and type commands, it'll be easier
to use chromeos-install directly.


> The error messages are as follows:
> + echo 1
> + chroot /usb /usr/sbin/chromeos-recovery /dev/mmcblk0
> initctl: Unable to connect to Upstart: Failed to connect to socket
> /com/ubuntu/upstart: Connection refused

This message is normal, and not an error.


> WARNING: Secondary GPT header is invalid
> WARNING: One of the GPT headers/entries is invalid
> WARNING: Secondary GPT header is invalid
> WARNING: One of the GPT headers/entries is invalid
>
These errors indicate that your SD card isn't properly
formatted. This could be a serious problem, although it's
possible that the system will install cleanly despite that.


> Error: can not determine destination device. Specify --dst yourself.

If you want to use a recovery image, you have to specify at
build time the destination device where the image will be
installed. I don't know exactly how to do that, but I think
the configuration is part of the disk_layout.json file.

If you use chromeos-install, you can just run it with the --dst
option to say what device you're installing to.


> + local install_status=1
> + [ 1 -ne 0 ]
> + dlog WARNING!!! Installation of software failed. Displaying hw
> diagnostics
> + echo WARNING!!! Installation of software failed. Displaying hw
> diagnostics
> + tee -a /dev/tty2 /dev/ttyS2
> Could you tell me where can I find the sources of chromeos-recovery?
> Any suggestions for this problem is appreciate.

chromeos-recovery is a 5-10 line wrapper around chromeos-install.
Both scripts are part of the installer package, here:
src/platform2/installer

https://chromium.googlesource.com/chromiumos/platform2/+/master/installer/


> Thank you
>
> BR,
> Jeff
>
>
>
> --
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

--
--jrb

Jeff Chuang

unread,
May 25, 2015, 2:38:51 AM5/25/15
to Richard Barnette, chromiu...@chromium.org
Hi Richard,

Thank you for sharing the info.
I found how to specify the destination device in the disk_layout.json file and you would need to specify it with the field "rootdev_base" in it.(please refer to https://chromium.googlesource.com/chromiumos/platform/crosutils/+/HEAD/build_library/README.disk_layout)
After gave the correct value of rootdev_base, the recovery procedure is going on....:D
However, chromeos-install stops when downloading STATE partition and complains it doesn't find cros_XXX string in the kernel command kernel. I will modify u-boot to add "cros_legacy" in command line for this problem.

About the warnings of GPT header, you said they indicate that my SD card isn't properly formatted.
I am curious at why this happens because I create the images and recovery SD card with chromium OS scripts.
My steps of creating images and recovery SD card are as following:
$CHROOT>./build_image --board=$BOARD --noenable_rootfs_verification base[or dev]
$CHROOT>./mod_image_for_recovery.sh \
    --board=${BOARD} \
    --nominimize_image \
    --image ~/trunk/src/build/images/${BOARD}/latest/chromiumos_image.bin \
    --to ~/trunk/src/build/images/${BOARD}/latest/recovery_image.bin

$CHROOT>cros flash usb:///dev/sdb ../build/images/${BOARD}/latest/recovery_image.bin
Is something wrong with my steps?
Thank you

BR,
Jeff

Richard Barnette

unread,
May 26, 2015, 12:27:06 PM5/26/15
to Jeff Chuang, Richard Barnette, chromiu...@chromium.org
(resend)

On 5/24/15 11:38 PM, Jeff Chuang wrote:
> Hi Richard,
>
> Thank you for sharing the info.
> I found how to specify the destination device in the disk_layout.json
> file and you would need to specify it with the field "rootdev_base" in
> it.(please refer to
> https://chromium.googlesource.com/chromiumos/platform/crosutils/+/HEAD/build_library/README.disk_layout)
> After gave the correct value of rootdev_base, the recovery procedure is
> going on....:D
> However, chromeos-install stops when downloading STATE partition and
> complains it doesn't find cros_XXX string in the kernel command kernel.
> I will modify u-boot to add "cros_legacy" in command line for this problem.
>
Ah. I didn't know exactly about the cros_legacy bit, but it's
not surprising.

> About the warnings of GPT header, you said they indicate that my SD card
> isn't properly formatted.
> I am curious at why this happens because I create the images and
> recovery SD card with chromium OS scripts.
> My steps of creating images and recovery SD card are as following:
> $CHROOT>./build_image --board=$BOARD --noenable_rootfs_verification
> base[or dev]
> $CHROOT>./mod_image_for_recovery.sh \
> --board=${BOARD} \
> --nominimize_image \
> --image ~/trunk/src/build/images/${BOARD}/latest/chromiumos_image.bin \
> --to ~/trunk/src/build/images/${BOARD}/latest/recovery_image.bin
> $CHROOT>cros flash usb:///dev/sdb
> ../build/images/${BOARD}/latest/recovery_image.bin
> Is something wrong with my steps?

The message means that the secondary GPT header isn't
located where it's expected to be at the end of the
disk. The message may be saying that the header is
simply earlier on the disk than expected. However, I
think that that particular message means that the
second header is completely missing.

A missing header would happen because the target SD card
was smaller than the source image, and the image was truncated
by the 'cros flash' procedure. If the image is truncated,
whether you're able to install depends on luck and how much
was actually truncated.

So... Check the size of the SD card (in bytes), and check
the size of the source image (in bytes), and compare. Also,
inside the chroot, the `cgpt show` command can be used to
tell you about the layout of either the disk or the source
image.

If the image wasn't truncated, you're fine. If the image was
truncated, the quick fix is a bigger SD card.


> Thank you
>
> BR,
> Jeff
>
> 2015-05-22 23:03 GMT+08:00 Richard Barnette <jrbar...@chromium.org
> <mailto:jrbar...@chromium.org>>:
> chromiu...@chromium.org <mailto:chromiu...@chromium.org>
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>
>
> --
> --jrb
>
>

--
--jrb

Bill Richardson

unread,
May 26, 2015, 1:35:41 PM5/26/15
to Richard Barnette, Jeff Chuang, Chromium OS dev
On Tue, May 26, 2015 at 9:27 AM, Richard Barnette <jrbar...@chromium.org> wrote:

The message means that the secondary GPT header isn't
located where it's expected to be at the end of the
disk.  The message may be saying that the header is
simply earlier on the disk than expected.  However, I
think that that particular message means that the
second header is completely missing.


​That's just a side-effect of the way we create the images.  The GPT expects headers at both the beginning and end of the physical disk. But the recovery image is just a file, so the "end" is just the end of the file. When you dd the image onto a physical disk, the end of the image isn't the end of the disk. The secondary header is just there for backup, so it's not fatal and nothing to worry about. Running "chromeos-install" will create the correct secondary header at the end of the target disk. 





--
Art for Art's Sake
Engineering for Money

Jeff Chuang

unread,
May 27, 2015, 7:00:04 PM5/27/15
to Bill Richardson, Richard Barnette, Chromium OS dev
Hi Richard and Bill,

Thank you very much for the suggestions and information.
The recovery could be done automatically on my board.
I will try to run chrome-install manually  in developer mode then.

BR,
Jeff


Bill Richardson <wfri...@chromium.org> 於 2015年5月27日 星期三寫道:
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages