-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.sh
executable file
·71 lines (56 loc) · 1.62 KB
/
configure.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
62
63
64
65
66
67
68
69
70
71
#! /bin/bash
# Script to implement https://www.redhat.com/sysadmin/fedora-iot-raspberry-pi
# Find your wifi key and run
# export WIFI_KEY=XXXXX
# before running this script
if [ -z "$WIFI_KEY" ]
then
echo "\$WIFI_KEY is empty"
echo "set with 'export WIFI_KEY=XXXXX'"
exit 1
fi
WIFI_AP=SKYSJJ2E
# sshkey to use
KEY=/home/anton/.ssh/id_ed25519.pub
# wifi config to use stored in /etc/NetworkManager/system-connections
CONN=wifi01.nmconnection
# Location of the image
IMG=/home/anton/Downloads/Fedora-IoT-39.20231103.1-20231103.1.aarch64.raw.xz
#use `lsblk` command to see the name of the disk
MOUNT=/dev/sda3
arm-image-installer \
--image=$IMG \
--target=rpi4 \
--media=/dev/sda \
--addkey=$KEY \
--resizefs \
-y
# sleep 1m
#read in template one line at the time, and replace variables
touch /tmp/$CONN
while read line
do
eval echo "$line" >> /tmp/$CONN
done < "./wifi01.nmconnection.template"
#use lsblk command to see the name of the disk
echo mounting $MOUNT
mount $MOUNT /mnt
cd /mnt
NW_LOCATION=`find . -wholename *0/etc/NetworkManager/system-connections`
# find the connection you wish to use in /etc/NetworkManager/system-connections/ and copy it over
echo "copying /tmp/$CONN"
echo "to $NW_LOCATION/$CONN"
cp /tmp/$CONN $NW_LOCATION/$CONN
echo "chmod $NW_LOCATION/$CONN"
chmod 600 $NW_LOCATION/$CONN
cd
umount /mnt
# boot the image and run
# # rpm-ostree upgrade
# # systemctl reboot
# useradd -g anton -G wheel -m -u 1000 anton
# mkdir /home/anton/.ssh
# chmod 700 /home/anton/.ssh
# touch /home/anton/.ssh/authorized_keys
# chmod 600 /home/anton/.ssh/authorized_keys
# chown -R anton:anton /home/anton/.ssh/