2021-12-17 20:30:04 +01:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
DESC="Auto deployment configuration from media"
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo -n "Start $DESC: "
|
2023-07-10 18:53:23 +02:00
|
|
|
# mount the overlay which is not auto mount by fstab
|
|
|
|
# this make /etc editable
|
|
|
|
mount -t overlay -o lowerdir=/etc,upperdir=/var/etc/upper,workdir=/var/etc/work overlay /etc
|
2023-07-09 18:28:04 +02:00
|
|
|
# for some reason the LCD backlight is turned off
|
|
|
|
# need to turn it on manually
|
|
|
|
echo 0 > /sys/class/backlight/backlight/bl_power
|
2021-12-17 20:30:04 +01:00
|
|
|
if [ -f "/boot/fs_resize" ]; then
|
2023-08-02 10:13:00 +02:00
|
|
|
/usr/sbin/expandfs.sh
|
2021-12-17 20:30:04 +01:00
|
|
|
touch /boot/home_partition_should_be_formated
|
|
|
|
rm /boot/fs_resize
|
|
|
|
reboot
|
|
|
|
fi
|
|
|
|
if [ -f "/boot/home_partition_should_be_formated" ]; then
|
|
|
|
echo "Trying to format the home partition"
|
2023-07-10 11:47:22 +02:00
|
|
|
umount /dev/mmcblk0p4
|
2023-07-10 11:47:05 +02:00
|
|
|
yes | mkfs.ext4 /dev/mmcblk0p4
|
|
|
|
mount /dev/mmcblk0p4 /home
|
2023-07-10 11:38:42 +02:00
|
|
|
mkdir -p /home/diya
|
|
|
|
chown -R diya:diya /home/diya
|
2021-12-17 20:30:04 +01:00
|
|
|
rm /boot/home_partition_should_be_formated
|
|
|
|
fi
|
2023-07-10 09:32:40 +02:00
|
|
|
if [ -e "/boot/wpa_supplicant.conf" ];then
|
2023-07-10 16:17:45 +02:00
|
|
|
mv /boot/wpa_supplicant.conf /etc/network/
|
2021-12-17 20:30:04 +01:00
|
|
|
reboot
|
|
|
|
fi
|
|
|
|
# display information
|
2022-01-29 16:31:50 +01:00
|
|
|
# disable wifi power save
|
|
|
|
/usr/sbin/iw wlan0 set power_save off
|
2021-12-17 20:30:04 +01:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
N=/etc/init.d/$NAME
|
|
|
|
echo "Usage: $N {start}" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|