On 09/12/18 02:45, Kihaguru Gathura wrote:
> Hi,
> 
> I am able to send SMS using AT commands and C outside chroot using
> code spinet below
> 
> -------------------------------------------------------------------
> #include <stdio.h>
> #include <time.h>
> #include <unistd.h>
> 
> #define MODEM_PATH "cu -l /dev/cuaU0 -s 115200"
> 
> int main()
> {
>          FILE *out;
>          char s[40];
> 
>         printf("Content-type: text/html\n\n");
> 
>         snprintf(s, sizeof(s), "%s", MODEM_PATH);
> ~
> ~
> ~
> ~
> ~
> ~
>         return(0);
> }
> --------------------------------------------------------------------
> 
> however, running the program from within chroot, I get the message
> 
> /dev/cuaU0 - No such file or directory
> 
> All files needed by cu are properly copied to chroot and cu works fine.
> 
> Question:
> 
> 1: How do i get /dev/cuaU0 device accessible under chroot?

# mkdir $chroot/dev
# cd $chroot/dev
# sh /dev/MAKEDEV ttyU0

Make sure the chroot isn't mounted 'nodev'.

> 2: Is there a better i.e more secure approach to access modem from
> within chroot?
> 

Reply via email to