mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
tree: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
25ea9c38f3
commit
8303c5fc78
Binary file not shown.
Binary file not shown.
@ -14,32 +14,9 @@
|
||||
# or
|
||||
# sudo -i /volume1/scripts/syno_hdd_db.sh -force -showedits
|
||||
#--------------------------------------------------------------------------------------------------
|
||||
# https://smarthdd.com/database/
|
||||
|
||||
# CHANGES
|
||||
# Bug fix for when there's multiple expansion unit models only the last expansion unit was processed. Issue #288
|
||||
# Bug fix for when there's multiple M2 adaptor card models only the last M2 card was processed.
|
||||
# Bug fix for incorrectly matching model name variations as well as the exact model name.
|
||||
# - e.g. RX1217 matched RX1217, RX1217rp and RX1217sas.
|
||||
#
|
||||
# Changed to enable creating storage pools/volumes on NVMe drives in a PCIe M.2 adaptor even if
|
||||
# PCIe M.2 adaptor not found. This may allow creating NVMe volumes on 3rd party PCIe M.2 adaptors.
|
||||
#
|
||||
# Bug fix for -s, --showedits option for multiple of the same drive model
|
||||
# but with different firmware versions. Issue #276
|
||||
#
|
||||
# Changed disabling memory compatibility for older models. Issue #272
|
||||
#
|
||||
# Hard coded /usr/syno/bin/<command> for Synology commands (to prevent $PATH issues).
|
||||
#
|
||||
# Now enables creating storage pools in Storage Manager for M.2 drives in PCIe adaptor cards.
|
||||
# - E10M20-T1, M2D20, M2D18, M2D17 and FX2422N
|
||||
#
|
||||
# Added new vendor ids for Apacer, aigo, Lexar and Transcend NVMe drives.
|
||||
#
|
||||
# Now includes syno_hdd_vendor_ids.txt so users can add their NVMe drive's vendor id.
|
||||
# - syno_hdd_vendor_ids.txt needs to be in the same folder as syno_hdd_db.sh
|
||||
#
|
||||
# Now warns if script is located on an M.2 volume.
|
||||
# RECENT CHANGES
|
||||
|
||||
# TODO
|
||||
# Enable SMART Attributes button on Storage Manager
|
||||
@ -48,7 +25,7 @@
|
||||
# /var/packages/StorageManager/target/ui/storage_panel.js
|
||||
|
||||
|
||||
scriptver="v3.5.90"
|
||||
scriptver="v3.5.94"
|
||||
script=Synology_HDD_db
|
||||
repo="007revad/Synology_HDD_db"
|
||||
scriptname=syno_hdd_db
|
||||
@ -359,6 +336,7 @@ echo "Running from: ${scriptpath}/$scriptfile"
|
||||
scriptvol=$(echo "$scriptpath" | cut -d"/" -f2)
|
||||
vg=$(lvdisplay | grep /volume_"${scriptvol#volume}" | cut -d"/" -f3)
|
||||
md=$(pvdisplay | grep -B 1 -E '[ ]'"$vg" | grep /dev/ | cut -d"/" -f3)
|
||||
# shellcheck disable=SC2002 # Don't warn about "Useless cat"
|
||||
if cat /proc/mdstat | grep "$md" | grep nvme >/dev/null; then
|
||||
echo -e "\n${Yellow}WARNING${Off} Don't store this script on an NVMe volume!"
|
||||
fi
|
||||
@ -386,7 +364,7 @@ cleanup_tmp(){
|
||||
fi
|
||||
|
||||
# Add warning to DSM log
|
||||
if [[ -z $cleanup_err ]]; then
|
||||
if [[ $cleanup_err ]]; then
|
||||
syslog_set warn "$script update failed to delete tmp files"
|
||||
fi
|
||||
}
|
||||
@ -684,13 +662,11 @@ if [[ $restore == "yes" ]]; then
|
||||
# Update .db files from Synology
|
||||
/usr/syno/bin/syno_disk_db_update --update
|
||||
|
||||
# Enable SynoMemCheck.service for DVA models
|
||||
if [[ ${model:0:3} == "dva" ]]; then
|
||||
# Enable SynoMemCheck.service if disabled
|
||||
memcheck="/usr/lib/systemd/system/SynoMemCheck.service"
|
||||
if [[ $(/usr/syno/bin/synogetkeyvalue "$memcheck" ExecStart) == "/bin/true" ]]; then
|
||||
/usr/syno/bin/synosetkeyvalue "$memcheck" ExecStart /usr/syno/bin/syno_mem_check
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ -z $restoreerr ]]; then
|
||||
echo -e "\nRestore successful."
|
||||
@ -770,6 +746,18 @@ set_vendor(){
|
||||
if ! grep "$vid" "$vidfile2" >/dev/null; then
|
||||
/usr/syno/bin/synosetkeyvalue "$vidfile2" "${vid,,}" "$vendor"
|
||||
fi
|
||||
|
||||
# Add leading 0 to short vid (change 0x5dc to 0x05dc)
|
||||
if [[ ${#vid} -eq "5" ]]; then
|
||||
vid="0x0${vid: -3}"
|
||||
fi
|
||||
if ! grep "$vid" "$vidfile" >/dev/null; then
|
||||
/usr/syno/bin/synosetkeyvalue "$vidfile" "${vid,,}" "$vendor"
|
||||
fi
|
||||
if ! grep "$vid" "$vidfile2" >/dev/null; then
|
||||
/usr/syno/bin/synosetkeyvalue "$vidfile2" "${vid,,}" "$vendor"
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -810,6 +798,15 @@ fixdrivemodel(){
|
||||
fi
|
||||
}
|
||||
|
||||
get_size_gb(){
|
||||
# $1 is /sys/block/sata1 or /sys/block/nvme0n1 etc
|
||||
local float
|
||||
local int
|
||||
float=$(synodisk --info /dev/"$(basename -- "$1")" | grep 'Total capacity' | awk '{print $4 * 1.0737}')
|
||||
int="${float%.*}"
|
||||
echo "$int"
|
||||
}
|
||||
|
||||
getdriveinfo(){
|
||||
# $1 is /sys/block/sata1 etc
|
||||
|
||||
@ -828,13 +825,28 @@ getdriveinfo(){
|
||||
#fwrev=$(cat "$1/device/rev")
|
||||
#fwrev=$(printf "%s" "$fwrev" | xargs) # trim leading and trailing white space
|
||||
|
||||
device="/dev/$(basename -- "$1")"
|
||||
device=/dev/"$(basename -- "$1")"
|
||||
#fwrev=$(/usr/syno/bin/syno_hdd_util --ssd_detect | grep "$device " | awk '{print $2}') # GitHub issue #86, 87
|
||||
# Account for SSD drives with spaces in their model name/number
|
||||
fwrev=$(/usr/syno/bin/syno_hdd_util --ssd_detect | grep "$device " | awk '{print $(NF-3)}') # GitHub issue #86, 87
|
||||
|
||||
# Get M.2 SATA SSD firmware version
|
||||
if [[ -z $fwrev ]]; then
|
||||
dev=/dev/"$(basename -- "$1")"
|
||||
fwrev=$(smartctl -a -d sat -T permissive "$dev" | grep -i firmware | awk '{print $NF}')
|
||||
fi
|
||||
|
||||
# Get drive GB size
|
||||
size_gb=$(get_size_gb "$1")
|
||||
|
||||
if [[ $hdmodel ]] && [[ $fwrev ]]; then
|
||||
hdlist+=("${hdmodel},${fwrev}")
|
||||
if /usr/syno/bin/synodisk --enum -t cache | grep -q /dev/"$(basename -- "$1")"; then
|
||||
# Is SATA M.2 SSD
|
||||
nvmelist+=("${hdmodel},${fwrev},${size_gb}")
|
||||
else
|
||||
hdlist+=("${hdmodel},${fwrev},${size_gb}")
|
||||
fi
|
||||
drivelist+=("${hdmodel}")
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -850,8 +862,12 @@ getm2info(){
|
||||
fi
|
||||
nvmefw=$(printf "%s" "$nvmefw" | xargs) # trim leading and trailing white space
|
||||
|
||||
# Get drive GB size
|
||||
size_gb=$(get_size_gb "$1")
|
||||
|
||||
if [[ $nvmemodel ]] && [[ $nvmefw ]]; then
|
||||
nvmelist+=("${nvmemodel},${nvmefw}")
|
||||
nvmelist+=("${nvmemodel},${nvmefw},${size_gb}")
|
||||
drivelist+=("${nvmemodel}")
|
||||
fi
|
||||
}
|
||||
|
||||
@ -883,58 +899,70 @@ getcardmodel(){
|
||||
}
|
||||
|
||||
m2_pool_support(){
|
||||
# M.2 drives in M2 adaptor card do not support storage pools
|
||||
# M.2 drives in M2 adaptor card do not officially support storage pools
|
||||
if [[ -f /run/synostorage/disks/"$(basename -- "$1")"/m2_pool_support ]]; then # GitHub issue #86, 87
|
||||
echo -n 1 > /run/synostorage/disks/"$(basename -- "$1")"/m2_pool_support
|
||||
fi
|
||||
}
|
||||
|
||||
m2_drive(){
|
||||
# $1 is nvme1 etc
|
||||
# $2 is drive type (nvme or nvc)
|
||||
if [[ $m2 != "no" ]]; then
|
||||
# Check if is NVMe or SATA M.2 SSD
|
||||
if /usr/syno/bin/synodisk --enum -t cache | grep -q /dev/"$(basename -- "$1")"; then
|
||||
|
||||
if [[ $2 == "nvme" ]] || [[ $2 == "nvc" ]]; then
|
||||
# Fix unknown vendor id if needed. GitHub issue #161
|
||||
# "Failed to get disk vendor" from synonvme --vendor-get
|
||||
# causes "Unsupported firmware version" warning.
|
||||
get_vid /dev/"$(basename -- "$1")"
|
||||
|
||||
# Get M2 model and firmware version
|
||||
getm2info "$1" "$2"
|
||||
fi
|
||||
|
||||
# Get M.2 card model if in M.2 card
|
||||
getcardmodel /dev/"$(basename -- "$1")"
|
||||
|
||||
# Enable creating M.2 storage pool and volume in Storage Manager
|
||||
m2_pool_support "$1"
|
||||
|
||||
rebootmsg=yes # Show reboot message at end
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
for d in /sys/block/*; do
|
||||
# $d is /sys/block/sata1 etc
|
||||
case "$(basename -- "${d}")" in
|
||||
sd*|hd*)
|
||||
if [[ $d =~ [hs]d[a-z][a-z]?$ ]]; then
|
||||
# Get drive model and firmware version
|
||||
getdriveinfo "$d"
|
||||
fi
|
||||
;;
|
||||
sata*|sas*)
|
||||
if [[ $d =~ (sas|sata)[0-9][0-9]?[0-9]?$ ]]; then
|
||||
# Get drive model and firmware version
|
||||
sas*)
|
||||
if [[ $d =~ sas[0-9][0-9]?[0-9]?$ ]]; then
|
||||
getdriveinfo "$d"
|
||||
fi
|
||||
;;
|
||||
sata*)
|
||||
if [[ $d =~ sata[0-9][0-9]?[0-9]?$ ]]; then
|
||||
getdriveinfo "$d"
|
||||
|
||||
# In case it's a SATA M.2 SSD in device tree model NAS
|
||||
# M.2 SATA drives in M2D18 or M2S17
|
||||
m2_drive "$d"
|
||||
fi
|
||||
;;
|
||||
nvme*)
|
||||
if [[ $d =~ nvme[0-9][0-9]?n[0-9][0-9]?$ ]]; then
|
||||
if [[ $m2 != "no" ]]; then
|
||||
# Fix unknown vendor id if needed. GitHub issue #161
|
||||
# "Failed to get disk vendor" from synonvme --vendor-get
|
||||
# causes "Unsupported firmware version" warning.
|
||||
get_vid "/dev/$(basename -- "${d}")"
|
||||
|
||||
getm2info "$d" "nvme"
|
||||
# Get M.2 card model if in M.2 card
|
||||
getcardmodel "/dev/$(basename -- "${d}")"
|
||||
|
||||
# Enable creating M.2 storage pool and volume in Storage Manager
|
||||
m2_pool_support "$d"
|
||||
|
||||
rebootmsg=yes # Show reboot message at end
|
||||
fi
|
||||
m2_drive "$d" "nvme"
|
||||
fi
|
||||
;;
|
||||
nvc*) # M.2 SATA drives (in PCIe card only?)
|
||||
nvc*) # M.2 SATA drives (in PCIe M2D18 or M2S17 only?)
|
||||
if [[ $d =~ nvc[0-9][0-9]?$ ]]; then
|
||||
if [[ $m2 != "no" ]]; then
|
||||
getm2info "$d" "nvc"
|
||||
# Get M.2 card model if in M.2 card
|
||||
getcardmodel "/dev/$(basename -- "${d}")"
|
||||
|
||||
# Enable creating M.2 storage pool and volume in Storage Manager
|
||||
m2_pool_support "$d"
|
||||
|
||||
rebootmsg=yes # Show reboot message at end
|
||||
fi
|
||||
m2_drive "$d" "nvc"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@ -948,15 +976,14 @@ if [[ ${#hdlist[@]} -gt "0" ]]; then
|
||||
done < <(printf "%s\0" "${hdlist[@]}" | sort -uz)
|
||||
fi
|
||||
|
||||
# Check hdds array isn't empty
|
||||
# Show hdds if hdds array isn't empty
|
||||
if [[ ${#hdds[@]} -eq "0" ]]; then
|
||||
ding
|
||||
echo -e "\n${Error}ERROR${Off} No drives found!" && exit 2
|
||||
echo -e "No SATA or SAS drives found\n"
|
||||
else
|
||||
echo -e "\nHDD/SSD models found: ${#hdds[@]}"
|
||||
num="0"
|
||||
while [[ $num -lt "${#hdds[@]}" ]]; do
|
||||
echo "${hdds[num]}"
|
||||
echo "${hdds[num]} GB"
|
||||
num=$((num +1))
|
||||
done
|
||||
echo
|
||||
@ -970,7 +997,7 @@ if [[ ${#nvmelist[@]} -gt "0" ]]; then
|
||||
done < <(printf "%s\0" "${nvmelist[@]}" | sort -uz)
|
||||
fi
|
||||
|
||||
# Check nvmes array isn't empty
|
||||
# Show nvmes if nvmes array isn't empty
|
||||
if [[ $m2 != "no" ]]; then
|
||||
if [[ ${#nvmes[@]} -eq "0" ]]; then
|
||||
echo -e "No M.2 drives found\n"
|
||||
@ -979,7 +1006,7 @@ if [[ $m2 != "no" ]]; then
|
||||
echo "M.2 drive models found: ${#nvmes[@]}"
|
||||
num="0"
|
||||
while [[ $num -lt "${#nvmes[@]}" ]]; do
|
||||
echo "${nvmes[num]}"
|
||||
echo "${nvmes[num]} GB"
|
||||
num=$((num +1))
|
||||
done
|
||||
echo
|
||||
@ -987,6 +1014,13 @@ if [[ $m2 != "no" ]]; then
|
||||
fi
|
||||
|
||||
|
||||
# Exit if no drives found
|
||||
if [[ ${#hdds[@]} -eq "0" ]] && [[ ${#nvmes[@]} -eq "0" ]]; then
|
||||
ding
|
||||
echo -e "\n${Error}ERROR${Off} No drives found!" && exit 2
|
||||
fi
|
||||
|
||||
|
||||
# M.2 card db files
|
||||
# Sort m2carddblist array into new m2carddbs array to remove duplicates
|
||||
if [[ ${#m2carddblist[@]} -gt "0" ]]; then
|
||||
@ -1051,7 +1085,6 @@ else
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# Check databases and add our drives if needed
|
||||
|
||||
@ -1197,6 +1230,7 @@ editdb7(){
|
||||
updatedb(){
|
||||
hdmodel=$(printf "%s" "$1" | cut -d"," -f 1)
|
||||
fwrev=$(printf "%s" "$1" | cut -d"," -f 2)
|
||||
size_gb=$(printf "%s" "$1" | cut -d"," -f 3)
|
||||
|
||||
#echo arg1 "$1" >&2 # debug
|
||||
#echo arg2 "$2" >&2 # debug
|
||||
@ -1211,15 +1245,23 @@ updatedb(){
|
||||
if grep "$hdmodel"'":{"'"$fwrev" "$2" >/dev/null; then
|
||||
echo -e "${Yellow}$hdmodel${Off} already exists in ${Cyan}$(basename -- "$2")${Off}" >&2
|
||||
else
|
||||
fwstrng=\"$fwrev\"
|
||||
fwstrng="$fwstrng":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\"
|
||||
fwstrng="$fwstrng":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true,
|
||||
fwstrng="$fwstrng"\"smart_test_ignore\":false,\"smart_attr_ignore\":false}]},
|
||||
common_string=\"size_gb\":$size_gb,
|
||||
common_string="$common_string"\"compatibility_interval\":[{
|
||||
common_string="$common_string"\"compatibility\":\"support\",
|
||||
common_string="$common_string"\"not_yet_rolling_status\":\"support\",
|
||||
common_string="$common_string"\"fw_dsm_update_status_notify\":false,
|
||||
common_string="$common_string"\"barebone_installable\":true,
|
||||
common_string="$common_string"\"barebone_installable_v2\":\"auto\",
|
||||
common_string="$common_string"\"smart_test_ignore\":false,
|
||||
common_string="$common_string"\"smart_attr_ignore\":false
|
||||
|
||||
default=\"default\"
|
||||
default="$default":{\"compatibility_interval\":[{\"compatibility\":\"support\",\"not_yet_rolling_status\"
|
||||
default="$default":\"support\",\"fw_dsm_update_status_notify\":false,\"barebone_installable\":true,
|
||||
default="$default"\"smart_test_ignore\":false,\"smart_attr_ignore\":false}]}}}
|
||||
fwstrng=\"$fwrev\":{
|
||||
fwstrng="$fwstrng$common_string"
|
||||
fwstrng="$fwstrng"}]},
|
||||
|
||||
default=\"default\":{
|
||||
default="$default$common_string"
|
||||
default="$default"}]}}}
|
||||
|
||||
# Synology misspelt compatibility as compatbility
|
||||
if grep '"disk_compatbility_info":{}' "$2" >/dev/null; then
|
||||
@ -1793,6 +1835,7 @@ fi
|
||||
|
||||
|
||||
# Enable nvme support
|
||||
# shellcheck disable=SC2010 # Don't warn about "Don't use ls | grep"
|
||||
if ls /dev | grep nvme >/dev/null ; then
|
||||
if [[ $m2 != "no" ]]; then
|
||||
# Check if nvme support is enabled
|
||||
@ -1824,7 +1867,8 @@ fi
|
||||
|
||||
|
||||
# Enable m2 volume support
|
||||
if ls /dev | grep nv[em] >/dev/null ; then
|
||||
# shellcheck disable=SC2010 # Don't warn about "Don't use ls | grep"
|
||||
if ls /dev | grep "nv[em]" >/dev/null ; then
|
||||
if [[ $m2 != "no" ]]; then
|
||||
if [[ $m2exists == "yes" ]]; then
|
||||
# Check if m2 volume support is enabled
|
||||
@ -1966,32 +2010,25 @@ fi
|
||||
# Finished
|
||||
|
||||
show_changes(){
|
||||
# Assign passed drive models array to my_array
|
||||
local my_array=("$@")
|
||||
local drive_models=()
|
||||
for i in "${!my_array[@]}"; do
|
||||
drive_models+=$(printf "%s" "${my_array[i]}" | cut -d"," -f 1)
|
||||
done
|
||||
# Sort array to remove duplicates
|
||||
IFS=$'\n'
|
||||
drives_sorted=($(sort -u <<<"${drive_models[*]}"))
|
||||
unset IFS
|
||||
for drive_model in "${drives_sorted[@]}"; do
|
||||
# $1 is drive_model,firmware_version,size_gb
|
||||
drive_model="$(printf "%s" "$1" | cut -d"," -f 1)"
|
||||
echo -e "\n$drive_model:"
|
||||
jq -r --arg drive_model "$drive_model" '.disk_compatbility_info[$drive_model]' "${db1list[0]}"
|
||||
done
|
||||
}
|
||||
|
||||
# Show the changes
|
||||
if [[ ${showedits,,} == "yes" ]]; then
|
||||
# HDDs/SSDs
|
||||
show_changes "${hdds[@]}"
|
||||
for d in "${hdds[@]}"; do
|
||||
show_changes "$d"
|
||||
done
|
||||
|
||||
# NVMe drives
|
||||
show_changes "${nvmes[@]}"
|
||||
for d in "${nvmes[@]}"; do
|
||||
show_changes "$d"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Make Synology check disk compatibility
|
||||
if [[ -f /usr/syno/sbin/synostgdisk ]]; then # DSM 6.2.3 does not have synostgdisk
|
||||
/usr/syno/sbin/synostgdisk --check-all-disks-compatibility
|
||||
|
Binary file not shown.
Binary file not shown.
@ -9,8 +9,6 @@
|
||||
if [ "${1}" = "early" ]; then
|
||||
echo "Installing addon misc - ${1}"
|
||||
|
||||
[ ! -L "/usr/sbin/modinfo" ] && ln -vsf /usr/bin/kmod /usr/sbin/modinfo
|
||||
|
||||
# [CREATE][failed] Raidtool initsys
|
||||
SO_FILE="/usr/syno/bin/scemd"
|
||||
[ ! -f "${SO_FILE}.bak" ] && cp -vf "${SO_FILE}" "${SO_FILE}.bak"
|
||||
@ -125,7 +123,7 @@ EOF
|
||||
elif [ "${1}" = "patches" ]; then
|
||||
# Set static IP from cmdline
|
||||
if grep -q 'network.' /proc/cmdline; then
|
||||
for I in $(grep -o 'network.[0-9a-fA-F:]\{12,17\}=[^ ]*' /proc/cmdline); do
|
||||
for I in $(grep -oE 'network.[0-9a-fA-F:]{12,17}=[^ ]*' /proc/cmdline); do
|
||||
MACR="$(echo "${I}" | cut -d. -f2 | cut -d= -f1 | sed 's/://g' | tr '[:upper:]' '[:lower:]')"
|
||||
IPRS="$(echo "${I}" | cut -d= -f2)"
|
||||
for ETH in $(ls /sys/class/net/ 2>/dev/null | grep eth); do
|
||||
@ -139,7 +137,7 @@ elif [ "${1}" = "patches" ]; then
|
||||
echo "IPADDR=$(echo "${IPRS}" | cut -d/ -f1)" >>/etc/sysconfig/network-scripts/ifcfg-${ETH}
|
||||
echo "NETMASK=$(echo "${IPRS}" | cut -d/ -f2)" >>/etc/sysconfig/network-scripts/ifcfg-${ETH}
|
||||
echo "GATEWAY=$(echo "${IPRS}" | cut -d/ -f3)" >>/etc/sysconfig/network-scripts/ifcfg-${ETH}
|
||||
echo "${ETH}" >> /etc/ifcfgs
|
||||
echo "${ETH}" >>/etc/ifcfgs
|
||||
fi
|
||||
done
|
||||
done
|
||||
@ -201,6 +199,27 @@ elif [ "${1}" = "late" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# service
|
||||
SERVICE_PATH="/tmpRoot/usr/lib/systemd/system"
|
||||
sed -i 's|ExecStart=/|ExecStart=-/|g' ${SERVICE_PATH}/syno-oob-check-status.service ${SERVICE_PATH}/SynoInitEth.service ${SERVICE_PATH}/syno_update_disk_logs.service
|
||||
if [ ! -f /tmpRoot/usr/lib/systemd/system/getty\@.service ]; then
|
||||
cp -fv /tmpRoot/usr/lib/systemd/system/serial-getty\@.service /tmpRoot/usr/lib/systemd/system/getty\@.service
|
||||
sed -i 's|^ExecStart=.*|ExecStart=-/sbin/agetty %I 115200 linux|' /tmpRoot/usr/lib/systemd/system/getty\@.service
|
||||
fi
|
||||
# getty
|
||||
for I in $(cat /proc/cmdline 2>/dev/null | grep -oE 'getty=[^ ]+' | sed 's/getty=//'); do
|
||||
TTYN="$(echo "${I}" | cut -d',' -f1)"
|
||||
BAUD="$(echo "${I}" | cut -d',' -f2 | cut -d'n' -f1)"
|
||||
echo "ttyS0 ttyS1 ttyS2" | grep -qw "${TTYN}" && continue
|
||||
|
||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/getty.target.wants
|
||||
if [ -n "${TTYN}" ] && [ -e "/dev/${TTYN}" ]; then
|
||||
echo "Make getty\@${TTYN}.service"
|
||||
cp -vf /tmpRoot/usr/lib/systemd/system/getty\@.service /tmpRoot/usr/lib/systemd/system/getty.target.wants/getty\@${TTYN}.service
|
||||
[ -n "${BAUD}" ] && sed -i "s|115200 linux|${BAUD} linux|" /tmpRoot/usr/lib/systemd/system/getty.target.wants/getty\@${TTYN}.service
|
||||
fi
|
||||
done
|
||||
|
||||
# Open-VM-Tools Fix
|
||||
if [ -d /tmpRoot/var/packages/open-vm-tools ]; then
|
||||
sed -i 's/package/root/g' /tmpRoot/var/packages/open-vm-tools/conf/privilege
|
||||
@ -211,10 +230,6 @@ elif [ "${1}" = "late" ]; then
|
||||
sed -i 's/package/root/g' /tmpRoot/var/packages/qemu-ga/conf/privilege
|
||||
fi
|
||||
|
||||
# OOB Service
|
||||
SERVICE_PATH="/tmpRoot/usr/lib/systemd/system"
|
||||
sed -i 's|ExecStart=/|ExecStart=-/|g' ${SERVICE_PATH}/syno-oob-check-status.service ${SERVICE_PATH}/SynoInitEth.service ${SERVICE_PATH}/syno_update_disk_logs.service
|
||||
|
||||
# SD Card
|
||||
cp -f /tmpRoot/usr/lib/udev/script/sdcard.sh /tmpRoot/usr/lib/udev/script/sdcard.sh.bak
|
||||
echo -en '#!/bin/sh\nexit 0\n' >/tmpRoot/usr/lib/udev/script/sdcard.sh
|
||||
|
@ -55,21 +55,20 @@ elif [ "${1}" = "late" ]; then
|
||||
|
||||
mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
||||
DEST="/tmpRoot/usr/lib/systemd/system/nvmesystem.service"
|
||||
cat > ${DEST} <<EOF
|
||||
[Unit]
|
||||
Description=Modify storage panel
|
||||
After=multi-user.target
|
||||
After=synoscgi.service
|
||||
After=storagepanel.service
|
||||
echo "[Unit]" >${DEST}
|
||||
echo "Description=Modify storage panel" >>${DEST}
|
||||
echo "After=multi-user.target" >>${DEST}
|
||||
echo "After=synoscgi.service" >>${DEST}
|
||||
echo "After=storagepanel.service" >>${DEST} # storagepanel
|
||||
echo >>${DEST}
|
||||
echo "[Service]" >>${DEST}
|
||||
echo "Type=oneshot" >>${DEST}
|
||||
echo "RemainAfterExit=yes" >>${DEST}
|
||||
echo "ExecStart=/usr/bin/nvmesystem.sh" >>${DEST}
|
||||
echo >>${DEST}
|
||||
echo "[Install]" >>${DEST}
|
||||
echo "WantedBy=multi-user.target" >>${DEST}
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/bin/nvmesystem.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
|
||||
ln -vsf /usr/lib/systemd/system/nvmesystem.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/nvmesystem.service
|
||||
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user