revises pill definition

This commit is contained in:
Joe Bryan 2019-02-11 14:11:12 -05:00
parent e0d9e19758
commit 35d18c2b83
2 changed files with 54 additions and 23 deletions

View File

@ -94,25 +94,20 @@ static c3_c sag_w;
:: +pill: boot-sequence ingredients :: +pill: boot-sequence ingredients
:: ::
+$ pill +$ pill
$% :: %fast: fast-boot with %zuse and vanes pre-installed (+solid) %+ each
:: :: %&: complete pill (either +brass or +solid)
:: p: jammed pill ::
:: q: optional %into ovum overriding that of .p :: p: jammed pill
:: :: q: optional %into ovum overriding that of .p
[%fast p=@ q=(unit ovum)] ::
:: %full: complete bootstrapping sequence (+brass) [p=@ q=(unit ovum)]
:: :: %|: incomplete pill (+ivory)
:: p: jammed pill ::
:: :: p: jammed pill
[%full p=@] :: q: module ova
:: %lite: lightweight boot sequence (+ivory) :: r: userspace ova
:: ::
:: p: jammed pill [p=@ q=(list ovum) r=(list ovum)]
:: q: module ova
:: r: userspace ova
::
[%lite p=@ q=(list ovum) r=(list ovum)]
==
:: +cede: lord to client :: +cede: lord to client
:: ::
:: XX not implemented :: XX not implemented
@ -432,7 +427,7 @@ _boothack_pill(void)
// XX stat first to print error on failure? // XX stat first to print error on failure?
// //
return u3nc(c3__full, u3m_file(u3_Host.ops_u.pil_c)); return u3nt(c3y, u3m_file(u3_Host.ops_u.pil_c), u3_nul);
} }
/* _boothack_key(): parse a private key file or value /* _boothack_key(): parse a private key file or value

View File

@ -863,12 +863,19 @@ _pier_boot_vent(u3_pier* pir_u)
// extract boot formulas and module/userspace ova from pill // extract boot formulas and module/userspace ova from pill
// //
{ {
u3_noun pil_p, pil_q, pil_r;
u3_noun pro; u3_noun pro;
c3_assert( c3y == u3du(pir_u->pil) ); c3_assert( c3y == u3du(pir_u->pil) );
c3_assert( c3__full == u3h(pir_u->pil) );
pro = u3m_soft(0, u3ke_cue, u3k(u3t(pir_u->pil))); if ( c3y == u3h(pir_u->pil) ) {
u3x_trel(pir_u->pil, 0, &pil_p, &pil_q);
}
else {
u3x_qual(pir_u->pil, 0, &pil_p, &pil_q, &pil_r);
}
pro = u3m_soft(0, u3ke_cue, u3k(pil_p));
if ( 0 != u3h(pro) ) { if ( 0 != u3h(pro) ) {
fprintf(stderr, "boot: failed: unable to parse pill\r\n"); fprintf(stderr, "boot: failed: unable to parse pill\r\n");
@ -877,8 +884,37 @@ _pier_boot_vent(u3_pier* pir_u)
u3x_trel(u3t(pro), &bot, &mod, &use); u3x_trel(u3t(pro), &bot, &mod, &use);
u3k(bot); u3k(mod); u3k(use); u3k(bot); u3k(mod); u3k(use);
u3z(pro);
// optionally replace filesystem in userspace
//
if ( c3y == u3h(pir_u->pil) ) {
if ( u3_nul != pil_q ) {
u3_noun new = u3nc(u3k(u3t(pil_q)), u3_nul);
u3_noun ova = use;
u3_noun ovo;
while ( u3_nul != ova ) {
ovo = u3h(ova);
if ( c3__into != u3h(u3t(ovo)) ) {
new = u3nc(u3k(ovo), new);
}
ova = u3t(ova);
}
u3z(use);
use = u3kb_flop(new);
}
}
// prepend %lite module and userspace ova
//
else {
mod = u3kb_weld(u3k(pil_q), mod);
use = u3kb_weld(u3k(pil_r), use);
}
u3z(pro);
u3z(pir_u->pil); u3z(pir_u->pil);
pir_u->pil = u3_nul; pir_u->pil = u3_nul;
} }