Skip to content

Commit 6bb0466

Browse files
chiichenBrahmaMantra
authored andcommitted
chore(tools): add bootstrap support for Centos/RHEL8/fedora (DragonOS-Community#713)
Co-authored-by: kejianchi <[email protected]>
1 parent a2bfee1 commit 6bb0466

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

tools/bootstrap.sh

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,44 @@ install_archlinux_pkg()
109109

110110
}
111111

112+
install_centos_pkg()
113+
{
114+
echo "检测到 Centos/Fedora/RHEL 8"
115+
echo "正在更新包管理器的列表..."
116+
sudo dnf update -y
117+
echo "正在安装所需的包"
118+
119+
echo "正在安装Development Tools..."
120+
sudo dnf groupinstall -y "Development Tools"
121+
122+
echo "正在安装LLVM和Clang..."
123+
sudo dnf install -y llvm-devel clang-devel
124+
125+
echo "正在安装Clang和GCC..."
126+
sudo dnf install -y clang gcc-c++
127+
128+
echo "正在安装QEMU和KVM..."
129+
sudo dnf install -y qemu qemu-kvm qemu-system-x86
130+
131+
echo "正在安装fdisk和redhat-lsb-core..."
132+
sudo dnf install -y util-linux redhat-lsb-core
133+
134+
echo "正在安装Git..."
135+
sudo dnf install -y git
136+
137+
echo "正在安装dosfstools..."
138+
sudo dnf install -y dosfstools
139+
140+
echo "正在安装unzip..."
141+
sudo dnf install -y unzip
142+
143+
echo "安装bridge utils"
144+
sudo dnf install -y bridge-utils || sudo rpm -ivh http://mirror.centos.org/centos/7/os/x86_64/Packages/bridge-utils-1.5-9.el7.x86_64.rpm #Centos8 需要直接安装Binary
145+
146+
echo "安装dnsmasq"
147+
sudo dnf install -y dnsmasq
148+
}
149+
112150
install_osx_pkg()
113151
{
114152
echo "Detected OSX! 暂不支持Mac OSX的一键安装!"
@@ -274,7 +312,7 @@ else
274312
install_ubuntu_debian_pkg "$defpackman" || exit 1
275313
# Fedora
276314
elif hash 2>/dev/null dnf; then
277-
fedora "$emulator" || exit 1
315+
install_centos_pkg || exit 1
278316
# Gentoo
279317
elif hash 2>/dev/null emerge; then
280318
gentoo "$emulator" || exit 1

tools/grub_auto_install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export OBJCOPY=objcopy
3838
if [ -d ${grub_dir_i386_efi}/bin ] && [ -d ${grub_dir_i386_legacy}/bin ] && [ -d ${grub_dir_x86_64_efi}/bin ] ; then
3939
exit 0
4040
fi
41-
#仅支持Ubuntu/Debain, Arch下的自动安装
42-
supported_package_manager="apt-get pacman"
41+
#仅支持Ubuntu/Debain, Arch, Centos/RHEL8/Fedora下的自动安装
42+
supported_package_manager="apt-get pacman dnf"
4343
packages=("make binutils bison gcc gettext flex bison automake autoconf wget gawk" \
4444
"make binutils bison gcc gettext flex bison automake autoconf wget gawk")
4545
update_options=("update" \

0 commit comments

Comments
 (0)