Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pkg/arvo/gen/reload-event.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
:: Produce a raw event to reload a vane
::
:: Try: .event/ovo +reload-event %c, then restart urbit with
:: -I pier/.urb/put/event.ovo
::
:- %say
|= $: [now=@da eny=@uvJ bek=beak]
[[tam=term ~] ~]
==
:- %ovo
=/ top `path`/(scot %p p.bek)/[q.bek]/(scot r.bek)
=/ nam
=/ van=(list [term ~])
:- zus=[%zuse ~]
~(tap by dir:.^(arch %cy (welp top /sys/vane)))
?. =(1 (met 3 tam))
tam
=+ ^- zaz=(list [p=knot ~])
(skim van |=([a=term ~] =(tam (end 3 1 a))))
?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz
=/ tip (end 3 1 nam)
=/ bip ?:(=('z' tip) %$ tip)
=/ way ?:(=('z' tip) (welp top /sys/[nam]) (welp top /sys/vane/[nam]))
=/ fil .^(@ %cx (welp way /hoon))
[//arvo %veer bip way fil]
6 changes: 5 additions & 1 deletion pkg/urbit/daemon/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.kno_w = DefaultKernel;

while ( -1 != (ch_i=getopt(argc, argv,
"G:J:B:K:A:H:w:u:e:E:f:F:k:m:p:LjabcCdgqstvxPDRS")) )
"G:J:B:K:A:H:I:w:u:e:E:f:F:k:m:p:LjabcCdgqstvxPDRS")) )
{
switch ( ch_i ) {
case 'J': {
Expand All @@ -118,6 +118,10 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.dns_c = strdup(optarg);
break;
}
case 'I': {
u3_Host.ops_u.jin_c = strdup(optarg);
break;
}
case 'e': {
u3_Host.ops_u.eth_c = strdup(optarg);
break;
Expand Down
1 change: 1 addition & 0 deletions pkg/urbit/include/vere/vere.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@
c3_c* gen_c; // -G, czar generator
c3_o gab; // -g, test garbage collection
c3_c* dns_c; // -H, ames bootstrap domain
c3_c* jin_c; // -I, inject raw event
c3_c* lit_c; // -J, ivory (fastboot) kernel
c3_o tra; // -j, json trace
c3_w kno_w; // -K, kernel version
Expand Down
18 changes: 18 additions & 0 deletions pkg/urbit/vere/pier.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static void _pier_boot_complete(u3_pier* pir_u);
static void _pier_boot_ready(u3_pier* pir_u);
static void _pier_boot_set_ship(u3_pier* pir_u, u3_noun who, u3_noun fak);
static void _pier_exit_done(u3_pier* pir_u);
static void _pier_inject(u3_pier* pir_u, c3_c* pax_c);
static void _pier_loop_resume(u3_pier* pir_u);

/* _pier_db_bail(): bail from disk i/o.
Expand Down Expand Up @@ -1531,6 +1532,12 @@ _pier_boot_complete(u3_pier* pir_u)
u3_term_ef_verb();
}
}

{
if ( 0 != u3_Host.ops_u.jin_c ) {
_pier_inject(pir_u, u3_Host.ops_u.jin_c);
}
}
}

/* _pier_boot_ready():
Expand Down Expand Up @@ -1772,6 +1779,17 @@ _pier_create(c3_w wag_w, c3_c* pax_c)
return pir_u;
}

/* _pier_inject(): inject raw event at filename
*/
static void
_pier_inject(u3_pier* pir_u, c3_c* pax_c)
{
u3_noun ovo = u3ke_cue(u3m_file(pax_c));
u3m_p("injecting event", u3h(ovo));
u3_pier_work(pir_u, u3k(u3h(ovo)), u3k(u3t(ovo)));
u3z(ovo);
}

/* u3_pier_interrupt(): interrupt running process.
*/
void
Expand Down