pxeless icon indicating copy to clipboard operation
pxeless copied to clipboard

Make sudo conditional to user/env

Open ToroNZ opened this issue 2 years ago • 1 comments
trafficstars

Noticed that this function was expanded quite a bit and "sudo" is now a dependency (which broke CI builds for me in Bitbucket). Perhaps we could make sudo optional if not running as root or in CI runners?... like:

#!/bin/bash
if [ ! "$CI" ]; then
  if [ "$USER" != "root" ]; then
    SUDO="sudo "
  fi
fi

I've had a quick look and they seem to be related to #27 . Though I never had issues adding extra files in Ubuntu Focal (20.04). So there must be something more to it... I hope to dig a little bit deeper on the following days, for now I will lock this submodule to the previous commit.

BTW - Kudos @cloudymax for maintaining this tool :)

https://github.com/cloudymax/pxeless/blob/d814df00b4df248f5070f857fd6ffc304729ebb0/image-create.sh#L387-L398

ToroNZ avatar May 01 '23 13:05 ToroNZ

Thanks for the kind words as well as letting me know the changes cased issues with your flow, ill definitely need to do some testing to sort out a solution for user/group/root/sudo permissions.

I think part of the problem is that 20.04 is the last version before the switch to the new ISO creation process using El troito, but I was unable to get the previous extra files method to work on 22.04.

Could you share how your running the command for 20.04 so I can try to get in-sync with how you're using the tool?

Work has been very hectic this month so I apologize for the delayed reply 🙏

cloudymax avatar May 12 '23 07:05 cloudymax