OSDN Git Service

Initial commit
[rebornos/cnchi-gnome-mac-osdn.git] / build.sh
1 #!/usr/bin/bash
2
3 set -e -u
4
5
6 if [ -f config ]; then
7     source ./config
8 else
9     # No config file!
10     exit 1
11 fi
12
13 iso_name=RebornOS-Mac
14 iso_label="RebornOS-Mac_$(date +%Y%m)"
15 iso_version=$(date +%Y.%m.%d)
16 install_dir=arch
17 work_dir=work
18 out_dir=out
19 gpg_key=
20
21 arch=$(uname -m)
22 verbose=""
23 script_path=$(readlink -f ${0%/*})
24
25 if [ -d ${script_path}/work ]; then
26      echo "Removing build directory for you. Please be patient..."
27      rm -rf ${script_path}/work
28     echo "######################################################"
29     echo "######################## DONE ########################"
30     echo "######################################################"
31 fi
32
33
34 _usage ()
35 {
36     echo "usage ${0} [options]"
37     echo
38     echo " General options:"
39     echo "    -N <iso_name>      Set an iso filename (prefix)"
40     echo "                        Default: ${iso_name}"
41     echo "    -V <iso_version>   Set an iso version (in filename)"
42     echo "                        Default: ${iso_version}"
43     echo "    -L <iso_label>     Set an iso label (disk label)"
44     echo "                        Default: ${iso_label}"
45     echo "    -D <install_dir>   Set an install_dir (directory inside iso)"
46     echo "                        Default: ${install_dir}"
47     echo "    -w <work_dir>      Set the working directory"
48     echo "                        Default: ${work_dir}"
49     echo "    -o <out_dir>       Set the output directory"
50     echo "                        Default: ${out_dir}"
51     echo "    -v                 Enable verbose output"
52     echo "    -h                 This help message"
53     exit ${1}
54 }
55
56 # Helper function to run make_*() only one time per architecture.
57 run_once() {
58     if [[ ! -e ${work_dir}/build.${1}_${arch} ]]; then
59         $1
60         touch ${work_dir}/build.${1}_${arch}
61     fi
62 }
63
64 # Setup custom pacman.conf with current cache directories.
65 make_pacman_conf() {
66     local _cache_dirs
67     _cache_dirs=($(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g'))
68 sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n ${_cache_dirs[@]})|g" ${script_path}/pacman.conf > ${work_dir}/pacman.conf
69 }
70
71 # Base installation, plus needed packages (airootfs)
72 make_basefs() {
73     setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" init
74     setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "haveged intel-ucode memtest86+ mkinitcpio-nfs-utils nbd" install
75 }
76
77 # Additional packages (airootfs)
78 make_packages() {
79      setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "$(grep -h -v ^# ${script_path}/packages.{both,${arch}})" install
80 }
81
82 # Needed packages for x86_64 EFI boot
83 make_packages_efi() {
84     setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "efitools efibootmgr" install
85 }
86 # Copy mkinitcpio archiso hooks and build initramfs (airootfs)
87 make_setup_mkinitcpio() {
88     local _hook
89     mkdir -p ${work_dir}/${arch}/airootfs/etc/initcpio/hooks
90     mkdir -p ${work_dir}/${arch}/airootfs/etc/initcpio/install
91     for _hook in archiso archiso_shutdown archiso_pxe_common archiso_pxe_nbd archiso_pxe_http archiso_pxe_nfs archiso_loop_mnt; do
92         cp /usr/lib/initcpio/hooks/${_hook} ${work_dir}/${arch}/airootfs/etc/initcpio/hooks
93         cp /usr/lib/initcpio/install/${_hook} ${work_dir}/${arch}/airootfs/etc/initcpio/install
94     done
95     sed -i "s|/usr/lib/initcpio/|/etc/initcpio/|g" ${work_dir}/${arch}/airootfs/etc/initcpio/install/archiso_shutdown
96     cp /usr/lib/initcpio/install/archiso_kms ${work_dir}/${arch}/airootfs/etc/initcpio/install
97     cp /usr/lib/initcpio/archiso_shutdown ${work_dir}/${arch}/airootfs/etc/initcpio
98     cp ${script_path}/mkinitcpio.conf ${work_dir}/${arch}/airootfs/etc/mkinitcpio-archiso.conf
99     gnupg_fd=
100     if [[ ${gpg_key} ]]; then
101       gpg --export ${gpg_key} >${work_dir}/gpgkey
102       exec 17<>${work_dir}/gpgkey
103     fi
104     ARCHISO_GNUPG_FD=${gpg_key:+17} setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img' run
105     if [[ ${gpg_key} ]]; then
106       exec 17<&-
107     fi
108 }
109 # Customize installation (airootfs)
110 make_customize_airootfs() {
111    cp -af ${script_path}/airootfs ${work_dir}/${arch}
112     curl -o ${work_dir}/${arch}/airootfs/etc/pacman.d/mirrorlist 'https://www.archlinux.org/mirrorlist/?country=all&protocol=http&use_mirror_status=on'
113     lynx -dump -nolist 'https://wiki.archlinux.org/index.php/Installation_Guide?action=render' >> ${work_dir}/${arch}/airootfs/root/install.txt
114     setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -r '/root/customize_airootfs.sh' run
115     rm ${work_dir}/${arch}/airootfs/root/customize_airootfs.sh
116     rm -f ${work_dir}/${arch}airootfs/etc/xdg/autostart/vboxclient.desktop
117         if [ -f "${work_dir}/${arch}/airootfs/etc/xdg/autostart/pamac-tray.desktop" ]; then
118             rm ${work_dir}/${arch}/airootfs/etc/xdg/autostart/pamac-tray.desktop
119         fi
120         ln -sf /usr/share/zoneinfo/UTC ${work_dir}/${arch}/airootfs/etc/localtime
121         chmod 750 ${work_dir}/${arch}/airootfs/etc/sudoers.d
122         chmod 440 ${work_dir}/${arch}/airootfs/etc/sudoers.d/g_wheel
123 cp -L ${script_path}/set_password ${work_dir}/${arch}/airootfs/usr/bin
124 }
125 ####################################################################################
126 # Install cnchi installer from Git
127 make_cnchi() {
128 # Install iso_hotfix_utility files to root-image
129 #    echo
130 #    echo ">>> Installing iso-hotfix-utility..."
131 #    echo
132 #    wget "${ISO_HOTFIX_UTILITY_URL}" -O ${script_path}/iso-hotfix-utility.tar.gz
133 #    tar xfz ${script_path}/iso-hotfix-utility.tar.gz -C ${script_path}
134 #    rm -f ${script_path}/iso-hotfix-utility.tar.gz
135 #    mv "${script_path}/iso-hotfix-utility-${ISO_HOTFIX_UTILITY_VERSION}" ${script_path}/iso-hotfix-utility
136 #    cp "${script_path}/iso-hotfix-utility/iso-hotfix-utility" "${work_dir}/${arch}/airootfs/usr/bin/pacman-boot"
137 #    chmod 755 "${work_dir}/${arch}/airootfs/usr/bin/pacman-boot"
138 #    mkdir -p "${work_dir}/${arch}/airootfs/etc/iso-hotfix-utility.d"
139 #    for _file in ${script_path}/iso-hotfix-utility/dist/**
140 #    do
141 #        install -m755 -t "${work_dir}/${arch}/airootfs/etc/iso-hotfix-utility.d" "${_file}"
142 #    done
143 #    for fpath in ${script_path}/iso-hotfix-utility/po/*; do
144 #        if [[ -f "${fpath}" ]] && [[ "${fpath}" != 'po/CNCHI_UPDATER.po' ]]; then
145 #            STRING_PO=`echo ${fpath#*/}`
146 #            STRING=`echo ${STRING_PO%.po}`
147 #            mkdir -p "${work_dir}/${arch}/airootfs/usr/share/locale/${STRING}/LC_MESSAGES"
148 #            msgfmt "${fpath}" -o "${work_dir}/${arch}/airootfs/usr/share/locale/${STRING}/LC_MESSAGES/CNCHI_UPDATER.mo"
149 #            echo "${STRING} installed..."
150 #            echo "ISO-HOTFIX-UTILITY IS NOW BUILT"
151 #        fi
152 #    done
153 #    rm -rf ${script_path}/iso-hotfix-utility
154 #
155     echo
156 #   echo ">>> Warning! Installing Cnchi Installer from GIT (${CNCHI_GIT_BRANCH} branch)"
157 #   wget "${CNCHI_GIT_URL}" -O ${script_path}/cnchi-git.zip
158     # The two previous line (commented) performed the download from Antergos Github.
159     # Now it's downloaded from our server:
160     echo "Downloading cnchi from our server:"
161     wget "${CNCHI_REBORNOS_URL}" -O ${script_path}/cnchi-git.zip
162     unzip ${script_path}/cnchi-git.zip -d ${script_path}
163     rm -f ${script_path}/cnchi-git.zip
164     CNCHI_SRC="${script_path}/Cnchi-${CNCHI_GIT_BRANCH}"
165         install -d ${work_dir}/${arch}/airootfs/usr/share/{cnchi,locale}
166         install -Dm755 "${CNCHI_SRC}/bin/cnchi" "${work_dir}/${arch}/airootfs/usr/bin/cnchi"
167          echo
168          echo "COPIED STARTUP FILE OVER"
169          echo
170         install -Dm755 "${CNCHI_SRC}/cnchi.desktop" "${work_dir}/${arch}/airootfs/usr/share/applications/cnchi.desktop"
171          echo
172          echo "COPIED DESKTOP FILE OVER"
173          echo
174         install -Dm644 "${CNCHI_SRC}/data/images/antergos/antergos-icon.png" "${work_dir}/${arch}/airootfs/usr/share/pixmaps/cnchi.png"
175          echo
176          echo "COPIED CNCHI ICON OVER"
177          echo
178     # TODO: This should be included in Cnchi's src code as a separate file
179     # (as both files are needed to run cnchi)
180     sed -r -i 's|\/usr.+ -v|pkexec /usr/share/cnchi/bin/cnchi -s bugsnag|g' "${work_dir}/${arch}/airootfs/usr/bin/cnchi"
181     echo
182     echo "MODIFIED STARTUP COMMAND FOR CNCHI"
183     echo
184     for i in ${CNCHI_SRC}/src ${CNCHI_SRC}/bin ${CNCHI_SRC}/data ${CNCHI_SRC}/scripts ${CNCHI_SRC}/ui; do
185         cp -R ${i} "${work_dir}/${arch}/airootfs/usr/share/cnchi/"
186         echo
187         echo "COPIED CNCHI'S MAIN SUBDIRECTORIES OVER TO BUILD FOLDER"
188         echo
189     done
190     echo
191     echo "REMOVED UNNECESARY .PO FILE"
192     rm -f ${CNCHI_SRC}/po/update_po.sh
193     echo
194     for files in ${CNCHI_SRC}/po/*; do
195         if [[ -f "$files" ]] && [[ "$files" != 'po/cnchi.pot' ]]; then
196             STRING_PO=`echo ${files#*/}`
197             STRING=`echo ${STRING_PO%.po}`
198             mkdir -p ${work_dir}/${arch}/airootfs/usr/share/locale/${STRING}/LC_MESSAGES
199             msgfmt $files -o ${work_dir}/${arch}/airootfs/usr/share/locale/${STRING}/LC_MESSAGES/cnchi.mo
200             echo "${STRING} installed..."
201             echo "CNCHI IS NOW BUILT"
202         fi
203     done
204 rm -rf ${script_path}/Cnchi-${CNCHI_GIT_BRANCH}
205             echo
206             echo "##################################################################"
207             echo "WRAPPED UP LOOSE ENDS - WILL BE MOVING ON NOW TO CUSTOMIZATIONS..."
208             echo "##################################################################"
209             echo
210             echo
211 }
212 ########################################################################################
213
214 make_fixes() {
215         # Remove Antergos gsettings file
216 #       rm ${work_dir}/${arch}/airootfs/usr/share/glib-2.0/schemas/90_deepin-default-gsettings.gschema.override
217         echo "ANTERGOS GSETTINGS REMOVED"
218         # Setup gsettings if gsettings folder exists
219         if [ -d ${script_path}/gsettings ]; then
220             # Copying GSettings XML schema files
221             mkdir -p ${work_dir}/${arch}/airootfs/usr/share/glib-2.0/schemas
222             for _schema in ${script_path}/gsettings/*.gschema.override; do
223                 echo ">>> Will use ${_schema}"
224                 cp ${_schema} ${work_dir}/${arch}/airootfs/usr/share/glib-2.0/schemas
225             done
226             # Compile GSettings XML schema files
227             # rm ${work_dir}/${arch}/airootfs/usr/share/glib-2.0/schemas/98_gnome.gschema.override
228             # rm ${work_dir}/${arch}/airootfs/usr/share/glib-2.0/schemas/95_budgie.gschema.override
229             echo "REMOVED APRICITY GSETTINGS"
230             ${work_dir}/${arch}/airootfs/usr/bin/glib-compile-schemas ${work_dir}/${arch}/airootfs/usr/share/glib-2.0/schemas
231           echo
232           echo "GENERATED REBORNOS GSETTINGS"
233           echo
234         fi
235 #Use lightdm.conf from local direcectory instead of default one
236 echo "Removing unnecessary lightdm.conf"
237 rm ${work_dir}/${arch}/airootfs/etc/lightdm/lightdm.conf
238 echo "Copying correct lightdm.conf file over"
239 cp ${script_path}/airootfs/etc/lightdm/lightdm.conf ${work_dir}/${arch}/airootfs/etc/lightdm/
240 echo "DONE"
241 echo
242 #Use sddm.conf from local direcectory instead of default one
243 echo "Removing unnecessary sddm.conf"
244 rm ${work_dir}/${arch}/airootfs/etc/sddm.conf
245 echo "Copying correct sddm.conf file over"
246 cp ${script_path}/airootfs/etc/sddm.conf ${work_dir}/${arch}/airootfs/etc/
247 echo "DONE"
248 echo
249 #Copy RebornOS Mirrorlist
250 echo "Setting up RebornOS Mirrorlist"
251 mkdir -p ${work_dir}/${arch}/airootfs/etc/pacman.d
252 cp ${script_path}/airootfs/etc/reborn-mirrorlist ${work_dir}/${arch}/airootfs/etc/pacman.d/
253 echo "DONE"
254 echo
255 #Copy pacman-init.service over
256 #echo "Copying pacman-init.service"
257 #cp ${script_path}/pacman-init.service ${work_dir}/${arch}/airootfs/etc/systemd/system/
258 echo "DONE"
259 echo
260 #Replace pacman.conf with RebornOS's
261 echo "Replacing pacman.conf with RebornOS's"
262 rm ${work_dir}/${arch}/airootfs/etc/pacman.conf
263 cp ${script_path}/Cnchi/pacman.conf ${work_dir}/${arch}/airootfs/etc/
264 cp ${script_path}/Cnchi/pacman.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
265 cp ${script_path}/Cnchi/pacman2.conf ${work_dir}/${arch}/airootfs/
266 mv ${work_dir}/${arch}/airootfs/pacman2.conf ${work_dir}/${arch}/airootfs/tmp/pacman.conf
267 echo "DONE"
268 echo
269 #Editting Cnchi
270 echo "Moving Cnchi files over..."
271 rm ${work_dir}/${arch}/airootfs/usr/share/applications/cnchi.desktop
272 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/features.py
273 cp ${script_path}/Cnchi/features.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
274 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/desktop_info.py
275 cp ${script_path}/Cnchi/desktop_info.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
276 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/encfs.py
277 #cp ${script_path}/Cnchi/encfs.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
278 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/boot/grub2.py
279 cp ${script_path}/Cnchi/grub2.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/boot/
280 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/10_antergos
281 cp ${script_path}/Cnchi/10_antergos ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/
282 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/boot/systemd_boot.py
283 cp ${script_path}/Cnchi/systemd_boot.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/boot/
284 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/postinstall.sh
285 cp ${script_path}/Cnchi/postinstall.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/
286 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/main_window.py
287 #cp ${script_path}/Cnchi/main_window.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
288 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/show_message.py
289 cp ${script_path}/Cnchi/show_message.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
290 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/slides.py
291 cp ${script_path}/Cnchi/slides.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
292 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/ask.py
293 #cp ${script_path}/Cnchi/ask.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
294 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/check.py
295 cp ${script_path}/Cnchi/check.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
296 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/timezone.py
297 #cp ${script_path}/Cnchi/timezone.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
298 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/welcome.py
299 cp ${script_path}/Cnchi/welcome.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
300 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/metalink.py
301 #cp ${script_path}/Cnchi/metalink.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/
302 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/pac.py
303 #cp ${script_path}/Cnchi/pac.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
304 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/antergos-logo-mini2.png
305 cp ${script_path}/Cnchi/antergos-logo-mini2.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/
306 cp ${script_path}/Cnchi/20-intel.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
307 cp ${script_path}/Cnchi/lightdm-webkit2-greeter.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
308 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/1.png
309 cp ${script_path}/Cnchi/1.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
310 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/2.png
311 cp ${script_path}/Cnchi/2.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
312 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/3.png
313 cp ${script_path}/Cnchi/3.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
314 # cp ${script_path}/Cnchi/4.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
315 cp ${script_path}/Cnchi/sddm.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
316 rm ${work_dir}/${arch}/airootfs/usr/share/pixmaps/cnchi.png
317 cp ${script_path}/airootfs/usr/share/applications/cnchi.png ${work_dir}/${arch}/airootfs/usr/share/pixmaps/
318 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/antergos-icon.png
319 cp ${script_path}/Cnchi/antergos-icon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/antergos-icon.png
320 cp ${script_path}/scripts/tint2-start.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
321 cp ${script_path}/scripts/conky-start.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
322 cp ${script_path}/scripts/obmenu-gen.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
323 cp ${script_path}/scripts/plymouth-reborn.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
324 cp ${script_path}/scripts/mate-panel.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
325 cp ${script_path}/scripts/plymouth.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
326 cp ${script_path}/scripts/flatpak.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
327 cp ${script_path}/scripts/pkcon.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
328 cp ${script_path}/scripts/pkcon2.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
329 cp ${script_path}/scripts/flatpak.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
330 #cp ${script_path}/Cnchi/pacman2.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
331 cp ${script_path}/scripts/update.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
332 cp ${script_path}/scripts/openbox-config.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
333 cp ${script_path}/scripts/deepin-fix.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
334 cp ${script_path}/scripts/deepin-fix.service ${work_dir}/${arch}/airootfs/usr/share/cnchi/
335 cp ${script_path}/images/pantheon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
336 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/deepin.png
337 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/kde.png
338 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/lxqt.png
339 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/openbox.png
340 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/xfce.png
341 cp ${script_path}/images/apricity.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
342 cp ${script_path}/images/deepin.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
343 cp ${script_path}/images/cinnamon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
344 cp ${script_path}/images/windows.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
345 cp ${script_path}/images/kde.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
346 cp ${script_path}/images/i3.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
347 cp ${script_path}/images/lxqt.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
348 cp ${script_path}/images/openbox.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
349 cp ${script_path}/images/enlightenment.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
350 cp ${script_path}/images/xfce.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
351 cp ${script_path}/images/desktop-environment-apricity.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
352 cp ${script_path}/images/desktop-environment-pantheon.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
353 cp ${script_path}/images/desktop-environment-windows.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
354 cp ${script_path}/images/desktop-environment-budgie.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
355 cp ${script_path}/images/desktop-environment-i3.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
356 cp ${script_path}/Cnchi/reborn-mirrorlist ${work_dir}/${arch}/airootfs/etc/pacman.d/
357 #
358 # ===>>> Replacement made by Rafael from RebornOS <<<=== #
359 #
360 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/pacman.conf
361 cp ${script_path}/Cnchi/pacman.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
362 rm ${work_dir}/${arch}/airootfs/etc/pacman.conf
363 cp ${script_path}/Cnchi/pacman.conf ${work_dir}/${arch}/airootfs/etc/
364 chmod 644 /etc/pacman.conf
365 chmod 644 /etc/pacman.d/reborn-mirrorlist
366 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/pacman.tmpl
367 cp ${script_path}/Cnchi/pacman.tmpl ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/
368 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/info.py
369 cp ${script_path}/Cnchi/info.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
370 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/update_db.py
371 cp ${script_path}/Cnchi/update_db.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
372 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/cnchi.py
373 cp ${script_path}/Cnchi/cnchi.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
374 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/rank_mirrors.py
375 cp ${script_path}/Cnchi/rank_mirrors.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
376 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/features_info.py
377 cp ${script_path}/Cnchi/features_info.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
378 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/packages.xml
379 cp ${script_path}/Cnchi/packages.xml ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/
380 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/mirrors.py
381 cp ${script_path}/Cnchi/mirrors.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
382 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/post_install.py
383 cp ${script_path}/Cnchi/post_install.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
384 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/install.py
385 cp ${script_path}/Cnchi/install.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
386 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/select_packages.py
387 cp ${script_path}/Cnchi/select_packages.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
388 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/metalink.py
389 cp ${script_path}/Cnchi/metalink.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/
390 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/logging_utils.py
391 cp ${script_path}/Cnchi/logging_utils.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
392 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/slides.py
393 cp ${script_path}/Cnchi/slides.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
394 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pacman/pac.py
395 cp ${script_path}/Cnchi/pac.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pacman/
396 # ===>>> Use neofetch to show in terminal RebornOS logo and info <<<=== #
397 rm ${work_dir}/${arch}/airootfs/home/rebornos/.bashrc
398 cp ${script_path}/Cnchi/bashrc ${work_dir}/${arch}/airootfs/home/rebornos/.bashrc
399 # ===>>> Correct GeoIP timeout <<<=== #
400 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/geoip.py
401 cp ${script_path}/Cnchi/geoip.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
402 # ===>>> cnchi-start.sh is modified in its original location <<<=== #
403 # rm ${work_dir}/${arch}/airootfs/usr/bin/cnchi-start.sh
404 # cp ${script_path}/Cnchi/cnchi-start.sh ${work_dir}/${arch}/airootfs/usr/bin/
405 # ===>>> Replace access to the RebornOS installer with another one with "sudo" <<<=== #
406 rm ${work_dir}/${arch}/airootfs/usr/share/applications/antergos-install.desktop
407 cp ${script_path}/Cnchi/rebornos-install.desktop ${work_dir}/${arch}/airootfs/usr/share/applications/
408 # ===>>> Add new cnchi icon for RebornOS Installer (change her name from reborn to rebornos) <<<=== #
409 rm ${work_dir}/${arch}/airootfs/usr/share/pixmaps/cnchi.png
410 cp ${script_path}/Cnchi/cnchi.png ${work_dir}/${arch}/airootfs/usr/share/pixmaps/
411 cp ${script_path}/Cnchi/rebornos-icon-new.png ${work_dir}/${arch}/airootfs/usr/share/pixmaps/
412 cp ${script_path}/Cnchi/cnchi.png ${work_dir}/${arch}/airootfs/usr/share/applications/
413 # ===>>> Add new wallpaper for RebornOS Live <<<=== #
414 rm ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-day.jpg
415 cp ${script_path}/Cnchi/adwaita-day.jpg ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/
416 rm ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-morning.jpg
417 cp ${script_path}/Cnchi/adwaita-day.jpg ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-morning.jpg
418 rm ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-night.jpg
419 cp ${script_path}/Cnchi/adwaita-day.jpg ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-night.jpg
420 # ===>>> Delete refresh.desktop in ~/.config/autostart and add new refresh-keys.desktop
421 # to refresh keys and run cnchi-start.sh when Live start <<<=== #
422 rm ${work_dir}/${arch}/airootfs/home/rebornos/.config/autostart/refresh.desktop
423 cp ${script_path}/Cnchi/refresh-keys.desktop ${work_dir}/${arch}/airootfs/home/rebornos/.config/autostart/
424 # ===>>> Add refresh-keys.sh to /usr/bin (called by install.desktop)
425 # In the end, call cnchi-start.sh <<<=== #
426 cp ${script_path}/Cnchi/refresh-keys.sh ${work_dir}/${arch}/airootfs/usr/bin/
427 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/10_antergos
428 cp ${script_path}/Cnchi/10_antergos ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/
429 # ===>>> Uncomplicated Firewall Workaround <<<=== #
430 cp ${script_path}/Cnchi/gufw.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/
431 cp ${script_path}/Cnchi/gufw.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/
432 cp ${script_path}/Cnchi/gufw.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
433 # ===>>> Cinnamon gschema <<<=== #
434 cp ${script_path}/Cnchi/95_cinnamon.gschema.override ${work_dir}/${arch}/airootfs/usr/share/cnchi/
435 # ===>>> Gnome gschema <<<=== #
436 cp ${script_path}/Cnchi/101_gnome.gschema.override ${work_dir}/${arch}/airootfs/usr/share/cnchi/
437 # ===>>> auto_partition.py modifications (change AntergosRoot by RebornOSRoot and others things...) <<<=== #
438 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/auto_partition.py
439 cp ${script_path}/Cnchi/auto_partition.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
440 # ===>>> Replace desktop.py to start with the default "base" desktop <<<=== #
441 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/desktop.py
442 cp ${script_path}/Cnchi/desktop.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
443 # ===>>> Change main_window.py with new rebornos-logo-mini2.png and rebornos-icon.png <<<=== #
444 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/main_window.py
445 cp ${script_path}/Cnchi/main_window.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
446 # ===>>> Add new png files used by modify main_window.py  <<<=== #
447 cp ${script_path}/Cnchi/rebornos-logo-mini2.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/
448 cp ${script_path}/Cnchi/rebornos-icon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/
449 echo "DONE"
450 echo
451 echo "Replacing Antergos mentions with RebornOS"
452 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/advanced.py
453 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/alongside.py
454 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/ask.py
455 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/automatic.py
456 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/check.py
457 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/gtkbasebox.py
458 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/keymap.py
459 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/language.py
460 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/location.py
461 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/process.py
462 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/slides.py
463 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/summary.py
464 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/timezone.py
465 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/user_info.py
466 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/wireless.py
467 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/zfs.py
468 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/desktop.py
469 # sed -i "s/gnome/deepin/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/desktop.py ==>> Commented to run "base" desktop preselected
470 # sed -i "s/Antergos/Reborn/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/encfs.py
471 # sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/main_window.py
472 echo "DONE"
473 echo
474 echo "Removing Mycroft-RebornOS's startup file from the ISO..."
475 rm -f ${work_dir}/${arch}/airootfs/etc/xdg/autostart/mycroft1.desktop
476 echo "DONE"
477 }
478 # Prepare kernel/initramfs ${install_dir}/boot/
479 make_boot() {
480     mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch}
481     echo "Executed 'mkdir -p' Command Successfully"
482     cp ${work_dir}/${arch}/airootfs/boot/archiso.img ${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img
483     echo "Built 'archiso.img' Successfully"
484     cp ${work_dir}/${arch}/airootfs/boot/vmlinuz-linux ${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz
485     echo "Built 'vmlinuz-linux' Successfully"
486     echo "DONE"
487     echo
488 }
489 # Add other aditional/extra files to ${install_dir}/boot/
490 make_boot_extra() {
491     cp ${work_dir}/${arch}/airootfs/boot/memtest86+/memtest.bin ${work_dir}/iso/${install_dir}/boot/memtest
492     cp ${work_dir}/${arch}/airootfs/usr/share/licenses/common/GPL2/license.txt ${work_dir}/iso/${install_dir}/boot/memtest.COPYING
493     cp ${work_dir}/${arch}/airootfs/boot/intel-ucode.img ${work_dir}/iso/${install_dir}/boot/intel_ucode.img
494     cp ${work_dir}/${arch}/airootfs/usr/share/licenses/intel-ucode/LICENSE ${work_dir}/iso/${install_dir}/boot/intel_ucode.LICENSE
495 }
496 # Prepare /${install_dir}/boot/syslinux
497 make_syslinux() {
498     mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux
499     for _cfg in ${script_path}/syslinux/*.cfg; do
500         sed "s|%ARCHISO_LABEL%|${iso_label}|g;
501              s|%INSTALL_DIR%|${install_dir}|g" ${_cfg} > ${work_dir}/iso/${install_dir}/boot/syslinux/${_cfg##*/}
502     done
503     cp ${script_path}/syslinux/splash.png ${work_dir}/iso/${install_dir}/boot/syslinux
504     cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/*.c32 ${work_dir}/iso/${install_dir}/boot/syslinux
505     cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/lpxelinux.0 ${work_dir}/iso/${install_dir}/boot/syslinux
506     cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/memdisk ${work_dir}/iso/${install_dir}/boot/syslinux
507     mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux/hdt
508     gzip -c -9 ${work_dir}/${arch}/airootfs/usr/share/hwdata/pci.ids > ${work_dir}/iso/${install_dir}/boot/syslinux/hdt/pciids.gz
509 #    gzip -c -9 ${work_dir}/${arch}/airootfs/usr/lib/modules/*-ARCH/modules.alias > ${work_dir}/iso/${install_dir}/boot/syslinux/hdt/modalias.gz
510 }
511 # Prepare /isolinux
512 make_isolinux() {
513     mkdir -p ${work_dir}/iso/isolinux
514     sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
515     cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/isolinux.bin ${work_dir}/iso/isolinux/
516     cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/isohdpfx.bin ${work_dir}/iso/isolinux/
517     cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/ldlinux.c32 ${work_dir}/iso/isolinux/
518 }
519 # Prepare /EFI
520 make_efi() {
521     mkdir -p ${work_dir}/iso/EFI/boot
522     cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/PreLoader.efi ${work_dir}/iso/EFI/boot/bootx64.efi
523     cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/HashTool.efi ${work_dir}/iso/EFI/boot/
524     cp ${work_dir}/x86_64/airootfs/usr/lib/systemd/boot/efi/systemd-bootx64.efi ${work_dir}/iso/EFI/boot/loader.efi
525     mkdir -p ${work_dir}/iso/loader/entries
526     cp ${script_path}/efiboot/loader/loader.conf ${work_dir}/iso/loader/
527     cp ${script_path}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/iso/loader/entries/
528     cp ${script_path}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/iso/loader/entries/
529     sed "s|%ARCHISO_LABEL%|${iso_label}|g;
530          s|%INSTALL_DIR%|${install_dir}|g" \
531         ${script_path}/efiboot/loader/entries/archiso-x86_64-usb.conf > ${work_dir}/iso/loader/entries/archiso-x86_64.conf
532     # EFI Shell 2.0 for UEFI 2.3+
533     curl -o ${work_dir}/iso/EFI/shellx64_v2.efi https://raw.githubusercontent.com/tianocore/edk2/master/ShellBinPkg/UefiShell/X64/Shell.efi
534     # EFI Shell 1.0 for non UEFI 2.3+
535     curl -o ${work_dir}/iso/EFI/shellx64_v1.efi https://raw.githubusercontent.com/tianocore/edk2/master/EdkShellBinPkg/FullShell/X64/Shell_Full.efi
536 }
537 # Prepare efiboot.img::/EFI for "El Torito" EFI boot mode
538 make_efiboot() {
539     mkdir -p ${work_dir}/iso/EFI/archiso
540     truncate -s 40M ${work_dir}/iso/EFI/archiso/efiboot.img
541     mkfs.vfat -n ARCHISO_EFI ${work_dir}/iso/EFI/archiso/efiboot.img
542     mkdir -p ${work_dir}/efiboot
543     mount ${work_dir}/iso/EFI/archiso/efiboot.img ${work_dir}/efiboot
544     mkdir -p ${work_dir}/efiboot/EFI/archiso
545     cp ${work_dir}/iso/${install_dir}/boot/x86_64/vmlinuz ${work_dir}/efiboot/EFI/archiso/vmlinuz.efi
546     cp ${work_dir}/iso/${install_dir}/boot/x86_64/archiso.img ${work_dir}/efiboot/EFI/archiso/archiso.img
547     cp ${work_dir}/iso/${install_dir}/boot/intel_ucode.img ${work_dir}/efiboot/EFI/archiso/intel_ucode.img
548     mkdir -p ${work_dir}/efiboot/EFI/boot
549     cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/PreLoader.efi ${work_dir}/efiboot/EFI/boot/bootx64.efi
550     cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/HashTool.efi ${work_dir}/efiboot/EFI/boot/
551     cp ${work_dir}/x86_64/airootfs/usr/lib/systemd/boot/efi/systemd-bootx64.efi ${work_dir}/efiboot/EFI/boot/loader.efi
552     mkdir -p ${work_dir}/efiboot/loader/entries
553     cp ${script_path}/efiboot/loader/loader.conf ${work_dir}/efiboot/loader/
554     cp ${script_path}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/efiboot/loader/entries/
555     cp ${script_path}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/efiboot/loader/entries/
556     sed "s|%ARCHISO_LABEL%|${iso_label}|g;
557          s|%INSTALL_DIR%|${install_dir}|g" \
558         ${script_path}/efiboot/loader/entries/archiso-x86_64-cd.conf > ${work_dir}/efiboot/loader/entries/archiso-x86_64.conf
559     cp ${work_dir}/iso/EFI/shellx64_v2.efi ${work_dir}/efiboot/EFI/
560     cp ${work_dir}/iso/EFI/shellx64_v1.efi ${work_dir}/efiboot/EFI/
561     umount -d ${work_dir}/efiboot
562 }
563
564 # Build airootfs filesystem image
565 make_prepare() {
566     cp -a -l -f ${work_dir}/${arch}/airootfs ${work_dir}
567     setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" pkglist
568     setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} prepare
569     rm -rf ${work_dir}/airootfs
570     # rm -rf ${work_dir}/${arch}/airootfs (if low space, this helps)
571 }
572 # Build ISO
573 make_iso() {
574     mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-x86_64.iso"
575 }
576 if [[ ${EUID} -ne 0 ]]; then
577     echo "This script must be run as root."
578     _usage 1
579 fi
580 if [[ ${arch} != x86_64 ]]; then
581     echo "This script needs to be run on x86_64"
582     _usage 1
583 fi
584 while getopts 'N:V:L:D:w:o:g:vh' arg; do
585     case "${arg}" in
586         N) iso_name="${OPTARG}" ;;
587         V) iso_version="${OPTARG}" ;;
588         L) iso_label="${OPTARG}" ;;
589         D) install_dir="${OPTARG}" ;;
590         w) work_dir="${OPTARG}" ;;
591         o) out_dir="${OPTARG}" ;;
592         g) gpg_key="${OPTARG}" ;;
593         v) verbose="-v" ;;
594         h) _usage 0 ;;
595         *)
596            echo "Invalid argument '${arg}'"
597            _usage 1
598            ;;
599     esac
600 done
601 mkdir -p ${work_dir}
602 run_once make_pacman_conf
603
604 for arch in x86_64; do
605     run_once make_basefs
606     run_once make_packages
607 done
608 run_once make_packages_efi
609 for arch in x86_64; do
610     run_once make_setup_mkinitcpio
611     run_once make_customize_airootfs
612 done
613 for arch in x86_64; do
614     run_once make_boot
615 done
616 # Do all stuff for iso
617 run_once make_boot_extra
618 run_once make_syslinux
619 run_once make_isolinux
620 run_once make_efi
621 run_once make_efiboot
622 run_once make_cnchi
623 run_once make_fixes
624
625 for arch in x86_64; do
626 run_once make_prepare
627 done
628 run_once make_iso