Skip to content

Commit

Permalink
README: re-wrap the lines
Browse files Browse the repository at this point in the history
Re wrap the lines to 80 words. No content change.

Signed-off-by: Baocheng Su <[email protected]>
  • Loading branch information
BaochengSu committed Feb 9, 2023
1 parent e04fd12 commit 44b83fa
Showing 1 changed file with 56 additions and 34 deletions.
90 changes: 56 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# META-IOT2050

This [Isar](https://github.com/ilbers/isar) layer contains recipes,
configuration and other artifacts that are specific to Debian-based
IOT2050 product.
configuration and other artifacts that are specific to Debian-based IOT2050
product.

## Build example image

Before building the system, you will need to install docker on build host.
For example under Debian Linux
Before building the system, you will need to install docker on build host. For
example under Debian Linux

```shell
sudo apt install docker.io
```

If you want to run docker as non-root user then you need to add your user to the docker group:
If you want to run docker as non-root user then you need to add your user to the
docker group:

```shell
sudo usermod -aG docker $USER
Expand Down Expand Up @@ -73,21 +74,23 @@ $ sudo dd if=build/tmp/deploy/images/iot2050/iot2050-image-example-iot2050-debia
of=/dev/mmcblk0 bs=4M oflag=sync
```

Alternatively, install the bmap-tools package and run the following command which is generally faster and safer:
Alternatively, install the bmap-tools package and run the following command
which is generally faster and safer:

```shell
$ sudo bmaptool copy build/tmp/deploy/images/iot2050/iot2050-image-example-iot2050-debian-iot2050.wic /dev/mmcblk0
```

The example image starts with the IP 192.168.200.1 preconfigured on the first
Ethernet interface, and use DHCP at another. You can use ssh to connect to the system.
Ethernet interface, and use DHCP at another. You can use ssh to connect to the
system.

The BSP image does not configure the network. If you want to ssh into the
system, you can use the root terminal via UART to ifconfig the IP address and
use that to ssh in.

NOTE: To login, the default username and password is `root`.
And you are required to change the default password when first login.
NOTE: To login, the default username and password is `root`. And you are
required to change the default password when first login.

## Installing the image on the eMMC (IOT2050 Advanced only)

Expand All @@ -99,8 +102,8 @@ at least 5 seconds to start the installation.
NOTE: All content of the eMMC will be overwritten by this procedure!

The ongoing installation is signaled by a fast blinking status LED. Wait for
several minutes until the LED stops blinking and the device reboots to the
eMMC. You can safely remove the SD card or USB stick at that point.
several minutes until the LED stops blinking and the device reboots to the eMMC.
You can safely remove the SD card or USB stick at that point.

The installation can also be triggered automatically by creating the file
`/etc/install-on-emmc` on the vanilla image by mounting it under Linux and
Expand All @@ -110,56 +113,72 @@ executing, e.g., `touch <mountpoint>/etc/install-on-emmc`.

By default, the boot loader will pick the first bootable device. If that device
may no longer fully start, you can select an alternative boot device in the
U-Boot shell. Attach a USB-UART adapter to X14, connect it to a host PC and
open a terminal program on that port. Reset the device and interrupt the boot
when it counts down ("Hit any key to stop autoboot"). Then type
U-Boot shell. Attach a USB-UART adapter to X14, connect it to a host PC and open
a terminal program on that port. Reset the device and interrupt the boot when it
counts down ("Hit any key to stop autoboot"). Then type

```shell
=> setenv boot_targets mmc0
=> run distro_bootcmd
```

to boot from the microSD card. Use `usb0` for the first USB mass storage
device.
to boot from the microSD card. Use `usb0` for the first USB mass storage device.

NOTE: This selection is not persistent. The boot loader will fall back to its
default boot order after reset.

## Building with SWUpdate support

It is possible to create an image with a SWUpdate based
[double copy root file system](https://sbabic.github.io/swupdate/overview.html#double-copy-with-fall-back) for Over-The-Air updates by selecting the option `Example image with SWUpdate support` during the image configuration with `./kas-container menu`. You can also build the image by calling:
It is possible to create an image with a SWUpdate based [double copy
root file
system](https://sbabic.github.io/swupdate/overview.html#double-copy-with-fall-back)
for Over-The-Air updates by selecting the option `Example image with
SWUpdate support` during the image configuration with `./kas-container
menu`. You can also build the image by calling:

```shell
./kas-container build kas-iot2050-example.yml:kas/opt/swupdate-example.yml
```

You can find the final image under `build/tmp/deploy/images/iot2050/iot2050-image-swu-example-iot2050-debian-iot2050.wic`. This image holds the necessary partition layout with two root file systems. The image `iot2050-image-swu-example-iot2050-debian-iot2050.wic` can be flashed directly to a SD card as described in section [Booting the image from SD card](#booting-the-image-from-sd-card).
You can find the final image under
`build/tmp/deploy/images/iot2050/iot2050-image-swu-example-iot2050-debian-iot2050.wic`.
This image holds the necessary partition layout with two root file
systems. The image
`iot2050-image-swu-example-iot2050-debian-iot2050.wic` can be flashed
directly to a SD card as described in section [Booting the image from SD
card](#booting-the-image-from-sd-card).

NOTE: As the image contains 2 root file systems, it has a size of 7 Gigabytes.

It also will create a binary for updating the system at `build/tmp/deploy/images/iot2050/iot2050-image-swu-example-iot2050-debian-iot2050.swu`
It also will create a binary for updating the system at
`build/tmp/deploy/images/iot2050/iot2050-image-swu-example-iot2050-debian-iot2050.swu`

### Update an image with SWUpdate

The following steps are necessary to update an image created with SWUpdate support.
1. Transfer the SWUpdate binary `iot2050-image-swu-example-iot2050-debian-iot2050.swu`
to the target system.
The following steps are necessary to update an image created with SWUpdate
support.

1. Transfer the SWUpdate binary
`iot2050-image-swu-example-iot2050-debian-iot2050.swu` to the target system.

2. Update the system with SWUpdate by executing:

```shell
$ swupdate -i iot2050-image-swu-example-iot2050-debian-iot2050.swu
```

You can find more details and options for the command `swupdate` in the [SWUpdate documentation](https://sbabic.github.io/swupdate/swupdate.html#running-swupdate).
You can find more details and options for the command `swupdate` in the
[SWUpdate
documentation](https://sbabic.github.io/swupdate/swupdate.html#running-swupdate).

NOTE: The used SWUpdate package does not contain a web-app example.

SWUpdate will write the image to the unused root partition and updates the EFI
Boot Guard state. EFI Boot Guard is the bootloader that controls which of the
two kernels and root file systems are booted.

3. Reboot the system into the new root file system. The switch between the root file systems
occurs automatically and requires no user interaction.
3. Reboot the system into the new root file system. The switch between the root
file systems occurs automatically and requires no user interaction.

4. Confirm that the new root file system is correctly booted.

Expand All @@ -170,21 +189,24 @@ successful the update process needs to be completed by calling:
$ complete_update.sh
```

The script sets the update state in the EFI Boot Guard configuration to the initial state.
The script sets the update state in the EFI Boot Guard configuration to the
initial state.

If the update is deemed failed, resetting the device will select the previous root file system.
If the update is deemed failed, resetting the device will select the previous
root file system.

### U-Boot environment

The bootloader environment needs to be adapted to select the correct
root file system during boot. This adaptation occurs automatically during the
first boot by executing the `patch-u-boot-env.service`. This systemd-service
activates the hardware watchdog in the U-Boot environment, setting it to 60
seconds by default.
The bootloader environment needs to be adapted to select the correct root file
system during boot. This adaptation occurs automatically during the first boot
by executing the `patch-u-boot-env.service`. This systemd-service activates the
hardware watchdog in the U-Boot environment, setting it to 60 seconds by
default.

#### Revert to the default environment

If it is necessary to revert to the default U-Boot environment the following command can be used:
If it is necessary to revert to the default U-Boot environment the following
command can be used:
```shell
$ fw_setenv -f /etc/u-boot-initial-env
```

0 comments on commit 44b83fa

Please sign in to comment.