全球主机交流论坛

标题: 谁会把德机 euserv的系统转成alpine,有个ovz的脚本一用就挂了 [打印本页]

作者: 抛砖引玉    时间: 2022-9-19 09:49
标题: 谁会把德机 euserv的系统转成alpine,有个ovz的脚本一用就挂了
最近又喜欢上了alpine
作者: LEB    时间: 2022-9-19 09:50
不用德鸡就好了
作者: 蒙面人    时间: 2022-9-19 09:50
netboot.xyz不行吗
作者: breakmyheart    时间: 2022-9-19 10:48
https://gist.github.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d
这个试了吗

作者: Smilence    时间: 2022-9-19 11:10
alpine有啥优势吗?
作者: yrj    时间: 2022-9-19 13:12
Smilence 发表于 2022-9-19 11:10
alpine有啥优势吗?

就是小吧,一般docker用的
作者: 表妹    时间: 2022-9-19 14:01
提示: 作者被禁止或删除 内容自动屏蔽
作者: 抛砖引玉    时间: 2022-9-19 19:10
breakmyheart 发表于 2022-9-19 10:48
https://gist.github.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d
这个试了吗

试的就是这个,不行
作者: 抛砖引玉    时间: 2022-9-19 19:12
表妹 发表于 2022-9-19 14:01
我自己写了一个

分享出来啊 我的亲妹
作者: huanx    时间: 2022-9-19 19:17
我也之前转过 没转成功..
作者: ChinaDNS    时间: 2022-9-19 19:17
LXC直接把修改网络配置那块改成复制interfaces就行了
作者: 抛砖引玉    时间: 2022-9-19 22:20
ChinaDNS 发表于 2022-9-19 19:17
LXC直接把修改网络配置那块改成复制interfaces就行了

#!/bin/sh -e
# Converts OpenVZ VPS to Alpine Linux
# WARNING: This script will wipe any data in your VPS!
# GPLv2; Partly based on https://gitlab.com/drizzt/vps2arch

server=http://images.linuxcontainers.org
path=$(wget -O- ${server}/meta/1.0/index-system | \
grep -v edge | awk '-F;' '($1=="alpine" && $3=="amd64") {print $NF}' | tail -1)

cd /
mkdir /x
wget ${server}/${path}/rootfs.tar.xz
tar -C /x -xf rootfs.tar.xz

sed -i '/getty/d' /x/etc/inittab
sed -i 's/rc_sys="lxc"/rc_sys="lxc"/' /x/etc/rc.conf

# save root password and ssh directory
sed -i '/^root:/d' /x/etc/shadow
grep '^root:' /etc/shadow >> /x/etc/shadow
[ -d /root/.ssh ] && cp -a /root/.ssh /x/root/

cp /etc/network/interfaces /x/etc/network/interfaces
cp /etc/resolv.conf /x/etc/resolv.conf

# remove all old files and replace with alpine rootfs
find / \( ! -path '/dev/*' -and ! -path '/proc/*' -and ! -path '/sys/*' -and ! -path '/x/*' \) -delete || true

/x/lib/ld-musl-x86_64.so.1 /x/bin/busybox cp -a /x/* /
export PATH="/usr/sbin:/usr/bin:/sbin:/bin"

rm -rf /x

apk update
apk add openssh bash htop nano
echo PermitRootLogin yes >> /etc/ssh/sshd_config
rc-update add sshd default
rc-update add mdev sysinit
rc-update add devfs sysinit
#sh # (for example, run `passwd`)

sync
reboot -f       
作者: 抛砖引玉    时间: 2022-9-19 22:23
ChinaDNS 发表于 2022-9-19 19:17
LXC直接把修改网络配置那块改成复制interfaces就行了

这样写对不对
作者: ChinaDNS    时间: 2022-9-19 22:42
抛砖引玉 发表于 2022-9-19 22:23
这样写对不对

你现在用的是debian/ubuntu的话 对
作者: 52Fancy    时间: 2022-9-19 23:07
是kvm吗?可以试试我签名的脚本
作者: 抛砖引玉    时间: 2022-9-20 00:11
52Fancy 发表于 2022-9-19 23:07
是kvm吗?可以试试我签名的脚本

不是 是lxc
作者: 抛砖引玉    时间: 2022-9-20 00:57
ChinaDNS 发表于 2022-9-19 22:42
你现在用的是debian/ubuntu的话 对

还是不行,脚本是运行成功的,就是重启后失联
作者: feixiang    时间: 2022-9-20 09:54
德基是lxc,ovz的脚本当然不行了。




欢迎光临 全球主机交流论坛 (https://loc.442266.xyz/) Powered by Discuz! X3.4