Skip to content

Commit

Permalink
Add Raspberry Pi OS auto-configuration files "ssh" and "userconf.txt"
Browse files Browse the repository at this point in the history
Bump major version number to 3.0
Add About menu item and support files
Remove hard-coded "pi" which snuck into various places
Change "pi" user to "hampi"
  • Loading branch information
Dave Slotter committed May 15, 2022
1 parent 3f9fda0 commit e174515
Show file tree
Hide file tree
Showing 42 changed files with 138 additions and 82 deletions.
Empty file added files/boot/ssh
Empty file.
1 change: 1 addition & 0 deletions files/boot/userconf.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hampi:$6$ROr8FS4LXyKAi1mz$cOdzsTWYYMbxvtcNwiGBoBHLgQkuG16tGSU6Rmp5yXjrdjS/qfJNHvfi.b.OHb9oGGy718hqYIybe2rCZG5ZT.
6 changes: 3 additions & 3 deletions files/etc/hampc-release
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PRETTY_NAME="HamPC 2.1 (April 2022)"
PRETTY_NAME="HamPC 3.0 (May 2022)"
NAME="HamPC"
VERSION_ID="2,1"
VERSION="2.1 (April 2021)"
VERSION_ID="3,0"
VERSION="3.0 (May 2022)"
HOME_URL="http://hampi.radiowaves.ca"
SUPPORT_URL="https://groups.io/g/Ham-Pi"
BUG_REPORT_URL="https://github.com/dslotter/HamPi/issues/"
6 changes: 3 additions & 3 deletions files/etc/hampi-release
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PRETTY_NAME="HamPi 2.1 (April 2022)"
PRETTY_NAME="HamPi 3.0 (May 2022)"
NAME="HamPi"
VERSION_ID="2,1"
VERSION="2.1 (April 2022)"
VERSION_ID="3,0"
VERSION="3.0 (May 2022)"
HOME_URL="http://hampi.radiowaves.ca"
SUPPORT_URL="https://groups.io/g/Ham-Pi"
BUG_REPORT_URL="https://github.com/dslotter/HamPi/issues/"
3 changes: 3 additions & 0 deletions files/home/hampi/.config/lxsession/LXDE-pi/remove_nag_dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

sed -i '/@\/home\/hampi\/.config\/lxsession\/LXDE-pi\/qslware.sh/d' /home/{{ ham_user }}/.config/lxsession/LXDE-pi/autostart
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions files/home/pi/.config/lxsession/LXDE-pi/remove_nag_dialog

This file was deleted.

7 changes: 7 additions & 0 deletions files/usr/bin/about_hampi
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/bash

VER=`grep -o '".*"' /etc/hampi-release | sed 's/"//g' | head -n 1`
SUPPORT_URL=`grep -o 'SUPPORT_URL.*' /etc/hampi-release | sed -e 's/SUPPORT_URL=//g' -e 's/"//g' | head -n 1`
BUG_REPORT_URL=`grep -o 'BUG_REPORT_URL.*' /etc/hampi-release | sed -e 's/BUG_REPORT_URL=//g' -e 's/"//g' | head -n 1`

zenity --info --width=450 --title "About HamPi" --text "${VER}\n\nSupport url: <a href=\"${SUPPORT_URL}\">${SUPPORT_URL}</a>\n\nBug report url: <a href=\"${BUG_REPORT_URL}\">${BUG_REPORT_URL}</a>\n\nCopyright 2020 - 2022, Dave Slotter (<a href=\"https://qrz.com/db/W3DJS\">W3DJS</a>)"
2 changes: 1 addition & 1 deletion files/usr/local/bin/update_d-rats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

cd /home/pi/hamradio/D-Rats/
cd /home/hampi/hamradio/D-Rats/
if [ $? != 0 ]; then
echo "Updating D-Rats failed. (cd)"
exit $?
Expand Down
4 changes: 2 additions & 2 deletions files/usr/local/share/applications/lopora.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Version=1.0
Name=Lopora
GenericName=QRSS Beacon Reception
Comment=Lopora is a QRSS Beacon Reception program
Exec=/home/pi/lopora/scriptfiles/quickstartlopora-hampi.sh
Path=/home/pi/lopora
Exec=/home/hampi/lopora/scriptfiles/quickstartlopora-hampi.sh
Path=/home/hampi/lopora
Terminal=false
StartupNotify=true
Categories=Utility;HamRadio
Expand Down
7 changes: 3 additions & 4 deletions files/usr/local/share/applications/noaa-apt.desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
pi@hampi:~ $ cat /usr/local/share/applications/noaa-apt.desktop
[Desktop Entry]
Name=NOAA Apt Image Decoder
GenericName=NOAA Apt Image Decoder
Comment=Image decoder for APT signals from NOAA satellites
Exec=/home/pi/hamradio/noaa-apt/target/release/noaa-apt
Path=/home/pi/hamradio/noaa-apt
Icon=/home/pi/hamradio/noaa-apt/res/icon.png
Exec=/home/hampi/hamradio/noaa-apt/target/release/noaa-apt
Path=/home/hampi/hamradio/noaa-apt
Icon=/home/hampi/hamradio/noaa-apt/res/icon.png
Terminal=false
Type=Application
Categories=HamRadio
11 changes: 11 additions & 0 deletions files/usr/share/applications/HamPi.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Type=Application
Name=About HamPi
Exec=/usr/bin/about_hampi
Terminal=false
Comment=About HamPi
Icon=hampi
Categories=HamRadio
Keywords=HamRadio
Binary file added files/usr/share/icons/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/icons/hampi/128x128/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/icons/hampi/256x256/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/icons/hampi/32x32/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/icons/hampi/48x48/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/icons/hampi/64x64/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/icons/hampi/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi/128x128/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi/256x256/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi/32x32/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi/48x48/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi/64x64/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added files/usr/share/pixmaps/hampi/hampi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packaging_utilities/compress_hampi_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo $start_time
# Compute the seconds since epoch for start date
t1=`date --date="$start_time" +%s`

VERSION=1.0
VERSION=3.0

# Compress image using XZ format
pxz "HamPi v${VERSION} by W3DJS/HamPi_v${VERSION}.img"
Expand Down
2 changes: 1 addition & 1 deletion packaging_utilities/create_hampi_torrent.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION=1.0
VERSION=3.0

transmission-create -o "HamPi Image Beta v${VERSION} (compressed).torrent" \
-t udp://tracker.opentrackr.org:1337/announce \
Expand Down
48 changes: 9 additions & 39 deletions tasks/configuration_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,57 +6,27 @@
hosts: all
tasks:

- name: Change hostname to hampi (for current session)
- name: Change hostname to {{ ham_user }} (for current session)
become: yes
command: hostname -b hampi
when: ansible_distribution == "Debian" and ansible_os_family == "Debian" and (ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' or ansible_architecture == "aarch64")

- name: Change hostname to hampc (for current session)
become: yes
command: hostname -b hampc
when: ansible_distribution == "Ubuntu" and ansible_os_family == "Debian" and (ansible_architecture == "x86_64" or ansible_architecture == "amd64")
command: hostname -b {{ ham_user }}

- name: Change hostname to hampi (permanently)
- name: Change hostname to {{ ham_user }} (permanently)
become: yes
copy:
src: "{{ playbook_dir }}/../files/etc/hostname_hampi"
src: "{{ playbook_dir }}/../files/etc/hostname_{{ ham_user }}"
dest: "/etc/hostname"
when: ansible_distribution == "Debian" and ansible_os_family == "Debian" and (ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' or ansible_architecture == "aarch64")

- name: Change hostname to hampc (permanently)
become: yes
copy:
src: "{{ playbook_dir }}/../files/etc/hostname_hampc"
dest: "/etc/hostname"
when: ansible_distribution == "Ubuntu" and ansible_os_family == "Debian" and (ansible_architecture == "x86_64" or ansible_architecture == "amd64")

- name: Change hostname to hampi (for hosts file)
become: yes
copy:
src: "{{ playbook_dir }}/../files/etc/hosts_hampi"
dest: "/etc/hosts"
when: ansible_distribution == "Debian" and ansible_os_family == "Debian" and (ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' or ansible_architecture == "aarch64")

- name: Change hostname to hampi (for hosts file)
- name: Change hostname to {{ ham_user }} (for hosts file)
become: yes
copy:
src: "{{ playbook_dir }}/../files/etc/hosts_hampc"
src: "{{ playbook_dir }}/../files/etc/hosts_{{ ham_user }}"
dest: "/etc/hosts"
when: ansible_distribution == "Ubuntu" and ansible_os_family == "Debian" and (ansible_architecture == "x86_64" or ansible_architecture == "amd64")

- name: Store a basic version file in public location
become: yes
copy:
src: "{{ playbook_dir }}/../files/etc/hampi-release"
dest: "/etc/hampi-release"
when: ansible_distribution == "Debian" and ansible_os_family == "Debian" and (ansible_architecture == 'armhf' or ansible_architecture == 'armv7l' or ansible_architecture == "aarch64")

- name: Store a basic version file in public location
become: yes
copy:
src: "{{ playbook_dir }}/../files/etc/hampc-release"
dest: "/etc/hampc-release"
when: ansible_distribution == "Ubuntu" and ansible_os_family == "Debian" and (ansible_architecture == "x86_64" or ansible_architecture == "amd64")
src: "{{ playbook_dir }}/../files/etc/{{ ham_user }}-release"
dest: "/etc/{{ ham_user }}-release"

- name: Check that the /boot/cmdline.txt exists
stat:
Expand Down Expand Up @@ -108,7 +78,7 @@
lineinfile:
path: /etc/apt/apt.conf.d/50unattended-upgrades
regexp: '^\/\/Unattended-Upgrade::Mail \"\";'
line: Unattended-Upgrade::Mail "pi";
line: Unattended-Upgrade::Mail "{{ ham_user }}";

- name: Add the user account to group of 'dialout'
become: yes
Expand Down
88 changes: 88 additions & 0 deletions tasks/install_about.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# Copyright 2020 - 2022, Dave Slotter (W3DJS). All rights reserved.
#

- name: About HamPi menu
hosts: all
gather_facts: no
tasks:

- name: Create /usr/share/icons/{{ ham_user }}/[RESOLUTION] directory
become: yes
file:
path: /usr/share/icons/{{ ham_user }}/{{ item }}
state: directory
mode: 644
with_items:
- 256x256
- 128x128
- 64x64
- 48x48
- 32x32

- name: Create HamPi icon in /usr/share/icons
become: yes
copy:
src: "{{ playbook_dir }}/../files/usr/share/icons/{{ ham_user }}.png"
dest: "/usr/share/icons/{{ ham_user }}.png"
mode: 644

- name: Create HamPi icon in /usr/share/icons/{{ ham_user }}/[RESOLUTION]
become: yes
copy:
src: "{{ playbook_dir }}/../files/usr/share/icons/{{ ham_user }}/{{ ham_user }}.png"
dest: "/usr/share/icons/{{ ham_user }}/{{ item }}/{{ ham_user }}.png"
mode: 644
with_items:
- 256x256
- 128x128
- 64x64
- 48x48
- 32x32

- name: Create /usr/share/pixmaps/{{ ham_user }}/[RESOLUTION] directory
become: yes
file:
path: /usr/share/pixmaps/{{ ham_user }}/{{ item }}
state: directory
mode: 644
with_items:
- 256x256
- 128x128
- 64x64
- 48x48
- 32x32

- name: Create HamPi icon in /usr/share/pixmaps
become: yes
copy:
src: "{{ playbook_dir }}/../files/usr/share/pixmaps/{{ ham_user }}.png"
dest: "/usr/share/pixmaps/{{ ham_user }}.png"
mode: 644

- name: Create HamPi icon in /usr/share/pixmaps/{{ ham_user }}/[RESOLUTION]
become: yes
copy:
src: "{{ playbook_dir }}/../files/usr/share/pixmaps/{{ ham_user }}/{{ ham_user }}.png"
dest: "/usr/share/pixmaps/{{ ham_user }}/{{ item }}/{{ ham_user }}.png"
mode: 644
with_items:
- 256x256
- 128x128
- 64x64
- 48x48
- 32x32

- name: Create HamPi desktop file in /usr/share/applications
become: yes
copy:
src: "{{ playbook_dir }}/../files/usr/share/applications/HamPi.desktop"
dest: "/usr/share/applications/HamPi.desktop"
mode: 644

- name: Create HamPi script in /usr/bin
become: yes
copy:
src: "{{ playbook_dir }}/../files/usr/bin/about_{{ ham_user }}"
dest: "/usr/bin/about_{{ ham_user }}"
mode: 755
2 changes: 1 addition & 1 deletion tasks/install_bluedv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

- name: Remove the offending "Let's Encrypt" root cert from the root store
become: yes
command: mv /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt /home/pi/DST_Root_CA_X3.crt
command: mv /usr/share/ca-certificates/mozilla/DST_Root_CA_X3.crt /home/{{ ham_user }}/DST_Root_CA_X3.crt
when: is_rpi|bool and is_bullseye|bool

- name: Resolves warning in next step
Expand Down
4 changes: 2 additions & 2 deletions tasks/install_gridtracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
become: yes
replace:
path: /usr/local/share/applications/GridTracker.desktop
regexp: '\/home\/pi\/Downloads'
regexp: "/home/{{ ham_user }}/Downloads"
replace: '/usr/local'
when: ansible_architecture == "armhf" or ansible_architecture == "armv7l" or ansible_architecture == "aarch64"

Expand Down Expand Up @@ -182,7 +182,7 @@
become: yes
replace:
path: /usr/local/share/applications/GridTracker.desktop
regexp: '/home/pi/Downloads'
regexp: '/home/{{ ham_user }}/Downloads'
replace: '/usr/local'

- name: Modify categories for GridTracker.desktop
Expand Down
21 changes: 0 additions & 21 deletions tasks/install_orca.yml

This file was deleted.

3 changes: 2 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

---

- name: HamPi 64-bit / HamPC v2.1 (March 2021) Playbook by W3DJS
- name: HamPi 64-bit / HamPC v3.0 (May 2021) Playbook by W3DJS
hosts: all
# hosts: nuc
# hosts: vm
Expand All @@ -20,6 +20,7 @@
- import_playbook: init_task.yml
- import_playbook: configuration_tasks.yml
- import_playbook: install_menus.yml
- import_playbook: install_about.yml
- import_playbook: install_wallpaper.yml
- import_playbook: upgrade_debian_packages.yml
- import_playbook: install_bookmarks.yml
Expand Down

0 comments on commit e174515

Please sign in to comment.