Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch/rocko3 #75

Closed
wants to merge 22 commits into from
Closed

Patch/rocko3 #75

wants to merge 22 commits into from

Conversation

andi8086
Copy link
Contributor

No description provided.

jan-kiszka and others added 22 commits January 4, 2018 17:26
The npm class of rocko tries to use "npm install -g" but stumbles over
--no-registry. Install our own method, which is the one morty used, and
switch our recipes to it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Rocko switched to 4.12 for the headers, but we don't want to pull
another kernel source tree.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Use normal install and drop rsync which also wasn't properly listed as
build-time dependency.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This lifts the BSP layer to Yocto 2.4 (rocko). Moving to that version
allows (and requires) us to drop the initrd installation workaround.

This temporarily breaks the example layer.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Enable the example image over (upcoming) Yocto 2.4.1. This brings a
number of changes:

 - meta-intel-iot-middleware is dead; mraa and upm were moved to meta-oe
 - we can drop bbappends for mraa and upm due to the newer versions in
   meta-oe
 - the new mraa recipe requires to ask for nodejs binding and the
   installation of mraa-utils explicitly
 - the newer version of mraa provides now Python 3 bindings (because
   that's the primary Python version on the target)
 - without Python 2 mraa, we need to port iot2000setup and setledcolor
   to Python 3
 - we can drop our Python 2 libnewt due to this
 - changes are required to uclibc recipes due to new recipe-specific
   sysroots of poky

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Allow color names as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Already a long time ago, poky stopped pulling in grub this way.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
While this will not bring us all the I/O of the IOT2000, we can still
use QEMU to test basic image features.

Set the required QB variables in the machine config, specifically
defining the RAM size (1G, that of the IOT2040) and ensuring that a
second UART is present which the image uses as console. We also need a
virtio-rng device due to lacking entropy in the virtual target.

Tune the kernel config to carry virtio block, net, and hw-random
support. As compensation, we can safely drop hw-random drivers that make
no sense on the IOT2000.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Change iot2000-example-image to include meta-efibootguard
in its kas file.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
In machine config set EFI_PROVIDER to efibootguard.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
For wic to create a GPT, gptfdisk is required. Make the image depend
on it.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Tell wic that we want a GPT.  The partition layout must have an EFI
partition, two config partitions, two root partitions and a persistent
partition for update images at least.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Import official meta-swupdate layer.
meta-swupdate needs some minor changes to be compatible
with our update process and configuration.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Add needed variables to WICVARS via a local.conf entry to have this
variable available in the wic source plugins.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Efibootguard's tool is needed to create the config partition

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Add bg_setenv/bg_readenv and swupdate to the example
image.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
cpio creation in swupdate.bbclass needs an ext4.gz image in the image
deploy dir. This must be added before the live-image.bbclass is
inherited otherwise the live-image mechanism breaks.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Add sw-description as an update example and
an example recipe to build an update image.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Add a kas yml to generate a base image with an update artifact
with the CIP RT kernel.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
do_image_wic requires files that do_bootimg generates.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
* Add error handling.
* Add logging.
* Do not assume we only have three partitions. Always expand the last
partition of the root device.
* Do not delete and re-create but use resize command of parted.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Add information about how swupdate is integrated and explain the
example recipes.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
@jan-kiszka
Copy link
Collaborator

I suppose I now want to try out patch/rocko4 rather than this version, right?

Copy link
Collaborator

@jan-kiszka jan-kiszka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who needs this? Not described in the commit log.

Also, can't we define this inside some config file that is related to the user of that feature and is pulled into the example image?

Copy link
Collaborator

@jan-kiszka jan-kiszka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rather make sure that the update image is building into ext4.gz and is NOT using wic.

Copy link
Collaborator

@jan-kiszka jan-kiszka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit only contains the -rt kas file. Either move the non-rt one from the previous patch or fold both patches into one.

Copy link
Collaborator

@jan-kiszka jan-kiszka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jan-kiszka
Copy link
Collaborator

Sorry, for duplicate comments, but github is highly counterintuitive /wrt how to comment on a particular commit in a PR.

@jan-kiszka
Copy link
Collaborator

OK, rocko4 is broken due to changes in there referenced swupdate repo (hash no longer present). Sticking with this series.

part swap --ondisk mmcblk0 --size 512 --fstype=swap --label swap --align 1024
part --size 1024 --extra-space 0 --overhead-factor 1 --ondisk mmcblk0 --label persistent --align 1024 --fstype=ext4
Copy link
Collaborator

@jan-kiszka jan-kiszka Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves the expansion space unusable for the normal user. It should be mounted, maybe as home partition or /persistent.

@@ -1,3 +1,14 @@
# short-description: Create an Galileo Gen 1/2 disk image
# long-description: Creates a partitioned EFI disk image for Intel Galileo Gen 1/2,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a Galileo.

@jan-kiszka
Copy link
Collaborator

We probably want to disable the resizer script in the update image. I suspect it stumbles while calling parted, causing a help dump of that tool during first boot after the update.

```
swupdate -i <filepath>.swu
```

Copy link
Collaborator

@jan-kiszka jan-kiszka Mar 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I need reboot (swupdate tells me, but better state this again). But how do I declare the update successful after the reboot? Without that, I will fall back into v1 again.

bg_setenv -c is what I want, I suppose.

@jan-kiszka
Copy link
Collaborator

Further meta comment: I noticed that the Linux watchdog daemon starts early and does not monitor if we manage to get to the final startup script. We probably want a simple "validate-update.sh" script that runs last, starts the watchdog and also confirms the update (if that hasn't happened before). That script could carry some comment like "add your custom validation steps here" so that users know where to put further tests for connectivity or the execution of critical services.

@andi8086
Copy link
Contributor Author

andi8086 commented Mar 5, 2018 via email

@jan-kiszka
Copy link
Collaborator

The random pool issue - at least /wrt tcf-agent - is fixed in current jan/rocko (your baseline is older).

If the watchdog is limited in duration, we can add single triggers along the boot process. But the daemon shall not start that early.

exit 1
;;
esac

START_BLOCK=$(parted $ROOT_DEVICE -ms unit s p | grep "^$PART_NUMBER" | cut -f 2 -d: | sed "s/s$//")
log "Fixing backup GPT position"
parted ${ROOT_DEVICE} print Fix
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left over debug print? But "Fix" is not a known parameter to parted.

partprobe ${ROOT_DEVICE}

log "Resizing file system on ${EXPAND_PARTITION}"
resize2fs ${EXPAND_PARTITION}
Copy link
Collaborator

@jan-kiszka jan-kiszka Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For whatever reason, this just refused to work:

rc: Resizing /dev/mmcblk0p7 to maximum
rc: Resizing file system on /dev/mmcblk0p7
resize2fs 1.43.5 (04-Aug-2017)
Please run 'e2fsck -f /dev/mmcblk0p7' first.

Adding that check here seems reasonable.


update-rc.d -f expandfs.sh remove
disable
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, not a regression: parted also gets stuck on lacking entropy. Possibly because it pulls in some uuid lib which first of all wants to initialized some randomness.

I'm checking if we can avoid that. Alternatively, we could send the whole thing into background so that the first boot is not delayed. At least we need to think about the watchdog in case we no longer start it prematurely during early boot.


include common.iot2000.wks.inc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now we are missing the initrd with ACPI fixups. While I hope we can overcome that soon, we require it for now. I suppose that explains why you patches didn't need some of the fixes of Farhat...

@andi8086
Copy link
Contributor Author

andi8086 commented Mar 6, 2018 via email

@andi8086
Copy link
Contributor Author

andi8086 commented Mar 6, 2018 via email

@andi8086
Copy link
Contributor Author

andi8086 commented Mar 6, 2018 via email

@franzhoepfinger
Copy link

How can i build this pull request to Test?

@franzhoepfinger
Copy link

When do you expect this Request to be integrated?

@jan-kiszka
Copy link
Collaborator

We are just releasing 2.2.0 and will then refresh and merge the rocko support. This PR depends on rocko being upstream first. There are also a couple of smaller issues to be addressed with a follow-up PR, and Andreas will need some time to work on them, so don't expect a quick resolution here.

Regarding test builds: There is a readme included, and you basically just need to build the example image with the known kas file. For update images, there is currently a separate kas file (one of the smaller things I'd like to change prior to merging).

@jan-kiszka jan-kiszka mentioned this pull request Oct 17, 2018
@jan-kiszka
Copy link
Collaborator

Superseded by #102.

@jan-kiszka jan-kiszka closed this Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants