nstboot — Used to manage start-up, shutdown and Grub2 actions related to NST.
nstboot
[ --move
[true]|false
] [ --shutdown
[true]|false
] [ --poweroff
[true]|false
] [ --reboot
[true]|false
] [ --halt
[true]|false
] [ --boot
[true]|false
] [ --grub2
[true]|false
] [ --isuefiboot
[true]|false
] [ --getgrub2confpath
[true]|false
] [ --getgrub2envpath
[true]|false
] [ --cpefigrubenv2bios
[true]|false
] [ --cpbiosgrubenv2efi
[true]|false
] [
-h
[true]|false
| --help
[true]|false
] [
-H
[true]|false
| --help-long
[true]|false
] [
-v
[true]|false
| --verbose
[true]|false
] [ --version
[true]|false
]
The nstboot is mainly used internally by the NST system to help manage the various combinations (modes) in which the system can be run from. This script is typically invoked during the boot or shutdown stages of the system.
Grub2
related operations like rebuilding
the NST Grub2
boot menu and
configuration / environment file relocation are available.
While you will typically never need to directly use this script, if you are booting your NST system from writable removable media (a USB thumb drive), you can use the following command to shutdown the system when you are planning on moving the system to new hardware:
[root@probe ~]#
nstboot --move --shutdown
Broadcast message from root@probe (/dev/pts/2) at 10:33 ... The system is going down for power off NOW! [root@probe ~]#
This is all that you will typically need to know about this script. The remainder of the documentation involves technical notes for the NST developers.
A NST system can be booted in the following manners:
A "Live" boot from writable media with a "persistent" layer (USB thumb drive).
A hard disk installation with full read/write access (internal SATA drive).
A hard disk installation to removable media (a external USB drive or USB thumb drive).
A "Live" boot from a read-only media running within a VMware virtual machine.
A hard disk installation running within a VMware virtual machine.
Each of the above mentioned boot conditions requires special attention. The nstboot script is used to help deal with the different operations involved.
The way in which a ISO image is treated as a writable disk
during a live boot causes the system to use up RAM as files are
"written". To avoid some of this memory loss,
the nstboot script will relocate some
directories to a tmpfs
file system if the
"nstrelocate=true
" option is specified on the
kernel boot parameter line. This option is recommended if you
intend to run from a live boot for a extended period of
time.
The following command line options are available:
--move [true]|false
]
If your system is booting from writable and
removable media (such as a USB memory stick),
it will likely persist information between boots. If you then
move the installation to new hardware, it is likely that the
persisted information will be incorrect for the new
hardware. The "--move
" option is used to
deal with this situation. It removes hardware specific
configuration files so that they will be recreated at boot
time.
--shutdown [true]|false
]
If this option is specified, the system will be shutdown and powered off after completing all other operations.
--poweroff [true]|false
]
If this option is specified, the system will be
shutdown and powered off after completing all other
operations. This option is the same as the
"--shutdown
" option.
--reboot [true]|false
]
If this option is specified, the system will be rebooted after completing all other operations.
--halt [true]|false
]
If this option is specified, the system will be shutdown and halted after completing all other operations. This option will not "power off" the system.
--boot [true]|false
]
Pass this option when running the script from the
end of the script: "/etc/init.d/livesys
"
for an NST Live boot or within script:
"/etc/init.d/nstinit
" for an NST hard disk
install. This will examine the boot state of the system and run
various commands accordingly. This option should
not be used directly from the command
line. When this runs, it will look for the string:
"nstmove
" in
/proc/cmdline
(boot options). If found, it
is assumed that you are booting the system on new hardware and
need to have any pre-existing hardware specific configuration
files removed. After the files are removed, the system will
automatically reboot. Other NST specific boot
command line options include: "nstreboot
".
The "nstreboot
" option will reboot the system
at completion of running the
"/etc/init.d/livesys
" or the
"/etc/init.d/nstinit
" script. Typically,
this option is used in conjuction with other boot command line
options (e.g., "reset_overlay
"). Finally,
the "--boot
" option will also perform a set
of Gnome 3 tweaks specific to NST system initialization (e.g.,
Set the default background color for the GDM login greeter and
the user 'root'). These tweaks are typically performed once
during the first NST boot.
--grub2 [true]|false
]
This option will rebuild the NST
'Grub2
' configuration file (NST Grub2 Boot
Menu): "/etc/grub2.conf
" using
the NST
tweak script:
"/etc/nst/tweak/09nst-config-grub2.tweak
". Typically,
after receiving a new Kernel update or making a change to the
NST default Grub2
configuration file:
"/etc/nst/grub2/nst_grub2_defaults
" this
option can be used to rebuild the 'Grub2
'
configuration file.
--isuefiboot [true]|false
]
If this option is specified, the script will return 0 if the system is UEFI booted. It will return 1 if the system is BIOS booted.
--getgrub2confpath [true]|false
]
If this option is specified, the full path name to
the Grub2
configuration file will be
returned. This option will provide the correct path for either a
BIOS or an UEFI booted
system.
--getgrub2envpath [true]|false
]
If this option is specified, the full path name to
the Grub2
environment file will be
returned. This option will provide the correct path for either a
BIOS or an UEFI booted
system.
--cpefigrubenv2bios [true]|false
]
If this option is specified, the
Grub2
environment file for an
UEFI booted system
("/boot/efi/EFI/fedora/grubenv
") will be
copied if available to the BIOS location
("/boot/grub2/grubenv
").
--cpbiosgrubenv2efi [true]|false
]
If this option is specified,
the Grub2
environment file for an
UEFI booted system will be copied from the
BIOS location
"/boot/grub2/grubenv
" to the
EFI location:
"/boot/efi/EFI/fedora/grubenv
".
-h [true]|false
] | [--help [true]|false
]
When this option is specified, nstboot will display a short one line description of nstboot, followed by a short description of each of the supported command line options. After displaying this information nstboot will terminate.
-H [true]|false
] | [--help-long [true]|false
]
This option will attempt to pull up additional
nstboot documentation within a text based
web browser. You can force which browser we use setting the
environment variable TEXTBROWSER
, otherwise,
we will search for some common ones.
-v [true]|false
] | [--verbose [true]|false
]
When you set this option to true, nstboot will produce additional output. This is typically used for diagnostic purposes to help track down when things go wrong.
--version [true]|false
]
If this option is specified, the version number of the script is displayed.
/usr/share/nstboot
Directory containing resource files used by nstboot.
/etc/init.d/livesys
NST Live system initialization script run at boot time prior to other init.d service scripts.
/etc/init.d/nstinit
NST hard disk installation system initialization script run at boot time prior to other init.d service scripts.
/proc/cmdline
Information about the command line options passed to the kernel at boot time.
/etc/nst/nstpasswd.conf
When the "--boot
"
option is specified, then this configuration file is used
to indicate the state of the system and clear text
passwords. If the variable NSTPASSWD_STATE
from the file does not have the value of
"set
", then
the nstpasswd command will be
run at boot time to initialize the system level
passwords. If the NSTCTPASSWD_STATE
does
not have the value of "set
", then the
system clear text passwords will be initialized with
randomly generated values. This file will be rewritten
should the state change. If this file is not present on
the system, each variable will be set to a value of
"initial
" (thus forcing password
generation).
/boot/grub2/grub.conf
Grub2
configuration file
for a BIOS booted system.
/boot/grub2/grubenv
Grub2
environment file
for a BIOS booted system.
/etc/grub2.conf
The Grub2
configuration
file.