Last active
October 27, 2023 00:32
-
-
Save guilt/d82e15cf0550a1a9d4e37fb8d84c4e8d to your computer and use it in GitHub Desktop.
WSL Build Scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [wsl2] | |
| kernel=C:\\Users\\Karthik\\WSL2\\vmlinux-5.4.91-microsoft-release | |
| swap=0 | |
| localhostForwarding=true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| [ -z $DEBUG ] || set -x | |
| BRANCH=${BRANCH:-linux-msft-wsl-5.4.y} | |
| PATCH=patch-${BRANCH}.diff | |
| echo 'Cloning Tree' | |
| [ -d WSL2-Linux-Kernel ] || git clone https://github.com/microsoft/WSL2-Linux-Kernel.git | |
| cd WSL2-Linux-Kernel | |
| echo 'Checking out Branch' | |
| git stash | |
| git reset --hard | |
| git checkout ${BRANCH} | |
| VERSION=$(cat Makefile | fgrep 'VERSION = ' | head -n 1 | awk '{ print $3 }') | |
| PATCHLEVEL=$(cat Makefile | fgrep 'PATCHLEVEL = ' | head -n 1 | awk '{ print $3 }') | |
| SUBLEVEL=$(cat Makefile | fgrep 'SUBLEVEL = ' | head -n 1 | awk '{ print $3 }') | |
| SUFFIX=-microsoft-release | |
| export LD=ld.bfd | |
| export CPLUS_INCLUDE_PATH= | |
| export C_INCLUDE_PATH= | |
| export LIBRARY_PATH= | |
| export KERNELRELEASE=${VERSION}.${PATCHLEVEL}.${SUBLEVEL}${SUFFIX} | |
| echo 'Cleaning' | |
| make LD=ld.bfd mrproper | |
| echo 'Configuring' | |
| cat Microsoft/config-wsl | sed 's/-microsoft-standard/-microsoft-release/g' > .config | |
| echo 'Patching' | |
| [ -f ../${PATCH} ] && patch -p1 < ../${PATCH} | |
| echo 'OldConfig' | |
| yes '' | make LD=ld.bfd KERNELRELEASE="$KERNELRELEASE" oldconfig | |
| make LD=ld.bfd KERNELRELEASE="$KERNELRELEASE" | |
| make LD=ld.bfd KERNELRELEASE="$KERNELRELEASE" modules | |
| echo 'Installing /lib/modules' | |
| sudo mkdir -p /lib/modules/$KERNELRELEASE/ | |
| sudo make LD=ld.bfd KERNELRELEASE="$KERNELRELEASE" modules install | |
| cp vmlinux ../vmlinux-${KERNELRELEASE} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tmpfs /var/tmp tmpfs defaults 0 0 | |
| debugfs /sys/kernel/debug debugfs defaults 0 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) | |
| { | |
| Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit | |
| } | |
| $wslPackage = "46932SUSE.openSUSELeap15.2_022rs5jcyhyac" | |
| $image = "C:\Users\Karthik" + "\AppData\Local\Packages\" + $wslPackage + "\LocalState\ext4.vhdx" | |
| Optimize-VHD $image | |
| Pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/drivers/hyperv/dxgkrnl/dxgmodule.c b/drivers/hyperv/dxgkrnl/dxgmodule.c | |
| index 4edb79d96a7a..2bd03661c7e6 100644 | |
| --- a/drivers/hyperv/dxgkrnl/dxgmodule.c | |
| +++ b/drivers/hyperv/dxgkrnl/dxgmodule.c | |
| @@ -417,12 +417,12 @@ const struct file_operations dxgk_fops = { | |
| */ | |
| /* vGPU VM bus channel instance ID */ | |
| -const int DXGK_VMBUS_CHANNEL_ID_OFFSET = 192; | |
| +const int DXGK_VMBUS_CHANNEL_ID_OFFSET = 192; | |
| /* DXGK_VMBUS_INTERFACE_VERSION (u32) */ | |
| -const int DXGK_VMBUS_VERSION_OFFSET = DXGK_VMBUS_CHANNEL_ID_OFFSET + | |
| +const int DXGK_VMBUS_VERSION_OFFSET = 192 + | |
| sizeof(guid_t); | |
| /* Luid of the virtual GPU on the host (struct winluid) */ | |
| -const int DXGK_VMBUS_VGPU_LUID_OFFSET = DXGK_VMBUS_VERSION_OFFSET + | |
| +const int DXGK_VMBUS_VGPU_LUID_OFFSET = 192 + sizeof(guid_t) + | |
| sizeof(u32); | |
| static int dxg_pci_read_dwords(struct pci_dev *dev, int offset, int size, | |
| diff --git a/drivers/net/wireguard/allowedips.c b/drivers/net/wireguard/allowedips.c | |
| index 3725e9cd85f4..9641b16d8f6f 100644 | |
| --- a/drivers/net/wireguard/allowedips.c | |
| +++ b/drivers/net/wireguard/allowedips.c | |
| @@ -35,14 +35,14 @@ static void push_rcu(struct allowedips_node **stack, | |
| struct allowedips_node __rcu *p, unsigned int *len) | |
| { | |
| if (rcu_access_pointer(p)) { | |
| - WARN_ON(IS_ENABLED(DEBUG) && *len >= 128); | |
| + WARN_ON(IS_ENABLED(DEBUG) && *len >= 96); | |
| stack[(*len)++] = rcu_dereference_raw(p); | |
| } | |
| } | |
| static void root_free_rcu(struct rcu_head *rcu) | |
| { | |
| - struct allowedips_node *node, *stack[128] = { | |
| + struct allowedips_node *node, *stack[96] = { | |
| container_of(rcu, struct allowedips_node, rcu) }; | |
| unsigned int len = 1; | |
| @@ -55,7 +55,7 @@ static void root_free_rcu(struct rcu_head *rcu) | |
| static void root_remove_peer_lists(struct allowedips_node *root) | |
| { | |
| - struct allowedips_node *node, *stack[128] = { root }; | |
| + struct allowedips_node *node, *stack[96] = { root }; | |
| unsigned int len = 1; | |
| while (len > 0 && (node = stack[--len])) { | |
| @@ -72,7 +72,7 @@ static void walk_remove_by_peer(struct allowedips_node __rcu **top, | |
| #define REF(p) rcu_access_pointer(p) | |
| #define DEREF(p) rcu_dereference_protected(*(p), lockdep_is_held(lock)) | |
| #define PUSH(p) ({ \ | |
| - WARN_ON(IS_ENABLED(DEBUG) && len >= 128); \ | |
| + WARN_ON(IS_ENABLED(DEBUG) && len >= 96); \ | |
| stack[len++] = p; \ | |
| }) | |
| --- a/.config 2021-02-18 15:40:08.330000000 -0800 | |
| +++ b/.config 2021-02-18 16:31:05.830000000 -0800 | |
| @@ -791,6 +792,7 @@ | |
| CONFIG_SPARSEMEM_VMEMMAP=y | |
| CONFIG_HAVE_MEMBLOCK_NODE_MAP=y | |
| CONFIG_HAVE_FAST_GUP=y | |
| +CONFIG_MEMORY_ISOLATION=y | |
| # CONFIG_MEMORY_HOTPLUG is not set | |
| CONFIG_SPLIT_PTLOCK_CPUS=4 | |
| CONFIG_MEMORY_BALLOON=y | |
| @@ -798,6 +800,7 @@ | |
| CONFIG_COMPACTION=y | |
| CONFIG_PAGE_REPORTING=y | |
| CONFIG_MIGRATION=y | |
| +CONFIG_CONTIG_ALLOC=y | |
| CONFIG_PHYS_ADDR_T_64BIT=y | |
| # CONFIG_BOUNCE is not set | |
| CONFIG_VIRT_TO_BUS=y | |
| @@ -812,7 +815,10 @@ | |
| CONFIG_TRANSPARENT_HUGE_PAGECACHE=y | |
| # CONFIG_CLEANCACHE is not set | |
| # CONFIG_FRONTSWAP is not set | |
| -# CONFIG_CMA is not set | |
| +CONFIG_CMA=y | |
| +# CONFIG_CMA_DEBUG is not set | |
| +# CONFIG_CMA_DEBUGFS is not set | |
| +CONFIG_CMA_AREAS=7 | |
| # CONFIG_MEM_SOFT_DIRTY is not set | |
| # CONFIG_ZPOOL is not set | |
| # CONFIG_ZBUD is not set | |
| @@ -1259,7 +1265,7 @@ | |
| CONFIG_NET_SCH_MULTIQ=y | |
| # CONFIG_NET_SCH_RED is not set | |
| # CONFIG_NET_SCH_SFB is not set | |
| -# CONFIG_NET_SCH_SFQ is not set | |
| +CONFIG_NET_SCH_SFQ=y | |
| # CONFIG_NET_SCH_TEQL is not set | |
| # CONFIG_NET_SCH_TBF is not set | |
| # CONFIG_NET_SCH_CBS is not set | |
| @@ -1283,6 +1289,7 @@ | |
| # CONFIG_NET_SCH_PLUG is not set | |
| CONFIG_NET_SCH_DEFAULT=y | |
| CONFIG_DEFAULT_FQ_CODEL=y | |
| +# CONFIG_DEFAULT_SFQ is not set | |
| # CONFIG_DEFAULT_PFIFO_FAST is not set | |
| CONFIG_DEFAULT_NET_SCH="fq_codel" | |
| @@ -1304,8 +1311,9 @@ | |
| # CONFIG_NET_CLS_MATCHALL is not set | |
| # CONFIG_NET_EMATCH is not set | |
| CONFIG_NET_CLS_ACT=y | |
| -# CONFIG_NET_ACT_POLICE is not set | |
| -# CONFIG_NET_ACT_GACT is not set | |
| +CONFIG_NET_ACT_POLICE=y | |
| +CONFIG_NET_ACT_GACT=y | |
| +# CONFIG_GACT_PROB is not set | |
| CONFIG_NET_ACT_MIRRED=y | |
| # CONFIG_NET_ACT_SAMPLE is not set | |
| CONFIG_NET_ACT_IPT=y | |
| @@ -1512,7 +1520,7 @@ | |
| CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 | |
| # CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
| # CONFIG_BLK_DEV_DRBD is not set | |
| -# CONFIG_BLK_DEV_NBD is not set | |
| +CONFIG_BLK_DEV_NBD=y | |
| # CONFIG_BLK_DEV_SKD is not set | |
| # CONFIG_BLK_DEV_SX8 is not set | |
| CONFIG_BLK_DEV_RAM=y | |
| @@ -2799,7 +2807,7 @@ | |
| # CONFIG_CRYPTO_PCRYPT is not set | |
| # CONFIG_CRYPTO_CRYPTD is not set | |
| CONFIG_CRYPTO_AUTHENC=y | |
| -# CONFIG_CRYPTO_TEST is not set | |
| +CONFIG_CRYPTO_TEST=m | |
| # | |
| # Public-key cryptography | |
| @@ -3070,6 +3078,7 @@ | |
| CONFIG_NEED_DMA_MAP_STATE=y | |
| CONFIG_ARCH_DMA_ADDR_T_64BIT=y | |
| CONFIG_SWIOTLB=y | |
| +# CONFIG_DMA_CMA is not set | |
| # CONFIG_DMA_API_DEBUG is not set | |
| CONFIG_SGL_ALLOC=y | |
| CONFIG_CPU_RMAP=y | |
| @@ -3317,4 +3326,3 @@ | |
| # CONFIG_UNWINDER_FRAME_POINTER is not set | |
| # CONFIG_UNWINDER_GUESS is not set | |
| # end of Kernel hacking | |
| - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment