alpine: 兼容 v3.16

This commit is contained in:
bin456789 2023-11-28 23:59:17 +08:00
parent 426b54a2d0
commit 6a17cab907
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B
2 changed files with 12 additions and 6 deletions

View File

@ -1140,11 +1140,13 @@ EOF
# udhcpc 添加 -n 参数请求dhcp失败后退出
# 使用同样参数运行 udhcpc6
# TODO: digitalocean -i eth1?
# shellcheck disable=SC2016
orig_cmd="$(grep '$MOCK udhcpc' init)"
# $MOCK udhcpc -i "$device" -f -q # v3.18
# udhcpc -i "$device" -f -q # v3.17
search='udhcpc -i'
orig_cmd="$(grep "$search" init)"
mod_cmd4="$orig_cmd -n || true"
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
# 脚本被调用的顺序

View File

@ -199,7 +199,8 @@ qemu_nbd() {
mod_motd() {
# 安装后 alpine 后要恢复默认
if [ "$distro" = alpine ]; then
# 自动安装失败后,可能手动安装 alpine因此无需判断 $distro
if ! [ -e /etc/motd.orig ]; then
cp /etc/motd /etc/motd.orig
# shellcheck disable=SC2016
echo 'mv /etc/motd.orig /etc/motd' |
@ -471,7 +472,7 @@ EOF
fi
# scaleway block volume optimal_io_size 是 4M
# setup-disk 用 cfdisk 从 1M 开始分区
# setup-disk 用 sfdisk 从 1M 开始分区
# 但 cfdisk 只能按 optimal_io_size 对齐分区,因此报错
# 将 start 置空,则自动对齐到 optimal_io_size
# https://oss.oracle.com/~mkp/docs/linux-advanced-storage.pdf
@ -583,8 +584,10 @@ EOF
if [ -e /dev/input/event0 ]; then
rc-update add acpid
fi
# 3.16 没有 seedrng
rc-update add crond
rc-update add seedrng boot
rc-update add seedrng boot || true
# 如果是 vm 就用 virt 内核
if is_virt; then
@ -2053,6 +2056,7 @@ fi
mod_motd
setup_tty_and_log
cat /proc/cmdline
clear_previous
add_community_repo