Compare commits
3 Commits
prawn/pipi
...
raihan2000
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
041b2d7dc5 | ||
|
|
7560af89f0 | ||
|
|
31cd87cea7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ __pycache__/
|
||||
.coverage*
|
||||
*.xml
|
||||
*.egg-info
|
||||
dist
|
||||
|
||||
@@ -38,7 +38,7 @@ def ctx() -> click.Context:
|
||||
|
||||
|
||||
def test_main_import():
|
||||
from main import cli
|
||||
from kupferbootstrap.main import cli
|
||||
assert cli
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import atexit
|
||||
import os
|
||||
|
||||
from typing import ClassVar, Optional
|
||||
from typing import ClassVar, Optional, cast
|
||||
|
||||
from kupferbootstrap.config.state import config
|
||||
from kupferbootstrap.constants import Arch, BASE_PACKAGES
|
||||
@@ -20,15 +20,14 @@ class DeviceChroot(BuildChroot):
|
||||
_copy_base: ClassVar[bool] = False
|
||||
|
||||
def create_rootfs(self, reset, pacman_conf_target, active_previously):
|
||||
clss = BuildChroot if self.copy_base else BaseChroot
|
||||
|
||||
makedir(config.get_path('chroots'))
|
||||
root_makedir(self.get_path())
|
||||
if not self.copy_base:
|
||||
pacman_conf_target = os.path.join(get_temp_dir(register_cleanup=True), f'pacman-{self.name}.conf')
|
||||
self.write_pacman_conf(in_chroot=False, absolute_path=pacman_conf_target)
|
||||
|
||||
clss.create_rootfs(self, reset, pacman_conf_target, active_previously)
|
||||
BaseChroot.create_rootfs(cast(BaseChroot, self), reset, pacman_conf_target, active_previously)
|
||||
else:
|
||||
BuildChroot.create_rootfs(self, reset, pacman_conf_target, active_previously)
|
||||
|
||||
def mount_rootfs(self, source_path: str, fs_type: Optional[str] = None, options: list[str] = [], allow_overlay: bool = False):
|
||||
if self.active:
|
||||
|
||||
@@ -8,6 +8,7 @@ from kupferbootstrap.config.state import config
|
||||
from kupferbootstrap.constants import SSH_COMMON_OPTIONS, SSH_DEFAULT_HOST, SSH_DEFAULT_PORT
|
||||
from kupferbootstrap.exec.cmd import run_cmd
|
||||
from kupferbootstrap.exec.file import write_file
|
||||
from kupferbootstrap.chroot.abstract import Chroot
|
||||
from kupferbootstrap.wrapper import check_programs_wrap
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user