fix: do not (mostly) handle /var/cache/blendOS explicitly
This commit is contained in:
parent
b53795bddb
commit
956ef6fb01
3 changed files with 9 additions and 31 deletions
|
|
@ -31,33 +31,6 @@ class RootFS:
|
||||||
def init(self) -> subprocess.CompletedProcess:
|
def init(self) -> subprocess.CompletedProcess:
|
||||||
"""Initialise rootfs."""
|
"""Initialise rootfs."""
|
||||||
|
|
||||||
# Create blendOS cache directory
|
|
||||||
Path("/var/cache/blendOS").mkdir(parents=True, exist_ok=True)
|
|
||||||
Path(os.path.join(self.rootfs_path, "var/cache/blendOS")).mkdir(
|
|
||||||
parents=True, exist_ok=True
|
|
||||||
)
|
|
||||||
# subprocess.run(
|
|
||||||
# ["rm", "-rf", "--", os.path.join(self.rootfs_path, "var/cache/blendOS")]
|
|
||||||
# )
|
|
||||||
# subprocess.run(
|
|
||||||
# [
|
|
||||||
# "cp",
|
|
||||||
# "-a",
|
|
||||||
# "--",
|
|
||||||
# "/var/cache/blendOS",
|
|
||||||
# os.path.join(self.rootfs_path, "var/cache/blendOS"),
|
|
||||||
# ]
|
|
||||||
# )
|
|
||||||
|
|
||||||
subprocess.run(
|
|
||||||
[
|
|
||||||
"mount",
|
|
||||||
"--bind",
|
|
||||||
"/var/cache/blendOS",
|
|
||||||
os.path.join(self.rootfs_path, "var/cache/blendOS"),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
completedProcess = subprocess.run(
|
completedProcess = subprocess.run(
|
||||||
["bash", "-s"],
|
["bash", "-s"],
|
||||||
text=True,
|
text=True,
|
||||||
|
|
@ -65,8 +38,6 @@ class RootFS:
|
||||||
cwd=self.rootfs_path,
|
cwd=self.rootfs_path,
|
||||||
)
|
)
|
||||||
|
|
||||||
subprocess.run(["umount", os.path.join(self.rootfs_path, "var/cache/blendOS")])
|
|
||||||
|
|
||||||
return completedProcess
|
return completedProcess
|
||||||
|
|
||||||
def exec(self, cmd, **kwargs) -> subprocess.CompletedProcess:
|
def exec(self, cmd, **kwargs) -> subprocess.CompletedProcess:
|
||||||
|
|
@ -81,7 +52,6 @@ class RootFS:
|
||||||
"systemd-nspawn",
|
"systemd-nspawn",
|
||||||
"--quiet",
|
"--quiet",
|
||||||
"--pipe",
|
"--pipe",
|
||||||
"--bind=/var/cache/blendOS",
|
|
||||||
"-D",
|
"-D",
|
||||||
self.rootfs_path,
|
self.rootfs_path,
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,13 @@ def gen_rootfs(system_config: dict, rootfs_path: str) -> RootFS:
|
||||||
"""Generates a rootfs for a given system configuration."""
|
"""Generates a rootfs for a given system configuration."""
|
||||||
|
|
||||||
rootfs = RootFS(rootfs_path, system_config["distro-config"])
|
rootfs = RootFS(rootfs_path, system_config["distro-config"])
|
||||||
rootfs.init()
|
|
||||||
|
subprocess.run(
|
||||||
|
["bash", "-s"],
|
||||||
|
text=True,
|
||||||
|
input=system_config["distro-config"]["before-stages"],
|
||||||
|
cwd=rootfs_path,
|
||||||
|
)
|
||||||
|
|
||||||
modules = {}
|
modules = {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ from .gen_rootfs import gen_rootfs
|
||||||
|
|
||||||
def update_cleanup() -> None:
|
def update_cleanup() -> None:
|
||||||
"""Clean-up from previous rebase/update."""
|
"""Clean-up from previous rebase/update."""
|
||||||
|
|
||||||
|
# FIXME: should not ideally handle /var/cache/blendOS explicitly
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["umount", "-l", "/var/cache/akshara/rootfs/var/cache/blendOS"],
|
["umount", "-l", "/var/cache/akshara/rootfs/var/cache/blendOS"],
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue