Skip to content

Commit

Permalink
fish: Remove support for WSL2
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
  • Loading branch information
nathanchance committed Dec 26, 2024
1 parent de35557 commit 3ea99fd
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 167 deletions.
4 changes: 1 addition & 3 deletions fish/conf.d/variables.fish
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ if test -z "$LOCATION"
set -Ux LOCATION workstation
case nathan@hyperv nathan@qemu nathan@vmware
set -Ux LOCATION vm
case nathan@MSI nathan@Ryzen-5-4500U nathan@Ryzen-9-3900X
set -Ux LOCATION wsl
case '*'
set -Ux LOCATION generic
end
Expand All @@ -49,7 +47,7 @@ end

# CCACHE_SIZE
switch $LOCATION
case generic wsl
case generic
set -gx CCACHE_MAXSIZE 25G
case hetzner
set -gx CCACHE_MAXSIZE 200G
Expand Down
2 changes: 1 addition & 1 deletion fish/functions/cbl_bld_tot_tcs.fish
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function cbl_bld_tot_tcs -d "Build LLVM and binutils from source for kernel deve
set func_bld (tbf (status function))

switch $LOCATION
case aadp generic wsl
case aadp generic
set bolt true
set pgo kernel-defconfig
if test $LOCATION = aadp
Expand Down
11 changes: 0 additions & 11 deletions fish/functions/cbl_clone_repo.fish
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ function cbl_clone_repo -d "Clone certain repos for ClangBuiltLinux testing and
set dest $NVME_SRC_FOLDER/$arg
end

case wsl2
set url git@github.com:nathanchance/WSL2-Linux-Kernel
set dest $CBL_SRC_P/wsl2

case '*'
print_error "$arg not supported explicitly, skipping!"
continue
Expand Down Expand Up @@ -109,13 +105,6 @@ function cbl_clone_repo -d "Clone certain repos for ClangBuiltLinux testing and
switch $arg
case tc-build
git -C $dest remote add -f nathanchance https://github.com/nathanchance/tc-build
case wsl2
git -C $dest remote add -f --tags mainline https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git -C $dest remote add -f --tags next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git -C $dest remote add -f --tags microsoft https://github.com/microsoft/WSL2-Linux-Kernel
git -C $dest remote add -f --tags sami https://github.com/samitolvanen/linux
git -C $dest config rerere.enabled true
git -C $dest config status.aheadBehind false
end
end
end
Expand Down
48 changes: 0 additions & 48 deletions fish/functions/cbl_rb_wk.fish

This file was deleted.

36 changes: 0 additions & 36 deletions fish/functions/cbl_test_kvm.fish
Original file line number Diff line number Diff line change
Expand Up @@ -45,45 +45,9 @@ function cbl_test_kvm -d "Test KVM against a Clang built kernel with QEMU"
# Start container before updating, as podman requires some kernel modules,
# which need to be loaded before updating, as an update to linux will
# remove the modules on disk for the current running kernel version.
# It does not hurt wsl2 so just do it unconditionally.
dbxe -- true; or return

switch $LOCATION
case wsl
set arch x86_64 # for now?
set src $CBL_SRC_C/linux
cbl_upd_src c m

for toolchain in GCC LLVM
set out (tbf $src)/$arch/(string lower $toolchain)
switch $arch
case x86_64
set kernel $out/arch/x86/boot/bzImage
case '*'
return 1
end

if not test -f $kernel
set -l make_args
switch $toolchain
case LLVM
set -a make_args LLVM=1
end
if dbx_has_82a69f0
dbxe -- fish -c "kmake -C $src ARCH=$arch $make_args O=$out defconfig all"
else
dbxe -- "fish -c 'kmake -C $src ARCH=$arch $make_args O=$out defconfig all'"
end
or return
end
if dbx_has_82a69f0
dbxe -- fish -c "kboot -a $arch -k $out"
else
dbxe -- "fish -c 'kboot -a $arch -k $out'"
end
or return
end

case vm
updfull
mkdir -p $TMP_FOLDER
Expand Down
38 changes: 0 additions & 38 deletions fish/functions/cbl_upd_krnl.fish
Original file line number Diff line number Diff line change
Expand Up @@ -156,43 +156,5 @@ function cbl_upd_krnl -d "Update machine's kernel"

# Install kernel and reboot as asked
install_arch_kernel $install_args $krnl

case wsl
in_container_msg -h; or return

set i 1
while test $i -le (count $argv)
switch $argv[$i]
case -g --github
set kernel_location github
case -k --kernel-suffix
set next (math $i + 1)
set kernel_suffix $argv[$next]
set i $next
case -l --local
set kernel_location local
case -s --server
set kernel_location server
end
set i (math $i + 1)
end
if test -z "$kernel_location"
set kernel_location github
end

set kernel /mnt/c/Users/natec/Linux/kernel"$kernel_suffix"
rm -r $kernel

switch $kernel_location
case local
cp -v $CBL_SRC_P/wsl2/arch/x86/boot/bzImage $kernel
case github
set repo nathanchance/WSL2-Linux-Kernel
crl -o $kernel https://github.com/$repo/releases/download/(glr $repo)/bzImage
case server
set src (string replace $MAIN_FOLDER $remote_main_folder $CBL_SRC_P)/wsl2
set image arch/x86/boot/bzImage
scp $remote_user@$remote_host:$src/$image $kernel
end
end
end
20 changes: 8 additions & 12 deletions fish/functions/hugo_serve.fish
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ function hugo_serve -d "Runs 'hugo server' based on WSL's IP address"
return 1
end

if test $LOCATION = wsl
set intf eth0
set hugo_args $argv
else
for arg in $argv
switch $arg
case -t --tailscale
set intf tailscale
case '*'
set -a hugo_args $arg
end
for arg in $argv
switch $arg
case -t --tailscale
set intf tailscale
case '*'
set -a hugo_args $arg
end
set -q intf; or set intf enp
end
set -q intf
or set intf enp

set ip (dirname (ip addr | grep $intf | grep inet | awk '{print $2}'))
if test -z "$ip"
Expand Down
22 changes: 4 additions & 18 deletions fish/functions/user_setup.fish
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function user_setup -d "Setup a user account, downloading all files and placing
switch $LOCATION
case aadp honeycomb pi test-desktop-amd test-desktop-intel-{11700,n100} test-laptop-intel
set trusted_ssh true
case hetzner workstation wsl
case hetzner workstation
set trusted_gpg true
set trusted_ssh true
end
Expand All @@ -38,21 +38,14 @@ function user_setup -d "Setup a user account, downloading all files and placing
set trusted_ssh true
set skip_install_ssh_keys true # orbstack passes along the macOS ssh-agent
end
set keys_folder /tmp/keys
# Trusting an environment with GPG but not SSH makes little sense
if test "$trusted_gpg" = true; and not test "$trusted_ssh" = true
print_error "This environment trusts GPG but not SSH?"
return 1
end
# Set up where keys should be available
switch $LOCATION
case wsl
set keys_folder /mnt/c/Users/natec/Documents/Keys
case '*'
set keys_folder /tmp/keys
end
# Set up SSH keys if requested
if test "$trusted_ssh" = true
# Set up gh
Expand Down Expand Up @@ -140,9 +133,7 @@ function user_setup -d "Setup a user account, downloading all files and placing
gpg_key_cache; or return
end
if test "$LOCATION" != wsl
rm -rf $keys_folder
end
rm -rf $keys_folder
# Downloading/updating environment scripts
if not test -d $ENV_FOLDER
Expand Down Expand Up @@ -267,7 +258,7 @@ rpmbuild/' >>$gitignore
else
updall --no-os; or return
end
if has_container_manager; and test "$LOCATION" != wsl
if has_container_manager
dbxc --yes
end

Expand Down Expand Up @@ -336,11 +327,6 @@ rpmbuild/' >>$gitignore

tmux new-window fish -c "begin; start_ssh_agent; and cbl_setup_other_repos; end; or exec fish -l"

case wsl
decrypt_gpg_file server_ip

set github_repos hugo-files nathanchance.github.io

case '*'
return 0
end
Expand Down

0 comments on commit 3ea99fd

Please sign in to comment.