mirror of
https://github.com/bin456789/reinstall.git
synced 2025-06-07 21:09:56 +00:00
core: 修复新系统没有 /usr/lib/systemd/system-preset 文件夹时报错
This commit is contained in:
parent
8b60b7d2df
commit
efb1614b6b
@ -22,6 +22,7 @@ ExecStart=/usr/bin/env bash /fix-eth-name.sh
|
|||||||
ExecStart=/usr/bin/env rm -f /fix-eth-name.sh
|
ExecStart=/usr/bin/env rm -f /fix-eth-name.sh
|
||||||
ExecStart=/usr/bin/env rm -f /etc/systemd/system/fix-eth-name.service
|
ExecStart=/usr/bin/env rm -f /etc/systemd/system/fix-eth-name.service
|
||||||
ExecStart=/usr/bin/env rm -f /etc/systemd/system/multi-user.target.wants/fix-eth-name.service
|
ExecStart=/usr/bin/env rm -f /etc/systemd/system/multi-user.target.wants/fix-eth-name.service
|
||||||
|
ExecStart=/usr/bin/env rm -f /lib/systemd/system-preset/01-fix-eth-name.preset
|
||||||
ExecStart=/usr/bin/env rm -f /usr/lib/systemd/system-preset/01-fix-eth-name.preset
|
ExecStart=/usr/bin/env rm -f /usr/lib/systemd/system-preset/01-fix-eth-name.preset
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
6
trans.sh
6
trans.sh
@ -1681,7 +1681,13 @@ add_fix_eth_name_systemd_service() {
|
|||||||
# 因此需要设置 fix-eth-name 的 preset 状态
|
# 因此需要设置 fix-eth-name 的 preset 状态
|
||||||
# 不然首次开机 /etc/systemd/system/multi-user.target.wants/fix-eth-name.service 会被删除
|
# 不然首次开机 /etc/systemd/system/multi-user.target.wants/fix-eth-name.service 会被删除
|
||||||
# 通常 /etc/systemd/system-preset/ 文件夹要新建,因此不放在这里
|
# 通常 /etc/systemd/system-preset/ 文件夹要新建,因此不放在这里
|
||||||
|
|
||||||
|
# 可能是 /usr/lib/systemd/system-preset/ 或者 /lib/systemd/system-preset/
|
||||||
|
if [ -d "$os_dir/usr/lib/systemd/system-preset" ]; then
|
||||||
echo 'enable fix-eth-name.service' >"$os_dir/usr/lib/systemd/system-preset/01-fix-eth-name.preset"
|
echo 'enable fix-eth-name.service' >"$os_dir/usr/lib/systemd/system-preset/01-fix-eth-name.preset"
|
||||||
|
else
|
||||||
|
echo 'enable fix-eth-name.service' >"$os_dir/lib/systemd/system-preset/01-fix-eth-name.preset"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
basic_init() {
|
basic_init() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user