Skip to content

Commit

Permalink
Merge pull request #199 from NeuroDesk:fix-cpuinfo-on-arm
Browse files Browse the repository at this point in the history
fix mhz issue on ARM
  • Loading branch information
stebo85 authored Nov 28, 2023
2 parents 7c4f261 + b022c9d commit a4139c8
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions config/jupyter/jupyterlab_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ fi

# Create a symlink to /neurodesktop-storage in home if it is mounted
if mountpoint -q /neurodesktop-storage/; then
if [ ! -L "/home/${NB_USER}/data/neurodesktop-storage" ]; then
if [ ! -L "/home/${NB_USER}/neurodesktop-storage" ]; then
ln -s /neurodesktop-storage/ /home/${NB_USER}/
fi
else
if [ ! -L "/neurodesktop-storage" ]; then
if [ ! -d "/home/${NB_USER}/neurodesktop-storage/" ]; then
mkdir -p /home/${NB_USER}/neurodesktop-storage/containers
fi
sudo ln -s /home/${NB_USER}/neurodesktop-storage/ /neurodesktop-storage
if [ ! -L "/neurodesktop-storage" ]; then
sudo ln -s /home/${NB_USER}/neurodesktop-storage/ /neurodesktop-storage
fi
fi
fi

Expand All @@ -89,6 +91,14 @@ if [ ! -L "/neurocommand/local/containers" ]; then
ln -s "/home/${NB_USER}/neurodesktop-storage/containers" "/neurocommand/local/containers"
fi

# Create a cpufino file with a valid CPU Mhz entry for ARM cpus
if ! grep -iq 'cpu.*hz' /proc/cpuinfo; then
cpuinfo_file=/home/${NB_USER}/.local/cpuinfo_with_ARM_MHz_fix
cp /proc/cpuinfo $cpuinfo_file
chmod u+rw $cpuinfo_file
sed -i '/^$/c\cpu MHz : 2245.778\n' $cpuinfo_file
sudo mount --bind $cpuinfo_file /proc/cpuinfo
fi

# Start and stop SSH server to initialize host
sudo service ssh restart
Expand Down

0 comments on commit a4139c8

Please sign in to comment.