~kris/9p

9hist

ref: d6fb2c556c9ec6d09bc59bb24fddaeebb9d83ca9 9hist/boot/sac.c -rw-r--r-- 1.0 KiB
d6fb2c55 — David du Colombier Plan 9 from Bell Labs 1999-06-15 27 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <u.h>
#include <libc.h>
#include <../boot/boot.h>

void configip(char* dev);

// HACK - take over from boot since files system is not
// available on a pipe

void
configsac(Method *mp)
{
	int fd;
	char cmd[64];

	USED(mp);

print("configsac\n");
	/*
	 *  create the name space, mount the root fs
	 */
	if(bind("/", "/", MREPL) < 0)
		fatal("bind /");
	if(bind("#C", "/", MAFTER) < 0)
		fatal("bind /");

	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);

	bargc = parsefields("-n 135.104.9.69 255.255.255.0 135.104.9.1 "
						"135.104.9.69 135.104.9.69", bargv, Nbarg-1, " ");
	configip("ether0");

	// fixed sysname - enables correct cpurc and namespace files
	// to be used

	sprint(cmd, "/%s/init", cputype);
	execl(cmd, "init", "-c", 0);
	fatal(cmd);
}

int
authsac(void)
{
	// does not get here
	return -1;
}

int
connectsac(void)
{
	// does not get here
	return -1;
}