Skip to content

Commit

Permalink
Merge pull request #2 from Bennett-Wendorf/arch-compatability-part-2
Browse files Browse the repository at this point in the history
Misspelled branch name on push.
  • Loading branch information
Bennett-Wendorf authored May 16, 2022
2 parents e14a951 + f83ef93 commit 139449d
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 12 deletions.
11 changes: 7 additions & 4 deletions Arch-Linux/LCD35-show
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Change working directory up to the main directory to allow easier access to the boot, etc, and usr directories.
cd ..

# Install wget...
sudo pacman -Sy --needed --noconfirm wget

sudo ./system_backup.sh

if [ -f /etc/X11/xorg.conf.d/40-libinput.conf ]; then
Expand Down Expand Up @@ -46,7 +49,7 @@ echo "gpio:resistance:35:90:480:320" > ./.have_installed
#FBCP install
wget --spider -q -o /dev/null --tries=1 -T 10 https://cmake.org/
if [ $? -eq 0 ]; then
sudo pacman -Sy --needed --noconfirm cmake 2> error_output.txt
sudo pacman -Sy --needed --noconfirm cmake make 2> error_output.txt
result=`cat ./error_output.txt`
echo -e "\033[31m$result\033[0m"
grep -q "^E:" ./error_output.txt
Expand All @@ -66,14 +69,14 @@ if [ $? -eq 0 ]; then
fi
sudo mkdir ./rpi-fbcp/build
cd ./rpi-fbcp/build/
sudo cmake ..
sudo make
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
cd - > /dev/null
type fbcp > /dev/null 2>&1
if [ $? -eq 0 ]; then
sudo cp -rf ./Arch-Linux/usr/99-fbdev-fbcp.conf /usr/share/X11/xorg.conf.d/99-fbdev.conf
sudo cp -rf ./etc/rc.local /etc/rc.local
#sudo cp -rf ./etc/rc.local /etc/rc.local
fi
else
echo "install cmake error!!!!"
Expand Down
16 changes: 8 additions & 8 deletions Arch-Linux/rotate.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
cur_dir=`pwd`
if [ ! -f $cur_dir/.have_installed ]; then
if [ ! -f $cur_dir/../.have_installed ]; then
echo "Please install the LCD driver first"
echo "Usage: sudo ./xxx-show. xxx: MHS35,LCD35,MPI3508 etc."
exit
Expand Down Expand Up @@ -39,13 +39,13 @@ exit
fi

#get screen parameter
tmp=`cat $cur_dir/.have_installed`
output_type=`cat $cur_dir/.have_installed | awk -F ':' '{printf $1}'`
touch_type=`cat $cur_dir/.have_installed | awk -F ':' '{printf $2}'`
device_id=`cat $cur_dir/.have_installed | awk -F ':' '{printf $3}'`
default_value=`cat $cur_dir/.have_installed | awk -F ':' '{printf $4}'`
width=`cat $cur_dir/.have_installed | awk -F ':' '{printf $5}'`
height=`cat $cur_dir/.have_installed | awk -F ':' '{printf $6}'`
tmp=`cat $cur_dir/../.have_installed`
output_type=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $1}'`
touch_type=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $2}'`
device_id=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $3}'`
default_value=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $4}'`
width=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $5}'`
height=`cat $cur_dir/../.have_installed | awk -F ':' '{printf $6}'`

if [ $output_type = "hdmi" ]; then
result=`grep -rn "^display_rotate=" /boot/config.txt | tail -n 1`
Expand Down
6 changes: 6 additions & 0 deletions Arch-Linux/usr/99-calibration.conf-35-0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "268 3880 227 3936"
Option "SwapAxes" "0"
EndSection
6 changes: 6 additions & 0 deletions Arch-Linux/usr/99-calibration.conf-35-180
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "3880 268 3936 227"
Option "SwapAxes" "0"
EndSection
6 changes: 6 additions & 0 deletions Arch-Linux/usr/99-calibration.conf-35-270
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "227 3936 3880 268"
Option "SwapAxes" "1"
EndSection
6 changes: 6 additions & 0 deletions Arch-Linux/usr/99-calibration.conf-35-90
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Section "InputClass"
Identifier "calibration"
MatchProduct "ADS7846 Touchscreen"
Option "Calibration" "3936 227 268 3880"
Option "SwapAxes" "1"
EndSection
4 changes: 4 additions & 0 deletions system_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ if [ -f /usr/share/X11/xorg.conf.d/99-fbturbo.conf ]; then
sudo cp -rf /usr/share/X11/xorg.conf.d/99-fbturbo.conf ./.system_backup/
fi
#sudo cp -rf ./usr/99-fbturbo.conf-original /usr/share/X11/xorg.conf.d/99-fbturbo.conf
if [ -f /etc/rc.local ]; then
sudo cp -rf /etc/rc.local ./.system_backup/
#sudo cp -rf ./etc/rc.local-original /etc/rc.local
fi

if [ -f /etc/modules ]; then
sudo cp -rf /etc/modules ./.system_backup/
#sudo cp -rf ./etc/modules-original /etc/modules
fi

if [ -f /etc/modprobe.d/fbtft.conf ]; then
sudo cp -rf /etc/modprobe.d/fbtft.conf ./.system_backup
Expand Down
6 changes: 6 additions & 0 deletions system_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ sudo cp -rf ./.system_backup/99-fbturbo.conf /usr/share/X11/xorg.conf.d
fi
sudo cp -rf ./.system_backup/cmdline.txt /boot/
sudo cp -rf ./.system_backup/config.txt /boot/

if [ -f ./.system_backup/rc.local ]; then
sudo cp -rf ./.system_backup/rc.local /etc/
fi

if [ -f ./.system_backup/modules ]; then
sudo cp -rf ./.system_backup/modules /etc/
fi

if [ -f /etc/inittab ]; then
sudo rm -rf /etc/inittab
Expand Down

0 comments on commit 139449d

Please sign in to comment.