Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/263'
Browse files Browse the repository at this point in the history
* origin/pr/263:
  kernel: integrate dummy-psu and dummy-backlight
  • Loading branch information
marmarek committed Oct 11, 2020
2 parents c6658e0 + 432f141 commit d22c689
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "dummy-psu"]
path = dummy-psu
url = https://github.com/QubesOS/qubes-dummy-psu
[submodule "dummy-backlight"]
path = dummy-backlight
url = https://github.com/QubesOS/qubes-dummy-backlight
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ verrel:
@echo $(NAME)-$(VERSION)-$(RELEASE)

get-sources: $(SRC_FILE) $(SIGN_FILE) $(SPI_SRC_FILE)
git submodule update --init --recursive

$(SRC_FILE):
@wget -q -N $(URL)
Expand Down
10 changes: 10 additions & 0 deletions Makefile.builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
ifeq ($(PACKAGE_SET),dom0)
RPM_SPEC_FILES := kernel.spec
NO_ARCHIVE := 1

INCLUDED_SOURCES = dummy-psu dummy-backlight
SOURCE_COPY_IN := $(INCLUDED_SOURCES)

$(INCLUDED_SOURCES): PACKAGE=$@
$(INCLUDED_SOURCES): VERSION=$(shell git -C $(ORIG_SRC)/$(PACKAGE) rev-parse --short HEAD)
$(INCLUDED_SOURCES):
$(BUILDER_DIR)/scripts/create-archive $(CHROOT_DIR)/$(DIST_SRC)/$(PACKAGE) $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)/
mv $(CHROOT_DIR)/$(DIST_SRC)/$(PACKAGE)/$(PACKAGE)-$(VERSION).tar.gz $(CHROOT_DIR)/$(DIST_SRC)
sed -i "s#@$(PACKAGE)@#$(PACKAGE)-$(VERSION).tar.gz#" $(CHROOT_DIR)/$(DIST_SRC)/kernel.spec.in
endif
1 change: 1 addition & 0 deletions dummy-backlight
Submodule dummy-backlight added at 039327
1 change: 1 addition & 0 deletions dummy-psu
Submodule dummy-psu added at e0ff33
25 changes: 25 additions & 0 deletions kernel.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ Source0: linux-%{upstream_version}.tar.xz
%else
Source0: linux-%{upstream_version}.tar.gz
%endif
Source1: @dummy-psu@
Source2: @dummy-backlight@
Source6: macbook12-spi-driver-ddfbc7733542b8474a0e8f593aba91e06542be4f.tar.gz
Source16: guards
Source17: apply-patches
Expand Down Expand Up @@ -201,6 +203,13 @@ make clean $MAKE_ARGS

rm -f source
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files

rm -rf %_builddir/dummy-psu
tar -x -C %_builddir -zf %{SOURCE1}

rm -rf %_builddir/dummy-backlight
tar -x -C %_builddir -zf %{SOURCE2}

rm -rf %_builddir/u2mfn
u2mfn_ver=`dkms status u2mfn|tail -n 1|cut -f 2 -d ' '|tr -d ':,:'`
if [ -n "$u2mfn_ver" ]; then
Expand All @@ -217,6 +226,16 @@ cd %kernel_build_dir

make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y

# Build dummy-psu module
if [ -d "%_builddir/dummy-psu" ]; then
make -C %kernel_build_dir M=%_builddir/dummy-psu modules
fi

# Build dummy-backlight module
if [ -d "%_builddir/dummy-backlight" ]; then
make -C %kernel_build_dir M=%_builddir/dummy-backlight modules
fi

# Build u2mfn module
if [ -d "%_builddir/u2mfn" ]; then
make -C %kernel_build_dir M=%_builddir/u2mfn modules
Expand Down Expand Up @@ -280,6 +299,12 @@ dd if=/dev/zero of=%buildroot/boot/initramfs-%kernelrelease.img \
gzip -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease.gz

make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
if [ -d "%_builddir/dummy-psu" ]; then
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/dummy-psu
fi
if [ -d "%_builddir/dummy-backlight" ]; then
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/dummy-backlight
fi
if [ -d "%_builddir/u2mfn" ]; then
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot M=%_builddir/u2mfn
fi
Expand Down

0 comments on commit d22c689

Please sign in to comment.