Skip to content

Commit 3d1d1e7

Browse files
authored
Merge pull request #528 from fosslinux/mirror-docs
Document mirrors a bit better
2 parents 14937ef + a4abe4f commit 3d1d1e7

File tree

4 files changed

+49
-1
lines changed

4 files changed

+49
-1
lines changed

.github/workflows/bwrap.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- name: Copy distfiles
9999
run: ./download-distfiles.sh file:///${PWD}/mirror
100100
- name: Run bootstrap
101-
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2
101+
run: ./rootfs.py --bwrap --external-sources --build-kernels --cores 2 --internal-ci pass2 --mirror file://${PWD}/mirror
102102
- name: Archive created packages
103103
if: failure() # archive failed builds progress
104104
uses: actions/upload-artifact@v4

README.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ How do I use this?
1717

1818
Quick start:
1919

20+
Choose a mirror from https://github.com/fosslinux/live-bootstrap/wiki/Mirrors,
21+
or create a private/public mirror yourself (see further below). You should
22+
provide the mirror as ``--mirror`` to ``rootfs.py``.
23+
2024
See ``./rootfs.py --help`` and follow the instructions given there.
2125
This uses a variety of userland tools to prepare the bootstrap.
2226

@@ -25,6 +29,8 @@ preparations! This is a currently unsolved problem.*)
2529

2630
Without using Python:
2731

32+
0. Choose a mirror as detailed above. (You will input this later, instead of
33+
passing it to ``rootfs.py```).
2834
1. ``git clone https://github.com/fosslinux/live-bootstrap``
2935
2. ``git submodule update --init --recursive``
3036
3. Consider whether you are going to run this in a chroot, in QEMU, or on bare
@@ -68,6 +74,31 @@ Without using Python:
6874
c. **Bare metal:** Follow the same steps as QEMU, but the disks need to be
6975
two different *physical* disks, and boot from the first disk.
7076

77+
Mirrors
78+
-------
79+
80+
It has been decided that repackaging distfiles for live-bootstrap is generally
81+
permissible, particularly from git repositories. We do this primarily because
82+
83+
a. currently live-bootstrap only supports tarballs/raw files as input, not git
84+
repositories
85+
b. to reduce load on servers
86+
87+
You may choose to use an existing mirror from
88+
https://github.com/fosslinux/live-bootstrap/wiki/Mirrors, however you may be
89+
(to some varied extent) trusting the operator of the mirror.
90+
91+
Alternatively, you can create your own local mirror - one such implementation
92+
is in ``./mirror.sh``. You can invoke it with
93+
``./mirror.sh path/to/mirror/dir path/to/mirror/state``.
94+
You would then pass ``--mirror path/to/mirror/dir`` to rootfs.py.
95+
(If not using rootfs.py, you need to copy files around manually into distfiles.)
96+
97+
Most helpfully to the project, you could create your own public mirror, by
98+
running ``./mirror.sh`` or writing your own script that does something similar
99+
on a timer (systemd timer or cron job, for example), where the mirror directory
100+
is publicly accessible on the Internet (ideally, via HTTP and HTTPS).
101+
71102
Background
72103
----------
73104

rootfs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ def check_types():
178178
else:
179179
args.swap = 0
180180

181+
# Validate mirrors
182+
if not args.mirrors:
183+
raise ValueError("At least one mirror must be provided.")
184+
181185
# Set constant umask
182186
os.umask(0o022)
183187

steps/configurator

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ this correctly, otherwise you risk overwriting an existing disk on your
4040
system. LIVE-BOOTSTRAP TAKES NO LIABILITY FOR ANY DATA LOSS RESULTING FROM
4141
ITS USE.
4242

43+
o /general/mirrors MIRRORS "" _ Mirrors
44+
live-bootstrap needs a mirror to download repackaged distfiles from,
45+
as long as you do not already have all the distfiles on an attached disk.
46+
Please see the README for your options of selecting one.
47+
This should be a URI of the form http(s)://[...], or if it is locally accessible
48+
on a filesystem (perhaps because you are running this in a sandboxing tool,
49+
instead of a VM or hardware), file://[...].
50+
Multiple mirrors can be provided, space separated.
51+
ENSURE YOU UPDATE MIRRORS_COUNT.
52+
53+
o /general/mirrors_count MIRRORS_LEN int _ Number of mirrors configured
54+
The number of mirrors you put into Mirrors. Should be an integer >= 0.
55+
4356
m /sysinfo _ _ _ System information
4457
Details about your specific system and the environment live-bootstrap is
4558
running in.

0 commit comments

Comments
 (0)