forked from Nkyoku/phoenix-jetson
-
Notifications
You must be signed in to change notification settings - Fork 0
/
initial_setup.sh
executable file
·61 lines (49 loc) · 1.84 KB
/
initial_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
# This script does below operations
# - Make Jetson to respond the power button immediately
# - Disable screen lock
# - Install AX200 driver
# - Enable spidev0.*, spidev1.*
# - Associate current user with gpio and tty group to be able to access hardware
# Exit on error
set -e
# Shutdown immediately when the power button was pressed
gsettings set org.gnome.settings-daemon.plugins.power button-power shutdown
sudo hostnamectl set-chassis vm
# Disable screen lock
gsettings set org.gnome.desktop.screensaver lock-enabled false
# Install Intel AX200 driver
sudo add-apt-repository -y ppa:canonical-hwe-team/backport-iwlwifi
sudo apt-get update -y
sudo apt-get install backport-iwlwifi-dkms
# Create service that set firmware fallback timeout value to 1s at every boot time
echo "[Unit]
Description=Set Firmware fallback timeout to 1
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo 1 > /sys/class/firmware/timeout'
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target" | sudo tee /etc/systemd/system/fallback-timeout.service
sudo systemctl enable fallback-timeout.service
# Rewrite extlinux.conf
# fbcon=map:0 => map:1, Default display output HDMI to DisplayPort
# add pci=noaer, Suppress PCIe bus error caused by AX200
sudo sed -i 's/fbcon=map:0/fbcon=map:1 pci=noaer/g' /boot/extlinux/extlinux.conf
# Enable spidev0.*, spidev1.*
sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb 1="spi1 spi2"
echo "spidev" | sudo tee -a /etc/modules
# Set permission to current user to manipulate hardware
sudo cp -f 99-gpio.rules /etc/udev/rules.d/
sudo groupadd -f -r gpio
sudo usermod -a -G gpio $(whoami)
sudo usermod -a -G tty $(whoami)
sudo usermod -a -G dialout $(whoami)
sudo systemctl stop nvgetty
sudo systemctl disable nvgetty
sudo chmod 660 /dev/ttyTHS1
sudo chmod 660 /dev/ttyTHS2
# Request reboot to user
echo "
Please reboot"