Skip to content

Commit cf82db1

Browse files
authored
don't check the passed version if we are in 1st stage (#2408)
Signed-off-by: Ashraf Fouda <ashraf.m.fouda@gmail.com>
1 parent aaabb43 commit cf82db1

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

bootstrap/bootstrap/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,25 @@ will do a multiple stage bootstrap. Currently this is only two stages:
2121
- As described above bootstrap run in two stages:
2222
- The first stage is used to update bootstrap itself, and it is done like that to avoid re-building the image if we only changed the bootstrap code. this update is basically done from `tf-autobuilder` repo in the [hub/tf-autobuilder](https://hub.grid.tf/tf-autobuilder) and download the latest bootstrap flist
2323
- For the second stage bootstrap will download the flists for that env. bootstrap cares about `runmode` argument that we pass during the start of the node. for example if we passed `runmode=dev` it will get the the tag `development` under [hub/tf-zos](https://hub.grid.tf/tf-zos) each tag is linked to a sub-directory where all flists for this env exists to be downloaded and installed on the node
24+
25+
## Testing in Developer setup
26+
27+
To test bootstrap changes on a local dev-setup you need to do the following
28+
29+
- under zos/qemu `cp -r overlay.normal overlay.custom`
30+
- build `bootstrap` bin
31+
- copy the `bootstrap` bin to overlay.custom/sbin/
32+
- remove dir `overlay.custom/bin`
33+
- remove all files under `overlay.custom/etc/zinit/`
34+
- add the file overlay.custom/etc/zinit/bootstrap.yaml with the following content
35+
36+
```
37+
exec: bootstrap -d
38+
oneshot: true
39+
after:
40+
- internet
41+
```
42+
43+
- remove overlay link under `qemu/overlay `
44+
- create a new link pointing to overlay.custom under zos/qemu `ln -s overlay.custom overlay`
45+
- boot your vm as normal

bootstrap/bootstrap/src/config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,15 @@ impl Config {
119119
if stage == 0 {
120120
bail!("invalid stage value 0, stages starting from 1");
121121
}
122-
122+
let mut ver = Version::V3;
123+
if stage == 2 {
124+
ver = version()?
125+
}
123126
Ok(Config {
124127
stage,
125128
debug: matches.occurrences_of("debug") > 0,
126129
runmode: runmode()?,
127-
version: version()?,
130+
version: ver,
128131
})
129132
}
130133
}

0 commit comments

Comments
 (0)