Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/rc/bin/pc/bootwinnt – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
 
3
disk=`{ls /dev/sd??/plan9 >[2]/dev/null | sed 1q | sed 's!.*/(.*)/plan9!\1!'}
4
if(! ~ $#disk 1) {
5
	echo 'No plan 9 disk found' >[1=2]
6
	exit
7
}
8
 
9
if(! c: || ! test -f /n/c:/boot.ini) {
10
	echo 'Could not find NT''s boot.ini on the first FAT disk.' >[1=2]
11
	exit
12
}
13
 
14
if(test -f /n/c:/boot.p9) {
15
	echo 'A Plan 9 backup already exists; will not edit boot.ini again.' >[1=2]
16
	exit
17
}
18
 
19
if(! cp /n/c:/boot.ini /n/c:/boot.p9) {
20
	echo 'Could not back up boot.ini; will not continue.' >[1=2]
21
	exit
22
}
23
 
24
chmod +w /n/c:/boot.ini
25
 
26
if(! grep -si '\[operating systems\]' /n/c:/boot.ini) {
27
	echo 'Could not parse boot.ini.' >[1=2]
28
	exit
29
}
30
 
31
if(grep -si 'Plan 9' /n/c:/boot.ini) {
32
	p9file=`{grep 'Plan 9' /n/c:/boot.ini | sed 1q | sed 's/=.*//'}
33
	if(! ~ $p9file [Cc]:'\'*) {
34
		echo 'Unexpected Plan 9 entry in boot.ini already; not continuing.' >[1=2]
35
		exit
36
	}
37
}
38
 
39
if not {
40
	p9file='c:\bootsect.p9'
41
	echo 'c:\bootsect.p9 = "Plan 9 from Bell Labs"
' >>/n/c:/boot.ini
42
}
43
44
 
45
46
 
47
 
48
	echo 'Plan 9 added to Windows NT boot menu.' >[1=2]
49
	exit
50
}
51
52
 
53
exit
54