Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/init/init
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ if ! init_tuple="$(grep -q '\<bedrock_init=' /proc/cmdline && sed -e 's/^.*bedro
fi
init_stratum="$(echo "${init_tuple}" | cut -d: -f1)"
init_cmd="$(echo "${init_tuple}" | cut -d: -f2-)"
# Make init_cmd available to brl-apply when we call it later.
export init_cmd

echo ""
step_init "6"
Expand Down
32 changes: 31 additions & 1 deletion src/slash-bedrock/etc/bedrock.conf
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ default =
# 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, /usr/bin/intra-desktop
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, /usr/bin/intra-desktop, /bin/66, /usr/bin/66

#
# Kernel modules to load before assuming keyboard is available.
Expand Down Expand Up @@ -442,6 +442,36 @@ pin/bin/reboot = init:$PATH/reboot
pin/bin/shutdown = init:$PATH/shutdown
pin/bin/halt = init:$PATH/halt

# Programs specific to 66 init.
pin/bin/66-all = init:$PATH/66-all
pin/bin/66-clock = init:$PATH/66-clock
pin/bin/66-dbctl = init:$PATH/66-dbctl
pin/bin/66-disable = init:$PATH/66-disable
pin/bin/66-echo = init:$PATH/66-echo
pin/bin/66-enable = init:$PATH/66-enable
pin/bin/66-env = init:$PATH/66-env
pin/bin/66-getenv = init:$PATH/66-getenv
pin/bin/66-gnwenv = init:$PATH/66-gnwenv
pin/bin/66-init = init:$PATH/66-init
pin/bin/66-inresolve = init:$PATH/66-inresolve
pin/bin/66-inservice = init:$PATH/66-inservice
pin/bin/66-instate = init:$PATH/66-instate
pin/bin/66-intree = init:$PATH/66-intree
pin/bin/66-ns = init:$PATH/66-ns
pin/bin/66-nuke = init:$PATH/66-nuke
pin/bin/66-olexec = init:$PATH/66-olexec
pin/bin/66-parser = init:$PATH/66-parser
pin/bin/66-scanctl = init:$PATH/66-scanctl
pin/bin/66-scandir = init:$PATH/66-scandir
pin/bin/66-start = init:$PATH/66-start
pin/bin/66-stop = init:$PATH/66-stop
pin/bin/66-svctl = init:$PATH/66-svctl
pin/bin/66-tree = init:$PATH/66-tree
pin/bin/66-update = init:$PATH/66-update
pin/bin/66-which = init:$PATH/66-which
pin/bin/66-writenv = init:$PATH/66-writenv
pin/bin/66-yeller = init:$PATH/66-yeller

# [restriction]/restrict items are only restricted if run through strat or
# cross. List any such items here to ensure they are run through cross to be
# restricted.
Expand Down
23 changes: 23 additions & 0 deletions src/slash-bedrock/libexec/brl-apply
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,14 @@ if [ -r /etc/fstab ] && awk '$1$2$3$4$5$6 !~ "#" && $6 != "" && $6 != 0 {x=1} EN
' /etc/fstab >/etc/fstab-new && mv /etc/fstab-new /etc/fstab
fi

# When using 66 init, make a tmpfs available for 66's LIVE directory.
# The init_cmd variable is exported by bedrock init for use here.
if [ -n $init_cmd ] && echo $init_cmd | grep -q '66'; then
live_dir=$(awk -F= '/^LIVE=/ { print $2 }' /etc/66/init.conf)
mkdir -p $live_dir
mount -t tmpfs tmpfs $live_dir -o rw,nosuid,nodev,mode=755,exec
fi

# Disable SELinux
for stratum in $(/bedrock/bin/brl list -ei); do
root="$(stratum_root --empty "${stratum}")"
Expand Down Expand Up @@ -445,4 +453,19 @@ for stratum in $(/bedrock/bin/brl list -ei); do
mv "${init}-bedrock-patch" "${init}"
done

# Patch 66 init to skip unmounting /run, as this breaks Bedrock's pre-init setup of /run
for stratum in $(/bedrock/bin/brl list -ei); do
stratum_root="/bedrock/strata/${stratum}"
for init in "${stratum_root}/bin/66" "${stratum_root}/usr/bin/66"; do
if [ -x ${init} ] && grep -q '\-m' ${init}; then
cp "${init}" "${init}-bedrock-patch"
# This is obviously not robust against the various
# forms the call to 66-boot can take, but KISS is
# probably sufficient for now.
sed 's/-m//' "${init}" > "${init}-bedrock-patch"
mv "${init}-bedrock-patch" "${init}"
fi
done
done

exit_success