Skip to content

Commit

Permalink
Merge pull request #2 from 14MR00T/7ryH4ckM3-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Randark-JMT authored Dec 26, 2023
2 parents 4b45c89 + fd8437e commit 1eb503e
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions core/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,20 @@ def container_start(self):
self.container = self.client.containers.run(**container_params)

def container_change_repository(self):
match self.banner_release:
case "ubuntu":
logging.info(
"[+] {}".format("sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list"))
self.container.exec_run(
"sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list")
logging.info(
"[+] {}".format("sed -i 's@//.*security.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list"))
self.container.exec_run(
"sed -i 's@//.*security.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list")
exec_result = self.container.exec_run("apt-get update")
logging.debug(exec_result.output.decode("utf-8").strip())
if self.banner_release == "ubuntu":
logging.info("[+] {}".format("sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list"))
self.container.exec_run("sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list")
logging.info("[+] {}".format("sed -i 's@//.*security.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list"))
self.container.exec_run("sed -i 's@//.*security.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list")
exec_result = self.container.exec_run("apt-get update")
logging.debug(exec_result.output.decode("utf-8").strip())

def container_install_dependency(self):
dependency_ubuntu = ["wget", "unzip", "dwarfdump", "build-essential", "kmod", "linux-base", "gcc-10", "gcc-11",
"gcc-12"]
match self.banner_release:
case "ubuntu":
logging.info("[+] {}".format("apt-get install -y " + " ".join(dependency_ubuntu)))
exec_result = self.container.exec_run("apt-get install -y " + " ".join(dependency_ubuntu))
logging.debug(exec_result.output.decode("utf-8").strip())
dependency_ubuntu = ["wget", "unzip", "dwarfdump", "build-essential", "kmod", "linux-base", "gcc-10", "gcc-11", "gcc-12"]
if self.banner_release == "ubuntu":
logging.info("[+] {}".format("apt-get install -y " + " ".join(dependency_ubuntu)))
exec_result = self.container.exec_run("apt-get install -y " + " ".join(dependency_ubuntu))
logging.debug(exec_result.output.decode("utf-8").strip())

def container_install_debs(self):
repository_url = key_repository[self.banner_release]
Expand Down

0 comments on commit 1eb503e

Please sign in to comment.