2018-01-02 01:00:07 +01:00
|
|
|
/* Copyright (C) Charles Forsyth
|
|
|
|
* See /doc/license/NOTICE.Plan9-9k.txt for details about the licensing.
|
|
|
|
*/
|
|
|
|
/* Portions of this file are Copyright (C) 2015-2018 Giacomo Tesio <giacomo@tesio.it>
|
|
|
|
* See /doc/license/gpl-2.0.txt for details about the licensing.
|
2016-11-25 17:18:40 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <u.h>
|
|
|
|
#include <libc.h>
|
|
|
|
#include "../boot/boot.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* HACK - take over from boot since file system is not
|
|
|
|
* available on a pipe
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
configsac(Method *mp)
|
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
char cmd[64];
|
|
|
|
|
|
|
|
USED(mp);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* create the name space, mount the root fs
|
|
|
|
*/
|
|
|
|
if(bind("/", "/", MREPL) < 0)
|
|
|
|
fatal("bind /");
|
|
|
|
if(bind("#C", "/", MAFTER) < 0)
|
|
|
|
fatal("bind /");
|
|
|
|
|
|
|
|
/* fixed sysname - enables correct namespace file */
|
|
|
|
fd = open("#c/sysname", OWRITE);
|
|
|
|
if(fd < 0)
|
|
|
|
fatal("open sysname");
|
|
|
|
write(fd, "brick", 5);
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
fd = open("#c/hostowner", OWRITE);
|
|
|
|
if(fd < 0)
|
|
|
|
fatal("open sysname");
|
|
|
|
write(fd, "brick", 5);
|
|
|
|
close(fd);
|
|
|
|
|
2017-04-19 23:33:14 +02:00
|
|
|
jehanne_sprint(cmd, "/arch/%s/init", cputype);
|
|
|
|
jehanne_print("starting %s\n", cmd);
|
|
|
|
jehanne_execl(cmd, "init", "-c", 0);
|
2016-11-25 17:18:40 +01:00
|
|
|
fatal(cmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
connectsac(void)
|
|
|
|
{
|
|
|
|
/* does not get here */
|
|
|
|
return -1;
|
|
|
|
}
|