Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sudo conditional to user/env #36

Open
ToroNZ opened this issue May 1, 2023 · 1 comment
Open

Make sudo conditional to user/env #36

ToroNZ opened this issue May 1, 2023 · 1 comment

Comments

@ToroNZ
Copy link
Contributor

ToroNZ commented May 1, 2023

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 :)

pxeless/image-create.sh

Lines 387 to 398 in d814df0

sudo unsquashfs "${SQUASH_FS}"
log " - Step 3. Copy extra files to /media..."
sudo cp -R "${EXTRA_FILES_FOLDER}/." "squashfs-root/media/"
if [ -n "$OFFLINE_INSTALLER" ]; then
log " - Step 3.5. Runing offline installer script..."
sudo chroot squashfs-root/ /bin/bash "/media/${OFFLINE_INSTALLER}"
fi
log " - Step 4. Rebuilding squashfs.."
sudo mksquashfs squashfs-root/ "${SQUASH_FS}" -comp xz -b 1M -noappend

@cloudymax
Copy link
Owner

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 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants