Skip to content

Commit

Permalink
Add -check to wsl-latest-kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
sirredbeard committed Jan 30, 2024
1 parent 0de4a67 commit 13ed899
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Downloads, builds, and installs the latest kernel release from WSL2-Linux-Kernel

`wsl-latest-kernel` - Run wsl-latest-kernel.

`wsl-latest-kernel -check` - Check for an available kernel updates.

`wsl-latest-kernel -force` - Overwrites the existing custom kernel.

`wsl-latest-kernel -customconfig kernelconfig` - Build the kernel with a custom kernel config file. Expects a Windows path.
Expand Down
7 changes: 6 additions & 1 deletion wsl-latest-kernel.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ param(
[switch]$force,
[string]$customConfig,
[switch]$skipClean,
[switch]$revert
[switch]$revert,
[switch]$check
)

# Function to convert a Windows path to a WSL path
Expand Down Expand Up @@ -57,6 +58,10 @@ if ($latestRelease.tag_name -eq $wslKernelVersion) {
Exit 1
}

if ($check) {
Exit 0
}

# Run a persistent process in the wsl-system distro to prevent it from shutting down and resetting the environment
$job = Start-Job -ScriptBlock {
wsl --system --user root sh -c "while true; do sleep 1000; done"
Expand Down

0 comments on commit 13ed899

Please sign in to comment.