mirror of
https://github.com/lxsang/meta-rpi-diya.git
synced 2024-11-14 01:08:22 +01:00
43 lines
1.2 KiB
Bash
43 lines
1.2 KiB
Bash
#!/bin/sh
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
DESC="Auto deployment configuration from media"
|
|
|
|
case "$1" in
|
|
start)
|
|
echo -n "Start $DESC: "
|
|
# for some reason the LCD backlight is turned off
|
|
# need to turn it on manually
|
|
echo 0 > /sys/class/backlight/backlight/bl_power
|
|
if [ -f "/boot/fs_resize" ]; then
|
|
/usr/bin/expandfs.sh
|
|
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"
|
|
umount /dev/mmcblk0p4
|
|
yes | mkfs.ext4 /dev/mmcblk0p4
|
|
mount /dev/mmcblk0p4 /home
|
|
mkdir -p /home/diya
|
|
chown -R diya:diya /home/diya
|
|
rm /boot/home_partition_should_be_formated
|
|
fi
|
|
if [ -e "/boot/wpa_supplicant.conf" ];then
|
|
mv /boot/wpa_supplicant.conf /var/etc/network/
|
|
reboot
|
|
fi
|
|
# display information
|
|
# disable wifi power save
|
|
/usr/sbin/iw wlan0 set power_save off
|
|
/sbin/ip a
|
|
;;
|
|
*)
|
|
N=/etc/init.d/$NAME
|
|
echo "Usage: $N {start}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0 |