diff options
author | dteske <dteske@FreeBSD.org> | 2015-08-04 06:29:30 +0800 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2015-08-04 06:29:30 +0800 |
commit | f0abd7da853573c14b5efe363245673a190dc960 (patch) | |
tree | e3bd0dc9a3597cd49ca1b5f2fcad9839be4db1d1 /emulators | |
parent | 7ff362e1b48bb23059bda5682571060ae3b6636f (diff) | |
download | freebsd-ports-gnome-f0abd7da853573c14b5efe363245673a190dc960.tar.gz freebsd-ports-gnome-f0abd7da853573c14b5efe363245673a190dc960.tar.zst freebsd-ports-gnome-f0abd7da853573c14b5efe363245673a190dc960.zip |
Move Xen Kernel menuitem to Boot Options submenu. Prevent conflict with
upcoming Boot Environment menu. The Xen Kernel is dynamically appended
after the last menuitem in the Boot Options submenu. If xen_kernel is not
defined in loader.conf(5) the Xen Kernel menuitem displays "N/A" versus
"On"/"off". While here, fix-up the pkg-message (make capitalization of
"in" vs. "In" consistent; make use of trailing ":" consistent; move a
comment out of the way of file contents, etc.).
Differential Revision: https://reviews.freebsd.org/D2717
Reviewed by: allanjude, bapt
Approved by: bapt
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/xen-kernel/Makefile | 2 | ||||
-rw-r--r-- | emulators/xen-kernel/files/xen.4th | 107 | ||||
-rw-r--r-- | emulators/xen-kernel/pkg-message | 12 |
3 files changed, 98 insertions, 23 deletions
diff --git a/emulators/xen-kernel/Makefile b/emulators/xen-kernel/Makefile index 24e5f623a692..d0b234701dcb 100644 --- a/emulators/xen-kernel/Makefile +++ b/emulators/xen-kernel/Makefile @@ -3,7 +3,7 @@ PORTNAME= xen PKGNAMESUFFIX= -kernel PORTVERSION= 4.5.0 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= emulators MASTER_SITES= http://bits.xensource.com/oss-xen/release/${PORTVERSION}/ diff --git a/emulators/xen-kernel/files/xen.4th b/emulators/xen-kernel/files/xen.4th index 7e9b0c2d3003..a74d03c28e95 100644 --- a/emulators/xen-kernel/files/xen.4th +++ b/emulators/xen-kernel/files/xen.4th @@ -1,24 +1,99 @@ +\ Copyright (c) 2015 Devin Teske <dteske@FreeBSD.org> +\ All rights reserved. +\ +\ Redistribution and use in source and binary forms, with or without +\ modification, are permitted provided that the following conditions +\ are met: +\ 1. Redistributions of source code must retain the above copyright +\ notice, this list of conditions and the following disclaimer. +\ 2. Redistributions in binary form must reproduce the above copyright +\ notice, this list of conditions and the following disclaimer in the +\ documentation and/or other materials provided with the distribution. +\ +\ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +\ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +\ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +\ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +\ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +\ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +\ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +\ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +\ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +\ SUCH DAMAGE. +\ +\ $FreeBSD$ + +create xenkerndefault 64 allot +0 xenkerndefault c! + also menu-command-helpers +also menu-namespace + +: init_xen_active ( N -- N ) + s" [X]en Kernel.. off" 2 pick menu_caption[x] setenv + s" [X]en Kernel.. On" 2 pick toggled_text[x] setenv + s" toggle_xen" 2 pick menu_command[x] setenv + s" 120" 2 pick menu_keycode[x] setenv + s" ^[1mX^[men Kernel.. ^[34;1mOff^[m" 2 pick ansi_caption[x] setenv + s" ^[1mX^[men Kernel.. ^[32;7mOn^[m" 2 pick toggled_ansi[x] setenv +; + +: init_xen_inactive ( N -- N ) + s" Xen Kernel.. N/A" 2dup + 4 pick menu_caption[x] setenv + 2 pick ansi_caption[x] setenv + s" true" 2 pick menu_command[x] setenv +; + +: init_xen ( -- ) + s" optionsmenu_options" getenv 0> if + c@ dup [char] 0 > over [char] 9 < and false = if + drop [char] 0 + then + 1+ + else + [char] 1 + then + begin + dup [char] 8 > if + false ( break ) + else + dup s" optionsmenu_caption[x]" 20 +c! getenv -1 = if + false ( break ) + else + drop true + then + then + while + 1+ + repeat + + s" xen_kernel" getenv dup -1 <> over 0> and if + xenkerndefault 1+ 0 2swap strcat swap 1- c! + init_xen_active ( n -- n ) + toggle_menuitem ( n -- n ) + else + drop + xenkerndefault c@ 0<> if + init_xen_active ( n -- n ) + else + init_xen_inactive ( n -- n ) + then + then +; -: boot_xen_disabled ( N -- NOTREACHED ) +: toggle_xen ( N -- N TRUE ) toggle_menuitem ( n -- n ) menu-redraw - 500 ms - 0 25 at-xy - s" xen_kernel" getenv dup -1 <> if - 1 1 unload - s" xen_kernel" unsetenv + + dup toggle_stateN @ 0= if + s" xen_kernel" unsetenv else - drop - 0 + xenkerndefault count s" xen_kernel" setenv then - 0 boot ( state -- ) -; -set mainmenu_caption[7]="Disable [X]en" -set maintoggled_text[7]="Disabling [X]en..." -set mainansi_caption[7]="Disable ^[1mX^[men" -set maintoggled_ansi[7]="Disabling ^[1mX^[men..." -set mainmenu_keycode[7]=120 -set mainmenu_command[7]="boot_xen_disabled" + TRUE \ loop menu again +; +set optionsmenu_init="$optionsmenu_init init_xen" diff --git a/emulators/xen-kernel/pkg-message b/emulators/xen-kernel/pkg-message index 0be4da400d7e..e9293d3cde07 100644 --- a/emulators/xen-kernel/pkg-message +++ b/emulators/xen-kernel/pkg-message @@ -1,17 +1,17 @@ Please add the following entries in order to boot the xen kernel -in /etc/sysctl.conf: +In /etc/sysctl.conf: vm.max_wired=-1 -in /etc/ttys +In /etc/ttys: xc0 "/usr/libexec/getty Pc" xterm on secure -In /boot/loader.conf for a dom0 with 2G memory and 4 vcpus +In /boot/loader.conf for a dom0 with 2G memory and 4 vcpus: xen_kernel="/boot/xen" xen_cmdline="dom0_mem=2048M dom0_max_vcpus=4 dom0pvh=1 com1=115200,8n1 guest_loglvl=all loglvl=all" -Add - console=com1 to the above xen_cmdline in order to activate the serial console +Add to the above xen_cmdline in order to activate the serial console: + console=com1 -In /boot/menu.rc.local +In /boot/menu.rc.local: try-include /boot/xen.4th |