How to add ssmtp into initramfs?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm trying to add ssmtp into initramfs. However, I can not find (or compile at the moment) the statically linked version. I guess my only option is adding the current, dynamically linked version.
I'm trying to add the binary (which ssmtp
) and its dependencies (ldd $(which ssmtp)
) to the initramfs. Although ssmtp
works fine in my system, I can not find one of the ldd /usr/sbin/ssmtp
output in anywhere:
$ ldd /usr/sbin/ssmtp
linux-vdso.so.1 (0x00007ffc661ca000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fd8ffc7e000)
libgnutls-openssl.so.27 => /usr/lib/x86_64-linux-gnu/libgnutls-openssl.so.27 (0x00007fd8ffa75000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8ff8b8000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fd8ff54d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd8ffefa000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd8ff32f000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fd8ff002000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fd8fede3000)
libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fd8fec5f000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fd8fea4c000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007fd8fe815000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007fd8fe5df000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fd8fe35b000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fd8fe150000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8fe14b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8fe12a000)
$ find / -name linux-vdso.so.1 2> /dev/null
# finds nothing
So, how can I install ssmtp into initramfs (or more generally, I can I install a dynamically linked binary into the initramfs)?
dynamic-linking initrd ssmtp
 |Â
show 2 more comments
up vote
1
down vote
favorite
I'm trying to add ssmtp into initramfs. However, I can not find (or compile at the moment) the statically linked version. I guess my only option is adding the current, dynamically linked version.
I'm trying to add the binary (which ssmtp
) and its dependencies (ldd $(which ssmtp)
) to the initramfs. Although ssmtp
works fine in my system, I can not find one of the ldd /usr/sbin/ssmtp
output in anywhere:
$ ldd /usr/sbin/ssmtp
linux-vdso.so.1 (0x00007ffc661ca000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fd8ffc7e000)
libgnutls-openssl.so.27 => /usr/lib/x86_64-linux-gnu/libgnutls-openssl.so.27 (0x00007fd8ffa75000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8ff8b8000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fd8ff54d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd8ffefa000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd8ff32f000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fd8ff002000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fd8fede3000)
libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fd8fec5f000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fd8fea4c000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007fd8fe815000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007fd8fe5df000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fd8fe35b000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fd8fe150000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8fe14b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8fe12a000)
$ find / -name linux-vdso.so.1 2> /dev/null
# finds nothing
So, how can I install ssmtp into initramfs (or more generally, I can I install a dynamically linked binary into the initramfs)?
dynamic-linking initrd ssmtp
3
You can add libc to initramfs, but it is better if you recompile it with klibc. All the initramfs-based debian binaries have a micro klibc version and this is going into initramfs.
â peterh
Sep 25 at 7:07
why are you adding ssmtp to initramfs?
â Rui F Ribeiro
Sep 25 at 7:26
@peterh I may try again to compile and link it statically. Thanks.
â ceremcem
Sep 25 at 7:29
@RuiFRibeiro I have a setup where the IP address is changed in random cases. If machine reboots, I need to know the IP address to connect and open the encrypted partition so the boot process can continue.
â ceremcem
Sep 25 at 7:29
You want to send mails from the initramfs? It could work, but then you have to also set up networking already in the initramfs. If your goal is simply to get a mail on any reboot, then cron is your best option. (Cron can have things which will happen on boot and not on any time)
â peterh
Sep 26 at 10:48
 |Â
show 2 more comments
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm trying to add ssmtp into initramfs. However, I can not find (or compile at the moment) the statically linked version. I guess my only option is adding the current, dynamically linked version.
I'm trying to add the binary (which ssmtp
) and its dependencies (ldd $(which ssmtp)
) to the initramfs. Although ssmtp
works fine in my system, I can not find one of the ldd /usr/sbin/ssmtp
output in anywhere:
$ ldd /usr/sbin/ssmtp
linux-vdso.so.1 (0x00007ffc661ca000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fd8ffc7e000)
libgnutls-openssl.so.27 => /usr/lib/x86_64-linux-gnu/libgnutls-openssl.so.27 (0x00007fd8ffa75000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8ff8b8000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fd8ff54d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd8ffefa000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd8ff32f000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fd8ff002000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fd8fede3000)
libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fd8fec5f000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fd8fea4c000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007fd8fe815000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007fd8fe5df000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fd8fe35b000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fd8fe150000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8fe14b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8fe12a000)
$ find / -name linux-vdso.so.1 2> /dev/null
# finds nothing
So, how can I install ssmtp into initramfs (or more generally, I can I install a dynamically linked binary into the initramfs)?
dynamic-linking initrd ssmtp
I'm trying to add ssmtp into initramfs. However, I can not find (or compile at the moment) the statically linked version. I guess my only option is adding the current, dynamically linked version.
I'm trying to add the binary (which ssmtp
) and its dependencies (ldd $(which ssmtp)
) to the initramfs. Although ssmtp
works fine in my system, I can not find one of the ldd /usr/sbin/ssmtp
output in anywhere:
$ ldd /usr/sbin/ssmtp
linux-vdso.so.1 (0x00007ffc661ca000)
libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007fd8ffc7e000)
libgnutls-openssl.so.27 => /usr/lib/x86_64-linux-gnu/libgnutls-openssl.so.27 (0x00007fd8ffa75000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd8ff8b8000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fd8ff54d000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd8ffefa000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd8ff32f000)
libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fd8ff002000)
libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fd8fede3000)
libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007fd8fec5f000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fd8fea4c000)
libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007fd8fe815000)
libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007fd8fe5df000)
libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fd8fe35b000)
libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007fd8fe150000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd8fe14b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd8fe12a000)
$ find / -name linux-vdso.so.1 2> /dev/null
# finds nothing
So, how can I install ssmtp into initramfs (or more generally, I can I install a dynamically linked binary into the initramfs)?
dynamic-linking initrd ssmtp
dynamic-linking initrd ssmtp
asked Sep 25 at 6:55
ceremcem
5291420
5291420
3
You can add libc to initramfs, but it is better if you recompile it with klibc. All the initramfs-based debian binaries have a micro klibc version and this is going into initramfs.
â peterh
Sep 25 at 7:07
why are you adding ssmtp to initramfs?
â Rui F Ribeiro
Sep 25 at 7:26
@peterh I may try again to compile and link it statically. Thanks.
â ceremcem
Sep 25 at 7:29
@RuiFRibeiro I have a setup where the IP address is changed in random cases. If machine reboots, I need to know the IP address to connect and open the encrypted partition so the boot process can continue.
â ceremcem
Sep 25 at 7:29
You want to send mails from the initramfs? It could work, but then you have to also set up networking already in the initramfs. If your goal is simply to get a mail on any reboot, then cron is your best option. (Cron can have things which will happen on boot and not on any time)
â peterh
Sep 26 at 10:48
 |Â
show 2 more comments
3
You can add libc to initramfs, but it is better if you recompile it with klibc. All the initramfs-based debian binaries have a micro klibc version and this is going into initramfs.
â peterh
Sep 25 at 7:07
why are you adding ssmtp to initramfs?
â Rui F Ribeiro
Sep 25 at 7:26
@peterh I may try again to compile and link it statically. Thanks.
â ceremcem
Sep 25 at 7:29
@RuiFRibeiro I have a setup where the IP address is changed in random cases. If machine reboots, I need to know the IP address to connect and open the encrypted partition so the boot process can continue.
â ceremcem
Sep 25 at 7:29
You want to send mails from the initramfs? It could work, but then you have to also set up networking already in the initramfs. If your goal is simply to get a mail on any reboot, then cron is your best option. (Cron can have things which will happen on boot and not on any time)
â peterh
Sep 26 at 10:48
3
3
You can add libc to initramfs, but it is better if you recompile it with klibc. All the initramfs-based debian binaries have a micro klibc version and this is going into initramfs.
â peterh
Sep 25 at 7:07
You can add libc to initramfs, but it is better if you recompile it with klibc. All the initramfs-based debian binaries have a micro klibc version and this is going into initramfs.
â peterh
Sep 25 at 7:07
why are you adding ssmtp to initramfs?
â Rui F Ribeiro
Sep 25 at 7:26
why are you adding ssmtp to initramfs?
â Rui F Ribeiro
Sep 25 at 7:26
@peterh I may try again to compile and link it statically. Thanks.
â ceremcem
Sep 25 at 7:29
@peterh I may try again to compile and link it statically. Thanks.
â ceremcem
Sep 25 at 7:29
@RuiFRibeiro I have a setup where the IP address is changed in random cases. If machine reboots, I need to know the IP address to connect and open the encrypted partition so the boot process can continue.
â ceremcem
Sep 25 at 7:29
@RuiFRibeiro I have a setup where the IP address is changed in random cases. If machine reboots, I need to know the IP address to connect and open the encrypted partition so the boot process can continue.
â ceremcem
Sep 25 at 7:29
You want to send mails from the initramfs? It could work, but then you have to also set up networking already in the initramfs. If your goal is simply to get a mail on any reboot, then cron is your best option. (Cron can have things which will happen on boot and not on any time)
â peterh
Sep 26 at 10:48
You want to send mails from the initramfs? It could work, but then you have to also set up networking already in the initramfs. If your goal is simply to get a mail on any reboot, then cron is your best option. (Cron can have things which will happen on boot and not on any time)
â peterh
Sep 26 at 10:48
 |Â
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471247%2fhow-to-add-ssmtp-into-initramfs%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
3
You can add libc to initramfs, but it is better if you recompile it with klibc. All the initramfs-based debian binaries have a micro klibc version and this is going into initramfs.
â peterh
Sep 25 at 7:07
why are you adding ssmtp to initramfs?
â Rui F Ribeiro
Sep 25 at 7:26
@peterh I may try again to compile and link it statically. Thanks.
â ceremcem
Sep 25 at 7:29
@RuiFRibeiro I have a setup where the IP address is changed in random cases. If machine reboots, I need to know the IP address to connect and open the encrypted partition so the boot process can continue.
â ceremcem
Sep 25 at 7:29
You want to send mails from the initramfs? It could work, but then you have to also set up networking already in the initramfs. If your goal is simply to get a mail on any reboot, then cron is your best option. (Cron can have things which will happen on boot and not on any time)
â peterh
Sep 26 at 10:48