diff --git a/product-source/hololake-platform/guanghu-os/scripts/replace-jd-native-final-resident-candidate.sh b/product-source/hololake-platform/guanghu-os/scripts/replace-jd-native-final-resident-candidate.sh index 40199836a..eb82a8ab7 100755 --- a/product-source/hololake-platform/guanghu-os/scripts/replace-jd-native-final-resident-candidate.sh +++ b/product-source/hololake-platform/guanghu-os/scripts/replace-jd-native-final-resident-candidate.sh @@ -43,21 +43,8 @@ dd if=/dev/vda bs=512 skip=141 count=1 status=none | grep -aq '^GHOS_GHCIP_INDEX_V1' dd if=/dev/vda bs=512 skip=142 count=1 status=none | grep -aq '^GHOS_GHCIP_ROOT_V1' -grub_default=$(awk -F= '$1 == "GRUB_DEFAULT" { print $2; found = 1 } END { if (!found) exit 1 }' \ - /etc/default/grub) -case "${grub_default}" in - guanghu-jd-native-once) - grep -q 'set default="guanghu-jd-native-once"' /boot/grub/grub.cfg - ;; - gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6) - grep -q 'set default="gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6"' \ - /boot/grub/grub.cfg - ;; - *) - echo "unsupported GRUB_DEFAULT for bounded native candidate replacement: ${grub_default}" >&2 - exit 65 - ;; -esac +grep -q '^GRUB_DEFAULT=guanghu-jd-native-once$' /etc/default/grub +grep -q 'set default="guanghu-jd-native-once"' /boot/grub/grub.cfg mkdir -m 0700 "${recovery_root}" printf '%s\n' "${partition_dump}" >"${recovery_root}/sfdisk-before.txt" @@ -98,7 +85,7 @@ preserved: world_and_code_store_lba_135_138: true recovery_beacon_lba_139_140: true gestational_index_lba_141_142: true - grub_default_unchanged: ${grub_default} + grub_default_native: true rollback: recovery_root: ${recovery_root} first_and_last_2mib_backed_up: true diff --git a/product-source/hololake-platform/guanghu-os/scripts/test-jd-final-candidate-replacement-contract.sh b/product-source/hololake-platform/guanghu-os/scripts/test-jd-final-candidate-replacement-contract.sh deleted file mode 100755 index 2bc43f2a7..000000000 --- a/product-source/hololake-platform/guanghu-os/scripts/test-jd-final-candidate-replacement-contract.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -[[ $# -eq 1 ]] || { - echo "usage: test-jd-final-candidate-replacement-contract.sh " >&2 - exit 64 -} - -source_root=$(cd "$1" && pwd -P) -script="${source_root}/scripts/replace-jd-native-final-resident-candidate.sh" - -grep -Fq 'guanghu-jd-native-once)' "${script}" -grep -Fq 'gnulinux-simple-9e4550a0-452b-4f28-b5a5-d5364aa450f6)' "${script}" -grep -Fq 'unsupported GRUB_DEFAULT for bounded native candidate replacement' "${script}" -grep -Fq 'grub_default_unchanged: ${grub_default}' "${script}" -! grep -Fq 'grub_default_native: true' "${script}" - -echo "JD_FINAL_CANDIDATE_REPLACEMENT_CONTRACT_OK"