Skip to content

Commit 3d576f6

Browse files
committed
Merge branch 'update_gateware' of https://github.com/apertus-open-source-cinema/axiom-firmware into update_gateware
2 parents 941ae9a + 043edf3 commit 3d576f6

File tree

6 files changed

+65
-17
lines changed

6 files changed

+65
-17
lines changed

makefiles/in_chroot/install.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ sed -i 's/#IgnorePkg =/IgnorePkg = linux linux-*/' /etc/pacman.conf
1717
echo 'Server = http://de3.mirror.archlinuxarm.org/$arch/$repo' > /etc/pacman.d/mirrorlist
1818
pacman-key --init
1919
pacman-key --populate archlinuxarm
20-
pacman --noprogressbar --noconfirm --needed -Syu
20+
pacman --noprogressbar --noconfirm --needed --overwrite '*' -Syu
2121
pacman --noprogressbar --noconfirm -R linux-zedboard || true
2222

2323
# install dependencies
24-
pacman --noprogressbar --noconfirm --needed -S $(grep -vE "^\s*#" makefiles/in_chroot/requirements_pacman.txt | tr "\n" " ")
24+
pacman --noprogressbar --noconfirm --needed --overwrite '*' -S $(grep -vE "^\s*#" makefiles/in_chroot/requirements_pacman.txt | tr "\n" " ")
2525
pip install --break-system-packages wheel
2626
pip install --break-system-packages --progress-bar off -r makefiles/in_chroot/requirements_pip.txt
2727

@@ -39,6 +39,9 @@ if ! [ -d /home/$USERNAME ]; then
3939
rm -f /home/$USERNAME/.bashrc
4040
fi
4141

42+
# also set the same password for root
43+
echo "root:$PASS" | chpasswd
44+
4245
# add empty ~/.ssh/authorized_keys (see #80)
4346
function add_authorized_keys_file() {
4447
SSH_AUTHORIZED_KEYS=/home/$1/.ssh/authorized_keys
@@ -56,8 +59,8 @@ add_authorized_keys_file "root"
5659
userdel -r -f alarm || true
5760

5861
# configure ssh
59-
grep 'PermitRootLogin' /etc/ssh/sshd_config && sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin without-password/' /etc/ssh/sshd_config
60-
grep 'PermitRootLogin' /etc/ssh/sshd_config || echo "PermitRootLogin without-password" >> /etc/ssh/sshd_config
62+
grep 'PermitRootLogin' /etc/ssh/sshd_config && sed -i 's/^.*PermitRootLogin.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
63+
grep 'PermitRootLogin' /etc/ssh/sshd_config || echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
6164
grep -x 'X11Forwarding yes' /etc/ssh/sshd_config || echo "X11Forwarding yes" >> /etc/ssh/sshd_config
6265

6366
# build all the tools
@@ -194,6 +197,6 @@ rm -f $HASH_LOCATION/hashes.txt; rm -f $HASH_LOCATION/files.txt
194197
find $VERIFY_DIRECTORIES -type f > $HASH_LOCATION/files.txt
195198
# also hash file list
196199
echo "$HASH_LOCATION/files.txt" >> $HASH_LOCATION/files.txt
197-
hashdeep -c sha256 -f $HASH_LOCATION/files.txt > $HASH_LOCATION/hashes.txt
200+
sudo rhash --sha256 --file-list $HASH_LOCATION/files.txt -o $HASH_LOCATION/hashes.txt
198201

199202
echo "axiom-update finished. Software version is now $(git describe --always --abbrev=8 --dirty)."

makefiles/in_chroot/requirements_pacman.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ base-devel
99
git
1010
figlet
1111
wget
12-
hashdeep
12+
rhash
1313
pacman-contrib
1414
rsync
1515

@@ -36,6 +36,9 @@ dtc
3636
man
3737
man-pages
3838
libdisplay-info
39+
bash-completion
40+
# for growpart
41+
cloud-guest-utils
3942

4043
# webserver
4144
lighttpd

software/configs/bashrc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,17 @@ alias rm='rm -i'
3131
alias cp='cp -i'
3232
alias mv='mv -i'
3333

34-
# editor
34+
35+
# enable bash autocompletion
36+
[ -r /usr/share/bash-completion/bash_completion ] && . /usr/share/bash-completion/bash_completion
37+
38+
# you can use pvim/pnano/pcat to edit scripts in the $PATH
39+
function pvim(){ sudo vim $(which "$1"); }
40+
complete -F _command pvim
41+
function pnano(){ sudo nano $(which "$1"); }
42+
complete -F _command pnano
43+
function pcat(){ cat $(which "$1"); }
44+
complete -F _command pcat
45+
3546
alias vi='vim'
47+
alias pvi='pvim'

software/scripts/axiom_file_check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
HASH_LOCATION="/opt/integrity_check"
33

44
echo "Checking Axiom system files... (this might take a while)"
5-
output=$(hashdeep -c sha256 -x -f $HASH_LOCATION/files.txt -k $HASH_LOCATION/hashes.txt)
5+
output=$(sudo rhash -c --skip-ok --brief $HASH_LOCATION/hashes.txt)
66

77
if [ -z "$output" ]; then
88
echo "No problems detected, all files are in factory state."

software/scripts/axiom_grow_fs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: © 2024 Jaro Habiger <jarohabiger@googlemail.com>
4+
# SPDX-License-Identifier: GPL-2.0-only
5+
6+
sudo growpart /dev/mmcblk0 2
7+
sudo resize2fs /dev/mmcblk0p2

software/scripts/axiom_start.sh

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,34 @@
77
# it was previously known as kick.sh / kick-manual.sh
88

99
if [ "$EUID" -ne 0 ]
10-
then echo "please run as root, 'sudo axiom_start.sh'"
11-
exit
10+
then echo "please run as root, e.g. 'sudo axiom_start.sh'"
11+
exit 2
1212
fi
1313

1414
# running axiom_start.sh twice will crash the camera, this should prevent that from happening
1515
FILE=/tmp/axiom.started
1616
if [[ -f "$FILE" ]]; then
1717
echo "AXIOM service seems to be running already, if that is not the case please remove the /tmp/axiom.started file and try again."
18-
exit
18+
exit 1
1919
fi
2020

2121

2222
MODE=${1:-normal}
23+
if [ "$MODE" = "normal" ]; then
24+
echo "starting with FHD color HDMI output on top and bottom plugins";
25+
echo
26+
elif [ "$MODE" = "raw-uhd" ]; then
27+
echo "starting camera with color HDMI output on top plugin and raw mode with alternating A/B frames on bottom plugin";
28+
echo "the resolution of the raw output is 3840x2160 (no black colums present)";
29+
echo
30+
elif [ "$MODE" = "raw-full-width" ]; then
31+
echo "starting camera with color HDMI output on top plugin and raw mode with alternating A/B frames on bottom plugin";
32+
echo "the resolution of the raw output is 4096x2160 (with black columns on left and right sides)";
33+
echo
34+
else
35+
echo
36+
exit 2
37+
fi
2338

2439
axiom_fclk_init.sh
2540
axiom_zynq_info.sh
@@ -47,7 +62,7 @@ while sleep 1; do
4762
axiom_fil_reg 15 0x08000800
4863
axiom_fil_reg 15 0x0
4964

50-
[ "$MODE" == "raw" ] && axiom_fil_reg 11 0x00000031
65+
[ "$MODE" =~ ^"raw" ] && axiom_fil_reg 11 0x00000031
5166

5267
axiom_cmv_init.sh
5368
axiom_train && break
@@ -56,7 +71,7 @@ while sleep 1; do
5671
axiom_gpio.py init
5772
done
5873

59-
[ "$MODE" == "raw" ] && i2c0_bit_set 0x22 0x15 7
74+
[ "$MODE" =~ ^"raw" ] && i2c0_bit_set 0x22 0x15 7
6075

6176
axiom_setup.sh $MODE
6277
# ./hdmi_init.sh
@@ -65,9 +80,17 @@ axiom_setup.sh $MODE
6580
axiom_fil_reg 15 0x01000100
6681

6782
# show overlay in normal mode - clear overlay in raw mode
68-
[ "$MODE" == "normal" ] && axiom_mimg -a -O /opt/overlays/AXIOM-Beta-logo-overlay-white.raw
69-
[ "$MODE" == "raw" ] && axiom_mimg -O -P0
83+
if [ "$MODE" == "normal" ]; then
84+
axiom_mimg -a -O /opt/overlays/AXIOM-Beta-logo-overlay-white.raw
85+
else
86+
axiom_mimg -O -P0
87+
fi
7088

89+
if [ "$MODE" == "raw-full-width" ]; then
90+
axiom_gen_init_hdmi.sh 2048x1080p50
91+
axiom_data_init_hdmi.sh
92+
axiom_snap -E -b -z # enable the black columns
93+
fi
7194

7295
# initiate HDMI
7396
axiom_hdmi_init3.sh
@@ -88,8 +111,8 @@ axiom_pic_jtag_pcie.py 0x92 0x92
88111
axiom_set_gain.sh 1
89112

90113

91-
# raw mode related commands
92-
if [ "$MODE" == "raw" ]; then
114+
# setup raw output
115+
if [ "$MODE" =~ ^"raw" ]; then
93116
axiom_scn_reg 28 0x7700
94117
axiom_scn_reg 28 0x7000
95118
axiom_scn_reg 31 0x0000 # top HDMI plugin module set normal color mode

0 commit comments

Comments
 (0)