Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
doas fails to emerge - only when scripted
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Chuck379
n00b
n00b


Joined: 13 Oct 2024
Posts: 2

PostPosted: Sun Oct 13, 2024 11:26 am    Post subject: doas fails to emerge - only when scripted Reply with quote

doas fails to emerge when running an installation script that I am writting but it does emerge successfully if do each of the steps in the installation script manually.

This is the installation script:
Code:
# installs dependencies
echo 'app-admin/doas persist' >>/etc/portage/package.use
emerge --ask=n \
  app-admin/doas \
  app-admin/eclean-kernel \
  app-portage/gentoolkit \
  net-misc/chrony \
  sys-block/io-scheduler-udev-rules \
  sys-kernel/gentoo-kernel || exit 1

# configures doas
cat <<EOF >/etc/doas.conf
# https://wiki.gentoo.org/wiki/Doas
permit  persist :wheel
permit  nopass  :wheel as root  cmd shutdown
permit  nopass  :wheel as root  cmd reboot
EOF
chown -c root:root /etc/doas.conf


---

Failed emerge info: https://bpa.st/BYWQ
Emerge pqv: https://bpa.st/XW2A
Build log: https://bpa.st/GZXQ

---

I am completly lost in this, any help would be appreciated
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22503

PostPosted: Sun Oct 13, 2024 3:51 pm    Post subject: Reply with quote

Welcome to the forums. Per Guidelines item #4, please show us how to reproduce the problem. Are all of these statements correct?
  • You are running all commands as root, from a clean root shell (via /bin/su - or a log in as root on a tty). You are not using sudo, doas, or similar. You are not letting su retain any part of the user's login environment.
  • Running emerge --ask=n app-admin/doas works correctly.
  • Running bash shown-script.sh fails.
  • You get the same version of doas in both paths.
Back to top
View user's profile Send private message
Chuck379
n00b
n00b


Joined: 13 Oct 2024
Posts: 2

PostPosted: Sun Oct 13, 2024 4:37 pm    Post subject: Reply with quote

Thank you for the answering Hu.

- I am running this from a root shell after chrooting into a blank device, untaring the openrc stage3 archive and installing gentoo's base system as per the handbook.
- Running emerge --ask=n app-admin/doas works correctly
- Running bash shown-script.sh fails.
- And I get the same version of doas in both paths.

To give you a bit more context, I have manually installed gentoo's systems successfully more times than I can remember (when I say manually I mean, going through the whole handbook with no automation). During the past few weeks I have been creating these bash scripts to reduce the effort in installing gentoo everytime I want to install a new system on a different computer - I could probably go through other approaches as backing up a base system and use it wherever, but I digress. These scripts go through all the steps of the handbook and my only deviation so far is installing doas which does not successfully do it while scripted but it does work if I manually run the same command at that point of the automation.

I probably had multiple versions of the same scripts that installed doas successfully, but this time it does not work for whatever reason.
To replicate what I am doing is using a live ISO debian based system and install gentoo's through my scripts which I do not expect you to take that effort.

Thank you anyways, any idea for me to try would be welcomed!
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1172
Location: Richmond Hill, Canada

PostPosted: Sun Oct 13, 2024 5:12 pm    Post subject: Reply with quote

Chuck379,

I think you may have misunderstood Hu's request.

We totally trust whatever user's report on how they arrived to the situation. However we are not in front of your computer so we need to examine if there are peripheral things that might have cause unexpected thing happen.

In the emerge design logic, the error condition you described cannot happen. Because running from command line vs running inside script should have exact same effect, either both success or both fail. so either there is something we don't see affect emerge or you running into a bug in emerge. however in order for us to determine which is the case we need to see more.

The error you reported in the build log is a C compiler identify missing declaration. Since emerge from each invocation should remove previous result and start from scratch so there is no reason to think the calling to C compiler from a interactive command vs from a batch script will work differently.

So it would be best if you can do Hu's request in one single shell session. And you do it such way that we can (sort of) see the whole sequence of the events.

and the events are,
  1. whoami # To demonstrate the running user.
  2. emerge --ask=n app-admin/doas
  3. <however you invoke your script> #So we can see how it failed and with whatever error messages (if any)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum