Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rppt/kpatch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: dynup/kpatch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing 839 changed files with 26,941 additions and 3,449 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: close inactive issues
on:
schedule:
- cron: "0 10 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-stale: 30
days-before-issue-close: 7
stale-issue-label: "stale"
stale-issue-message: "This issue has been open for 30 days with no activity and no assignee. It will be closed in 7 days unless a comment is added."
close-issue-message: "This issue was closed because it was inactive for 7 days after being marked stale."
days-before-pr-stale: 60
days-before-pr-close: 7
stale-pr-label: "stale"
stale-pr-message: "This PR has been open for 60 days with no activity and no assignee. It will be closed in 7 days unless a comment is added."
close-pr-message: "This PR was closed because it was inactive for 7 days after being marked stale."
exempt-all-assignees: true
ascending: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build and unit tests

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
cflags: [ "", "-O2", "-O3" ]
runs-on: ubuntu-latest
env:
CFLAGS: ${{ matrix.cflags }}
steps:
- uses: actions/checkout@v3
- name: dependencies
run: sudo apt-get install -y libelf-dev linux-headers-$(uname -r) shellcheck elfutils
- name: make
run: make
- name: submodule update
run: git submodule update --init
- name: make unit
run: make unit
- name: make check
run: make check
- name: install
run: sudo make install
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
*.ko.cmd
*.mod.c
*.swp
*.swo
*.d
*.so
.tmp_versions
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "test/unit/objs"]
path = test/unit/objs
url = https://github.com/dynup/kpatch-unit-test-objs.git
18 changes: 18 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: c
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y libelf-dev linux-headers-$(uname -r) shellcheck elfutils

jobs:
include:
- name: "Default"
- name: "-O2"
env: CFLAGS="-O2"
- name: "-O3"
env: CFLAGS="-O3"

script:
- make
- make unit
- make check
- sudo make install
69 changes: 67 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,14 +6,26 @@ INSTALL_DIRS = $(SUBDIRS:%=install-%)
UNINSTALL_DIRS = $(SUBDIRS:%=uninstall-%)
CLEAN_DIRS = $(SUBDIRS:%=clean-%)

.PHONY: all install uninstall clean check
UNITTEST_DIR = test/unit
INTEGRATION_DIR = test/integration
CLEAN_DIRS += clean-$(UNITTEST_DIR)

.PHONY: all dependencies install uninstall clean check unit
.PHONY: $(SUBDIRS) $(BUILD_DIRS) $(INSTALL_DIRS) $(CLEAN_DIRS)
.PHONY: integration integration-slow integration-quick
.PHONY: vagrant-integration-slow vagrant-integration-quick vagrant-integration
.PHONY: vagrant-install
.PHONY: help


all: $(BUILD_DIRS)
$(BUILD_DIRS):
$(MAKE) -C $(@:build-%=%)

dependencies: SHELL:=/bin/bash
dependencies:
source test/integration/lib.sh && kpatch_dependencies

install: $(INSTALL_DIRS)
$(INSTALL_DIRS):
$(MAKE) -C $(@:install-%=%) install
@@ -26,5 +38,58 @@ clean: $(CLEAN_DIRS)
$(CLEAN_DIRS):
$(MAKE) -C $(@:clean-%=%) clean

unit: $(UNITTEST_DIR)/Makefile build-kpatch-build
$(MAKE) -C $(UNITTEST_DIR)

integration: integration-quick

integration-slow: $(INTEGRATION_DIR)/Makefile build-kpatch-build build-kpatch build-kmod
$(MAKE) -C $(INTEGRATION_DIR) slow

integration-quick: $(INTEGRATION_DIR)/Makefile build-kpatch-build build-kpatch build-kmod
$(MAKE) -C $(INTEGRATION_DIR) quick

vagrant-install: $(INTEGRATION_DIR)/lib.sh
ifneq ($(shell id -u), 0)
@echo "WARNING: This target is intended for use on freshly-installed machines/vms only." && \
echo "Do not proceed unless you read $(INTEGRATION_DIR)/lib.sh and realise what this target does." && \
echo "Press ctrl-c to abort, return to proceed." && \
read
endif
source $(INTEGRATION_DIR)/lib.sh && kpatch_check_install_vagrant

vagrant-integration: vagrant-integration-quick

vagrant-integration-slow:
$(MAKE) -C $(INTEGRATION_DIR) vagrant-slow

vagrant-integration-quick:
$(MAKE) -C $(INTEGRATION_DIR) vagrant-quick

check:
shellcheck kpatch/kpatch kpatch-build/kpatch-build kpatch-build/kpatch-gcc
shellcheck kpatch/kpatch kpatch-build/kpatch-build kpatch-build/kpatch-cc
shellcheck test/difftree.sh test/integration/kpatch-test \
test/integration/lib.sh test/integration/rebase-patches \
test/integration/test-vagrant \
test/integration/vm-integration-run

help:
@echo "kpatch Makefile"
@echo
@echo "Targets:"
@echo " make dependencies install build dependencies [1]"
@echo " make all build entire project"
@echo " make install install programs to system [1]"
@echo " make uninstall remove programs from system [1]"
@echo " make clean clean build files"
@echo
@echo "Test targets:"
@echo " make check run static code analyzers"
@echo " make integration build and run integration tests [2]"
@echo " make integration-slow build and run integration tests [2]"
@echo " make integration-quick build and run integration tests [2]"
@echo " make unit run unit tests"
@echo
@echo "[1] requires admin privileges"
@echo "[2] installs test kpatch kernel modules, run at your own risk"
@echo
5 changes: 0 additions & 5 deletions Makefile.inc
Original file line number Diff line number Diff line change
@@ -17,10 +17,5 @@ MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1
SYSTEMDDIR = $(DESTDIR)$(PREFIX)/lib/systemd/system
UPSTARTDIR = $(DESTDIR)/etc/init

# The core module is only supported on x86_64
ifeq ($(ARCH),x86_64)
BUILDMOD ?= yes
endif

.PHONY: all install clean
.DEFAULT: all
Loading