Instead of switching from user to root lets use sudo instead

NotPike 2022-10-01 14:46:06 -07:00
parent c06bfac64f
commit afd9fef9a5

@ -152,40 +152,40 @@ If you decide to [ignore this guide](https://github.com/eried/portapack-mayhem/i
* You can speed up the building process by calling 'make -j 8 firmware' instead, where 8 is the number of physical CPU cores (if you have
some compiling errors to check it's better to call it without '-j 8')
## 1. Update a Debian based OS, install cmake, python, pyyaml (as root)
## 1. Update a Debian based OS, install cmake, python, pyyaml
apt-get update
apt-get install -y git tar wget dfu-util cmake python3 bzip2 curl hackrf python3-distutils python3-setuptools
sudo apt-get update
sudo apt-get install -y git tar wget dfu-util cmake python3 bzip2 curl hackrf python3-distutils python3-setuptools
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py; python3 get-pip.py
pip install pyyaml
## 2. Install the necessary ARM compiler to /opt/armbin (as root) (if not done before, root needed if you install it in /opt)
## 2. Install the necessary ARM compiler to /opt/armbin (if not done before, root needed if you install it in /opt)
mkdir /opt/build
sudo mkdir /opt/build
cd /opt/build
wget -O gcc-arm-none-eabi.tar.bz2 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2?revision=05382cca-1721-44e1-ae19-1e7c3dc96118&la=en&hash=D7C9D18FCA2DD9F894FD9F3C3DC9228498FA281A'
mkdir armbin
tar --strip=1 -xjvf gcc-arm-none-eabi.tar.bz2 -C armbin
sudo wget -O gcc-arm-none-eabi.tar.bz2 'https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2?revision=05382cca-1721-44e1-ae19-1e7c3dc96118&la=en&hash=D7C9D18FCA2DD9F894FD9F3C3DC9228498FA281A'
sudo mkdir armbin
sudo tar --strip=1 -xjvf gcc-arm-none-eabi.tar.bz2 -C armbin
## 3. Link ARM compiler to your bash environment
echo 'PATH=/opt/build/armbin/bin:/opt/build/armbin/lib:$PATH' >> ~/.bashrc
source ~/.bashrc
## 4. Clone the eried's mayhem repository from GitHub (as user) (if not done before) into /opt
## 4. Clone the eried's mayhem repository from GitHub (if not done before) into /opt
cd /opt
git clone --recurse-submodules https://github.com/eried/portapack-mayhem.git
sudo git clone --recurse-submodules https://github.com/eried/portapack-mayhem.git
## 5. Give permission for the portapack-mayhem directory to your user
chown -R my_user:my_usergroup /opt/portapack-mayhem
sudo chown -R my_user:my_usergroup /opt/portapack-mayhem
## 6. Replace the python version in libopencm3 to use python3 (as user)
## 6. Replace the python version in libopencm3 to use python3
sed -i 's/env python/env python3/g' /opt/portapack-mayhem/hackrf/firmware/libopencm3/scripts/irq2nvic_h
## 7. Create makefile through cmake and compile (as user) (it's important to call the PATH cmd in step 3 just before making the cmake)
## 7. Create makefile through cmake and compile (it's important to call the PATH cmd in step 3 just before making the cmake)
cd /opt/portapack-mayhem
mkdir build