How to add ssmtp into initramfs?

The name of the pictureThe name of the pictureThe name of the pictureClash 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)?










share|improve this question

















  • 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














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










share|improve this question

















  • 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












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










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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












  • 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















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay