This commit is contained in:
pi-farm
2023-11-17 18:28:21 +01:00
commit 83aebf933f
20 changed files with 274 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
.git
.gitignore
srv
RPi-PXE-Server
Executable
+31
View File
@@ -0,0 +1,31 @@
HowToBuild and setup
Clone this repo: git clone https://gitea.pi-farm.duckdns.org/meik/pxe-server.git
and cd into it: cd pxe-server
run: bash start.sh
1. choose (b) to build the image
2. restart your pc
3. edit the p2-include-handle file in RPi-PXE-Server folder (look here: https://github.com/beta-tester/RPi-PXE-Server#p2-include-handle--c2-custom-handle)
4. run bash start.sh again an choose (s) for setup
5. restart your pc
6. run bash start.sh again an choose (u) for update
afer that, your pc is ready
to check, if the volumes are mounted, go into the running container:
docker exec -it pxe-container bash
- run: df -h
- run: showmount -e
Check if all services are up and running:
systemctl status chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server
if not, try to start the services:
systemctl start chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server
Executable
+9
View File
@@ -0,0 +1,9 @@
#!/bin/bash
docker stop pxe-container-s6
docker rm pxe-container-s6
docker rmi pxe-image:s6-test01
docker build -t pxe-image:s6-test01 .
#docker run -it --privileged --net=host --volume ${PWD}/RPi-PXE-Server:/app/RPi-PXE-Server --volume ${PWD}/srv:/srv --name pxe-container-s6 pxe-image:s6-test01
##docker exec -it pxe-container-s6 bash
+32
View File
@@ -0,0 +1,32 @@
version: '3.7'
services:
pxe-container-s6:
build: .
stdin_open: true
tty: true
privileged: true
network_mode: host
volumes:
- ${PWD}/samba:/etc/samba
- ${PWD}/RPi-PXE-Server:/app/RPi-PXE-Server
- ${PWD}/srv:/srv
- ${PWD}/media:/media/
- /boot:/boot
container_name: pxe-container
image: pxe-image:s6-test01
pxe-samba:
image: gists/samba-server
container_name: samba-server
ports:
- "0.0.0.0:137:137/udp"
- "0.0.0.0:138:138/udp"
- "0.0.0.0:139:139/tcp"
- "0.0.0.0:445:445/tcp"
volumes:
- ${PWD}/samba:/etc/samba
- ${PWD}/srv:/srv
- ${PWD}/media:/media/
# restart: unless-stoped
depends_on:
- pxe-container-s6
Executable
+39
View File
@@ -0,0 +1,39 @@
FROM ubuntu:latest
RUN apt update && apt upgrade -y && apt autoremove -y
RUN apt install util-linux nano xz-utils wget systemctl sudo git -y
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.1.6.0/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.1.6.0/s6-overlay-aarch64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-aarch64.tar.xz
RUN mkdir /app
RUN mkdir /app/RPi-PXE-Server
COPY root/ /
#WORKDIR /app
#RUN git clone https://github.com/beta-tester/RPi-PXE-Server.git
#VOLUME /app/RPi-PXE-Server
#COPY scripts/ /app/RPi-PXE-Server/
VOLUME /app/RPi-PXE-Server
VOLUME /srv
VOLUME /etc/samba
VOLUME /boot
WORKDIR /app/RPi-PXE-Server
ENTRYPOINT [ "/init" ]
## docker build -t pxe-image:test01 .
## docker run -it -d --privileged --net=host --volume ${PWD}/RPi-PXE-Server:/app/RPi-PXE-Server --volume ${PWD}/srv:/srv --name pxe-container pxe-image:test01
## docker exec -it pxe-container bash
## systemctl start chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server nmbd rsync samba-ad-dc smbd udev && systemctl stop rpcbind
## /etc/init.d/dnsmasq start
## /etc/init.d/chrony start
## /etc/init.d/lighttpd start
## /etc/init.d/nfs-kernel-server start
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
systemctl start chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server nmbd rsync samba-ad-dc smbd
systemctl stop rpcbind
systemctl status chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server nmbd rsync samba-ad-dc smbd
Vendored Executable
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
systemctl start chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server nmbd rsync samba-ad-dc smbd
systemctl stop rpcbind
systemctl status chrony dnsmasq lighttpd nfs-mountd nfs-server nfs-kernel-server nmbd rsync samba-ad-dc smbd
+1
View File
@@ -0,0 +1 @@
oneshot
+1
View File
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-pxe-boot-config/run
+2
View File
@@ -0,0 +1,2 @@
bt
quit
+64
View File
@@ -0,0 +1,64 @@
########################################
## mod_install_server
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
workgroup = WORKGROUP
dns proxy = yes
enhanced browsing = no
#### Networking ####
interfaces = 192.168.178.0/24 eth0
bind interfaces only = yes
#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
########## Domains ###########
############ Misc ############
usershare allow guests = yes
#======================= Share Definitions =======================
[srv]
path = /srv
comment = /srv folder of pxe-server
guest ok = yes
guest only = yes
browseable = no
read only = no
create mask = 0644
directory mask = 0755
force create mode = 0644
force directory mode = 0755
force user = root
force group = root
hide dot files = no
[media]
path = /media/
comment = /media folder of pxe-server
guest ok = yes
guest only = yes
browseable = no
read only = no
create mask = 0644
directory mask = 0755
force create mode = 0644
force directory mode = 0755
force user =
force group =
hide dot files = no
+64
View File
@@ -0,0 +1,64 @@
########################################
## mod_install_server
#======================= Global Settings =======================
[global]
## Browsing/Identification ###
workgroup = WORKGROUP
dns proxy = yes
enhanced browsing = no
#### Networking ####
interfaces = 192.168.178.0/24 eth0
bind interfaces only = yes
#### Debugging/Accounting ####
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
####### Authentication #######
server role = standalone server
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
########## Domains ###########
############ Misc ############
usershare allow guests = yes
#======================= Share Definitions =======================
[srv]
path = /srv
comment = /srv folder of pxe-server
guest ok = yes
guest only = yes
browseable = no
read only = no
create mask = 0644
directory mask = 0755
force create mode = 0644
force directory mode = 0755
force user = root
force group = root
hide dot files = no
[media]
path = /media/
comment = /media folder of pxe-server
guest ok = yes
guest only = yes
browseable = no
read only = no
create mask = 0644
directory mask = 0755
force create mode = 0644
force directory mode = 0755
force user =
force group =
hide dot files = no
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
bash run.sh install
exit
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
bash run.sh setup
exit
+7
View File
@@ -0,0 +1,7 @@
#!/bin/bash
bash run.sh update
rpc.mountd
df -h
showmount -e
exit