mirror of
https://github.com/AuxXxilium/arc.git
synced 2024-11-24 00:39:53 +07:00
tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
185381aff6
commit
d50c968a95
@ -1,3 +1,6 @@
|
||||
|
||||
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
|
||||
###############################################################################
|
||||
# Permits user edit the user config
|
||||
function editUserConfig() {
|
||||
|
@ -9,7 +9,6 @@
|
||||
. ${ARC_PATH}/include/modules.sh
|
||||
. ${ARC_PATH}/include/storage.sh
|
||||
. ${ARC_PATH}/include/network.sh
|
||||
. ${ARC_PATH}/include/update.sh
|
||||
. ${ARC_PATH}/arc-functions.sh
|
||||
|
||||
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
|
||||
|
@ -344,62 +344,6 @@ function convert_netmask() {
|
||||
echo "${bits}"
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Livepatch
|
||||
function livepatch() {
|
||||
FAIL=0
|
||||
# Patch zImage
|
||||
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}")"
|
||||
if [ "${OFFLINE}" = "false" ]; then
|
||||
# Looking for Update
|
||||
if [ ${FAIL} -eq 1 ]; then
|
||||
# Update Configs
|
||||
updateConfigs
|
||||
# Update Patches
|
||||
updatePatches
|
||||
# Patch zImage
|
||||
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
|
||||
fi
|
||||
if [ ${FAIL} -eq 1 ]; then
|
||||
echo
|
||||
echo -e "Patching DSM Files failed! Please stay patient for Update." 0 0
|
||||
sleep 5
|
||||
exit 1
|
||||
else
|
||||
echo "DSM Image patched - Ready!"
|
||||
fi
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Rebooting
|
||||
# (based on pocopico's TCRP code)
|
||||
|
@ -1,9 +1,5 @@
|
||||
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
|
||||
. ${ARC_PATH}/include/consts.sh
|
||||
. ${ARC_PATH}/include/configFile.sh
|
||||
. ${ARC_PATH}/include/functions.sh
|
||||
. ${ARC_PATH}/include/modules.sh
|
||||
[[ -z "${ARC_PATH}" || ! -d "${ARC_PATH}/include" ]] && ARC_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
|
||||
CUSTOM="$(readConfigKey "arc.custom" "${USER_CONFIG_FILE}")"
|
||||
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
|
||||
@ -346,4 +342,60 @@ function updateLKMs() {
|
||||
) 2>&1 | dialog --backtitle "$(backtitle)" --title "Update LKMs" \
|
||||
--progressbox "Updating LKMs..." 20 70
|
||||
return 0
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
# Livepatch
|
||||
function livepatch() {
|
||||
FAIL=0
|
||||
# Patch zImage
|
||||
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}")"
|
||||
if [ "${OFFLINE}" = "false" ]; then
|
||||
# Looking for Update
|
||||
if [ ${FAIL} -eq 1 ]; then
|
||||
# Update Configs
|
||||
updateConfigs
|
||||
# Update Patches
|
||||
updatePatches
|
||||
# Patch zImage
|
||||
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
|
||||
fi
|
||||
if [ ${FAIL} -eq 1 ]; then
|
||||
echo
|
||||
echo -e "Patching DSM Files failed! Please stay patient for Update." 0 0
|
||||
sleep 5
|
||||
exit 1
|
||||
else
|
||||
echo "DSM Image patched - Ready!"
|
||||
fi
|
||||
}
|
@ -8,7 +8,6 @@
|
||||
. ${ARC_PATH}/include/addons.sh
|
||||
. ${ARC_PATH}/include/modules.sh
|
||||
. ${ARC_PATH}/include/network.sh
|
||||
. ${ARC_PATH}/include/update.sh
|
||||
|
||||
[ -z "${LOADER_DISK}" ] && die "Loader Disk not found!"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user