From e5681fcf2d4e7dc6fe25e99d9972d6d68326930a Mon Sep 17 00:00:00 2001 From: TuxfeatMac Date: Wed, 8 Sep 2021 22:34:21 +0200 Subject: [PATCH 1/5] initial commit --- RPiOS64autoinstall.sh | 107 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 RPiOS64autoinstall.sh diff --git a/RPiOS64autoinstall.sh b/RPiOS64autoinstall.sh new file mode 100644 index 0000000..386f9a1 --- /dev/null +++ b/RPiOS64autoinstall.sh @@ -0,0 +1,107 @@ +# !/bin/bash +################################################################# +# Name: RPiOS64fullautoinst.sh Version: 0.0.1 # +# Created: 07.09.2021 Modified: 08.09.2021 # +# Author: TuxfeatMac J.T. # +# Purpose: full automated Pimox7 installation RPi4B, RPi3B+ # +################################################################# +# Tested with image from: https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-05-28/2021-05-07-raspios-buster-arm64-lite.zip +################################################################# +#### BASIC SETTINGS !! PROPPERLY CONFIGURE THESE SETTINGS !! ### +HOSTNAME='RPiX-PVE-X' # set the new hostname + RPI_IP='XXX.XXX.XXX.XXX' # set new static ip address + GATEWAY='XXX.XXX.XXX.X' # set the gateway + NETMASK='/24' # set the netmask only / notation +#### ADVANCED SETTINGS ########################################## +PI3_ZRAM='1664' # zram 1,6GB +PI3_SWAP='384' # dphys-swapfile 0,4GB +#PI4_ZRAM='no install' +#PI4_SWAP='will be removed' +################################################################# +# ! NO TOUCHIE BELOW THIS LINE UNLEES U KNOW WHAT YOU ARE DOING ! +################################################################# + +#### SCRIPT IS MENT TO BE TO RUN AS ROOT! NOT AS PI WITH SUDO ### +if [ $USER != root ] + then + printf "This script is ment to be to run as superuser!\n" + exit # correct it, if u know how to improve it. +fi + +#### SET A ROOT PWD FOR WEB GUI LOGIN ##### ##################### +printf " +========================== +! SET YOUR ROOT PASSWORD ! +========================== +" && passwd +if [ $? != 0 ]; then exit; fi + +#### BASE UPDATE, DEPENDENCIES INSTALLATION ##################### +apt update && apt upgrade -y # maybe upgrade could be skiped ? +apt install -y gnupg # nmon #screen +RPIMOD=$(cat /sys/firmware/devicetree/base/model | cut -d ' ' -f 3) +if [ $RPIMOD == 3 ] + then + + apt install -y zram-tools + printf "SIZE=$PI3_ZRAM\nPRIORITY=100\nALGO=lz4\n" >> /etc/default/zramswap + printf "CONF_SWAPSIZE=$PI3_SWAP\n" >> /etc/dphys-swapfile + vm.swappiness=100 >> /etc/sysctl.d/99-sysctl.conf + # fix net names eth0 | enxMAC + RPIMAC=$(ip a | grep ether | cut -d ' ' -f 6) + printf "SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"$RPIMAC\", ATTR{dev_id}==\"0x0\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth0\"\n" > /etc/udev/rules.d/70-presistant-net.rules +fi + +#### ADDJUST SOURCES 11 | PIMOX7 + KEY ############################# +rm -f /etc/apt/sources.list.d/*.list +printf "# Raspberry Pi OS 11 Bullseye Repo +deb http://archive.raspberrypi.org/debian/ bullseye main +# Pimox 7 Development Repo | PVE 7 +deb https://raw.githubusercontent.com/pimox/pimox7/master/ dev/ +# Debian 11 Bullseye Repo +deb http://deb.debian.org/debian bullseye main contrib +# Debian 11 Bullseye Security Updates Repo +deb http://security.debian.org/debian-security bullseye-security main contrib \n" > /etc/apt/sources.list +curl https://raw.githubusercontent.com/pimox/pimox7/master/KEY.gpg | apt-key add - + +#### UPDATE UND UPGRADE TO 11 ###################################### +echo '* libraries/restart-without-asking boolean true' | debconf-set-selections #### How to reset at end? +DEBIAN_FRONTEND=noninteractive apt update && apt -y -o Dpkg::Options::="--force-confold" dist-upgrade +apt install -y raspberrypi-kernel-headers + +#### RECONFIGURE NETWORK ########################################### +printf "auto lo +iface lo inet loopback + +auto eth0 +iface eth0 inet static +address $RPI_IP$NETMASK +gateway $GATEWAY\n" > /etc/network/interfaces + +#### SET NEW HOSTNAME ############################################## +hostnamectl set-hostname $HOSTNAME +printf "127.0.0.1\t\tlocalhost\n$RPI_IP\t\t$HOSTNAME\n" > /etc/hosts + +#### REMOVE DHCP, CLEAN UP ######################################### +apt purge -y dhcpcd5 +if [ $RPIMOD == 4 ] + then + # remove sdcard swapfile # ask for it ? + apt purge -y dphys-swapfile +fi + apt autoremove -y + +# INSTALL PIMOX7 AND REBOOT###################################### +DEBIAN_FRONTEND=noninteractive apt install -y -o Dpkg::Options::="--force-confdef" proxmox-ve +printf " +========================================= +! ERRORS ARE NOMALAY FINE -> README.md ! +========================================= +\n" && sleep 3 +printf " +========================================= +! INSTALATION COMPLETED ! WAIT ! REBOOT ! +========================================= +\n" && sleep 7 && reboot + +#### EOF #### From 53e177417dd0447d21844b5aaec073f3eae3e194 Mon Sep 17 00:00:00 2001 From: TuxfeatMac Date: Wed, 8 Sep 2021 23:08:01 +0200 Subject: [PATCH 2/5] added RPiautoinstall steps --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3a93bc7..e6d9c73 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Pimox is a port of Proxmox to the Raspberry Pi allowing you to build a Proxmox c Requirements --- * Raspberry Pi 4 -* Pre-installed Debian __Bullseye__ based 64-bit OS ___(not 32-bit)___ +* Pre-installed Debian __Bullseye__ based ___64-bit___ OS (not 32bit) Prechecks --- @@ -21,8 +21,20 @@ Install 2. sudo -s 3. curl https://raw.githubusercontent.com/pimox/pimox7/master/pimox.sh | sh +RPiOS64 autoinstall +--- +0. Flash and startup the latest image from https://downloads.raspberrypi.org/raspios_arm64/ . +1. sudo -s +2. curl https://raw.githubusercontent.com/TuxfeatMac/pimox7/e5681fcf2d4e7dc6fe25e99d9972d6d68326930a/RPiOS64autoinstall.sh > RPiOS64autoinstall.sh +3. nano RPiOS64autoinstall.sh +5. Adjust network and hostname settings. +6. chmod +x RPiOS64autoinstall.sh +7. ./RPiOS64autoinstall.sh +8. Type a new root password. +9. Retype new password. +10. Do __not__ touch it untill, reboot is done. + Notes --- 1. This repo just contains the precompiled debian packages. The original Proxmox sources can be found at https://git.proxmox.com 2. The (very minimally) patched sources to rebuild this can be found at https://github.com/pimox - From 3556eebe9d6b8b1dee098916a8fe817ecb6202a0 Mon Sep 17 00:00:00 2001 From: TuxfeatMac Date: Fri, 10 Sep 2021 19:45:52 +0200 Subject: [PATCH 3/5] added cgroup options for working CT statistic in the PVE GUI, append these options to cmdline.txt if CT_STATS var is set to 'true' cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 --- RPiOS64autoinstall.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/RPiOS64autoinstall.sh b/RPiOS64autoinstall.sh index 386f9a1..ba11378 100644 --- a/RPiOS64autoinstall.sh +++ b/RPiOS64autoinstall.sh @@ -1,7 +1,7 @@ # !/bin/bash ################################################################# -# Name: RPiOS64fullautoinst.sh Version: 0.0.1 # -# Created: 07.09.2021 Modified: 08.09.2021 # +# Name: RPiOS64fullautoinst.sh Version: 0.0.2 # +# Created: 07.09.2021 Modified: 10.09.2021 # # Author: TuxfeatMac J.T. # # Purpose: full automated Pimox7 installation RPi4B, RPi3B+ # ################################################################# @@ -15,6 +15,7 @@ HOSTNAME='RPiX-PVE-X' # set the new hostname #### ADVANCED SETTINGS ########################################## PI3_ZRAM='1664' # zram 1,6GB PI3_SWAP='384' # dphys-swapfile 0,4GB +CT_STATS='true' # fix cmdline.txt for GUI stats #PI4_ZRAM='no install' #PI4_SWAP='will be removed' ################################################################# @@ -91,7 +92,18 @@ if [ $RPIMOD == 4 ] fi apt autoremove -y -# INSTALL PIMOX7 AND REBOOT###################################### +# FIX CONTAINER STATS NOT SHOWING UP IN WEB GUI #################### +if [ "$CT_STATS" == "true" ] + then + if [ "$(cat /boot/cmdline.txt | grep cgroup)" != "" ] + then + printf "Seems to be already fixed!" + else + sed -i "1 s|$| cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1|" /boot/cmdline.txt + fi +fi + +# INSTALL PIMOX7 AND REBOOT######################################### DEBIAN_FRONTEND=noninteractive apt install -y -o Dpkg::Options::="--force-confdef" proxmox-ve printf " ========================================= From a44aaee8a783fe0ad0559764e7e8deb0d36b1fa2 Mon Sep 17 00:00:00 2001 From: TuxfeatMac Date: Fri, 10 Sep 2021 19:49:49 +0200 Subject: [PATCH 4/5] adjusted permalink --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e6d9c73..ddf3168 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ RPiOS64 autoinstall --- 0. Flash and startup the latest image from https://downloads.raspberrypi.org/raspios_arm64/ . 1. sudo -s -2. curl https://raw.githubusercontent.com/TuxfeatMac/pimox7/e5681fcf2d4e7dc6fe25e99d9972d6d68326930a/RPiOS64autoinstall.sh > RPiOS64autoinstall.sh +2. curl https://raw.githubusercontent.com/TuxfeatMac/pimox7/master/RPiOS64autoinstall.sh > RPiOS64autoinstall.sh 3. nano RPiOS64autoinstall.sh 5. Adjust network and hostname settings. 6. chmod +x RPiOS64autoinstall.sh From 737a88683748934d28ef56c23607974a9537f02c Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Mon, 4 Oct 2021 21:48:08 -0700 Subject: [PATCH 5/5] Fix shell url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ddf3168..9567c5b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ RPiOS64 autoinstall --- 0. Flash and startup the latest image from https://downloads.raspberrypi.org/raspios_arm64/ . 1. sudo -s -2. curl https://raw.githubusercontent.com/TuxfeatMac/pimox7/master/RPiOS64autoinstall.sh > RPiOS64autoinstall.sh +2. curl https://raw.githubusercontent.com/pimox/pimox7/master/RPiOS64autoinstall.sh > RPiOS64autoinstall.sh 3. nano RPiOS64autoinstall.sh 5. Adjust network and hostname settings. 6. chmod +x RPiOS64autoinstall.sh