forked from WSA-Community/WSAGAScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend_and_mount_images.sh
59 lines (40 loc) · 1.29 KB
/
extend_and_mount_images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
. ./VARIABLES.sh
if [[ ! /proc/self/mounts -ef /etc/mtab ]]; then
printf "/etc/mtab doesn't exist or is invalid\n"
printf 'creating valid /etc/mtab\n'
ln -sf /proc/self/mounts /etc/mtab
fi
echo "chk product.img"
e2fsck -f $ImagesRoot/product.img
echo "Resizing product.img"
resize2fs $ImagesRoot/product.img 1024M
echo "chk system.img"
e2fsck -f $ImagesRoot/system.img
echo "Resizing system.img"
resize2fs $ImagesRoot/system.img 1280M
echo "chk system_ext.img"
e2fsck -f $ImagesRoot/system_ext.img
echo "Resizing system_ext.img"
resize2fs $ImagesRoot/system_ext.img 108M
echo "chk vendor.img"
e2fsck -f $ImagesRoot/vendor.img
echo "Resizing vendor.img"
resize2fs $ImagesRoot/vendor.img 300M
echo "Creating mount point for product"
mkdir -p $MountPointProduct
echo "Creating mount point for system_ext"
mkdir -p $MountPointSystemExt
echo "Creating mount point for system"
mkdir -p $MountPointSystem
echo "Creating mount point for vendor"
mkdir -p $MountPointVendor
echo "Mounting product"
mount $ImagesRoot/product.img $MountPointProduct
echo "Mounting system_ext"
mount $ImagesRoot/system_ext.img $MountPointSystemExt
echo "Mounting system"
mount $ImagesRoot/system.img $MountPointSystem
echo "Mounting vendor"
mount $ImagesRoot/vendor.img $MountPointVendor
echo "!! Images mounted !!"