Release upgrade initial CI
Initial upgrade script to test upgrading from the latest stable to edge.
Currently being stuck in the sed
command to replace the repositories, it is valid but the the file is never changed in the chroot.
Fixed :) pmbootstrap configured the repos again after I overwritten them
Current issues:
-
Hardcoded to Pine64 PinePhone rootfs -
Hardcoded to v21.12 -
Assume that we want firewall + SSH installed and no-image to be generated
I think we can handle these things as in upstream_compat_setup.sh
?
Contributes to https://gitlab.com/postmarketOS/pmaports/-/issues/1432
Merge request reports
Activity
added 1 commit
- dfab9718 - test_upgrade_compatibility: initial CI
By Dylan Van Assche on 2022-04-23T19:37:05
added 1 commit
- 564516bd - test_upgrade_compatibility: initial CI
By Dylan Van Assche on 2022-04-24T09:23:41
added 1 commit
- db6c4b40 - test_upgrade_compat: initial CI
By Dylan Van Assche on 2022-04-24T09:29:32
added 1 commit
- a102699f - test_upgrade_compat: initial CI
By Dylan Van Assche on 2022-04-24T09:30:14
added 1 commit
- 1f7a999f - test_upgrade_compat: initial CI
By Dylan Van Assche on 2022-04-24T09:32:27
2 failures during upgrade from v21.12 --> edge currently:
apline-baselayout-data
(1/676) Installing alpine-baselayout-data (3.2.0-r20) ERROR: alpine-baselayout-data-3.2.0-r20: trying to overwrite etc/fstab owned by postmarketos-base-15-r7.
u-boot-pinephone
(351/676) Upgrading u-boot-pinephone (2021.10-r0 -> 2021.10-r1) Executing u-boot-pinephone-2021.10-r1.post-upgrade Using default clock: 528 MHz Using default clock: 528 MHz usage: /usr/sbin/update-u-boot [-n,--dry-run] [-i,--imagedir <imagedir>] [-b|--board <board-type>] [-d|--device <device>] [-r|--ram-freq <freq>] [-s|--skip-delay] options: -b,--board <board> Specify the board type: pinephone, pinetab (current default: none) -d,--device <device> Specify the device where to install u-boot (current default: none) -i,--imagedir <imagedir> Specify u-boot image directory (current default: /usr/share/u-boot) -n,--dry-run Print commands but don't execute them -r,--ram-freq RAM clock speed, one of: * 528 (default for new postmarketOS installations) * 552 (default before v21.03 / edge 2021-04-05) * 624 -s,--skip-delay Skip delay and flash the image immediately ERROR: u-boot-pinephone-2021.10-r1.post-upgrade: script exited with error 1
By Dylan Van Assche on 2022-04-24T09:40:40
- Resolved by Administrator
Thanks a lot for starting this @dylanvanassche!
-
I suggest to put this into a different repository, created postmarketos-release-upgrade.git. Can you create a follow-up MR there? Reasons:
- monitoring.git CI runs hourly, whereas I think we should run the release upgrade test daily. It takes longer, and having it daily should be enough.
- the plan is to make a script / cli program that deals with some quirks eventually, which will need its own repository anyway
-
Can you create a .gitlab-ci.yml that actually runs the script, so we can see the errors?
- to install pmbootstrap, use the ci-common script like here: https://gitlab.com/postmarketOS/pmaports/-/blob/885ee925e501069640436f945f48bae757f2f956/.gitlab-ci.yml#L69
-
Let's make the source branch and the device arguments, so we can easily test other combinations. (Either env vars or cmdline args)
-
Calls directly to the pmbootstrap api like
pmb.install._install.create_device_rootfs(args, 2, 2)
are a bit fragile. In this test, I think we can do everything by running pmbootstrap as command-line program. And while at it, maybe the whole script becomes a lot simpler if you run it as shell script? Something like this, untested:
#!/bin/sh -ex # copyright, license GPL-3.0-or-later etc. DEVICE="${DEVICE:-qemu-amd64}" UI="${UI:phosh}" CHANNEL_OLD="${CHANNEL_OLD:v21.12}" CHANNEL_NEW="${CHANNEL_NEW:edge}" WORK="$(pmbootstrap -q config work)" # switch branch etc, see # https://gitlab.com/postmarketOS/build.postmarketos.org/-/blob/master/bpo/job_services/sourcehut.py#L80-94 pmbootstrap -q config device "$DEVICE" pmbootstrap -q config ui "$UI" pmbootstrap install --no-image --password test cp upgrade.sh "$WORK"/chroot_rootfs_$DEVICE/tmp/upgrade.sh pmbootstrap -q chroot -r -- /tmp/upgrade.sh "$CHANNEL_OLD" "$CHANNEL_NEW"
Then have a second upgrade.sh script, which will run inside the chroot, and
- runs sed on /etc/apk/repositories like your current script does
- apply any quirks, e.g. to fix the postmarketos-base /etc/fstab thing
Note that some commands have "-q" to shorten the output if it wouldn't print anything interesting anyway.
- Regarding the 2 failures:
-
alpine-baselayout-data-3.2.0-r20: trying to overwrite etc/fstab
: legitimate error. postmarketos-base already "replaces" "alpine-baselayout-data". Not sure how to resolve this best, but for now we could add a quirk in the upgrade script to take care of this. Maybe it works by installing postmarketos-base first, or by running apk fix afterwards? Fixing it "properly" would be best of course, but I'd focus on getting the upgrade test script working at all. -
u-boot-pinephone
: probably trying to write the bootloader and failing to do that while running in qemu / pmb chroot. I'd just use the amd64-qemu device for now to circumvent this.
-
By Oliver Smith on 2022-04-25T11:28:49
Edited by Ghost User -
mentioned in merge request postmarketos-release-upgrade!1 (merged)
By Dylan Van Assche on 2022-04-25T17:04:47