Skip to content

Commit e88efe0

Browse files
authored
Merge pull request #42 from 128technology/develop
Develop
2 parents c3def4b + 67edd84 commit e88efe0

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ This repository contains files and instructions that can be used to setup a basi
44

55
This software is provided as a 128T Community supported application and is not maintained by 128 Technology officially. Any issues can be reported through this github repository with no guarantee that a fix will be provided and no SLA for any fix timeframes.
66

7-
> **Current Release: v1.2, July 22, 2021
8-
>
7+
> **Current Release: v1.2.1, August 16, 2021
8+
> * Updates from v1.2:
9+
> * Disable getty in containers to avoid taking over screen on attached monitor/console
10+
> * Create kickstart pre section to eject USB disks to avoid overwriting devices that force PXE boot
11+
>
912
> * Updates from v1.1:
1013
> * Introduced database schema versions - no more need to manually handle tables on upgrades (including this one)
1114
> * Allow toggling of ISO post install behavior between default "shutdown" and "reboot" - useful when using a default quickstart

webapp/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM centos:7
22

33
RUN yum -y install epel-release
4-
RUN yum -y install python3 openssl redis nfs-utils xorriso
4+
RUN yum -y install python3 openssl redis nfs-utils xorriso rpcbind
55

66
ENV VIRTUAL_ENV=/opt/venv
77
RUN python3 -m venv $VIRTUAL_ENV
@@ -23,11 +23,14 @@ COPY conf.d-celery /etc/conf.d/celery
2323
COPY proxy.conf /etc/conf.d/proxy.conf
2424
COPY webapp.service /etc/systemd/system
2525
COPY setup_scripts.sh /opt/
26+
COPY eject_usb_disks.sh /opt/
2627

2728
RUN systemctl enable celery
2829
RUN systemctl enable webapp
2930
RUN systemctl enable redis
30-
RUN systemctl enable nfs
31+
RUN systemctl enable rpcbind.service
32+
RUN systemctl enable rpcbind.socket
33+
RUN systemctl disable [email protected]
3134

3235
ENV LC_ALL=en_US.UTF-8
3336
ENV FLASK_APP="blaster.factory"

webapp/blaster/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
UEFI_TFTPBOOT_DIR = '/opt/tftpboot.uefi'
1414
BIOS_TFTPBOOT_DIR = '/opt/tftpboot.bios'
1515
SCRIPT_KS_SNIPPET = '/opt/setup_scripts.sh'
16+
EJECT_USB_KS_SNIPPET = '/opt/eject_usb_disks.sh'
1617
UEFI_IP = '192.168.128.4'
1718
BIOS_IP = '192.168.128.3'
1819
NFS_IP = '192.168.128.128'

webapp/blaster/tasks.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
'%include /mnt/install/repo/setup_scripts.sh\n',
1919
'# Notify blaster this system has completed blasting\n',
2020
'curl -XPOST http://192.168.128.128/node/add/`dmidecode --string system-serial-number`\n',
21+
'%end\n',
22+
'%pre\n',
23+
'%include /mnt/install/repo/eject_usb_disks.sh\n',
2124
'%end\n'
2225
]
2326

@@ -193,6 +196,8 @@ def stage_image(name):
193196

194197
print(f"Setting up snippet to stage bootstrap scripts for image {name}")
195198
shutil.copyfile(constants.SCRIPT_KS_SNIPPET, nfs_dir / 'setup_scripts.sh')
199+
print(f"Setting up snippet to eject USB drives before install for image {name}")
200+
shutil.copyfile(constants.EJECT_USB_KS_SNIPPET, nfs_dir / 'eject_usb_disks.sh')
196201

197202
print(f"Updating password hashes for image {name}")
198203
update_password(name)

webapp/eject_usb_disks.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
for usb_drive in /dev/disk/by-path/*usb*; do
2+
USB_DEV=`readlink $usb_drive | xargs basename`
3+
echo "offline" > /sys/block/$USB_DEV/device/state
4+
echo "1" > /sys/block/$USB_DEV/device/delete
5+
done

0 commit comments

Comments
 (0)