Posts by 3nz0

    I tried this with Raspberry Pi 5 but I think it works also with Pi 4.

    Libreelec 11 lost WiFi connection often. There is also a known bug , I don't know if my problem is related to this bug.

    I have 3 problems:

    - WiFi connection lost

    - router password lost

    - bad routing

    in /storage/.config/ I created a new file wifi_monitor.sh (of course replace MY-SSID-5-GHZ, MY-SSID-2.4-GHZ, MY-WPA-KEY and 192.168.1.1 with your values)

    in /storage/.config/system.d/ I created a new file, wifi_monitor.service

    Code
    [Unit]
    Description=WiFi monitor and reboot if multiple WiFi connects fail
    
    [Service]
    ExecStart=/storage/.config/wifi_monitor.sh
    
    [Install]
    WantedBy=multi-user.target


    then from bash:

    Code
    chmod +x /storage/.config/wifi_monitor.sh
    
    systemctl enable wifi_monitor.service

    how the script works:

    - it does a check every 10 seconds

    - at each check, it fix routing. It remove a bad route with the right one. In my WiFi network the default gateway is 192.168.1.1, so replace this with your (it could be 192.168.0.1, 192.168.2.1 ...)

    - with ip addr show wlan0 | grep "inet " &> /dev/null it checks if you are connected to wlan

    - if you are not connected it force connection to your network using the right key. In my script I have 2 different SSID, one for 5 Ghz and another one for 2.4 Ghz so the script try with one SSID or with the other. Of course you can modify it to match your needs and router settings

    - you can remove the reboot part, I only added it out of an abundance of caution (the script reboot Libreelec after max_attempts consecutive failed connections)

    Note: when you start LibreElec you can still see the annoying popup window for password setting. Looking at Kore you can see you are connect so you can press <- on Kore interface to remove the popup and you are done.

    This is how I got auto decrypt & mount working on Libreelec 11 on Raspberry Pi 5, without entering the password every time. All my hd use the same password and all use truecrypt hidden volume. Please advise if there is a better method:

    I did all these steps with my root account.

    I create a file ( /storage/myscripts/my_pwd ) and write my truecrypt password without ending newline, then I restricted access, then I restricted access ( chmod 0600 /storage/myscripts/my_pwd )

    I created /etc/crypttab file:

    then I relaunched systemctl:

    Code
    systemctl daemon-reload

    in this way I got 16 new service files in /var/run/systemd/generator/ , one for each sdd. In this way every sdd. If you open [email protected] you can read these lines:

    Code
    ExecStart=/usr/lib/systemd/systemd-cryptsetup attach 'truecryptsda1' '/dev/sda1' '/storage/myscripts/my_pwd' 'tcrypt-hidden,nofail'
    ExecStop=/usr/lib/systemd/systemd-cryptsetup detach 'truecryptsda1'

    then I created a new file, /storage/.config/udev.rules.d/99-automount.rules , with only one line:

    Code
    ACTION=="add", SUBSYSTEM=="block", ENV{DEVTYPE}=="partition", KERNEL=="sd[a-z][0-9]", RUN+="/storage/myscripts/my_automount.sh %k"

    finally, I created /storage/myscripts/my_automount.sh

    done. Now my hidden truecrypt volumes are automount at boot or as soon as I connect to any USB port.

    Note: default Raspberry Pi 5 boot sequence is USB, sd so if you have your os on sd don't connect your truecrypt volume to a USB 3 ports (USB 2 ports are ok). Of course you can change boot sequence (be careful, there is a bug ...) or use USB 3 port after Libreelec boots.

    and the actual command line i use at the moment on my CentOS7 systems to mount my encrypted drives with a PW given in a script and mounting all

    Code
    stty -echo
    $ECHO -e ">>> Please enter password:    \c"
    read PASS
    stty echo
    
    cryptsetup luksOpen /dev/sdc1 luks-sdc1 - <<< "$PASS" || exit 1

    I'm stuck here. How can I automount truecrypt volume without entering password each time?

    This is the scene: I use Raspberry Pi 5 as mediacenter, my hard disk is encrypted with truecrypt, I connect it to usb port and I would like it is automounted. But using cryptsetup open --type tcrypt /media/container.tc tcrypt-sda1 I need to manually enter a password each time.