Skip to content

Commit

Permalink
Use /root as current working directory in init-minimal
Browse files Browse the repository at this point in the history
When booting via systemd, ssh and the serial bash have /root as cwd. To
make the behavior of further commands more consistent, cd there when
using the minimal init. This avoids having SSH commands do slightly
different things depending on the init system.
  • Loading branch information
FlorentRevest committed Feb 21, 2024
1 parent 88bec39 commit f8196fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tasks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ cat /etc/hostname > /proc/sys/kernel/hostname
ip link set eth0 up
dhclient eth0
# Change cwd to /root
HOME=/root
cd $HOME
# Start the SSH server
mkdir /run/sshd/
/usr/sbin/sshd
Expand Down

0 comments on commit f8196fb

Please sign in to comment.