Skip to content

Commit

Permalink
Merge pull request #6 from hongxu-jia/main
Browse files Browse the repository at this point in the history
support to install from remote ostree repository
  • Loading branch information
zulcss authored Mar 27, 2024
2 parents cfc775a + b71b30b commit b1db932
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions config/disk/ostree-remote.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
source:
host: http://192.168.100.106/repo
repository: http://127.0.0.1/repo
branch: exampleos/testing
kernel_args:
- root=LABEL=ROOT
Expand All @@ -11,7 +11,7 @@ disk:
device: /dev/vda
partitions:
- name: EFI
start: O%
start: 0%
end: 256MB
flags: [boot, esp]
- name: ROOT
Expand Down
16 changes: 13 additions & 3 deletions tiler/ostree.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ def run(self):
ostree_repo.mkdir(parents=True, exist_ok=True)
utils.run_command(
["ostree", "init", "--repo", ostree_repo, "--mode", "bare"])
self.logging.info(f"Pulling {branch}")
utils.run_command(
["ostree", "pull-local", "--repo", ostree_repo, repo, branch])
self.logging.info(f"Pulling {branch} from {repo}")
if repo.startswith("http"):
utils.run_command(
["ostree", "remote", "--repo={0}".format(ostree_repo), "add", "--no-gpg-verify", "pablo-edge", repo])
utils.run_command(
["ostree", "pull", "--repo={0}".format(ostree_repo), "pablo-edge", branch])
elif os.path.exists(repo):
utils.run_command(
["ostree", "pull-local", "--repo", ostree_repo, repo, branch])
else:
self.logging.error("Invalid ostree repository {repo}")
sys.exit(1)

utils.run_command(
["ostree", "config", "--repo", ostree_repo, "--group", "sysroot",
"set", "bootloader", "none"])
Expand Down

0 comments on commit b1db932

Please sign in to comment.