How to create an appx file for a Porteus install to WSL

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8437
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create an appx file for a Porteus install to WSL

Post#1 by Ed_P » 24 Mar 2024, 05:29

The title basically says it all. We download ISOs, how do we convert an ISO file to be an Appx file? :%)
Ed

beny
Full of knowledge
Full of knowledge
Posts: 2116
Joined: 02 Jan 2011, 11:33
Location: italy

How to create an appx file for a Porteus install to WSL

Post#2 by beny » 26 Mar 2024, 00:21

hi Ed_P only snap on ubuntu have something useful for this task but snap need systemd so you have to have an ubuntu system running

User avatar
Ed_P
Contributor
Contributor
Posts: 8437
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create an appx file for a Porteus install to WSL

Post#3 by Ed_P » 26 Mar 2024, 03:51

Thanks beny. I'm surprised there is no Porteus dir2appx command. :( And surprised I can't find documentation on what's in one other than the OS's files themselves. I think there is a files folder but don't know what the format of the lines in it is. There are appx files on Windows' WSL Store, I may have to download one to analyze. :hmmm:
Ed

beny
Full of knowledge
Full of knowledge
Posts: 2116
Joined: 02 Jan 2011, 11:33
Location: italy

How to create an appx file for a Porteus install to WSL

Post#4 by beny » 26 Mar 2024, 13:45

The Appx format is proprietary to Microsoft so I don't think Porteus can have software like this,but you can always hope

User avatar
Ed_P
Contributor
Contributor
Posts: 8437
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create an appx file for a Porteus install to WSL

Post#5 by Ed_P » 26 Mar 2024, 14:22

:hmmm: I think you're right. :( But just saw some useful app links here: video downloaders I wonder if WSL will work with one of them.
Ed

i3slkiller
Contributor
Contributor
Posts: 64
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

How to create an appx file for a Porteus install to WSL

Post#6 by i3slkiller » 22 May 2024, 11:14

Image
So, I installed Windows 10 on vmware (because it's only hypervisor which supports nested vm on my pc) and WSL2 on it, and I got figuring how to start porteus on it, as a result I am sharing a quickly written way to get it "working".

build kernel

Code: Select all

activate 05-devel.xzm
wget https://github.com/microsoft/WSL2-Linux-Kernel/archive/linux-msft-wsl-5.15.153.1/WSL2-Linux-Kernel-linux-msft-wsl-5.15.153.1.tar.gz
tar -xf WSL2-Linux-Kernel-linux-msft-wsl-5.15.153.1.tar.gz
git clone https://github.com/sfjro/aufs-standalone.git
git -C aufs-standalone checkout aufs5.15.41
cd WSL2-Linux-Kernel-linux-msft-wsl-5.15.153.1
patch -p1 < ../aufs-standalone/aufs5-kbuild.patch
patch -p1 < ../aufs-standalone/aufs5-base.patch
patch -p1 < ../aufs-standalone/aufs5-mmap.patch
patch -p1 < ../aufs-standalone/aufs5-standalone.patch
cp -r ../aufs-standalone/{Documentation,fs} .
cp ../aufs-standalone/include/uapi/linux/aufs_type.h include/uapi/linux
patch -p1 < ../aufs-standalone/vfs-ino.patch
patch -p1 < ../aufs-standalone/tmpfs-idr.patch
cp arch/x86/configs/config-wsl .config
cat << EOF > patch
--- arch/x86/configs/config-wsl	2024-04-23 19:27:59.000000000 +0200
+++ /mnt/vbox/tmp/.config	2024-05-21 19:16:30.573137835 +0200
@@ -1,15 +1,15 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 5.15.146.1 Kernel Configuration
+# Linux/x86 5.15.153.1 Kernel Configuration
 #
-CONFIG_CC_VERSION_TEXT="gcc (Ubuntu 11.4.0-2ubuntu1~20.04) 11.4.0"
+CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.2.0"
 CONFIG_CC_IS_GCC=y
-CONFIG_GCC_VERSION=110400
+CONFIG_GCC_VERSION=110200
 CONFIG_CLANG_VERSION=0
 CONFIG_AS_IS_GNU=y
-CONFIG_AS_VERSION=23400
+CONFIG_AS_VERSION=23700
 CONFIG_LD_IS_BFD=y
-CONFIG_LD_VERSION=23400
+CONFIG_LD_VERSION=23700
 CONFIG_LLD_VERSION=0
 CONFIG_CC_CAN_LINK=y
 CONFIG_CC_CAN_LINK_STATIC=y
@@ -18,7 +18,7 @@
 CONFIG_CC_HAS_ASM_GOTO_TIED_OUTPUT=y
 CONFIG_CC_HAS_ASM_INLINE=y
 CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
-CONFIG_PAHOLE_VERSION=121
+CONFIG_PAHOLE_VERSION=0
 CONFIG_IRQ_WORK=y
 CONFIG_BUILDTIME_TABLE_SORT=y
 CONFIG_THREAD_INFO_IN_TASK=y
@@ -29,7 +29,7 @@
 CONFIG_INIT_ENV_ARG_LIMIT=32
 # CONFIG_COMPILE_TEST is not set
 # CONFIG_WERROR is not set
-CONFIG_LOCALVERSION="-microsoft-standard-WSL2"
+CONFIG_LOCALVERSION="-aufs-WSL2"
 # CONFIG_LOCALVERSION_AUTO is not set
 CONFIG_BUILD_SALT=""
 CONFIG_HAVE_KERNEL_GZIP=y
@@ -462,7 +462,6 @@
 CONFIG_HAVE_LIVEPATCH=y
 # end of Processor type and features

-CONFIG_CC_HAS_SLS=y
 CONFIG_CC_HAS_RETURN_THUNK=y
 CONFIG_SPECULATION_MITIGATIONS=y
 CONFIG_PAGE_TABLE_ISOLATION=y
@@ -472,7 +471,6 @@
 CONFIG_CPU_IBPB_ENTRY=y
 CONFIG_CPU_IBRS_ENTRY=y
 CONFIG_CPU_SRSO=y
-# CONFIG_SLS is not set
 # CONFIG_GDS_FORCE_MITIGATION is not set
 CONFIG_ARCH_HAS_ADD_PAGES=y
 CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE=y
@@ -749,6 +747,10 @@
 # end of GCOV-based kernel profiling

 CONFIG_HAVE_GCC_PLUGINS=y
+CONFIG_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGIN_CYC_COMPLEXITY is not set
+# CONFIG_GCC_PLUGIN_LATENT_ENTROPY is not set
+# CONFIG_GCC_PLUGIN_RANDSTRUCT is not set
 # end of General architecture-dependent options

 CONFIG_RT_MUTEXES=y
@@ -1363,7 +1365,6 @@
 #
 # Queueing/Scheduling
 #
-# CONFIG_NET_SCH_CBQ is not set
 # CONFIG_NET_SCH_HTB is not set
 # CONFIG_NET_SCH_HFSC is not set
 # CONFIG_NET_SCH_PRIO is not set
@@ -1377,7 +1378,6 @@
 # CONFIG_NET_SCH_ETF is not set
 # CONFIG_NET_SCH_TAPRIO is not set
 # CONFIG_NET_SCH_GRED is not set
-# CONFIG_NET_SCH_DSMARK is not set
 # CONFIG_NET_SCH_NETEM is not set
 # CONFIG_NET_SCH_DRR is not set
 # CONFIG_NET_SCH_MQPRIO is not set
@@ -2445,7 +2445,6 @@
 # CONFIG_MFD_SM501 is not set
 # CONFIG_MFD_SKY81452 is not set
 # CONFIG_MFD_SYSCON is not set
-# CONFIG_MFD_TI_AM335X_TSCADC is not set
 # CONFIG_MFD_LP3943 is not set
 # CONFIG_MFD_LP8788 is not set
 # CONFIG_MFD_TI_LMU is not set
@@ -3390,6 +3389,26 @@
 CONFIG_EROFS_FS_POSIX_ACL=y
 CONFIG_EROFS_FS_SECURITY=y
 CONFIG_EROFS_FS_ZIP=y
+CONFIG_AUFS_FS=y
+# CONFIG_AUFS_BRANCH_MAX_127 is not set
+# CONFIG_AUFS_BRANCH_MAX_511 is not set
+# CONFIG_AUFS_BRANCH_MAX_1023 is not set
+CONFIG_AUFS_BRANCH_MAX_32767=y
+CONFIG_AUFS_SBILIST=y
+CONFIG_AUFS_HNOTIFY=y
+CONFIG_AUFS_HFSNOTIFY=y
+CONFIG_AUFS_EXPORT=y
+CONFIG_AUFS_INO_T_64=y
+CONFIG_AUFS_XATTR=y
+CONFIG_AUFS_FHSM=y
+CONFIG_AUFS_RDU=y
+CONFIG_AUFS_DIRREN=y
+CONFIG_AUFS_SHWH=y
+CONFIG_AUFS_BR_RAMFS=y
+CONFIG_AUFS_BR_FUSE=y
+CONFIG_AUFS_POLL=y
+CONFIG_AUFS_BDEV_LOOP=y
+# CONFIG_AUFS_DEBUG is not set
 CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V2=y
@@ -3549,6 +3568,10 @@
 # Memory initialization
 #
 CONFIG_INIT_STACK_NONE=y
+# CONFIG_GCC_PLUGIN_STRUCTLEAK_USER is not set
+# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF is not set
+# CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL is not set
+# CONFIG_GCC_PLUGIN_STACKLEAK is not set
 # CONFIG_INIT_ON_ALLOC_DEFAULT_ON is not set
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
 CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
@@ -3926,9 +3949,7 @@
 CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y
 # CONFIG_DEBUG_INFO_DWARF4 is not set
 # CONFIG_DEBUG_INFO_DWARF5 is not set
-CONFIG_DEBUG_INFO_BTF=y
-CONFIG_PAHOLE_HAS_SPLIT_BTF=y
-CONFIG_DEBUG_INFO_BTF_MODULES=y
+# CONFIG_DEBUG_INFO_BTF is not set
 # CONFIG_GDB_SCRIPTS is not set
 CONFIG_FRAME_WARN=1024
 # CONFIG_STRIP_ASM_SYMS is not set
EOF
patch .config < patch
make -j4
move arch/x86/boot/bzImage to windows pc


clone repo

Code: Select all

git clone https://gitlab.com/i3slkiller/porteus-wsl2
cd porteus-wsl2
convert base modules (001,002,003) to zstd* and put them in porteus/base
optionally create porteus/modules and porteus/modules folders and put additional modules here (must be also zstd*)

create tar package

Code: Select all

tar --owner=0 --group=0 -cf ../wsl2/rootfs.tar --exclude='.git*' --exclude='.empty' .
move rootfs.tar to windows pc


* - on xz modules spams dmesg with squashfs error messages and throws input/output error


on windows
move bzImage to C:\Users\user
create C:\Users\user\.wslconfig file with these contents

Code: Select all

[wsl2]
kernel=C:\\Users\\user\\bzImage
restart windows
open command prompt

Code: Select all

> mkdir C:\wsl2
> wsl --import porteus C:\wsl2\porteus Z:\wsl2\rootfs.tar --version 2
> wsl -d porteus
# /linuxrc
porteus# su -l

** - modules to activate must be outside union

User avatar
Ed_P
Contributor
Contributor
Posts: 8437
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create an appx file for a Porteus install to WSL

Post#7 by Ed_P » 22 May 2024, 20:05

Interesting. Thank you i3slkiller.

I have WSL in my Windows 11 system so I need to skip a step or two. May take a few days to test depending on rl matters.
Ed

rych
Warlord
Warlord
Posts: 662
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

How to create an appx file for a Porteus install to WSL

Post#8 by rych » 23 May 2024, 11:50

What is this useful for? Is it (just) a Linux CLI environment running on Windows, and you're adding Porteus into the WSL list of supported Linux flavors ... then what?

i3slkiller
Contributor
Contributor
Posts: 64
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

How to create an appx file for a Porteus install to WSL

Post#9 by i3slkiller » 23 May 2024, 13:15

Rather only for satisfy my curiosity about whether it is possible; apart from very far-fetched reasons like building/checking modules when cannot install normal hypervisor (like VirtualBox or VMware) nor boot Porteus, I don't see the point of it.

User avatar
Ed_P
Contributor
Contributor
Posts: 8437
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create an appx file for a Porteus install to WSL

Post#10 by Ed_P » 23 May 2024, 15:19

i3slkiller wrote:
23 May 2024, 13:15
nor boot Porteus, I don't see the point of it.
:hmmm: I was thinking I could run Porteus in WSL like the ISO but now not so sure. WSL I thought was a Linux kernel so an app of Porteus's base modules would run Porteus. You guys think WSL is only for CLI functions? That could be useful I guess for Porteus scripts I guess. What about scripts that load Porteus modules, that too far out too? :%)
Ed

i3slkiller
Contributor
Contributor
Posts: 64
Joined: 03 Feb 2020, 18:51
Distribution: Porteus XFCE v5.0rc2 x86_64
Location: Poland

How to create an appx file for a Porteus install to WSL

Post#11 by i3slkiller » 23 May 2024, 16:42

Ed_P wrote:
23 May 2024, 15:19
WSL I thought was a Linux kernel
More specifically, WSL2 is a virtual machine, on which as far as I know multiple running distros shares the same linux kernel.
Ed_P wrote:
23 May 2024, 15:19
You guys think WSL is only for CLI functions?
At least in WSL2, you can also use graphical apps (look at the screenshot on #6).

Ed_P wrote:
23 May 2024, 15:19
What about scripts that load Porteus modules
activate, deactivate - works.

Regarding modules there are caveats:
- modules must be zstd-compressed, because (on at least kernel which I built) there are squashfs errors on xz modules (exactly the same modules works without that errors on Porteus)
- modules(xzm files) you want to activate must not be in aufs union (also on at least kernel which I built)

Don't forget to update WSL (wsl --update).

User avatar
Ed_P
Contributor
Contributor
Posts: 8437
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to create an appx file for a Porteus install to WSL

Post#12 by Ed_P » 23 May 2024, 23:00

Code: Select all

C:\Users\Ed>wsl --update
Checking for updates.
The most recent version of Windows Subsystem for Linux is already installed.

C:\Users\Ed>wsl --version
WSL version: 2.1.5.0
Kernel version: 5.15.146.1-2
WSLg version: 1.0.60
MSRDC version: 1.2.5105
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3593

C:\Users\Ed>wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl.exe --install <Distro>'.

NAME                                   FRIENDLY NAME
Ubuntu                                 Ubuntu
Debian                                 Debian GNU/Linux
kali-linux                             Kali Linux Rolling
Ubuntu-18.04                           Ubuntu 18.04 LTS
Ubuntu-20.04                           Ubuntu 20.04 LTS
Ubuntu-22.04                           Ubuntu 22.04 LTS
Ubuntu-24.04                           Ubuntu 24.04 LTS
OracleLinux_7_9                        Oracle Linux 7.9
OracleLinux_8_7                        Oracle Linux 8.7
OracleLinux_9_1                        Oracle Linux 9.1
openSUSE-Leap-15.5                     openSUSE Leap 15.5
SUSE-Linux-Enterprise-Server-15-SP4    SUSE Linux Enterprise Server 15 SP4
SUSE-Linux-Enterprise-15-SP5           SUSE Linux Enterprise 15 SP5
openSUSE-Tumbleweed                    openSUSE Tumbleweed

C:\Users\Ed>
The wsl --list --online output is why I was hoping we could do the same for Porteus.

BTW My Windows OS is version 11, surprised to see the WSL version shows Windows 10.
Ed

Post Reply