Merge ~alextu/pc-enablement/+git/oem-scripts:steps-to-support-ubuntu-recovery-injection into ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master

Proposed by Alex Tu
Status: Work in progress
Proposed branch: ~alextu/pc-enablement/+git/oem-scripts:steps-to-support-ubuntu-recovery-injection
Merge into: ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master
Diff against target: 56 lines (+22/-2)
1 file modified
recovery-from-iso.sh (+22/-2)
Reviewer Review Type Date Requested Status
OEM Solutions Group: Engineers Pending
Review via email: mp+402151@code.launchpad.net
To post a comment you must log in.
ff91625... by Alex Tu

do_recovery based on project code name

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
mir-bug FAIL non-zero exit status 1
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
git-url-insteadof-setting FAIL non-zero exit status 128
recovery-from-iso.sh PASS
mir-bug-verification FAIL stderr: E: Unable to locate package oem-somerville-maester-meta

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts-0.88-ff91625-in-linux-container-focal

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
mir-bug FAIL non-zero exit status 1
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
git-url-insteadof-setting FAIL non-zero exit status 128
recovery-from-iso.sh PASS
mir-bug-verification PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-0.88-ff91625-in-linux-container-focal

Unmerged commits

ff91625... by Alex Tu

do_recovery based on project code name

f9bc06f... by Alex Tu

prepare oem-install for machines with ubuntu-recovery

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/recovery-from-iso.sh b/recovery-from-iso.sh
2index c8a5b1c..9248e24 100755
3--- a/recovery-from-iso.sh
4+++ b/recovery-from-iso.sh
5@@ -10,7 +10,7 @@ SCP="scp -o StrictHostKeyChecking=no"
6 #TAR="tar -C $temp_folder"
7 temp_folder="$(mktemp -d -p "$PWD")"
8 GIT="git -C $temp_folder"
9-
10+oem_project=""
11 clear_all() {
12 rm -rf "$temp_folder"
13 }
14@@ -58,6 +58,7 @@ download_preseed() {
15 $GIT clone https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-fix-misc-cnl-skip-oobe --depth 1
16 $GIT clone https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-fix-misc-cnl-skip-storage-selecting --depth 1
17 $GIT clone https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/pack-fish.openssh-fossa --depth 1
18+ $GIT clone https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-fix-misc-cnl-oem-image-helper --depth 1 -b oem-fix-misc-cnl-oem-image-helper_fish
19
20 # get pkgs for ssh key and skip disk checking.
21 $GIT clone https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-fix-misc-cnl-misc-for-automation --depth 1 misc_for_automation
22@@ -123,6 +124,9 @@ EOF
23 }
24 prepare() {
25 echo "prepare"
26+ ssh -o StrictHostKeyChecking=no "$user_on_target"@"$target_ip" wget https://gitlab.com/canonical-mainstream/plainbox-provider-pc-sanity/-/raw/master/bin/get-oem-info.sh
27+ oem_project="$(ssh -o StrictHostKeyChecking=no "$user_on_target"@"$target_ip" bash get-oem-info.sh --oem-codename)"
28+ [ -n "$oem_project" ] || exit 1
29 inject_recovery_iso
30 inject_preseed
31 }
32@@ -137,7 +141,23 @@ poll_recovery_status() {
33 }
34
35 do_recovery() {
36- ssh -o StrictHostKeyChecking=no "$user_on_target"@"$target_ip" sudo dell-restore-system -y &
37+ if [ "$oem_project"="stella" ]; then
38+ script_on_target_machine="do-recovery.sh"
39+cat <<EOF > "$temp_folder/$script_on_target_machine"
40+#!/bin/bash
41+set -x
42+sudo efibootmgr -n \$(efibootmgr | grep Recovery | cut -c 5-8)
43+sudo reboot
44+EOF
45+ scp -o StrictHostKeyChecking=no "$temp_folder/$script_on_target_machine" "$user_on_target"@"$target_ip":~/
46+ ssh -o StrictHostKeyChecking=no "$user_on_target"@"$target_ip" chmod +x "\$HOME/$script_on_target_machine"
47+ ssh -o StrictHostKeyChecking=no "$user_on_target"@"$target_ip" "\$HOME/$script_on_target_machine"
48+ elif "$oem_project"="somerville"; then
49+ ssh -o StrictHostKeyChecking=no "$user_on_target"@"$target_ip" sudo dell-restore-system -y &
50+ else
51+ echo "ERROR: no oem project matched."
52+ exit 1
53+ fi
54 sleep 300 # sleep to make sure the target system has been rebooted to recovery mode.
55 poll_recovery_status
56 }

Subscribers

People subscribed via source and target branches