-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.sh
executable file
·93 lines (77 loc) · 3.26 KB
/
build.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/bin/bash
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
set -e
mkdir -p build
rm -rf build/airootfs
cp -r /usr/share/archiso/configs/releng/* build
# Disable copytoram through bootloader kernel param
grep -r -l archisobasedir= build | xargs sed -i 's/archisobasedir=/copytoram=n archisobasedir=/'
pushd build/airootfs/etc > /dev/null
find . \
! -path '.' \
! -path './locale.conf' \
! -path './localtime' \
! -path './machine-id' \
! -path './mkinitcpio.conf' \
! -path './mkinitcpio.conf.d' \
! -path './mkinitcpio.conf.d/archiso.conf' \
! -path './mkinitcpio.d' \
! -path './mkinitcpio.d/linux.preset' \
! -path './modprobe.d' \
! -path './modprobe.d/broadcom-wl.conf' \
! -path './shadow' \
! -path './systemd' \
! -path './systemd/journald.conf.d' \
! -path './systemd/journald.conf.d/*' \
! -path './systemd/logind.conf.d' \
! -path './systemd/logind.conf.d/*' \
! -path './systemd/system' \
! -path './systemd/system/dbus-org.freedesktop.resolve1.service' \
! -path './systemd/system/etc-pacman.d-gnupg.mount' \
! -path './systemd/system/[email protected]' \
! -path './systemd/system/[email protected]/*' \
! -path './systemd/system/multi-user.target.wants' \
! -path './systemd/system/multi-user.target.wants/pacman-init.service' \
! -path './systemd/system/multi-user.target.wants/systemd-resolved.service' \
! -path './systemd/system/pacman-init.service' \
-delete
popd > /dev/null
mkdir -p build/airootfs/usr/local/bin
mkdir -p build/airootfs/usr/local/lib/alinstaller
mkdir -p build/airootfs/usr/local/share/{applications,locale}
cp src/{*.py,*.glade,*.txt} build/airootfs/usr/local/lib/alinstaller
cp misc/alinstaller build/airootfs/usr/local/bin/alinstaller
cp misc/pacman-init.service build/airootfs/etc/systemd/system/pacman-init.service
cp misc/*.desktop build/airootfs/usr/local/share/applications
./install-locale.sh build/airootfs/usr/local/share
for file in build/packages.*; do
cat misc/packages_any >> "$file"
done
mv build/airootfs/root/.zlogin build/airootfs/root/.bash_login
echo '' >> build/airootfs/root/.bash_login
cat misc/rc.sh >> build/airootfs/root/.bash_login
mkdir -p build/airootfs/etc/pacman.d/hooks
cp misc/zzzz99-customize-hook.hook build/airootfs/etc/pacman.d/hooks/zzzz99-customize-hook.hook
cp misc/customize.sh build/airootfs/root/alinstaller_customize.sh
echo "airootfs_image_tool_options=('-comp' 'zstd' '-Xcompression-level' '22' '-b' '1M')" >> build/profiledef.sh
mkdir -p build/out
rm -f build/work/build.make_*
pushd build > /dev/null
mkarchiso -v .
pushd out > /dev/null
for file in archlinux-*.iso; do
mv "$file" alinstaller.iso;
done
popd > /dev/null
popd > /dev/null