Skip to content

Commit

Permalink
Upgrade: adjust new active.img file size to 3G
Browse files Browse the repository at this point in the history
To be consistent with previous versions.

Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
  • Loading branch information
bk201 authored and starbops committed Sep 7, 2023
1 parent ea81492 commit 05f8a87
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion package/upgrade/upgrade_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,24 @@ upgrade_os() {
tmp_rootfs_mount=$(mktemp -d -p $HOST_DIR/tmp)
mount $tmp_rootfs_squashfs $tmp_rootfs_mount

tmp_elemental_config_dir=$(mktemp -d -p $HOST_DIR/tmp)
# adjust new active.img size
cat > $tmp_elemental_config_dir/config.yaml <<EOF
upgrade:
system:
size: 3072
EOF

# replace the fixed elemental CLI for fix elemental upgrade issues
new_elemental_cli=$SCRIPT_DIR/elemental
target_elemental_cli=$HOST_DIR/usr/bin/elemental
elemental_upgrade_log="${UPGRADE_TMP_DIR#"$HOST_DIR"}/elemental-upgrade-$(date +%Y%m%d%H%M%S).log"
local ret=0
mount --bind $new_elemental_cli $target_elemental_cli
chroot $HOST_DIR elemental upgrade --logfile "$elemental_upgrade_log" --directory ${tmp_rootfs_mount#"$HOST_DIR"} || ret=$?
chroot $HOST_DIR elemental upgrade \
--logfile "$elemental_upgrade_log" \
--directory ${tmp_rootfs_mount#"$HOST_DIR"} \
--config-dir ${tmp_elemental_config_dir#"$HOST_DIR"} || ret=$?
if [ "$ret" != 0 ]; then
echo "elemental upgrade failed with return code: $ret"
cat "$HOST_DIR$elemental_upgrade_log"
Expand Down

0 comments on commit 05f8a87

Please sign in to comment.