I experienced a similar issue today while upgrading SailfishOS with sfos-upgrade 4.5.0.25
from 4.5.0.19
. I managed to connect the phone to an eth0
connection using a USB Ethernet adapter and re-ran sfos-upgrade --verify
. From the logs, I understood the issue was due to insufficient space for completing the upgrade.
The situation got even stranger when I updated to 4.6.0.13
. Wi-Fi stopped working, and even after adjusting wpa_supplicant
, I kept getting an “incorrect password” error. The phone became quite unresponsive, with multiple issues cropping up.
To resolve this, I used SSH from my laptop to set up a routine to automatically connect to eth0
, but I couldn’t directly connect the USB cable to the laptop. So, I created a service with the following script:
#!/bin/bash
# Sets static IP, gateway, and interface
IP_ADDRESS="192.168.1.23/24"
GATEWAY="192.168.1.1"
INTERFACE="eth0"
# Loop until the eth0 interface is available
while true; do
if ip link show "$INTERFACE" > /dev/null 2>&1; then
echo "Interface $INTERFACE found. Configuring connection..."
# Configure IP address for the interface
echo "Assigning IP $IP_ADDRESS to interface $INTERFACE..."
ip addr add "$IP_ADDRESS" dev "$INTERFACE" || echo "Error assigning IP address"
# Enable the interface
echo "Activating interface $INTERFACE..."
ip link set "$INTERFACE" up || echo "Error activating interface"
# Set the default gateway
echo "Setting gateway to $GATEWAY..."
ip route add default via "$GATEWAY" || echo "Error setting gateway"
# Verify interface configuration
echo "Configuration complete:"
ip addr show "$INTERFACE"
ip route show
echo "Connection configured on $INTERFACE."
break
else
echo "Interface $INTERFACE not found. Retrying in 5 seconds..."
sleep 5
fi
done
Step 2: Creating a Service
To make this persistent, I set up a systemd service. I created a file in /etc/systemd/system/connection_ethernet.service
:
[Unit]
Description=Run connection_ethernet.sh at startup
After=network.target
[Service]
ExecStart=/usr/local/bin/connection_ethernet.sh
Type=simple
Restart=on-failure
[Install]
WantedBy=multi-user.target
Step 3: Enabling and Starting the Service
I then enabled and started the service to check that it worked:
systemctl enable connection_ethernet.service
systemctl start connection_ethernet.service
systemctl status connection_ethernet.service
This approach worked; I was back online with SFOS, cleaned up some space, and successfully completed sfos-upgrade
to 4.6.0.13
.