diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e594810 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.rpm +*.log +*spec-20* +*.tar.xz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..663e4da --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: smeserver-pxe +# $Id: Makefile,v 1.1 2022/04/30 02:44:36 trevorb Exp $ +NAME := smeserver-pxe +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index e506b01..88fdef5 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,16 @@ -# smeserver-pxe +# smeserver-pxe -SMEServer Koozali developed git repo for smeserver-pxe smecontribs \ No newline at end of file +SMEServer Koozali developed git repo for smeserver-pxe smecontribs + +## Wiki +
https://wiki.koozali.org/Pxe +
https://wiki.koozali.org/PXE_booting_to_BARTPE + +## Bugzilla +Show list of outstanding bugs: [here](https://bugs.koozali.org/buglist.cgi?component=smeserver-pxe&product=SME%20Contribs&query_format=advanced&limit=0&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=CONFIRMED) + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..9b7fd51 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +contribs10 diff --git a/createlinks b/createlinks new file mode 100644 index 0000000..ffff818 --- /dev/null +++ b/createlinks @@ -0,0 +1,14 @@ +#!/usr/bin/perl -w + +use esmith::Build::CreateLinks qw(:all); +use File::Basename; +use File::Path; + +# our event specific for updating with yum without reboot +$event = 'smeserver-pxe-update'; +#add here the path to your templates needed to expand +event_templates($event, '/etc/dhcpd.conf'); +#action specific to this package +#event_link('action', $event, '30'); +#services we need to restart +event_services($event, 'dhcpd' => 'restart'); diff --git a/root/etc/e-smith/db/configuration/defaults/pxe/00:06 b/root/etc/e-smith/db/configuration/defaults/pxe/00:06 new file mode 100644 index 0000000..10a1ad8 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/pxe/00:06 @@ -0,0 +1 @@ +BOOTIA32.EFI diff --git a/root/etc/e-smith/db/configuration/defaults/pxe/00:07 b/root/etc/e-smith/db/configuration/defaults/pxe/00:07 new file mode 100644 index 0000000..0c0276c --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/pxe/00:07 @@ -0,0 +1 @@ +BOOTX64.EFI diff --git a/root/etc/e-smith/db/configuration/defaults/pxe/default b/root/etc/e-smith/db/configuration/defaults/pxe/default new file mode 100644 index 0000000..6bfaee7 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/pxe/default @@ -0,0 +1 @@ +pxelinux.0 diff --git a/root/etc/e-smith/db/configuration/defaults/pxe/status b/root/etc/e-smith/db/configuration/defaults/pxe/status new file mode 100644 index 0000000..86981e6 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/pxe/status @@ -0,0 +1 @@ +enabled diff --git a/root/etc/e-smith/db/configuration/defaults/pxe/type b/root/etc/e-smith/db/configuration/defaults/pxe/type new file mode 100644 index 0000000..f92f363 --- /dev/null +++ b/root/etc/e-smith/db/configuration/defaults/pxe/type @@ -0,0 +1 @@ +configuration diff --git a/root/etc/e-smith/templates/etc/dhcpd.conf/12ClientArchitecture b/root/etc/e-smith/templates/etc/dhcpd.conf/12ClientArchitecture new file mode 100644 index 0000000..cd1d301 --- /dev/null +++ b/root/etc/e-smith/templates/etc/dhcpd.conf/12ClientArchitecture @@ -0,0 +1,7 @@ +{ + if ($pxe{status} eq "enabled") + { + return "option client-architecture code 93 = unsigned integer 16;"; + } +} + diff --git a/root/etc/e-smith/templates/etc/dhcpd.conf/27pxe b/root/etc/e-smith/templates/etc/dhcpd.conf/27pxe new file mode 100644 index 0000000..82c3512 --- /dev/null +++ b/root/etc/e-smith/templates/etc/dhcpd.conf/27pxe @@ -0,0 +1,42 @@ +{ + if ($pxe{status} eq "enabled") + { + if ($pxe{nextserver}) + { + $OUT .= " next-server $pxe{nextserver};\n\n"; + } + my $seq = 0; + while (my ($arch, $prog) = each (%pxe)) + { + unless ($arch eq 'default' || $arch eq 'type' || $arch eq 'status' || $arch eq 'nextserver' || $arch eq 'dir') + { + if ($prog) + { + ++$seq; + if ($seq eq 1) + { + $OUT .= " if option client-architecture = $arch {\n"; + $OUT .= " filename \"$pxe{dir}/$prog\";\n"; + $OUT .= " }\n"; + } + else + { + $OUT .= " elsif option client-architecture = $arch {\n"; + $OUT .= " filename \"$pxe{dir}/$prog\";\n"; + $OUT .= " }\n"; + } + } + } + } + if ($seq eq 0) + { + $OUT .= " filename \"$pxe{dir}/$pxe{default}\";\n"; + } + else + { + $OUT .= " else {\n"; + $OUT .= " filename \"$pxe{dir}/$pxe{default}\";\n"; + $OUT .= " }\n"; + } + } +} diff --git a/smeserver-pxe.spec b/smeserver-pxe.spec new file mode 100644 index 0000000..f9d60d7 --- /dev/null +++ b/smeserver-pxe.spec @@ -0,0 +1,73 @@ +# $Id: smeserver-pxe.spec,v 1.0 2022/04/28 18:45:26 brianr Exp $ +# Authority: nocvs +# Name: Trevor Batley + +Summary: Allow pxeboot of client machines over network +%define name smeserver-pxe +Name: %{name} +%define version 0.1 +%define release 5 +Version: %{version} +Release: %{release}%{?dist} +License: GPL +Group: Network +Source: %{name}-%{version}.tar.xz +BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot +BuildArch: noarch +Requires: e-smith-base +BuildRequires: e-smith-devtools >= 1.13.1-03 +AutoReq: yes + +%description +Global settings for dhcp to allow clients to network boot. +Assumes sme server is acting as dhcp server. + +%changelog +* Sat Sep 07 2024 cvs2git.sh aka Brian Read 0.1-5.sme +- Roll up patches and move to git repo [SME: 12338] + +* Sat Sep 07 2024 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Sat Jul 2 2022 Trevor Batley ,trevor@batley.id.au> 0.1-4.sme +- add event smeserver-pxe-update to trigger dhcpd restart via creatlinks [12087] + +* Sat May 28 2022 Trevor Batley 0.1-3.sme +- Remove incorrect = sign from nextserver parameter and enclsing "'s + +* Mon May 09 2022 Trevor Batley 0.1-2.sme +- Set default architecture executables to Centos 7 defaults [SME 11969] + +* Thu Apr 28 2022 Trevor Batley 0.1-1.sme +- Initial release [SME 10821] +- Split of PXE Global parameters out of smeserver-thinclient +- Allow for different architectures (including UEFI booting) + +%prep + +%setup -q -n %{name}-%{version} + +%build +perl createlinks + +%install +/bin/rm -rf $RPM_BUILD_ROOT +(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT) +/bin/rm -f %{name}-%{version}-filelist +/sbin/e-smith/genfilelist $RPM_BUILD_ROOT > %{name}-%{version}-filelist + +%clean +rm -rf $RPM_BUILD_ROOT + +%files -f %{name}-%{version}-filelist + +%defattr(-,root,root) + +%pre + +%preun + +%post + +%postun