You are not logged in.

#1 2019-10-31 21:24:44

23pieces
Member
Registered: 2019-02-08
Posts: 12

[SOLVED] Pacman hook redirect stdin

Heya!

I'm trying to write a new pacman hook to mount a luks encrypted boot partion.

Something like:

....
Exec = /usr/bin/cryptsetup open /dev/sda2 cryptboot
...

Unfortunately it seems that i cant get stdin redirected to cryptsetup executed by execv.


The short output from strace:


openat(AT_FDCWD, ".", O_RDONLY|O_CLOEXEC) = 5
chdir("/")                              = 0
socketpair(AF_UNIX, SOCK_STREAM, 0, [7, 8]) = 0
socketpair(AF_UNIX, SOCK_STREAM, 0, [9, 10]) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7fc349b46a10) = 28241
fcntl(7, F_SETFL, O_RDONLY|O_NONBLOCK)  = 0
close(8)                                = 0
close(9)                                = 0
close(10)                               = 0
poll([{fd=7, events=POLLIN}, {fd=-1}], 2, -1) = 1 ([{fd=7, revents=POLLIN}])
read(7, "Nothing to read on input.\n", 2046) = 26


My first thought was that pacman doesnt redirect stdin here, am i correct with that?
Any ideas?

Best regards

Last edited by 23pieces (2019-10-31 22:32:13)

Offline

#2 2019-10-31 22:13:37

apg
Developer
Registered: 2012-11-10
Posts: 190

Re: [SOLVED] Pacman hook redirect stdin

Hooks are not interactive.

Offline

#3 2019-10-31 22:31:12

23pieces
Member
Registered: 2019-02-08
Posts: 12

Re: [SOLVED] Pacman hook redirect stdin

Thx for the reply.
Thought so^^

I wrote a zsh function now.

Offline

Board footer

Powered by FluxBB