menu.lua (fd2b19b3eeada3bb85075809899d71ec34152d3c) | menu.lua (5c1b51658125f5a9bf94179f89a9f24bc7761311) |
---|---|
1-- 2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 3-- All rights reserved. 4-- 5-- Redistribution and use in source and binary forms, with or without 6-- modification, are permitted provided that the following conditions 7-- are met: 8-- 1. Redistributions of source code must retain the above copyright --- 123 unchanged lines hidden (view full) --- 132 }, 133}; 134 135menu.welcome = { 136 entries = function() 137 local menu_entries = menu.welcome.all_entries; 138 -- Swap the first two menu items on single user boot 139 if (core.isSingleUserBoot()) then | 1-- 2-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 3-- All rights reserved. 4-- 5-- Redistribution and use in source and binary forms, with or without 6-- modification, are permitted provided that the following conditions 7-- are met: 8-- 1. Redistributions of source code must retain the above copyright --- 123 unchanged lines hidden (view full) --- 132 }, 133}; 134 135menu.welcome = { 136 entries = function() 137 local menu_entries = menu.welcome.all_entries; 138 -- Swap the first two menu items on single user boot 139 if (core.isSingleUserBoot()) then |
140 -- Shallow copy the table 141 menu_entries = core.shallowCopyTable(menu_entries); 142 |
|
140 local multiuser = menu_entries[1]; 141 local singleuser = menu_entries[2]; 142 | 143 local multiuser = menu_entries[1]; 144 local singleuser = menu_entries[2]; 145 |
146 multiuser.name = multiuser.alternate_name; 147 singleuser.name = singleuser.alternate_name; 148 |
|
143 menu_entries[2] = multiuser; 144 menu_entries[1] = singleuser; 145 end 146 return menu_entries; 147 end, 148 all_entries = { 149 -- boot multi user 150 { 151 entry_type = core.MENU_ENTRY, 152 name = function() 153 return color.highlight("B") .. 154 "oot Multi user " .. 155 color.highlight("[Enter]"); 156 end, | 149 menu_entries[2] = multiuser; 150 menu_entries[1] = singleuser; 151 end 152 return menu_entries; 153 end, 154 all_entries = { 155 -- boot multi user 156 { 157 entry_type = core.MENU_ENTRY, 158 name = function() 159 return color.highlight("B") .. 160 "oot Multi user " .. 161 color.highlight("[Enter]"); 162 end, |
163 -- Not a standard menu entry function! 164 alternate_name = function() 165 return color.highlight("B") .. 166 "oot Multi user"; 167 end, |
|
157 func = function() 158 core.setSingleUser(false); 159 core.boot(); 160 end, 161 alias = {"b", "B"} 162 }, 163 164 -- boot single user 165 { 166 entry_type = core.MENU_ENTRY, 167 name = function() 168 return "Boot " .. color.highlight("S") .. 169 "ingle user"; 170 end, | 168 func = function() 169 core.setSingleUser(false); 170 core.boot(); 171 end, 172 alias = {"b", "B"} 173 }, 174 175 -- boot single user 176 { 177 entry_type = core.MENU_ENTRY, 178 name = function() 179 return "Boot " .. color.highlight("S") .. 180 "ingle user"; 181 end, |
182 -- Not a standard menu entry function! 183 alternate_name = function() 184 return "Boot " .. color.highlight("S") .. 185 "ingle user " .. color.highlight("[Enter]"); 186 end, |
|
171 func = function() 172 core.setSingleUser(true); 173 core.boot(); 174 end, 175 alias = {"s", "S"} 176 }, 177 178 -- escape to interpreter --- 255 unchanged lines hidden --- | 187 func = function() 188 core.setSingleUser(true); 189 core.boot(); 190 end, 191 alias = {"s", "S"} 192 }, 193 194 -- escape to interpreter --- 255 unchanged lines hidden --- |