-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Uee reflash-board instead of custom plugins for switching boot media
- Loading branch information
1 parent
80f58f5
commit cadfac6
Showing
11 changed files
with
89 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,36 +17,24 @@ LINUXFAMILY=$2 | |
BOARD=$3 | ||
BUILD_DESKTOP=$4 | ||
|
||
install_bins(){ | ||
cp /tmp/overlay/bins/* /usr/local/bin | ||
chmod +x /usr/local/bin/* | ||
} | ||
|
||
add_overlays(){ | ||
mkdir /boot/overlay-user | ||
cp /tmp/overlay/dts/* /boot/overlay-user | ||
} | ||
PREP_PACKAGE_LIST="avahi-daemon iptables dnsmasq-base" | ||
|
||
fix_netplan(){ | ||
cat <<- EOF > /etc/netplan/armbian-default.yaml | ||
network: | ||
version: 2 | ||
renderer: NetworkManager | ||
EOF | ||
} | ||
source /tmp/overlay/install_components/reflash.sh | ||
source /tmp/overlay/install_components/add_overlays.sh | ||
source /tmp/overlay/install_components/fix_netplan.sh | ||
|
||
prepare_build() { | ||
post_build() { | ||
echo "ttyGS0" >> /etc/securetty | ||
systemctl enable [email protected] | ||
|
||
cp /tmp/overlay/rebuild/rebuild-version /etc/ | ||
} | ||
|
||
echo "🍰 Rebuild starting..." | ||
|
||
prepare_build | ||
install_bins | ||
add_overlays | ||
fix_netplan | ||
|
||
cp /tmp/overlay/rebuild/rebuild-version /etc/ | ||
install_reflash_board | ||
post_build | ||
|
||
echo "🍰 Rebuild finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ source /tmp/overlay/install_components/prep_install.sh | |
source /tmp/overlay/install_components/add_overlays.sh | ||
source /tmp/overlay/install_components/fix_netplan.sh | ||
source /tmp/overlay/install_components/post_build.sh | ||
source /tmp/overlay/install_components/reflash.sh | ||
|
||
echo "🍰 Rebuild starting..." | ||
|
||
|
@@ -46,8 +47,11 @@ install_klipperscreen | |
install_ustreamer | ||
install_bins | ||
install_autohotspot | ||
install_reflash_board | ||
add_overlays | ||
fix_netplan | ||
post_build | ||
|
||
systemctl disable [email protected] | ||
|
||
echo "🍰 Rebuild finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,62 +17,31 @@ LINUXFAMILY=$2 | |
BOARD=$3 | ||
BUILD_DESKTOP=$4 | ||
|
||
prepare_install(){ | ||
apt update | ||
apt install -y python3-flask python3-requests pv xz-utils avahi-daemon unzip nginx gunicorn expect iptables dnsmasq-base | ||
|
||
# Set new password for root | ||
sh -c 'echo root:temppwd | chpasswd' | ||
|
||
# Add lost+found catalog and make it readable | ||
cd /boot | ||
mklost+found | ||
chmod +r /boot/lost+found | ||
|
||
echo "ttyGS0" >> /etc/securetty | ||
systemctl enable [email protected] | ||
|
||
} | ||
|
||
install_reflash() { | ||
cd /usr/src | ||
wget https://github.com/intelligent-agent/Reflash/releases/download/v0.1.2-RC2/reflash.tar.gz | ||
tar -xf reflash.tar.gz | ||
cd reflash | ||
chmod +x ./scripts/install_reflash.sh | ||
./scripts/install_reflash.sh | ||
} | ||
|
||
install_autohotspot() { | ||
# Install autohotspot script | ||
cp /tmp/overlay/autohotspot/autohotspot /usr/local/bin | ||
chmod +x /usr/local/bin/autohotspot | ||
|
||
# Install autohotspot service file | ||
cp /tmp/overlay/autohotspot/autohotspot.service /etc/systemd/system/ | ||
|
||
systemctl enable autohotspot.service | ||
} | ||
|
||
add_overlays(){ | ||
mkdir /boot/overlay-user | ||
cp /tmp/overlay/dts/* /boot/overlay-user | ||
} | ||
|
||
fix_netplan(){ | ||
cat <<- EOF > /etc/netplan/armbian-default.yaml | ||
network: | ||
version: 2 | ||
renderer: NetworkManager | ||
EOF | ||
PREP_PACKAGE_LIST="avahi-daemon iptables dnsmasq-base" | ||
|
||
source /tmp/overlay/install_components/prep_install.sh | ||
source /tmp/overlay/install_components/add_overlays.sh | ||
source /tmp/overlay/install_components/reflash.sh | ||
|
||
local_fixups() { | ||
# Add lost+found catalog and make it readable | ||
cd /boot | ||
mklost+found | ||
chmod +r /boot/lost+found | ||
|
||
# Fix netplan error. This is probably a bugfix for Armbian. | ||
cat <<- EOF > /etc/netplan/armbian-default.yaml | ||
network: | ||
version: 2 | ||
renderer: NetworkManager | ||
EOF | ||
} | ||
|
||
set -e | ||
|
||
echo "🍰 Reflash starting..." | ||
prepare_install | ||
prepare_build_reflash | ||
install_reflash | ||
install_autohotspot | ||
add_overlays | ||
fix_netplan | ||
local_fixups | ||
echo "🍰 Custom script completed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,28 @@ prepare_build() { | |
cp /tmp/overlay/rebuild/rebuild-version /etc/ | ||
# Backwards compatibility with refactor | ||
cp /tmp/overlay/rebuild/rebuild-version /etc/refactor.version | ||
} | ||
} | ||
|
||
|
||
prepare_build_reflash() { | ||
echo "🍰 Prepare build" | ||
|
||
apt update | ||
apt install -y $PREP_PACKAGE_LIST --no-install-recommends --no-install-suggests | ||
|
||
# Ensure the debian user exists | ||
useradd debian -d /home/debian -G tty,dialout -m -s /bin/bash -e -1 | ||
echo "debian ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/debian | ||
|
||
# Set default passwords | ||
echo debian:temppwd | chpasswd | ||
echo root:temppwd | chpasswd | ||
|
||
# Disable SSH root access | ||
sed -i 's/^PermitRootLogin.*$/#PermitRootLogin/g' /etc/ssh/sshd_config | ||
|
||
echo "ttyGS0" >> /etc/securetty | ||
systemctl enable [email protected] | ||
|
||
cp /tmp/overlay/rebuild/rebuild-version /etc/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
install_reflash() { | ||
apt install -y python3-gevent python3-flask python3-requests python3-pip pv xz-utils unzip nginx gunicorn --no-install-recommends --no-install-suggests | ||
pip install sqlitedict | ||
cd /usr/src | ||
wget https://github.com/intelligent-agent/Reflash/releases/download/v0.2.0-RC1/reflash.tar.gz | ||
tar -xf reflash.tar.gz | ||
cd reflash | ||
chmod +x ./scripts/install_reflash.sh | ||
./scripts/install_reflash.sh | ||
} | ||
|
||
install_reflash_board() { | ||
apt install -y python3-gevent python3-flask python3-requests python3-pip nginx gunicorn --no-install-recommends --no-install-suggests | ||
pip install sqlitedict | ||
cd /usr/src | ||
wget https://github.com/intelligent-agent/Reflash/releases/download/v0.2.0-RC1/reflash-board.tar.gz | ||
tar -xf reflash-board.tar.gz | ||
cd reflash | ||
chmod +x ./scripts/install_reflash_board.sh | ||
./scripts/install_reflash_board.sh | ||
} |