Skip to content

Instantly share code, notes, and snippets.

@wynn1212
Created March 24, 2019 18:17
Show Gist options
  • Save wynn1212/61db16447e8f4e777b50933d0cdc735b to your computer and use it in GitHub Desktop.
Save wynn1212/61db16447e8f4e777b50933d0cdc735b to your computer and use it in GitHub Desktop.
Bedrock Linux Configuration
#
# Bedrock Linux main configuration file
#
# After making changes here, run `brl apply` (as root) to apply them.
#
[locale]
#
# The Olson timezone. For example:
#
# timezone = America/New_York
#
# At least one stratum should provide an Olson database file at
#
# /usr/share/zoneinfo/<timezone>
#
# For example, for America/New_York there should be a file at
#
# /usr/share/zoneinfo/America/New_York
#
timezone = Asia/Taipei
#
# The /etc/locale.gen language line. For example:
#
# localegen = en_US.UTF-8 UTF-8
#
localegen = zh_TW.UTF-8 UTF-8
#
# The POSIX $LANG variable
#
LANG = zh_TW.UTF-8
[init]
#
# Bedrock Linux provides its own init which sets up Bedrock subsystems then
# hands control over to a user-selected init provided by some stratum.
#
#
# Number of seconds to wait for an init to be input before automatically
# selecting the default value (if a valid default value is set).
#
timeout = 30
#
# Init to utilize by default if timeout expires. Format is
#
# default = <stratum>:<path>
#
# For example, to use void's /sbin/init, use:
#
# default = void:/sbin/init
#
default = debian:/sbin/init
#
# A comma separated list of local file paths which may provide an init. The
# Bedrock init menu will list every available one from every (unignored)
# stratum.
#
paths = /sbin/init, /sbin/fallback-init, /sbin/myinit, /sbin/ninit, /sbin/openrc-init, /sbin/runit-init, /sbin/simpleinit, /sbin/upstart, /lib/sysvinit/init, /lib/systemd/systemd, /usr/lib/systemd/systemd
[global]
#
# Bedrock Linux categorizes every file path on the system as either:
#
# - Local to a given stratum. Multiple instances of such files are needed to
# avoid conflicts between the strata.
# - Global across all strata. There is only one instance of such a file
# irrelevant of the number of strata.
#
# For example: both Debian and Ubuntu have package managers that read
# /etc/apt/sources.list, and each needs to see something different there.
# Thus, the /etc/apt/sources.list file path should be local to each stratum.
# However, all processes should see the same contents in /home, and thus /home
# is global.
#
# By default, all files are local. The following settings are used to indicate
# which files should be global. Different contexts require different systems
# for marking a file path as global.
#
#
# A list of directories which should be global. If something is
# mounted into one of these directories, that new mount point
# is also global.
#
share = /boot, /dev, /home, /lib/modules, /media, /mnt, /proc, /root, /run, /sys, /tmp, /var/tmp
#
# Another list of directories which should be global. Anything mounted in them
# is local by default. These are primarily used to avoid recursion in nested
# cases. Given that nesting is expected, be careful with order.
#
bind = /bedrock, /bedrock/cross, /bedrock/run, /bedrock/strata/bedrock
#
# A list of files and directories within /etc which should be global. /etc
# must be treated specially, as the techniques used for share and bind do not
# work for files in it.
#
etc = adjtime, default/grub, fstab, group, group-, gshadow, gshadow-, hostname, hosts, login.defs, machine-id, modprobe.d/blacklist.conf, passwd, passwd-, rc.local, resolv.conf, shadow, shadow-, sudoers
[symlinks]
#
# Enforce various symlinks are in place at local paths. This is applied at
# stratum enable/repair time.
#
# Keys are local paths, values are symlink contents.
#
# The symlink contents must be absolute paths.
#
#
# Some package managers attempt to update this. They become upset if it is
# created between an unlink() and symlink(), making it unsuitable for
# [etc-symlinks] below.
#
# Different distros use slightly different values here that are all effectively
# the same. Rather than attempt to fight distros in this regard, Bedrock has
# hard-coded internal support for multiple valid values here and may not
# respect changes to this field.
/etc/mtab = /proc/self/mounts
#
# Some distros may expect a file at one path while others expect it at another.
# Standardize the location of global files.
#
/var/lib/dbus/machine-id = /etc/machine-id
/var/run = /run
#
# Various programs need to be configured to properly interact with Bedrock
# subsystems. Point them to Bedrock configuration.
#
/etc/systemd/system/bedrock-fix-mounts.service = /bedrock/share/systemd/bedrock-fix-mounts.service
/etc/systemd/system/bedrock-stop-fuse-filesystems.service = /bedrock/share/systemd/bedrock-stop-fuse-filesystems.service
/etc/systemd/system/multi-user.target.wants/bedrock-fix-mounts.service = /bedrock/share/systemd/bedrock-fix-mounts.service
/etc/systemd/system/multi-user.target.wants/bedrock-stop-fuse-filesystems.service = /bedrock/share/systemd/bedrock-stop-fuse-filesystems.service
/etc/X11/xorg.conf.d/99-bedrock-fonts.conf = /bedrock/run/xorg-fonts
/etc/fonts/conf.d/99-bedrock-fonts.conf = /bedrock/share/fonts/fontconf.conf
/etc/X11/Xsession.d/99bedrock_env = /bedrock/run/profile
/etc/X11/xinit/xinitrc.d/99bedrock_env = /bedrock/run/profile
/etc/bash_completion.d/brl = /bedrock/share/bash/completion/brl
/etc/bash_completion.d/strat = /bedrock/share/bash/completion/strat
/etc/fish/conf.d/99bedrock.fish = /bedrock/run/fprofile
/etc/fish/completions/brl.fish = /bedrock/share/fish/completion/brl.fish
/etc/fish/completions/strat.fish = /bedrock/share/fish/completion/strat.fish
#
# In general, system software such as Bedrock should not manipulate /usr/local.
# Bedrock should favor configuring /etc files instead.
#
# However, dbus's dbus-daemon-launch-helper seems to ignore /etc/dbus-1/
# configuration extending the search path. See
# https://bugs.freedesktop.org/show_bug.cgi?id=92458 for a discussion on the
# matter. For example:
#
# > Note that d-d-l-h only reads .service files from standard hard-coded paths,
# > not from any additional paths that you might have configured
#
# Since /usr/local/share/dbus is included in the hard-coded paths, is not used
# by most package managers, and is rarely used by end-users, it's the cleanest
# option available to teach dbus about /bedrock/cross.
#
/usr/local/share/dbus-1/system-services = /bedrock/cross/dbus-system
/usr/local/share/dbus-1/services = /bedrock/cross/dbus-session
#
# Some distros use a swap file and include reference to it in their fstab.
# This must be global so that it is valid when using an init from another
# stratum. However, it is not clear if it would work well with any of the
# established techniques in [global]. Instead, symlink it into a known global
# directory.
#
/swapfile = /bedrock/swapfile
[etc-symlinks]
#
# Dynamically enforce various symlinks are in place at local paths. Any change
# away from specified configuration is immediately undone.
#
# Keys are local paths relative to /etc, values are symlink contents.
#
# The symlink contents must be absolute paths.
#
#
# Some init systems attempt to change these values at boot time, just after
# being enabled. Thus, symlinks-general will not suffice.
#
localtime = /bedrock/run/localtime
environment = /bedrock/run/environment
[etc-inject]
#
# Not all programs can be adequately/reliably configured by creating new,
# cleanly isolated configuration files. Instead, a configuration file must be
# extended to include desired configuration without clobbering its stratum
# local configuration. Typically these configuration files are in /etc.
#
# Bedrock ensures that, should certain files exist in /etc, they will include
# content specified at another file path. If the desired content is not found
# in the file it is automatically appended to the end.
#
# The keys are file paths relative to /etc, and the values are paths to files
# whose content must be included if the key's file exists in /etc.
#
# If you alter either the key/values in this section, or the actual content of
# the values, run `brl reload` to apply the change. Do this before rebooting
# to ensure any old content is removed.
#
sudoers = /bedrock/share/sudo/include-bedrock
profile = /bedrock/share/shells/include-bedrock
#
# etc-inject only injects existing files and does create make files in order to
# avoid creating a file a package manager does not expect. Different distro
# zsh packages provide different files, requiring multiple zsh file injections.
#
zsh/zshenv = /bedrock/share/zsh/include-bedrock
zsh/zprofile = /bedrock/share/zsh/include-bedrock
[env-vars]
#
# Many programs search environment variables consisting of a colon-separated
# list of directories. We can use these to teach these programs about
# cross-stratum content.
#
# Generally, the fields fall into three categories, which should be in the
# following order:
#
# - The file must come from a specific stratum.
# - For example, `reboot` should be provided by the stratum providing the
# current init.
# - Typically, these are provided by `/bedrock/cross/pin/[...]`.
# - The file must come from the local stratum.
# - Bedrock Linux assumes strata are self-sufficient in terms of hard
# dependencies. Thus, if something has a hard dependency on a given file
# that file *must* be available locally.
# - For example, if a given distro's `/bin/sh` is provided by bash, that
# distro's scripts may use bash-isms, and thus another distro's `/bin/sh`
# may be unsuitable.
# - Typically these values are the traditional values of the given
# environment variable.
# - The file may come from any stratum.
# - If the above two categories don't apply, we know the program isn't
# picky about the specific version of the given file, and thus any distro
# may provide it.
# - Typically, these are provided by `/bedrock/cross/[...]`.
#
#
# A list of directories searched by various programs to find executables.
#
PATH = /bedrock/cross/pin/bin:/bedrock/bin:/usr/local/sbin:/usr/local/bin:/opt/sbin:/opt/bin:/usr/sbin:/usr/bin:/sbin:/bin:/bedrock/cross/bin
#
# A list of directories searched by the man executable to find documentation.
#
MANPATH = /bedrock/share/man:/usr/local/share/man:/usr/share/man:/bedrock/cross/man
#
# A list of directories searched by the info executable to find documentation.
#
INFOPATH = /bedrock/share/info:/usr/local/share/info:/usr/share/info:/bedrock/cross/info
#
# A list of directories used by the freedesktop.org standard containing things
# such as icons and application descriptions.
#
XDG_DATA_DIRS = /usr/local/share:/usr/share:/bedrock/cross/
#
# Terminfo file locations
#
TERMINFO_DIRS = /usr/local/share/terminfo:/usr/share/terminfo:/bedrock/cross/terminfo
[cross]
#
# Bedrock Linux mounts a virtual filesystem at
#
# /bedrock/cross
#
# which provides an alternative view of various files from the enabled strata.
# This view is used for cross-stratum coordination.
#
# For the [cross-*] sections below, the keys represent file paths appended to
# /bedrock/cross, and the values are a list of files or directories to be
# searched for contents for the given file path. For example,
#
# man = /usr/local/share/man, /usr/share/man
#
# indicates that /bedrock/cross/man should be populated with the contents of
# the /usr/local/share/man and /usr/share/man directories of all of the enabled
# strata.
#
# The paths used for values may be prefixed by "<stratum>:" indicating the
# given file/directory should only be considered from a specific stratum. For
# example,
#
# pin/bin/firefox = arch:/usr/bin/firefox, void:/usr/bin/firefox
#
# Indicates a file at /bedrock/cross/pin/bin/firefox should be provided by
# arch if available, or if not then void; otherwise, the file should not exist.
#
#
# If a value does not have a stratum prefixed, it may be provided by any
# stratum that has the file. If multiple do, the values in "priority" below
# indicate which should be given priority. Any enabled strata left unspecified
# are implicitly appended at the end in an unspecified order. For example,
#
# priority = gentoo, debian
#
# indicates that for the `man` example above, if gentoo provides the given man
# page, gentoo's version should be provided. Otherwise, if debian does, then
# debian's should be provided. Otherwise, any stratum that provides the man
# page may provide it.
#
priority =
[cross-pass]
#
# Files accessed here are passed through from the stratum's version unaltered.
#
man = /bedrock/share/man, /usr/local/share/man, /usr/share/man
info = /bedrock/share/info, /usr/local/share/info, /usr/share/info
icons = /usr/local/share/icons, /usr/share/icons
zoneinfo = /usr/share/zoneinfo
terminfo = /usr/local/share/terminfo, /usr/share/terminfo
bash-completion = /usr/share/bash-completion
zsh-completion = /usr/share/zsh/site-functions, /usr/share/zsh/vendor-completion, /usr/share/zsh/functions/Completion/Debian, /usr/share/zsh/functions/Completion/Mandriva, /usr/share/zsh/functions/Completion/openSUSE, /usr/share/zsh/functions/Completion/Redhat
firmware = /lib/firmware/updates/UTS_RELEASE, /lib/firmware/updates, /lib/firmware/UTS_RELEASE, /lib/firmware
[cross-bin]
#
# Files are executables. Executing these files should implicitly redirect
# through `strat <stratum>`.
#
bin = /usr/local/sbin, /usr/local/bin, /opt/sbin, /opt/bin, /usr/sbin, /usr/bin, /sbin, /bin, /usr/games, /usr/local/games
#
# These programs are strongly related to the init system. If the stratum
# providing init provides these commands, that version should take priority.
# Typical Bedrock systems have /bedrock/pin/bin/ at the from of the $PATH.
#
pin/bin/systemctl = init:/usr/sbin/systemctl, init:/usr/bin/systemctl, init:/sbin/systemctl, init:/bin/systemctl
pin/bin/rc-service = init:/usr/sbin/rc-service, init:/usr/bin/rc-service, init:/sbin/rc-service, init:/bin/rc-service
pin/bin/rc-status = init:/usr/sbin/rc-status, init:/usr/bin/rc-status, init:/sbin/rc-status, init:/bin/rc-status
pin/bin/rc-update = init:/usr/sbin/rc-update, init:/usr/bin/rc-update, init:/sbin/rc-update, init:/bin/rc-update
pin/bin/rc-udevadm = init:/usr/sbin/rc-udevadm, init:/usr/bin/rc-udevadm, init:/sbin/rc-udevadm, init:/bin/rc-udevadm
pin/bin/sv = init:/usr/sbin/sv, init:/usr/bin/sv, init:/sbin/sv, init:/bin/sv
pin/bin/poweroff = init:/usr/sbin/poweroff, init:/sbin/poweroff, init:/usr/bin/poweroff, init:/bin/poweroff
pin/bin/reboot = init:/usr/sbin/reboot, init:/sbin/reboot, init:/usr/bin/reboot, init:/bin/reboot
pin/bin/shutdown = init:/usr/sbin/shutdown, init:/sbin/shutdown, init:/usr/bin/shutdown, init:/bin/shutdown
pin/bin/halt = init:/usr/sbin/halt, init:/sbin/halt, init:/usr/bin/halt, init:/bin/halt
[cross-ini]
#
# Files are in ini format. Any keys which match
# "[Try]Exec[Start|Stop|Exec|Reload]" should have their values altered to
# redirect through `strat <stratum>`.
#
applications = /usr/local/share/applications, /usr/share/applications
xsessions = init:/usr/local/share/xsessions, init:/usr/share/xsessions, /usr/local/share/xsessions, /usr/share/xsessions
dbus-system = /usr/share/dbus-1/system-services
dbus-session = /usr/share/dbus-1/services
[cross-font]
#
# Values are font directories. Fonts are passed through, and font databases
# are merged to list all fonts.
#
fonts = /usr/share/fonts
[brl-fetch-mirrors]
#
# `brl fetch` fetches files from distros for use as Bedrock Linux strata.
#
# If a mirror is provided to the `brl fetch` command, it is used to fetch the
# given distro. Otherwise, this configuration is checked to see if it
# specifies a given mirror should be tried. If no working mirror is found
# here, `brl fetch` will attempt to select a mirror from those it finds for the
# given distribution.
#
#
# Some mirrors support multiple Linux distributions and use the same prefix
# path for all of them. For example, at the time of writing, there is an Arch
# mirror at
#
# http://mirrors.edge.kernel.org/archlinux
#
# and a CentOS mirror at
#
# http://mirrors.edge.kernel.org/centos
#
# and a Debian mirror at:
#
# http://mirrors.edge.kernel.org/debian
#
# and a Fedora mirror at
#
# http://mirrors.edge.kernel.org/fedora
#
# Rather than configuring each of these separately, the base URL can be added
# to mirror-prefix to tell `brl fetch` to check it as a possible mirror. For
# the above kernel.org example, one may set:
#
# mirror-prefix = http://mirrors.edge.kernel.org
#
# This is a comma separated list which is checked in order.
#
mirror-prefix =
#
# You may set mirrors per distro by setting the distro name as spelled by `
#
# brl fetch --list
#
# as the key and the mirror as the value. For example, to indicate that Ubuntu
# should be fetched with the mirror
#
# http://us.archive.ubuntu.com/ubuntu
#
# One may set
#
# ubuntu = http://us.archive.ubuntu.com/ubuntu
#
[miscellaneous]
mirrors = https://raw.githubusercontent.com/bedrocklinux/bedrocklinux-userland/0.7/releases
# Set to false to disable color in brl output
color = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment