[Libre-soc-dev] Coriolis2 Non-Chroot Script

lkcl luke.leighton at gmail.com
Sun Sep 12 18:54:13 BST 2021


On Sun, Sep 12, 2021 at 5:18 PM Andrey Miroshnikov
<andrey at technepisteme.xyz> wrote:
>
> On 11/09/2021 22:59, Andrey Miroshnikov wrote:
>  > Now that I understand "mk-deb-chroot" better, I ran it and made the
>  > chroot environment. Next I'll do the coriolis install without a
>  > "coriolis" chroot.
>
> Currently working on this, and have an issue with "runuser" command.
> This script is run from inside a chroot, as root (sudo bash).
>
> Here's the block of code in question (using ellipsis for clarity):
> runuser $SUDO_USER --preserve-environment -c '
> ...
> git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
> ...
> '

now that is *precisely* what gets deleted (the runuser....) part.
the script reduces to *ONLY* the commands *INSIDE* the
block up to the EOF.

> The command does complete, however the environment variables are
> probably wrong as it tries to access root's git configuration.

the script should not be being run *as* root in the first place.

the *entire* script should *only* be being run *as* the user, and thus
"runuser" is entirely redundant and should be deleted.

runuser $SUDO_USER --preserve-environment -c 'schroot -c coriolis
--directory=/tmp /bin/bash << EOF
cd /home/$SUDO_USER
git clone https://github.com/cliffordwolf/yosys.git
cd yosys
git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
make config-clang
make -j$(nproc)
EOF'


becomes JUST:

cd /home/$SUDO_USER
git clone https://github.com/cliffordwolf/yosys.git
cd yosys
git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
make config-clang
make -j$(nproc)

and

schroot -c coriolis --directory=/tmp /bin/bash << EOF
cd /home/$SUDO_USER/yosys
make install
EOF

becomes JUST:

cd /home/$SUDO_USER/yosys
make install

followed finally, at the end, exactly as is in nextpnr-ecp5-install:

cd /home/$SUDO_USER/src/nextpnr
chown -R $SUDO_USER .
chgrp -R $SUDO_USER .

or something equivalent which takes care of restoring user permissions.

l.



More information about the Libre-soc-dev mailing list