Skip to content

Commit 078ae42

Browse files
committed
create and maintain release from /usr/src
1 parent 8005be9 commit 078ae42

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,25 @@ jail.create("11.1-RELEASE")
4949

5050
Libiocage comes bundles with a CLI tool called `ioc`. It is inspired by the command line interface of [iocage](https://github.com/iocage/iocage) but meant to be developed along with the library and to spike on new features.
5151

52+
### Custom Release (e.g. running -CURRENT)
53+
54+
#### Initially create release dataset
55+
56+
```sh
57+
zfs create zroot/iocage/releases/custom/root
58+
cd /usr/src
59+
#install your source tree
60+
make installworld DESTDIR=/iocage/releases/custom/root
61+
make distribution DESTDIR=/iocage/releases/custom/root
62+
ioc fetch -r custom -b
63+
```
64+
65+
#### Update the installation after recompile
66+
```sh
67+
make installworld DESTDIR=/iocage/releases/custom/root
68+
ioc fetch -r custom -b
69+
```
70+
5271
## Development
5372

5473
### Install Development Dependencies

iocage/cli/fetch.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
# Compat
5353
@click.option("--http", "-h", default=False,
5454
help="Have --server define a HTTP server instead.", is_flag=True)
55+
# Basejail Update
56+
@click.option(
57+
"--copy-basejail-only",
58+
"-b",
59+
is_flag=True,
60+
default=False,
61+
help="Update basejail after changes"
62+
)
5563
# Compat files
5664
@click.option("--files", multiple=True,
5765
help="Specify the files to fetch from the mirror. "
@@ -78,6 +86,13 @@ def cli(ctx, **kwargs):
7886
logger.error(f"Invalid Release '{release_input}'")
7987
exit(1)
8088

89+
if kwargs["copy_basejail_only"] is True:
90+
try:
91+
release.update_base_release()
92+
exit(0)
93+
except iocage.lib.errors.IocageException:
94+
exit(1)
95+
8196
url_or_files_selected = False
8297

8398
if is_option_enabled(kwargs, "url"):

iocage/lib/Release.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def fetch(self, update=None, fetch_updates=None):
435435

436436
if release_changed:
437437
yield releaseCopyBaseEvent.begin()
438-
self._update_zfs_base()
438+
self.update_base_release()
439439
yield releaseCopyBaseEvent.end()
440440
else:
441441
yield releaseCopyBaseEvent.skip(message="release unchanged")
@@ -864,7 +864,7 @@ def _update_name_from_dataset(self):
864864
if self.dataset is not None:
865865
self.name = self.dataset.name.split("/")[-2:-1]
866866

867-
def _update_zfs_base(self):
867+
def update_base_release(self):
868868

869869
base_dataset = self.zfs.get_or_create_dataset(self.base_dataset_name)
870870

0 commit comments

Comments
 (0)