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

Test ARM on native hardware #930

Closed
5 tasks
mudler opened this issue Dec 6, 2021 · 7 comments
Closed
5 tasks

Test ARM on native hardware #930

mudler opened this issue Dec 6, 2021 · 7 comments

Comments

@mudler
Copy link
Contributor

mudler commented Dec 6, 2021

as #526 is in with #867 and #918 we can test cOS on native hardware.

Keep in mind that the default example images and the arm builder script partitions by default the SD image without a COS_PERSISTENT partition set, so needs a cloud-init setup similar to https://rancher-sandbox.github.io/cos-toolkit-docs/docs/getting-started/booting/#cloud-images (see cloud-init layout example), which should provided as result of this card too, as part of documentation

We need to test if at least if the minimum core set of functionalities are working on RPI3/4.

Action items

  • Configure COS_PERSISTENT with cloud-init
  • Test upgrades
  • Test resets
  • Test upgrade of recovery
  • Document requirements to get a fully functional system

Notes

To get the image:

# Image will be available at rpi-image/build/*.img, and can be used with dd
sudo luet util unpack quay.io/costoolkit/examples:rpi-0.7.9-3-g1128618e.img rpi-image
@mudler mudler added the kind/enhancement New feature or request label Dec 6, 2021
@mudler mudler assigned mudler and unassigned mudler Dec 6, 2021
@mudler mudler added architecture/arm64 area/QA and removed kind/enhancement New feature or request labels Dec 6, 2021
This was referenced Dec 6, 2021
@kkaempf
Copy link
Contributor

kkaempf commented Dec 17, 2021

The image link above should be changed to something like ...:latest 😉

@mudler
Copy link
Contributor Author

mudler commented Dec 22, 2021

Currently experimenting with quay.io/costoolkit/examples:rpi-554a9b96 and the cloud-init below (to place manually into the COS_OEM partition after flashing the SD card) which setup a 'fake' COS_PERSISTENT partition from the recovery, in such way cos-upgrade can run:
(mind, it sets up a COS_PERSISTENT of 100mb). Still missing the partition expansion part

name: "Immutable Layout"
stages:
  boot:
    - name: "Create COS_PERSISTENT"
      commands:
      - |
        RECOVERY=$(blkid -L COS_RECOVERY || true)
        mkdir /run/rec
        mount $RECOVERY /run/rec
        if [ ! -e "/run/rec/persistent.img" ]; then
          dd if=/dev/zero of=/run/rec/persistent.img bs=1MB count=100
          mkfs.ext4 /run/rec/persistent.img -L COS_PERSISTENT
        fi
        
        export DRIVE=$(losetup -f "/run/rec/persistent.img" --show)
        kpartx -va $DRIVE
        mount $DRIVE /usr/local

@dragonchaser
Copy link
Contributor

dragonchaser commented Jan 28, 2022

**Tested image **

cOS-example-rpi-0.7.15-g2db1242a

Upgrade active

Upgrading from release channel
                       ██      ██    ██ ███████ ████████ 
                       ██      ██    ██ ██         ██    
                       ██      ██    ██ █████      ██    
                       ██      ██    ██ ██         ██    
                       ███████  ██████  ███████    ██    
                       
                                                                                
                 Luet - 0-deps container-based package manager                  
                                                                                

    0.22.7-gbff45b9bd953b46dda8498495d5d6e1b4575fe8c 2022-01-18 07:50:59 UTC
                Luet Copyright (C) 2019-2021 Ettore Di Giacinto
                This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
 INFO    Enabled plugins:
 INFO    	 luet-cosign (at /usr/bin/luet-cosign)
           
  Install  
           
 INFO    Downloading  quay.io/costoolkit/releases-green-arm64:repository.yaml
  ERROR     Plugin luet-cosign at /usr/bin/luet-cosign had an error: bash: warning: setlocale: LC_ALL: cannot change locale (en_GB.utf-8)
          Error: exactly one of: key reference (--key), or hardware token (--sk) must be provided
          main.go error during command execution: exactly one of: key reference (--key), or hardware token (--sk) must be provided

Upgrade is running but I am getting this error in the end, not sure if this is an issue.

Upgrade recovery

After upgrade recovery is unbootable, grub is bailing out on:

error: ../../grub-core/commands/search.c:296: no such device:
/cOS/recovery.squashfs.

Reset

Reset is failing with:

grub2-install: error: failed to get canonical path of `/tmp/state/boot/efi'.

Reset is also updating the grub.cfg and changes all entries to cOS RPI example [,fallback,recovery]

@mudler
Copy link
Contributor Author

mudler commented Jan 31, 2022

The images are not signed, can you try with cos-upgrade --no-cosign ?

@dragonchaser
Copy link
Contributor

Results in different errors:

Program Name | Version  | License | Repository
system/cos   | 0.7.17-1 |         | cos       

Downloading packages [0/1] █                                                                   0% | 0s
 INFO    Downloading image  quay.io/costoolkit/releases-green-arm64:cos-system-0.7.17-1               
 WARNING    failed downloading image quay.io/costoolkit/releases-green-arm64:cos-system-0.7.17-1: write /usr/local/.cos-upgrade/tmp/upgrade/tmpluet/image4146378108/boot/initrd-5.3.18-59.40-default: no space left on device
panic: runtime error: invalid memory address or nil pointer dereference                               
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xfc0380]

goroutine 75 [running]:
github.com/mudler/luet/pkg/api/core/types/artifact.(*Checksums).generateSum(0x4000843cd0, 0x0, {{0x1650cf8, 0x4001ca5480}, {0x13b953d, 0x6}})
	/luetbuild/go/src/github.com/mudler/luet/pkg/api/core/types/artifact/checksum.go:78 +0x30
github.com/mudler/luet/pkg/api/core/types/artifact.(*Checksums).generateSHA256(0x4000843cd0, 0x0)
	/luetbuild/go/src/github.com/mudler/luet/pkg/api/core/types/artifact/checksum.go:73 +0x78
github.com/mudler/luet/pkg/api/core/types/artifact.(*Checksums).Generate(...)
	/luetbuild/go/src/github.com/mudler/luet/pkg/api/core/types/artifact/checksum.go:60
github.com/mudler/luet/pkg/api/core/types/artifact.(*PackageArtifact).Verify(0x0)
	/luetbuild/go/src/github.com/mudler/luet/pkg/api/core/types/artifact/artifact.go:114 +0x78
github.com/mudler/luet/pkg/installer.(*LuetInstaller).getPackage(0x400044c080, {{0x1684f80, 0x40261b9b80}, 0x4015968480, {0x1623200, 0x40006bc180}}, {0x167e758, 0x4026136780})
	/luetbuild/go/src/github.com/mudler/luet/pkg/installer/installer.go:937 +0x7c
github.com/mudler/luet/pkg/installer.(*LuetInstaller).downloadWorker(0x400044c080, 0x3, 0x40262bde60, 0x40005b3810, 0x401dddc840, {0x167e758, 0x4026136780})
	/luetbuild/go/src/github.com/mudler/luet/pkg/installer/installer.go:971 +0xe8
created by github.com/mudler/luet/pkg/installer.(*LuetInstaller).download
	/luetbuild/go/src/github.com/mudler/luet/pkg/installer/installer.go:633 +0x4dc
+ upgrade_cleanup
+ EXIT=2
+ upgrade_cleanup2
+ return 2

@dragonchaser
Copy link
Contributor

dragonchaser commented Feb 3, 2022

I have tried with 16GB of storage for COS_PERSISTENT resulting in the same error (for both cases, with and without --no-cosign.

@dragonchaser dragonchaser removed their assignment Feb 7, 2022
@mudler mudler added this to Elemental Jun 1, 2022
@mudler mudler moved this to 💡 Untriaged in Elemental Jun 1, 2022
@kkaempf kkaempf removed this from Elemental Jun 13, 2022
@kkaempf
Copy link
Contributor

kkaempf commented Dec 23, 2022

Closing for now as we have initial support for ARM in our development documentation

@kkaempf kkaempf closed this as completed Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants