Adjust %sith card.

This commit is contained in:
C. Guy Yarvin 2017-06-10 22:30:49 -07:00
parent 14890c4bd1
commit 1af4895a89
4 changed files with 109 additions and 85 deletions

View File

@ -722,7 +722,8 @@
c3_c* sys_c; // pill file
c3_d gen_d; // last event discovered
c3_d but_d; // boot barrier
c3_d sec_d[1]; // secret (unstretched)
c3_d tic_d[1]; // ticket (unstretched)
c3_d sec_d[1]; // generator (unstretched)
c3_d key_d[4]; // secret (stretched)
c3_d who_d[2]; // identity
c3_c* who_c; // identity as C string
@ -1498,6 +1499,7 @@
*/
void
u3_pier_boot(u3_noun who, // identity
u3_noun tic, // ticket if any
u3_noun sec, // secret or 0
u3_noun pax, // path to pier
u3_noun sys); // path to boot pill

View File

@ -12,11 +12,29 @@
static u3j_harm _144_hex_loss_a[] = {{".2", u3we_loss}, {}};
static u3j_harm _144_hex_lune_a[] = {{".2", u3we_lune}, {}};
static u3j_harm _144_hex_coed__ed_puck_a[] = {{".2", u3wee_puck}, {}};
static u3j_harm _144_hex_coed__ed_sign_a[] = {{".2", u3wee_sign}, {}};
static u3j_harm _144_hex_coed__ed_veri_a[] = {{".2", u3wee_veri}, {}};
static u3j_harm _144_hex_coed__ed_shar_a[] = {{".2", u3wee_shar}, {}};
static u3j_core _144_hex_coed__ed_d[] =
{ { "sign", _144_hex_coed__ed_sign_a },
{ "puck", _144_hex_coed__ed_puck_a },
{ "veri", _144_hex_coed__ed_veri_a },
{ "shar", _144_hex_coed__ed_shar_a },
{}
};
static u3j_core _144_hex_coed_d[] =
{ { "ed", 0, _144_hex_coed__ed_d },
{}
};
static u3j_core _144_hex_d[] =
{ { "down", 0, _144_hex_down_d },
{ "lore", _144_hex_lore_a },
{ "loss", _144_hex_loss_a },
{ "lune", _144_hex_lune_a },
{ "coed", 0, _144_hex_coed_d },
{}
};

View File

@ -34,7 +34,8 @@
++ doom :: daemon command
$% $: $boot :: boot new pier
who/ship :: ship
sec/@ :: secret
tic/@ :: ticket (or 0)
sec/@ :: secret (or 0)
pax/@t :: directory
sys/@ :: boot pill
== ::
@ -214,10 +215,10 @@ _king_doom(u3_noun doom)
void
_king_boot(u3_noun bul)
{
u3_noun who, sec, sys, pax;
u3_noun who, sec, tic, sys, pax;
u3r_qual(bul, &who, &sec, &sys, &pax);
u3_pier_boot(u3k(who), u3k(sec), u3k(sys), u3k(pax));
u3r_quil(bul, &who, &tic, &sec, &sys, &pax);
u3_pier_boot(u3k(who), u3k(tic), u3k(sec), u3k(sys), u3k(pax));
u3z(bul);
}
@ -295,7 +296,7 @@ _boothack_cb(uv_connect_t *conn, int status)
{
u3_mojo *moj_u = conn->data;
u3_atom mat;
u3_atom pax, sys, who, sec;
u3_atom pax, sys, who, tic, sec;
{
if ( !u3_Host.ops_u.pil_c ) {
@ -321,6 +322,7 @@ _boothack_cb(uv_connect_t *conn, int status)
who = u3k(u3t(whu));
u3z(whu);
}
{
if ( !u3_Host.ops_u.tic_c ) {
fprintf(stderr, "boot: F A K E ship with null security (use -t)\r\n");
@ -337,11 +339,12 @@ _boothack_cb(uv_connect_t *conn, int status)
u3z(suc);
}
}
tic = u3k(sec);
pax = u3i_string(u3_Host.dir_c);
mat = u3ke_jam(u3nc(c3__doom,
u3nc(c3__boot,
u3nq(who, sec, pax, sys))));
u3nq(who, tic, sec, u3nc(pax, sys)))));
u3_newt_write(moj_u, mat, 0);
}

View File

@ -894,98 +894,95 @@ _pier_disk_consolidate(u3_pier* pir_u,
}
{
u3_noun lal = u3ke_cue(u3k(u3A->sys));
#if 0
u3_noun all = lal;
pir_u->but_d = u3kb_lent(u3k(all));
while ( all ) {
_pier_insert(pir_u, 0, u3k(u3h(all)));
inx_w++;
all = u3t(all);
}
#else
/* this new boot sequence is almost, but not quite,
** the right thing. see new arvo.
*/
{
u3_noun who = u3i_chubs(2, pir_u->who_d);
u3_noun bot, mod, fil;
u3r_trel(lal, &bot, &mod, &fil);
pir_u->but_d = 0;
/* insert boot sequence directly
/* this new boot sequence is almost, but not quite,
** the right thing. see new arvo.
*/
{
u3_noun seq = u3k(bot);
{
u3_noun all = seq;
u3_noun who = u3i_chubs(2, pir_u->who_d);
u3_noun tic = u3i_chubs(1, pir_u->tic_d);
u3_noun sec = u3i_chubs(1, pir_u->sec_d);
u3_noun bot, mod, fil;
pir_u->but_d += u3kb_lent(u3k(all));
while ( all ) {
_pier_insert(pir_u, 0, u3k(u3h(all)));
inx_w++;
all = u3t(all);
u3r_trel(lal, &bot, &mod, &fil);
pir_u->but_d = 0;
/* insert boot sequence directly
*/
{
u3_noun seq = u3k(bot);
{
u3_noun all = seq;
pir_u->but_d += u3kb_lent(u3k(all));
while ( all ) {
_pier_insert(pir_u, 0, u3k(u3h(all)));
inx_w++;
all = u3t(all);
}
}
u3z(seq);
}
/* insert module sequence, prepending first identity event
*/
{
u3_noun seq;
/* prepend identity event to module sequence
*/
{
u3_noun wir = u3nt(c3__name, u3dc("scot", 'p', u3k(who)), u3_nul);
u3_noun car = u3nc(c3__veal, u3k(who));
u3_noun ovo = u3nc(wir, car);
seq = u3nc(ovo, u3k(mod));
}
/* insert with timestamp
*/
{
u3_noun all = seq;
pir_u->but_d += u3kb_lent(u3k(all));
while ( all ) {
_pier_insert_ovum(pir_u, 0, u3k(u3h(all)));
inx_w++;
all = u3t(all);
}
}
}
u3z(seq);
}
/* insert module sequence, prepending first identity event
*/
{
u3_noun seq;
/* prepend identity event to module sequence
/* insert legacy boot event
*/
{
u3_noun wir = u3nt(c3__name, u3dc("scot", 'p', u3k(who)), u3_nul);
u3_noun car = u3nc(c3__veal, u3k(who));
u3_noun ovo = u3nc(wir, car);
u3_noun ovo;
seq = u3nc(ovo, u3k(mod));
}
/* make legacy boot event
*/
{
u3_noun wir = u3nq(u3_blip, c3__term, '1', u3_nul);
u3_noun car = u3nq(c3__boot,
c3__sith,
u3k(who),
u3nc(u3k(tic), u3k(sec)));
/* insert with timestamp
*/
{
u3_noun all = seq;
pir_u->but_d += u3kb_lent(u3k(all));
while ( all ) {
_pier_insert_ovum(pir_u, 0, u3k(u3h(all)));
inx_w++;
all = u3t(all);
ovo = u3nc(wir, car);
}
_pier_insert_ovum(pir_u, 0, ovo);
}
}
/* insert legacy boot event
*/
{
u3_noun ovo;
/* make legacy boot event
/* insert filesystem install event
*/
{
u3_noun wir = u3nq(u3_blip, c3__term, '1', u3_nul);
u3_noun car = u3nq(c3__boot, c3__sith, u3k(who), u3nc(u3k(who), c3y));
ovo = u3nc(wir, car);
_pier_insert_ovum(pir_u, 0, u3k(fil));
}
_pier_insert_ovum(pir_u, 0, ovo);
u3z(lal);
u3z(sec);
u3z(who);
}
/* insert filesystem install event
*/
{
_pier_insert_ovum(pir_u, 0, u3k(fil));
}
}
#endif
u3z(lal);
}
} else {
pir_u->but_d = (lav_d - 1ULL);
@ -1903,6 +1900,7 @@ u3_pier_stub(void)
*/
static u3_pier*
_pier_boot_make(u3_noun who,
u3_noun tic,
u3_noun sec,
u3_noun pax,
u3_noun sys)
@ -1924,11 +1922,13 @@ _pier_boot_make(u3_noun who,
fprintf(stderr, "boot: ship: %s\r\n", pir_u->who_c);
}
u3r_chubs(0, 1, pir_u->sec_d, sec);
u3r_chubs(0, 2, pir_u->who_d, who);
u3r_chubs(0, 1, pir_u->tic_d, tic);
u3r_chubs(0, 1, pir_u->sec_d, sec);
pir_u->por_s = 0;
u3z(tic);
u3z(sec);
u3z(who);
@ -1940,6 +1940,7 @@ _pier_boot_make(u3_noun who,
*/
void
u3_pier_boot(u3_noun who, // identity
u3_noun tic, // ticket if any
u3_noun sec, // secret or 0
u3_noun pax, // path to pier
u3_noun sys) // path to boot pill (if needed)
@ -1948,7 +1949,7 @@ u3_pier_boot(u3_noun who, // identity
/* make/load pier
*/
pir_u = _pier_boot_make(who, sec, pax, sys);
pir_u = _pier_boot_make(who, tic, sec, pax, sys);
/* initialize polling handle
*/