#if we're root, try to run as a user instead
if [ "$USER" = "root" ] && getent passwd nobody 1>/dev/null && su nobody -c "/bin/true" 1>/dev/null; then the_make_command="su nobody -c \"$the_make_command\""
chmod +x $dkms_tree/$module/$module_version/build
chown -R nobody $dkms_tree/$module/$module_version/build
fi
How could that be failing? What about your situation is different?
So it's already explicitly doing this:
#if we're root, try to run as a user instead
the_make_ command= "su nobody -c \"$the_ make_command\ "" $module/ $module_ version/ build $module/ $module_ version/ build
if [ "$USER" = "root" ] && getent passwd nobody 1>/dev/null && su nobody -c "/bin/true" 1>/dev/null; then
chmod +x $dkms_tree/
chown -R nobody $dkms_tree/
fi
How could that be failing? What about your situation is different?