mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 04:49:13 +08:00
alpine: 兼容 v3.16
This commit is contained in:
parent
426b54a2d0
commit
6a17cab907
@ -1140,11 +1140,13 @@ EOF
|
|||||||
# udhcpc 添加 -n 参数,请求dhcp失败后退出
|
# udhcpc 添加 -n 参数,请求dhcp失败后退出
|
||||||
# 使用同样参数运行 udhcpc6
|
# 使用同样参数运行 udhcpc6
|
||||||
# TODO: digitalocean -i eth1?
|
# TODO: digitalocean -i eth1?
|
||||||
# shellcheck disable=SC2016
|
# $MOCK udhcpc -i "$device" -f -q # v3.18
|
||||||
orig_cmd="$(grep '$MOCK udhcpc' init)"
|
# udhcpc -i "$device" -f -q # v3.17
|
||||||
|
search='udhcpc -i'
|
||||||
|
orig_cmd="$(grep "$search" init)"
|
||||||
mod_cmd4="$orig_cmd -n || true"
|
mod_cmd4="$orig_cmd -n || true"
|
||||||
mod_cmd6="${mod_cmd4//udhcpc/udhcpc6}"
|
mod_cmd6="${mod_cmd4//udhcpc/udhcpc6}"
|
||||||
sed -i "/\$MOCK udhcpc/c$mod_cmd4 \n $mod_cmd6" init
|
sed -i "/$search/c$mod_cmd4 \n $mod_cmd6" init
|
||||||
|
|
||||||
# hack 3 /usr/share/udhcpc/default.script
|
# hack 3 /usr/share/udhcpc/default.script
|
||||||
# 脚本被调用的顺序
|
# 脚本被调用的顺序
|
||||||
|
10
trans.sh
10
trans.sh
@ -199,7 +199,8 @@ qemu_nbd() {
|
|||||||
|
|
||||||
mod_motd() {
|
mod_motd() {
|
||||||
# 安装后 alpine 后要恢复默认
|
# 安装后 alpine 后要恢复默认
|
||||||
if [ "$distro" = alpine ]; then
|
# 自动安装失败后,可能手动安装 alpine,因此无需判断 $distro
|
||||||
|
if ! [ -e /etc/motd.orig ]; then
|
||||||
cp /etc/motd /etc/motd.orig
|
cp /etc/motd /etc/motd.orig
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
echo 'mv /etc/motd.orig /etc/motd' |
|
echo 'mv /etc/motd.orig /etc/motd' |
|
||||||
@ -471,7 +472,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# scaleway block volume optimal_io_size 是 4M
|
# scaleway block volume optimal_io_size 是 4M
|
||||||
# setup-disk 用 cfdisk 从 1M 开始分区
|
# setup-disk 用 sfdisk 从 1M 开始分区
|
||||||
# 但 cfdisk 只能按 optimal_io_size 对齐分区,因此报错
|
# 但 cfdisk 只能按 optimal_io_size 对齐分区,因此报错
|
||||||
# 将 start 置空,则自动对齐到 optimal_io_size
|
# 将 start 置空,则自动对齐到 optimal_io_size
|
||||||
# https://oss.oracle.com/~mkp/docs/linux-advanced-storage.pdf
|
# https://oss.oracle.com/~mkp/docs/linux-advanced-storage.pdf
|
||||||
@ -583,8 +584,10 @@ EOF
|
|||||||
if [ -e /dev/input/event0 ]; then
|
if [ -e /dev/input/event0 ]; then
|
||||||
rc-update add acpid
|
rc-update add acpid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 3.16 没有 seedrng
|
||||||
rc-update add crond
|
rc-update add crond
|
||||||
rc-update add seedrng boot
|
rc-update add seedrng boot || true
|
||||||
|
|
||||||
# 如果是 vm 就用 virt 内核
|
# 如果是 vm 就用 virt 内核
|
||||||
if is_virt; then
|
if is_virt; then
|
||||||
@ -2053,6 +2056,7 @@ fi
|
|||||||
|
|
||||||
mod_motd
|
mod_motd
|
||||||
setup_tty_and_log
|
setup_tty_and_log
|
||||||
|
cat /proc/cmdline
|
||||||
clear_previous
|
clear_previous
|
||||||
add_community_repo
|
add_community_repo
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user