Skip to content

Commit 93e444e

Browse files
committed
Simplify configuration
- mount partitions to the empty folders on system partition - add executable permissions to scripts in repo - increase system partition size to accomodate bigger GApps (nano works) - use .gitkeep files
1 parent 9a24d81 commit 93e444e

12 files changed

+45
-87
lines changed

#GAPPS/dummyfile

-1
This file was deleted.

#IMAGES/dummyfile

-1
This file was deleted.

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
gapps/
2+
images/

README.md

+5-29
Original file line numberDiff line numberDiff line change
@@ -46,39 +46,16 @@ For Ubuntu
4646

4747
```
4848
git clone https://github.com/ADeltaX/WSAGAScript
49-
cd WSAGAScript/\#IMAGES
50-
mv /mnt/path-to-extracted-msix/*.img .
51-
cd ../\#GAPPS
52-
cp /mnt/path-to-downloaded-gapps/*.zip .
49+
cd WSAGAScript/
50+
mv /mnt/path-to-extracted-msix/*.img images/
51+
cp /mnt/path-to-downloaded-gapps/*.zip gapps/
5352
```
5453

5554
paths in wsl follow the same as windows after /mnt/ its just the drive letter then folder structure as normal. For example /mnt/c/users would be the c:\users folder
5655

5756
### Edit scripts
5857

59-
Set executable permission for the scripts
60-
61-
```
62-
cd ..
63-
sudo chmod +x extract_gapps_pico.sh
64-
sudo chmod +x extend_and_mount_images.sh
65-
sudo chmod +x apply.sh
66-
sudo chmod +x unmount_images.sh
67-
```
68-
69-
Change the root directory in VARIABLES.sh
70-
71-
```
72-
pwd
73-
```
74-
75-
(take note of the output)
76-
77-
```
78-
nano VARIABLES.sh
79-
```
80-
81-
replace the root variable with the output of pwd up until and including the WSAGAScript folder
58+
If needed, you can change the variables used in the scripts in the `VARIABLES` file. The defaults should work fine.
8259

8360
**Debian WSL users need to create an mtab symlink:**
8461
```
@@ -97,8 +74,7 @@ sudo ./unmount_images.sh
9774
### Copy the edited images
9875

9976
```
100-
cd \#IMAGES
101-
cp *.img /mnt/path-to-extracted-msix/
77+
cp images/*.img /mnt/path-to-extracted-msix/
10278
```
10379

10480
### Register the edited WSA

VARIABLES

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Modify your variables here to corretly reference your directory and subdir
2+
3+
Root="$(dirname "$(realpath "$0")")"
4+
5+
MiscRoot="$Root/misc"
6+
7+
GAppsRoot="$Root/gapps"
8+
GAppsOutputFolder="$GAppsRoot/output"
9+
GAppsExtractFolder="$GAppsRoot/extract"
10+
GAppsTmpFolder="$GAppsRoot/tmp"
11+
12+
ImagesRoot="$Root/images"
13+
MountPointSystem="/mnt/system"
14+
15+
InstallPartition="$MountPointSystem"
16+
InstallDir="$InstallPartition/system"

VARIABLES.sh

-21
This file was deleted.

apply.sh

100644100755
+8-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#!/bin/bash
22

3-
. ./VARIABLES.sh
3+
. ./VARIABLES
44

55
echo "Copying build.prop for each image"
6-
cp "$MiscRoot/prop/build_system_ext.prop" /mnt/system_ext/build.prop
7-
cp "$MiscRoot/prop/build_system.prop" /mnt/system/build.prop
8-
cp "$MiscRoot/prop/build_system.prop" /mnt/system/system/build.prop
9-
cp "$MiscRoot/prop/build_product.prop" /mnt/product/build.prop
10-
cp "$MiscRoot/prop/build_vendor.prop" /mnt/vendor/build.prop
11-
cp "$MiscRoot/prop/build_vendor_odm.prop" /mnt/vendor/odm/etc/vendor.prop
6+
cp "$MiscRoot/prop/build_system_ext.prop" "$MountPointSystem/system_ext/build.prop"
7+
cp "$MiscRoot/prop/build_system.prop" "$MountPointSystem/build.prop"
8+
cp "$MiscRoot/prop/build_system.prop" "$MountPointSystem/system/build.prop"
9+
cp "$MiscRoot/prop/build_product.prop" "$MountPointSystem/product/build.prop"
10+
cp "$MiscRoot/prop/build_vendor.prop" "$MountPointSystem/vendor/build.prop"
11+
cp "$MiscRoot/prop/build_vendor_odm.prop" "$MountPointSystem/vendor/odm/etc/vendor.prop"
1212

1313
echo "Copying GApps files to system..."
14-
cp -f -a $GAppsOutputFolder/app/* $InstallDir/app
15-
cp -f -a $GAppsOutputFolder/etc/* $InstallDir/etc
16-
cp -f -a $GAppsOutputFolder/overlay/* $InstallDir/overlay
17-
cp -f -a $GAppsOutputFolder/priv-app/* $InstallDir/priv-app
18-
cp -f -a $GAppsOutputFolder/framework/* $InstallDir/framework
14+
cp -Ra $GAppsOutputFolder/* $InstallDir/
1915

2016
echo "Applying root file ownership"
2117
find $InstallDir/app -exec chown root:root {} &>/dev/null \;

extend_and_mount_images.sh

100644100755
+7-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
. ./VARIABLES.sh
3+
. ./VARIABLES
44

55
echo "chk product.img"
66
e2fsck -f $ImagesRoot/product.img
@@ -12,7 +12,7 @@ echo "chk system.img"
1212
e2fsck -f $ImagesRoot/system.img
1313

1414
echo "Resizing system.img"
15-
resize2fs $ImagesRoot/system.img 1280M
15+
resize2fs $ImagesRoot/system.img 1536M
1616

1717
echo "chk system_ext.img"
1818
e2fsck -f $ImagesRoot/system_ext.img
@@ -26,28 +26,19 @@ e2fsck -f $ImagesRoot/vendor.img
2626
echo "Resizing vendor.img"
2727
resize2fs $ImagesRoot/vendor.img 300M
2828

29-
echo "Creating mount point for product"
30-
mkdir -p $MountPointProduct
31-
32-
echo "Creating mount point for system_ext"
33-
mkdir -p $MountPointSystemExt
34-
3529
echo "Creating mount point for system"
3630
mkdir -p $MountPointSystem
3731

38-
echo "Creating mount point for vendor"
39-
mkdir -p $MountPointVendor
32+
echo "Mounting system"
33+
mount -o rw $ImagesRoot/system.img $MountPointSystem
4034

4135
echo "Mounting product"
42-
mount -o rw $ImagesRoot/product.img $MountPointProduct
36+
mount -o rw $ImagesRoot/product.img $MountPointSystem/product
4337

4438
echo "Mounting system_ext"
45-
mount -o rw $ImagesRoot/system_ext.img $MountPointSystemExt
46-
47-
echo "Mounting system"
48-
mount -o rw $ImagesRoot/system.img $MountPointSystem
39+
mount -o rw $ImagesRoot/system_ext.img $MountPointSystem/system_ext
4940

5041
echo "Mounting vendor"
51-
mount -o rw $ImagesRoot/vendor.img $MountPointVendor
42+
mount -o rw $ImagesRoot/vendor.img $MountPointSystem/vendor
5243

5344
echo "!! Images mounted !!"

extract_gapps_pico.sh renamed to extract_gapps.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
. ./VARIABLES.sh
3+
. ./VARIABLES
44

55
rm -rf $GAppsOutputFolder
66
rm -rf $GAppsTmpFolder

gapps/.gitkeep

Whitespace-only changes.

images/.gitkeep

Whitespace-only changes.

unmount_images.sh

100644100755
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/bin/bash
22

3-
. ./VARIABLES.sh
3+
. ./VARIABLES
44

55
echo "Unmounting product.img"
6-
umount $MountPointProduct
6+
umount $MountPointSystem/product
77

88
echo "Unmounting system_ext.img"
9-
umount $MountPointSystemExt
9+
umount $MountPointSystem/system_ext
10+
11+
echo "Unmounting vendor.img"
12+
umount $MountPointSystem/vendor
1013

1114
echo "Unmounting system.img"
1215
umount $MountPointSystem
1316

14-
echo "Unmounting vendor.img"
15-
umount $MountPointVendor
16-
1717
echo "!! Unmounting completed !!"

0 commit comments

Comments
 (0)