Skip to content

Commit d156521

Browse files
authored
Update kbuild.yml
1 parent 64e5fa5 commit d156521

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

.github/workflows/kbuild.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,38 @@ jobs:
2222
sudo apt-get update
2323
sudo apt-get install -y wget tar libncurses-dev bison flex libssl-dev libelf-dev bc zstd unzip
2424
25-
# Cache the 'kext' directory to avoid re-downloading and extracting kernel on subsequent runs
26-
- name: Cache kernel and firmware
25+
# Cache the 'kext' directory to avoid re-downloading kernel on each run
26+
- name: Cache kernel source
2727
uses: actions/[email protected]
2828
with:
2929
path: kext/
30-
key: ${{ runner.os }}-kext-${{ hashFiles('kext/**') }}
30+
key: ${{ runner.os }}-kext-${{ hashFiles('kernel-url') }}
3131
restore-keys: |
3232
${{ runner.os }}-kext-
3333
34-
# Download kernel and firmware files, extract and build
35-
- name: Download, extract and build kernel
34+
# Download, extract, and build kernel, always running make
35+
- name: Download, extract, and build kernel
3636
run: |
37-
if [ ! -f "kext/arch/x86/boot/bzImage" ]; then
38-
# If the kernel hasn't been built or cached, proceed with download and build
37+
# Download the kernel source only if it's not cached
38+
if [ ! -d "kext" ]; then
3939
wget -q -i kernel-url -O kernel.tar.xz
4040
mkdir -p kext
4141
tar -xf kernel.tar.xz -C kext --strip-components=1
42-
cp .config kext/
42+
fi
43+
44+
# Copy the .config file and update configuration
45+
cp .config kext/
46+
cd kext
4347
44-
# Download firmware (ensure the URL is correct)
48+
# Download firmware if necessary
49+
if [ ! -f "inspiron-351-fw-main" ]; then
4550
wget https://github.com/kzwkt/inspiron-351-fw/archive/refs/heads/main.zip
4651
unzip -q main.zip -d kext/
47-
48-
# Build the kernel
49-
cd kext
50-
make -j$(nproc)
51-
else
52-
echo "Kernel already built. Skipping download and build."
5352
fi
5453
54+
# Run make every time, even if cached
55+
make -j$(nproc)
56+
5557
# Upload the kernel artifact
5658
- name: Upload kernel
5759
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)