Skip to content

Commit

Permalink
functions: cleanup code
Browse files Browse the repository at this point in the history
Signed-off-by: AuxXxilium <[email protected]>
  • Loading branch information
AuxXxilium committed May 22, 2024
1 parent c2beb03 commit d51add1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions files/initrd/opt/arc/include/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -423,16 +423,12 @@ function livepatch() {
if ! ${ARC_PATH}/zimage-patch.sh; then
FAIL=1
else
ZIMAGE_HASH_CUR="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
writeConfigKey "zimage-hash" "${ZIMAGE_HASH_CUR}" "${USER_CONFIG_FILE}"
FAIL=0
fi
# Patch Ramdisk
if ! ${ARC_PATH}/ramdisk-patch.sh; then
FAIL=1
else
RAMDISK_HASH_CUR="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
writeConfigKey "ramdisk-hash" "${RAMDISK_HASH_CUR}" "${USER_CONFIG_FILE}"
FAIL=0
fi
OFFLINE="$(readConfigKey "arc.offline" "${USER_CONFIG_FILE}")"
Expand All @@ -447,16 +443,12 @@ function livepatch() {
if ! ${ARC_PATH}/zimage-patch.sh; then
FAIL=1
else
ZIMAGE_HASH_CUR="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
writeConfigKey "zimage-hash" "${ZIMAGE_HASH_CUR}" "${USER_CONFIG_FILE}"
FAIL=0
fi
# Patch Ramdisk
if ! ${ARC_PATH}/ramdisk-patch.sh; then
FAIL=1
else
RAMDISK_HASH_CUR="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
writeConfigKey "ramdisk-hash" "${RAMDISK_HASH_CUR}" "${USER_CONFIG_FILE}"
FAIL=0
fi
fi
Expand All @@ -467,6 +459,10 @@ function livepatch() {
sleep 5
exit 1
else
ZIMAGE_HASH_CUR="$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')"
writeConfigKey "zimage-hash" "${ZIMAGE_HASH_CUR}" "${USER_CONFIG_FILE}"
RAMDISK_HASH_CUR="$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')"
writeConfigKey "ramdisk-hash" "${RAMDISK_HASH_CUR}" "${USER_CONFIG_FILE}"
echo "DSM Image patched - Ready!"
fi
}

0 comments on commit d51add1

Please sign in to comment.