blob: e2521b768668fb194721924b949ac6787e07acea (
plain)
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
|
#!/bin/rc
fn configreboot {
if(~ $"* *!*){
*=`{echo $* | sed 's,!, ,'}
shift
*=`{echo $* | sed 's,!, ,'}
x=m$1
x=$$x
shift
# config method
$x(1) $*
}
}
fn connectreboot {
if(~ $"* *!*){
*=`{echo $* | sed 's,!, ,'}
bootfile=$1
shift
bootargs=$*
*=`{echo $* | sed 's,!, ,'}
x=m$1
x=$$x
shift
# connect method
$x(2) $*
rfork ne
# set new kernel parameters
echo -n $bootargs > '#ec/bootargs'
rm -f '#ec/bootloop'
# remove part of our temporary root
/mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
/mnt/broot/$cputype/bin/unmount /rc/bin /bin
/mnt/broot/$cputype/bin/unmount /
# create the name space, mount the root fs
/mnt/broot/$cputype/bin/bind / /
/mnt/broot/$cputype/bin/mount -ac '#s/boot' /
}
if not {
bootfile=$1
}
# load the new kernel
/mnt/broot/$cputype/bin/echo reboot $bootfile > /dev/reboot
exit 'reboot failed'
}
mreboot=(configreboot connectreboot)
mt=(mreboot $mt)
|