-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathassemble.sh
47 lines (47 loc) · 1.43 KB
/
assemble.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
#!/bin/bash
set -euo pipefail
mkdir -p rootfs chroot/{etc,dev,proc,sys,usr/{bin,lib,share}}
cd rootfs
tar xf ../stage4-amd64-desktop-systemd.tar
rm -r sys dev proc
find etc/ -mindepth 1 -maxdepth 1 \
\! -name eselect -a \
\! -name 'ld.so*' \
-exec mv {} ../chroot/etc/ \;
mv boot home media mnt opt root run tmp var ../chroot/
mv usr/{include,libexec,local,sbin,src,x86_64-pc-linux-gnu} ../chroot/usr/
mv usr/lib/mingw64-toolchain ../chroot/usr/lib/
mkdir -p ../chroot/usr/lib/locale
mv usr/lib/locale/locale-archive ../chroot/usr/lib/locale/
find usr/bin -mindepth 1 -maxdepth 1 \
\! -name 'wine*' -a \
\! -name 'mango*' -a \
\! -name 'notepad*' -a \
\! -name 'msi*' -a \
\! -name 'regedit*' -a \
\! -name 'regsvr32*' -a \
\! -name '*vulkan*' -a \
\! -name '*vk*' -a \
\! -name ulimit -a \
\! -name ldd -a \
\! -name env -a \
\! -name sh -a \
\! -name bash -a \
\! -name ls -a \
\! -name stat -a \
\! -name dirname -a \
\! -name realpath -a \
\! -name basename -a \
\! -name nproc -a \
\! -name uname -a \
\! -name ldconfig -a \
\! -name arch -a \
-exec mv {} ../chroot/usr/bin/ \;
find usr/share -mindepth 1 -maxdepth 1 \
\! -name 'wine*' -a \
\! -name drirc.d -a \
\! -name vulkan \
-exec mv {} ../chroot/usr/share/ \;
cd ..
mksquashfs rootfs fex-rootfs.sqfs -comp zstd
mksquashfs chroot fex-chroot.sqfs -comp zstd