1 |
cb7d18d5
|
Renato Botelho
|
#!/usr/local/bin/php-cgi -q
|
2 |
2b5f276f
|
jim-p
|
<?php
|
3 |
ac24dc24
|
Renato Botelho
|
/*
|
4 |
|
|
* rc.nanobsd_switch_boot_slice
|
5 |
|
|
*
|
6 |
|
|
* part of pfSense (https://www.pfsense.org)
|
7 |
c5d81585
|
Renato Botelho
|
* Copyright (c) 2004-2016 Electric Sheep Fencing, LLC
|
8 |
ac24dc24
|
Renato Botelho
|
* All rights reserved.
|
9 |
|
|
*
|
10 |
b12ea3fb
|
Renato Botelho
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
11 |
|
|
* you may not use this file except in compliance with the License.
|
12 |
|
|
* You may obtain a copy of the License at
|
13 |
ac24dc24
|
Renato Botelho
|
*
|
14 |
b12ea3fb
|
Renato Botelho
|
* http://www.apache.org/licenses/LICENSE-2.0
|
15 |
ac24dc24
|
Renato Botelho
|
*
|
16 |
b12ea3fb
|
Renato Botelho
|
* Unless required by applicable law or agreed to in writing, software
|
17 |
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
18 |
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19 |
|
|
* See the License for the specific language governing permissions and
|
20 |
|
|
* limitations under the License.
|
21 |
ac24dc24
|
Renato Botelho
|
*/
|
22 |
|
|
|
23 |
2b5f276f
|
jim-p
|
require_once("globals.inc");
|
24 |
|
|
require_once("config.inc");
|
25 |
|
|
require_once("pfsense-utils.inc");
|
26 |
|
|
|
27 |
|
|
global $g;
|
28 |
|
|
global $SLICE, $OLDSLICE, $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH;
|
29 |
|
|
global $GLABEL_SLICE, $UFS_ID, $OLD_UFS_ID, $BOOTFLASH;
|
30 |
|
|
global $BOOT_DEVICE, $REAL_BOOT_DEVICE, $BOOT_DRIVE, $ACTIVE_SLICE;
|
31 |
|
|
nanobsd_detect_slice_info();
|
32 |
|
|
|
33 |
|
|
if ($g['platform'] != "nanobsd") {
|
34 |
|
|
echo "This script can only be used on NanoBSD (embedded) images.\n";
|
35 |
9ea554ee
|
Ermal LUÇI
|
return 1;
|
36 |
2b5f276f
|
jim-p
|
}
|
37 |
|
|
|
38 |
|
|
echo "Boot slice : {$BOOTFLASH} ({$BOOT_DEVICE})\n";
|
39 |
|
|
echo "Active slice: {$ACTIVE_SLICE}\n\n";
|
40 |
|
|
|
41 |
|
|
echo "Switching active slice...";
|
42 |
|
|
nanobsd_switch_boot_slice();
|
43 |
|
|
echo "Done.\n\n";
|
44 |
|
|
nanobsd_detect_slice_info();
|
45 |
|
|
echo "Boot slice : {$BOOTFLASH} ({$BOOT_DEVICE})\n";
|
46 |
|
|
echo "Active slice: {$ACTIVE_SLICE}\n\n";
|
47 |
9ea554ee
|
Ermal LUÇI
|
?>
|