-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This splits things into two source packages: dracut-nmbl, which contains the dracut plugin, and nmbl-builder, which expect dracut-nmbl to be installed in the buildroot. The second package makes three different[0] nmbl UKIs, one "monolith", which is what we've been building, one "cloud", and one "workstation". It also deletes 10_linux because we haven't been using it. [0] These aren't actually different yet.
- Loading branch information
Showing
17 changed files
with
190 additions
and
515 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
*~ | ||
*.rpm | ||
*.spec | ||
*.sw? | ||
*.tar | ||
*.tar.?z | ||
/build.log | ||
/hw_info.log | ||
/installed_pkgs.log | ||
/nmbl*/ | ||
/nmbl.initramfs.img | ||
/nmbl-builder.spec | ||
/nmbl.uki | ||
/root.log | ||
/state.log | ||
/temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,97 +4,46 @@ | |
# Copyright Peter Jones <[email protected]> | ||
# | ||
|
||
DESTDIR ?= temp | ||
DATE=$(shell date "+%Y%m%d") | ||
ESPDIR ?= /boot/efi/EFI/BOOT | ||
VERSION = 0 | ||
RELEASE = 1 | ||
OS_NAME ?= $(shell grep '^ID=' /etc/os-release | sed 's/ID=//') | ||
OS_VERSION ?= $(shell grep '^VERSION_ID=' /etc/os-release | sed 's/VERSION_ID=//') | ||
OS_DIST ?= $(shell rpm --eval '%{dist}') | ||
SRPM = nmbl-builder-$(VERSION)-$(RELEASE)$(OS_DIST).src.rpm | ||
TARBALL = nmbl-builder-$(VERSION).tar.xz | ||
KVERREL ?= $(shell rpm -q kernel-core --qf '%{VERSION}-%{RELEASE}.%{ARCH}\n' | tail -n 1) | ||
ARCH ?= $(shell rpm --eval '%{_build_arch}') | ||
RPM = nmbl-$(VERSION)-$(RELEASE)$(OS_DIST).$(ARCH).rpm | ||
MOCKROOT ?= $(OS_NAME)-$(OS_VERSION)-$(ARCH) | ||
TOPDIR ?= $(realpath ./) | ||
include $(TOPDIR)/utils.mk | ||
|
||
.ONESHELL: | ||
MOCK_ROOT_NAME ?= $(OS_NAME)-$(OS_VERSION)-$(ARCH) | ||
MOCK_ROOT_PATH ?= $(realpath $(shell mock -r $(MOCK_ROOT_NAME) --print-root-path)/../) | ||
|
||
all: nmbl.uki | ||
all: | ||
|
||
install-grub2-emu: | ||
install -m 0755 -d "$(DESTDIR)/usr/lib/dracut/modules.d/99grub2-emu" | ||
install -m 0755 -t "$(DESTDIR)/usr/lib/dracut/modules.d/99grub2-emu" $(wildcard 99grub2-emu/*) | ||
install -m 0755 -d "$(DESTDIR)/etc/dracut-grub2.conf.d" | ||
install -m 0644 -t "$(DESTDIR)/etc/dracut-grub2.conf.d" etc/dracut-grub2.conf.d/grub2-emu.conf | ||
install -m 0755 -d "$(DESTDIR)/etc/dracut.conf.d" | ||
install -m 0755 -t "$(DESTDIR)/etc/dracut.conf.d" etc/dracut.conf.d/grub2-emu.conf | ||
install -m 0755 -d "$(DESTDIR)/etc/grub.d" | ||
install -m 0755 -t "$(DESTDIR)/etc/grub.d" etc/grub.d/10_linux | ||
dracut-nmbl-$(VERSION).tar.xz : | ||
$(MAKE) -C dracut-nmbl tarball | ||
mv -v dracut-nmbl/dracut-nmbl-$(VERSION).tar.xz . | ||
|
||
%.spec : %.spec.in | ||
@sed \ | ||
-e 's,@@VERSION@@,$(VERSION),g' \ | ||
-e 's,@@RELEASE@@,$(RELEASE),g' \ | ||
$< > $@ | ||
dracut-nmbl-$(VR).src.rpm : dracut-nmbl.spec dracut-nmbl-$(VERSION).tar.xz | ||
rpmbuild $(RPMBUILD_ARGS) -bs $< | ||
|
||
nmbl.initramfs.img: | ||
dracut --verbose --confdir /etc/dracut-grub2.conf.d/ --no-hostonly \ | ||
nmbl.initramfs.img \ | ||
$(KVERREL) | ||
dracut-nmbl-$(VR).noarch.rpm : dracut-nmbl-$(VR).src.rpm | ||
mock -r "$(MOCK_ROOT_NAME)" --rebuild dracut-nmbl-$(VR).src.rpm | ||
mv "$(MOCK_ROOT_PATH)/result/$@" . | ||
|
||
nmbl.uki: nmbl.initramfs.img | ||
/usr/lib/systemd/ukify -o nmbl.uki \ | ||
--os-release @/etc/os-release \ | ||
--uname $(KVERREL) \ | ||
--efi-arch x64 \ | ||
--stub /usr/lib/systemd/boot/efi/linuxx64.efi.stub \ | ||
/boot/vmlinuz-$(KVERREL) \ | ||
"nmbl.initramfs.img" | ||
nmbl-builder-$(VERSION).tar.xz : | ||
$(MAKE) -C nmbl-builder tarball | ||
mv -v nmbl-builder/nmbl-builder-$(VERSION).tar.xz . | ||
|
||
$(TARBALL) : | ||
@git archive --format=tar --prefix=nmbl-builder-$(VERSION)/ HEAD | xz > $@ | ||
nmbl-builder-$(VR).src.rpm : nmbl-builder.spec nmbl-builder-$(VERSION).tar.xz | ||
rpmbuild $(RPMBUILD_ARGS) -bs $< | ||
|
||
$(SRPM) : nmbl-builder.spec $(TARBALL) | ||
@rpmbuild -D "_topdir %(echo $$(pwd))" \ | ||
-D '_builddir %{_topdir}' \ | ||
-D '_rpmdir %{_topdir}' \ | ||
-D '_sourcedir %{_topdir}' \ | ||
-D '_specdir %{_topdir}' \ | ||
-D '_srcrpmdir %{_topdir}' \ | ||
-bs $< | ||
|
||
install: nmbl.uki | ||
@install -m 0755 -d "$(DESTDIR)$(ESPDIR)" | ||
install -m 0644 -t "$(DESTDIR)$(ESPDIR)" nmbl.uki | ||
|
||
tarball : $(TARBALL) | ||
|
||
srpm : $(SRPM) | ||
nmbl-$(KVRA).rpm: nmbl-builder-$(VR).src.rpm dracut-nmbl-$(VR).noarch.rpm | ||
mock -r "$(MOCK_ROOT_NAME)" --install dracut-nmbl-$(VR).noarch.rpm --cache-alterations --no-cleanup-after | ||
mock -r "$(MOCK_ROOT_NAME)" --installdeps nmbl-builder-$(VR).src.rpm --cache-alterations --no-clean --no-cleanup-after | ||
mock -r "$(MOCK_ROOT_NAME)" --rebuild nmbl-builder-$(VR).src.rpm --no-clean | ||
|
||
init-mock: | ||
@mock -r "$(MOCKROOT)" --init | ||
|
||
$(RPM) : $(SRPM) | ||
@mock -r "$(MOCKROOT)" --installdeps --no-clean $(SRPM) | ||
# well, here's a hot mess... this needs to be an rpm we can buildreq on, eventually. | ||
find etc/ -exec mock -r "$(MOCKROOT)" --copyin --no-clean {} /{} \; | ||
find 99grub2-emu -exec mock -r "$(MOCKROOT)" --copyin --no-clean {} /usr/lib/dracut/modules.d/{} \; | ||
mock -r "$(MOCKROOT)" --rebuild --no-clean $(SRPM) | ||
cp -av "/var/lib/mock/$(MOCKROOT)/result"/* ./ | ||
|
||
rpm : $(RPM) | ||
mock -r "$(MOCK_ROOT_NAME)" --init | ||
|
||
clean-mock: | ||
@mock -r "$(MOCKROOT)" --clean | ||
mock -r "$(MOCK_ROOT_NAME)" --clean | ||
|
||
clean: | ||
@rm -vf nmbl.initramfs.img nmbl.uki nmbl-builder.spec \ | ||
build.log hw_info.log installed_pkgs.log root.log state.log \ | ||
$(wildcard *.tar *.tar.xz *.rpm) | ||
rm -vf $(wildcard *.tar *.tar.xz *.rpm *.spec) | ||
|
||
.PHONY: all clean clean-mock init-mock install install-grub2-emu rpm rpm-deps \ | ||
srpm tarball | ||
.PHONY: all clean clean-mock init-mock | ||
|
||
# vim:ft=make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
%global debug_package %{nil} | ||
%global kver %{expand:%(rpm -q kernel-core --qf '%%{VERSION}' | tail -n 1)} | ||
%global krel %{expand:%(rpm -q kernel-core --qf '%%{RELEASE}' | tail -n 1)} | ||
|
||
Summary: nmbl proof of concept as a dracut module | ||
Name: dracut-nmbl | ||
BuildArch: noarch | ||
Version: @@VERSION@@ | ||
Release: @@RELEASE@@%{?dist} | ||
Group: System Environment/Base | ||
License: GPLv3 | ||
URL: https://github.com/rhboot/nmbl-poc | ||
|
||
BuildRequires: git | ||
BuildRequires: make | ||
|
||
Source0: dracut-nmbl-%{version}.tar.xz | ||
|
||
%description | ||
nmbl-poc is a proof of concept for a bootloader for UEFI machines based on | ||
the linux kernel and grub-emu, using either switchroot or kexec. | ||
|
||
%prep | ||
%autosetup -S git_am | ||
|
||
%build | ||
make all | ||
|
||
%install | ||
%make_install | ||
|
||
%files | ||
%defattr(-,root,root,-) | ||
%{_sysconfdir}/dracut.conf.d/grub2-emu.conf | ||
%dir /usr/lib/dracut/modules.d/99grub2-emu | ||
/usr/lib/dracut/modules.d/99grub2-emu/* | ||
|
||
%changelog | ||
* Fri Mar 17 2023 Peter Jones <[email protected]> - 0-0 | ||
- Yeet a spec file into the world |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# SPDX-License-Identifier: GPLv3 | ||
# | ||
# Makefile | ||
# Copyright Peter Jones <[email protected]> | ||
# | ||
|
||
DESTDIR ?= temp | ||
VERSION ?= 0 | ||
|
||
all: | ||
|
||
install : | ||
install -m 0755 -d "$(DESTDIR)/usr/lib/dracut/modules.d/99grub2-emu" | ||
install -m 0644 -t "$(DESTDIR)/usr/lib/dracut/modules.d/99grub2-emu" $(wildcard 99grub2-emu/*) | ||
install -m 0755 -d "$(DESTDIR)/etc/dracut.conf.d" | ||
install -m 0644 -t "$(DESTDIR)/etc/dracut.conf.d" etc/dracut.conf.d/grub2-emu.conf | ||
|
||
dracut-nmbl-$(VERSION).tar.xz : Makefile | ||
@git archive --format=tar --prefix=dracut-nmbl-$(VERSION)/ HEAD -- \ | ||
99grub2-emu/ \ | ||
etc/ \ | ||
Makefile \ | ||
| xz > $@ | ||
|
||
tarball : dracut-nmbl-$(VERSION).tar.xz | ||
|
||
clean : | ||
@rm -vf dracut-nmbl-$(VERSION).tar.xz | ||
|
||
.PHONY: all install clean tarball | ||
|
||
# vim:ft=make |
File renamed without changes.
Oops, something went wrong.