diff options
author | ggilestro | 2019-06-25 11:56:47 +0100 |
---|---|---|
committer | ggilestro | 2019-06-25 11:56:47 +0100 |
commit | 2151f88aa30199aae3cd803555867321e85698dc (patch) | |
tree | 442bf1203e8977c3dacb95f45860e8d1257ad5c0 | |
parent | f4ae8e376c8f12967b4f7f7cfbb7605c4f1c5511 (diff) | |
download | aur-2151f88aa30199aae3cd803555867321e85698dc.tar.gz |
Added a number of post installation modifications
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 4 | ||||
-rw-r--r-- | ethoscope-device.install | 67 |
3 files changed, 74 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = ethoscope-device pkgdesc = A platform from monitoring animal behaviour in real time from a raspberry pi - Device version pkgver = r1702.g1c43fc3 - pkgrel = 1 + pkgrel = 2 url = http://lab.gilest.ro/ethoscope install = ethoscope-device.install arch = any @@ -12,9 +12,14 @@ pkgbase = ethoscope-device makedepends = wget makedepends = fping makedepends = ntp + makedepends = fake-hwclock makedepends = openssh makedepends = mariadb makedepends = dnsmasq + makedepends = wpa_supplicant + makedepends = ifplugd + makedepends = wpa_action + makedepends = base-devel depends = opencv depends = hdf5 depends = gtk3 @@ -2,12 +2,12 @@ pkgname=ethoscope-device pkgver=r1702.g1c43fc3 -pkgrel=1 +pkgrel=2 pkgdesc="A platform from monitoring animal behaviour in real time from a raspberry pi - Device version" arch=('any') url="http://lab.gilest.ro/ethoscope" license=('GPL3') -makedepends=('git' 'gcc-fortran' 'rsync' 'wget' 'fping' 'ntp' 'openssh' 'mariadb' 'dnsmasq' ) #'base-devel' ) +makedepends=('git' 'gcc-fortran' 'rsync' 'wget' 'fping' 'ntp' 'fake-hwclock' 'openssh' 'mariadb' 'dnsmasq' 'wpa_supplicant' 'ifplugd' 'wpa_action' 'base-devel' ) depends=('opencv' 'hdf5' 'gtk3' 'python-pip' 'python-numpy' 'python-scipy' 'python-bottle' 'python-pyserial' 'python-mysql-connector' 'python-netifaces' 'python-cherrypy' 'python-eventlet' 'python-gitpython' 'python-dnspython' 'python-greenlet' 'python-monotonic' 'python-picamera') provides=('ethoscope-device') install="ethoscope-device.install" diff --git a/ethoscope-device.install b/ethoscope-device.install index 06949674bf95..d670f9525663 100644 --- a/ethoscope-device.install +++ b/ethoscope-device.install @@ -16,8 +16,73 @@ post_install() { echo "ETHOSCOPE_000" > /etc/machine-name echo "ETHOSCOPE_000" > /etc/hostname + #create a default wlan0 file + echo 'Description=ethoscope_wifi network' > /etc/netctl/wlan0 + echo 'Interface=wlan0' >> /etc/netctl/wlan0 + echo 'Connection=wireless' >> /etc/netctl/wlan0 + echo 'Security=wpa' >> /etc/netctl/wlan0 + echo 'IP=dhcp' >> /etc/netctl/wlan0 + echo 'TimeoutDHCP=60' >> /etc/netctl/wlan0 + echo "ESSID=ETHOSCOPE_WIFI" >> /etc/netctl/wlan0 + echo "Key=ETHOSCOPE_1234" >> /etc/netctl/wlan0 + + #creates a default eth0 file + echo 'Description=eth0 Network' > /etc/netctl/eth0 + echo 'Interface=eth0' >> /etc/netctl/eth0 + echo 'Connection=ethernet' >> /etc/netctl/eth0 + echo 'IP=dhcp' >> /etc/netctl/eth0 + + #use netctl instead of netword + systemctl disable systemd-networkd + ip link set eth0 down + + #setting up wifi + netctl-auto enable wlan0 + netctl-auto start wlan0 + systemctl enable netctl-auto@wlan0.service + systemctl start netctl-auto@wlan0.service + systemctl enable netctl-ifplugd@wlan0.service + systemctl start netctl-ifplugd@wlan0.service + netctl enable eth0 + netctl start eth0 + systemctl enable netctl@eth0.service + systemctl start netctl@eth0.service + systemctl enable netctl-ifplugd@eth0.service + systemctl start netctl-ifplugd@eth0.service + #device service + + #configure the NTP file + echo 'server node' > /etc/ntp.conf + echo 'server 127.127.1.0' >> /etc/ntp.conf + echo 'fudge 127.127.1.0 stratum 10' >> /etc/ntp.conf + echo 'restrict default kod limited nomodify nopeer noquery notrap' >> /etc/ntp.conf + echo 'restrict 127.0.0.1' >> /etc/ntp.conf + echo 'restrict ::1' >> /etc/ntp.conf + echo 'driftfile /var/lib/ntp/ntp.drift' >> /etc/ntp.conf + echo "enabling DEVICE specific systemd service files" - systemctl enable ethoscope_device.service ethoscope_update.service + systemctl enable ethoscope_device.service ethoscope_update.service + systemctl enable ntpd.service mysqld.service fake-hwclock fake-hwclock-save.timer sshd.service + + #mysql stuff + mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql + systemctl enable mysqld.service + mysql -u root -e "CREATE USER 'ethoscope'@'localhost' IDENTIFIED BY 'ethoscope'" + mysql -u root -e "CREATE USER 'ethoscope'@'%' IDENTIFIED BY 'ethoscope'" + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'ethoscope'@'localhost' WITH GRANT OPTION"; + mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'ethoscope'@'%' WITH GRANT OPTION"; + + #install picamera settings + echo 'start_file=start_x.elf' > /boot/config.txt + echo 'fixup_file=fixup_x.dat' >> /boot/config.txt + echo 'disable_camera_led=1' >> /boot/config.txt + echo 'gpu_mem=256' >> /boot/config.txt + echo 'cma_lwm=' >> /boot/config.txt + echo 'cma_hwm=' >> /boot/config.txt + echo 'cma_offline_start=' >> /boot/config.txt + echo 'Loading bcm2835 module' + echo "bcm2835-v4l2" > /etc/modules-load.d/picamera.conf + echo "Please reboot the PI now." |