File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,13 +156,13 @@ function chroot_sdcard_with_stdout() {
156156function chroot_custom_long_running() { # any pipe causes the left-hand side to subshell and caos ensues. it's just like chroot_custom()
157157 local target=$1
158158 shift
159- raw_command=" $* " raw_extra=" chroot_custom_long_running" TMPDIR=" " run_host_command_logged_raw chroot " ${target} " /usr/bin/env bash -e -o pipefail -c " $* "
159+ raw_command=" $* " raw_extra=" chroot_custom_long_running" TMPDIR=" " LC_ALL= " C " LANG= " C " LANGUAGE= " " SUDO_USER= " " run_host_command_logged_raw chroot " ${target} " /usr/bin/env bash -e -o pipefail -c " $* "
160160}
161161
162162function chroot_custom() {
163163 local target=$1
164164 shift
165- raw_command=" $* " raw_extra=" chroot_custom" TMPDIR=" " run_host_command_logged_raw chroot " ${target} " /usr/bin/env bash -e -o pipefail -c " $* "
165+ raw_command=" $* " raw_extra=" chroot_custom" TMPDIR=" " LC_ALL= " C " LANG= " C " LANGUAGE= " " SUDO_USER= " " run_host_command_logged_raw chroot " ${target} " /usr/bin/env bash -e -o pipefail -c " $* "
166166}
167167
168168# For installing packages host-side. Not chroot!
Original file line number Diff line number Diff line change 99
1010function disable_systemd_service_sdcard() {
1111 display_alert " Disabling systemd service(s) on target" " ${* } " " debug"
12- declare service
12+ declare service stderr_output
1313 for service in " ${@ } " ; do
14- chroot_sdcard systemctl --no-reload disable " ${service} " " ||" true
14+ # Use --root= to operate directly on the chroot filesystem
15+ # instead of talking to the host's systemd via D-Bus (which
16+ # doesn't know about the chroot's unit files).
17+ stderr_output=" $( systemctl --root=" ${SDCARD} " --no-reload disable " ${service} " 2>&1 ) " || true
18+ [[ -n " ${stderr_output} " ]] && display_alert " systemctl disable ${service} " " ${stderr_output} " " debug"
1519 done
1620}
You can’t perform that action at this time.
0 commit comments