From 964c8ec8a24b5eecaa45839bf32b314f4e1d3041 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 27 Dec 2023 19:58:02 -0800 Subject: [PATCH 1/9] Re-enable opi5 and create user --- .github/workflows/main.yml | 7 +++---- install_opi5.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aae59a9d..46a628c6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,10 +21,9 @@ jobs: - name: raspi script: ./install_pi.sh base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz - # Orange pi default user seems bjork? also I can't find the where this file ends up in the image? https://github.com/Joshua-Riek/ubuntu-rockchip/blob/0710bd81f5619c25ccddb4e9d69ddbe73827f850/overlay/boot/firmware/user-data#L4 - # - name: opi5 - # script: ./install_opi5.sh - # base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.30/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz + - name: opi5 + script: ./install_opi5.sh + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.30/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz name: "Build for ${{ matrix.name }}" diff --git a/install_opi5.sh b/install_opi5.sh index face130c..e4523e47 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -13,6 +13,15 @@ sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh ./install.sh +if id "$1" >/dev/null 2>&1; then + echo 'user found' +else + echo "creating pi user" + useradd pi -b /home +fi + +echo "pi:raspberry" | chpasswd + # Remove extra packages too apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* From 3fdfaab55a21756eb6a1c077f17c71186c622c51 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 27 Dec 2023 20:14:37 -0800 Subject: [PATCH 2/9] Update install_opi5.sh --- install_opi5.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/install_opi5.sh b/install_opi5.sh index e4523e47..44ed14b8 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -1,7 +1,3 @@ -find / - -find / -name user-data - apt-get update apt-get upgrade -y From efcaa4f071934ff513a7dd20aab466d065549e2b Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Dec 2023 08:55:17 -0800 Subject: [PATCH 3/9] Update install_opi5.sh --- install_opi5.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/install_opi5.sh b/install_opi5.sh index 44ed14b8..7b57c736 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -1,24 +1,24 @@ -apt-get update -apt-get upgrade -y - -cd /tmp -wget https://git.io/JJrEP -O install.sh -chmod +x install.sh - -sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh - -./install.sh +# Create pi/raspberry login if id "$1" >/dev/null 2>&1; then echo 'user found' else echo "creating pi user" useradd pi -b /home + sudo usermod -a -G sudo pi fi - echo "pi:raspberry" | chpasswd -# Remove extra packages too +apt-get update +wget https://git.io/JJrEP -O install.sh +chmod +x install.sh + +sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh + +./install.sh +rm install.sh + +# Remove extra packages apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* apt-get autoremove -y From 4e401e751ce207c7f19f5e78989d2dabe552e498 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Dec 2023 10:50:31 -0800 Subject: [PATCH 4/9] Don't clean up extra packages --- install_opi5.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install_opi5.sh b/install_opi5.sh index 7b57c736..78f97b16 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -5,7 +5,7 @@ if id "$1" >/dev/null 2>&1; then else echo "creating pi user" useradd pi -b /home - sudo usermod -a -G sudo pi + usermod -a -G sudo pi fi echo "pi:raspberry" | chpasswd @@ -20,11 +20,11 @@ rm install.sh # Remove extra packages -apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* -apt-get autoremove -y +# apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* +# apt-get autoremove -y -rm -rf /var/lib/apt/lists/* -apt-get clean +# rm -rf /var/lib/apt/lists/* +# apt-get clean -rm -rf /usr/share/doc -rm -rf /usr/share/locale/ +# rm -rf /usr/share/doc +# rm -rf /usr/share/locale/ From 4542826aa3f943c17663e3aefd6ac8281f79c70b Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Dec 2023 10:55:23 -0800 Subject: [PATCH 5/9] Maybe actually keep netplan? unclear --- install_opi5.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/install_opi5.sh b/install_opi5.sh index 78f97b16..9163149b 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -18,13 +18,18 @@ sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh ./install.sh rm install.sh +sudo apt-get update +apt-get install -y network-manager net-tools + +apt-mark manual netplan.io + # Remove extra packages -# apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev *qt* -# apt-get autoremove -y +apt-get remove -y python3 gdb gcc g++ linux-headers* libgcc*-dev +apt-get autoremove -y -# rm -rf /var/lib/apt/lists/* -# apt-get clean +rm -rf /var/lib/apt/lists/* +apt-get clean -# rm -rf /usr/share/doc -# rm -rf /usr/share/locale/ +rm -rf /usr/share/doc +rm -rf /usr/share/locale/ From 6740a0819d63031686bece7044168c4e0de0ab3f Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Dec 2023 10:56:51 -0800 Subject: [PATCH 6/9] Create /home/pi --- install_opi5.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_opi5.sh b/install_opi5.sh index 9163149b..b352b756 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -6,6 +6,7 @@ else echo "creating pi user" useradd pi -b /home usermod -a -G sudo pi + mkdir /home/pi fi echo "pi:raspberry" | chpasswd From 44708430be580411d29b459ebd6ef27afebb2d66 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Dec 2023 11:03:07 -0800 Subject: [PATCH 7/9] Use NetworkManager by default --- install_opi5.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install_opi5.sh b/install_opi5.sh index b352b756..81298f7e 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -21,12 +21,16 @@ rm install.sh sudo apt-get update apt-get install -y network-manager net-tools - apt-mark manual netplan.io +cat > /etc/netplan/00-default-nm-renderer.yaml < Date: Thu, 28 Dec 2023 11:04:18 -0800 Subject: [PATCH 8/9] change ownership of pi to pi --- install_opi5.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install_opi5.sh b/install_opi5.sh index 81298f7e..22de0e14 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -7,6 +7,7 @@ else useradd pi -b /home usermod -a -G sudo pi mkdir /home/pi + chown -R pi /home/pi fi echo "pi:raspberry" | chpasswd From e3eb3dd8a98626c22eb8ab56c13821326fa6a7a7 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 28 Dec 2023 11:59:16 -0800 Subject: [PATCH 9/9] Pretty please don't uninstall libatomic1 --- install_opi5.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/install_opi5.sh b/install_opi5.sh index 22de0e14..f676a44c 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -21,8 +21,9 @@ sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh rm install.sh sudo apt-get update -apt-get install -y network-manager net-tools +apt-get install -y network-manager net-tools libatomic1 apt-mark manual netplan.io +apt-mark manual libatomic1 cat > /etc/netplan/00-default-nm-renderer.yaml <