mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
debian: 优化更改 Priority 的速度
This commit is contained in:
parent
611ea3e69f
commit
3510865ca1
21
reinstall.sh
21
reinstall.sh
@ -2725,28 +2725,27 @@ mod_initrd_debian_kali() {
|
|||||||
get_ip_conf_cmd | insert_into_file $postinst after ": get_ip_conf_cmd"
|
get_ip_conf_cmd | insert_into_file $postinst after ": get_ip_conf_cmd"
|
||||||
# cat $postinst
|
# cat $postinst
|
||||||
|
|
||||||
# shellcheck disable=SC2317
|
|
||||||
change_priority() {
|
change_priority() {
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
key_=$(echo "$line" | cut -d' ' -f1)
|
if [[ "$line" = Package:* ]]; then
|
||||||
value=$(echo "$line" | cut -d' ' -f2-)
|
package=$(echo "$line" | cut -d' ' -f2-)
|
||||||
|
|
||||||
case "$key_" in
|
elif [[ "$line" = Priority:* ]]; then
|
||||||
Package:)
|
|
||||||
package="$value"
|
|
||||||
;;
|
|
||||||
Priority:)
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
if [ "$value" = standard ] && echo "$disabled_list" | grep -qx "$package"; then
|
if [ "$line" = "Priority: standard" ]; then
|
||||||
|
for p in $disabled_list; do
|
||||||
|
if [ "$package" = "$p" ]; then
|
||||||
line="Priority: optional"
|
line="Priority: optional"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
elif [[ "$package" = ata-modules* ]]; then
|
elif [[ "$package" = ata-modules* ]]; then
|
||||||
# 改成强制安装
|
# 改成强制安装
|
||||||
# 因为是 pata-modules sata-modules scsi-modules 的依赖
|
# 因为是 pata-modules sata-modules scsi-modules 的依赖
|
||||||
# 但我们没安装它们,也就不会自动安装 ata-modules
|
# 但我们没安装它们,也就不会自动安装 ata-modules
|
||||||
line="Priority: standard"
|
line="Priority: standard"
|
||||||
fi
|
fi
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
echo "$line"
|
echo "$line"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user