# that can be found in the LICENSE file.
# SPDX short identifier: BSD-2-Clause
-# Script must run as root, otherwise it creates trees
-# as the user.
-user=$(id -u)
-[ "$user" != "0" ] && printf "You need to run this script as root! \n" && exit 1
+# This scripts create basic trees and enable services.
+# Excluding the common posix userland commands, the script needs 66-yeller
+# (from 66-tools), 66-env, 66-tree and 66-enable (from 66).
# Variables for 66-yeller
export PROG="66boot-initial-setup"
export COLOR_ENABLED="1"
export CLOCK_ENABLED="0"
+# Script must run as root, otherwise it creates trees
+# as the user.
+user=$(id -u)
+[ "$user" != "0" ] && printf "You need to run this script as root! \n" && exit 1
+
# Information for the user, in case of failure. 66 output is informative, this
# is just a pointer to the docs.
msg_trees() {
# ${1} is the name of the tree
- 66-yeller -F %r "An action for the [${1}] tree failed.
+ 66-yeller -W %b "An action for the [${1}] tree failed.
Check the output before this message for a possibe cause and consult
the 66-tree documentation." %n
- exit 1
}
msg_services() {
}
# Create the mandatory boot tree.
-66-tree -n boot || msg_trees boot
+66-tree -nz boot || msg_trees boot
# Enable the boot@system service in the boot tree.
-66-enable -F -t boot boot@system || msg_services boot@system
+66-enable -z -F -t boot boot@system || msg_services boot@system
# Copy the default boot@conf so that it will survive updates and be accesible
# though /etc/66rc.conf. Also, remove the warning in the first lines of the file.
[ "$warn" = "##[STARTWARN]" ] && sed -i '1,5d' "$new_conf"
# Create default tree, enable it and make it current.
-66-tree -nEc default || msg_trees default
+66-tree -z -nEc default || msg_trees default
# Enable switch-initutils oneshot service in the default tree.
-66-enable switch-initutils || msg_services switch-initutils
+66-enable -z switch-initutils || msg_services switch-initutils
# Create and enable runit tree.
-66-tree -nE runit || msg_trees runit
+66-tree -z -nE runit || msg_trees runit
# Enable the runit service in the runit tree.
-66-enable -t runit runit || msg_services runit
+66-enable -z -t runit runit || msg_services runit
# Start runit tree after the default tree.
-66-tree -S default runit || msg_trees runit
+66-tree -z -S default runit || msg_trees runit
+
+# Print on succesfull completion
+if [ "$?" = 0 ]; then 66-yeller %g "Basic trees created and services enabled succesfully!"; fi
# This script reads a **valid** rc.conf and writes the values to the
# corresponding configuration options in the boot@system environment file.
+# Excluding the common posix userland commands, the script needs 66-yeller
+# (from 66-tools) and 66-env (from 66).
+
+# Variables for 66-yeller
+export PROG="66boot-rcdotconf"
+export COLOR_ENABLED="1"
+export CLOCK_ENABLED="0"
+
# Script must run as root.
user=$(id -u)
FONT_UNIMAP=
TTYS=
-
-# Variables for 66-yeller
-export PROG="66boot-storage-autoconf"
-export COLOR_ENABLED="1"
-export CLOCK_ENABLED="0"
-
apply_conf_from_to(){
# Set configuration value ${3} from ${1} to ${2}
# ${1} is the conf option from /etc/rc.conf
# Same positional args as apply_conf_from_to
if [ -n "${3}" ]
then
- if [ ${3} -lt 11 ] && [ ${3} -gt 0 ]
+ if [ "${3}" -lt 11 ] && [ "${3}" -gt 0 ]
then
apply_conf_from_to "${1}" "${2}" "${3}"
else
fi
else
66-env -t boot -r TTY=!4 boot@system
- 66-yeller -F %r "TTY number not set, reverting
+ 66-yeller -W %b "TTY number not set, reverting
to the default [4]." %n
fi
}
apply_conf_from_to FONT FONT "$FONT"
apply_conf_from_to FONT_UNIMAP FONT_UNIMAP "$FONT_UNIMAP"
set_ttys TTYS TTY "$TTYS"
+
+66-yeller %g "Please re-enable the boot@system service
+for the changes to take effect by running (as root):
+'66-enable -F -t boot boot@system'" %n
\ No newline at end of file
# that can be found in the LICENSE file.
# SPDX short identifier: BSD-2-Clause
+# This scripts determines if the system has dmraid, luks, zfs, btrfs, or
+# btrfs volumes and configures the environment file of the boot@system
+# service accordingly.
+# Excluding the common posix userland commands, the script needs 66-which and 66-yeller
+# (from 66-tools), 66-env (from 66) and blkid (from util-linux).
+
# Variables for 66-yeller
export PROG="66boot-storage-autoconf"
export COLOR_ENABLED="1"
user=$(id -u)
[ "$user" != "0" ] && printf "You need to run this script as root!\n" && exit 1
-# Excluding the common posix userland commands, the script needs 66-which and 66-yeller
-# (from 66-tools), 66-env (from 66) and blkid (from util-linux).
+
detect_fs() {
# Uses blkid to detect partition TYPEs. The result is the number
check_and_apply_conf "$crypto_LUKS_detected" "$luks_util_exists" CRYPTTAB LUKS cryptsetup "[cryptsetup]"
check_and_apply_conf "$LVM2_member_detected" "$lvm_util_exists" LVM LVM lvchange "[lvm2]"
check_and_apply_conf "$dmraid_detected" "$dmraid_util_exists" DMRAID DMRAID dmraid "[dmraid]"
+
+66-yeller %g "Please re-enable the boot@system service
+for the changes to take effect by running (as root):
+'66-enable -F -t boot boot@system'" %n
\ No newline at end of file