14 iso_label="RebornOS_$(date +%Y%m)"
15 iso_version=$(date +%Y.%m.%d)
23 script_path=$(readlink -f ${0%/*})
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 "######################################################"
36 echo "usage ${0} [options]"
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"
56 # Helper function to run make_*() only one time per architecture.
58 if [[ ! -e ${work_dir}/build.${1}_${arch} ]]; then
60 touch ${work_dir}/build.${1}_${arch}
64 # Setup custom pacman.conf with current cache directories.
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
71 # Base installation, plus needed packages (airootfs)
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
77 # Additional packages (airootfs)
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
82 # Needed packages for x86_64 EFI boot
84 setarch ${arch} mkarchiso ${verbose} -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "efitools efibootmgr" install
86 # Copy mkinitcpio archiso hooks and build initramfs (airootfs)
87 make_setup_mkinitcpio() {
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
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
100 if [[ ${gpg_key} ]]; then
101 gpg --export ${gpg_key} >${work_dir}/gpgkey
102 exec 17<>${work_dir}/gpgkey
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
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
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
125 ####################################################################################
126 # Install cnchi installer from Git
128 # Install iso_hotfix_utility files to root-image
130 # echo ">>> Installing iso-hotfix-utility..."
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/**
141 # install -m755 -t "${work_dir}/${arch}/airootfs/etc/iso-hotfix-utility.d" "${_file}"
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"
153 # rm -rf ${script_path}/iso-hotfix-utility
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"
168 echo "COPIED STARTUP FILE OVER"
170 install -Dm755 "${CNCHI_SRC}/cnchi.desktop" "${work_dir}/${arch}/airootfs/usr/share/applications/cnchi.desktop"
172 echo "COPIED DESKTOP FILE OVER"
174 install -Dm644 "${CNCHI_SRC}/data/images/antergos/antergos-icon.png" "${work_dir}/${arch}/airootfs/usr/share/pixmaps/cnchi.png"
176 echo "COPIED CNCHI ICON OVER"
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"
182 echo "MODIFIED STARTUP COMMAND FOR CNCHI"
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/"
187 echo "COPIED CNCHI'S MAIN SUBDIRECTORIES OVER TO BUILD FOLDER"
191 echo "REMOVED UNNECESARY .PO FILE"
192 rm -f ${CNCHI_SRC}/po/update_po.sh
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"
204 rm -rf ${script_path}/Cnchi-${CNCHI_GIT_BRANCH}
206 echo "##################################################################"
207 echo "WRAPPED UP LOOSE ENDS - WILL BE MOVING ON NOW TO CUSTOMIZATIONS..."
208 echo "##################################################################"
212 ########################################################################################
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
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
232 echo "GENERATED REBORNOS GSETTINGS"
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/
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/
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/
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/
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
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/pages/desktop.py
301 #cp ${script_path}/Cnchi/desktop.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
302 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/metalink.py
303 #cp ${script_path}/Cnchi/metalink.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/
304 #rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/pac.py
305 #cp ${script_path}/Cnchi/pac.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
306 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/antergos-logo-mini2.png
307 cp ${script_path}/Cnchi/antergos-logo-mini2.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/
308 cp ${script_path}/Cnchi/20-intel.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
309 cp ${script_path}/Cnchi/lightdm-webkit2-greeter.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
310 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/1.png
311 cp ${script_path}/Cnchi/1.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
312 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/2.png
313 cp ${script_path}/Cnchi/2.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
314 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/3.png
315 cp ${script_path}/Cnchi/3.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
316 # cp ${script_path}/Cnchi/4.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/slides/
317 cp ${script_path}/Cnchi/sddm.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
318 rm ${work_dir}/${arch}/airootfs/usr/share/pixmaps/cnchi.png
319 cp ${script_path}/airootfs/usr/share/applications/cnchi.png ${work_dir}/${arch}/airootfs/usr/share/pixmaps/
320 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/antergos-icon.png
321 cp ${script_path}/Cnchi/antergos-icon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/antergos/antergos-icon.png
322 cp ${script_path}/scripts/tint2-start.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
323 cp ${script_path}/scripts/conky-start.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
324 cp ${script_path}/scripts/obmenu-gen.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
325 cp ${script_path}/scripts/plymouth-reborn.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
326 cp ${script_path}/scripts/mate-panel.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
327 cp ${script_path}/scripts/plymouth.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
328 cp ${script_path}/scripts/flatpak.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
329 cp ${script_path}/scripts/pkcon.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
330 cp ${script_path}/scripts/pkcon2.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
331 cp ${script_path}/scripts/flatpak.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
332 #cp ${script_path}/Cnchi/pacman2.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
333 cp ${script_path}/scripts/update.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
334 cp ${script_path}/scripts/openbox-config.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
335 cp ${script_path}/scripts/deepin-fix.sh ${work_dir}/${arch}/airootfs/usr/share/cnchi/
336 cp ${script_path}/scripts/deepin-fix.service ${work_dir}/${arch}/airootfs/usr/share/cnchi/
337 cp ${script_path}/images/pantheon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
338 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/deepin.png
339 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/kde.png
340 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/lxqt.png
341 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/openbox.png
342 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/xfce.png
343 cp ${script_path}/images/apricity.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
344 cp ${script_path}/images/deepin.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
345 cp ${script_path}/images/cinnamon.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
346 cp ${script_path}/images/windows.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
347 cp ${script_path}/images/kde.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
348 cp ${script_path}/images/i3.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
349 cp ${script_path}/images/lxqt.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
350 cp ${script_path}/images/openbox.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
351 cp ${script_path}/images/enlightenment.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
352 cp ${script_path}/images/xfce.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/images/desktops/
353 cp ${script_path}/images/desktop-environment-apricity.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
354 cp ${script_path}/images/desktop-environment-pantheon.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
355 cp ${script_path}/images/desktop-environment-windows.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
356 cp ${script_path}/images/desktop-environment-budgie.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
357 cp ${script_path}/images/desktop-environment-i3.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/icons/scalable/
358 cp ${script_path}/Cnchi/reborn-mirrorlist ${work_dir}/${arch}/airootfs/etc/pacman.d/
360 # Replacement made by Rafael from RebornOS
362 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/pacman.conf
363 cp ${script_path}/Cnchi/pacman.conf ${work_dir}/${arch}/airootfs/usr/share/cnchi/
364 rm ${work_dir}/${arch}/airootfs/etc/pacman.conf
365 cp ${script_path}/Cnchi/pacman.conf ${work_dir}/${arch}/airootfs/etc/
366 chmod 644 /etc/pacman.conf
367 chmod 644 /etc/pacman.d/reborn-mirrorlist
368 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/pacman.tmpl
369 cp ${script_path}/Cnchi/pacman.tmpl ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/
370 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/info.py
371 cp ${script_path}/Cnchi/info.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
372 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/update_db.py
373 cp ${script_path}/Cnchi/update_db.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
374 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/cnchi.py
375 cp ${script_path}/Cnchi/cnchi.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
376 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/rank_mirrors.py
377 cp ${script_path}/Cnchi/rank_mirrors.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
378 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/features_info.py
379 cp ${script_path}/Cnchi/features_info.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
380 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/packages.xml
381 cp ${script_path}/Cnchi/packages.xml ${work_dir}/${arch}/airootfs/usr/share/cnchi/data/
382 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/mirrors.py
383 cp ${script_path}/Cnchi/mirrors.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
384 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/post_install.py
385 cp ${script_path}/Cnchi/post_install.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
386 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/install.py
387 cp ${script_path}/Cnchi/install.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
388 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/select_packages.py
389 cp ${script_path}/Cnchi/select_packages.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/
390 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/metalink.py
391 cp ${script_path}/Cnchi/metalink.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/download/
392 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/logging_utils.py
393 cp ${script_path}/Cnchi/logging_utils.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
394 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/slides.py
395 cp ${script_path}/Cnchi/slides.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/
396 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pacman/pac.py
397 cp ${script_path}/Cnchi/pac.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pacman/
398 # Use neofetch to show in terminal RebornOS logo and info
399 rm ${work_dir}/${arch}/airootfs/home/rebornos/.bashrc
400 cp ${script_path}/Cnchi/bashrc ${work_dir}/${arch}/airootfs/home/rebornos/.bashrc
401 # Correct GeoIP timeout
402 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/geoip.py
403 cp ${script_path}/Cnchi/geoip.py ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/
404 # cnchi-start.sh is modified in its original location
405 # rm ${work_dir}/${arch}/airootfs/usr/bin/cnchi-start.sh
406 # cp ${script_path}/Cnchi/cnchi-start.sh ${work_dir}/${arch}/airootfs/usr/bin/
407 # Replace access to the RebornOS installer with another one with "sudo"
408 rm ${work_dir}/${arch}/airootfs/usr/share/applications/antergos-install.desktop
409 cp ${script_path}/Cnchi/antergos-install.desktop ${work_dir}/${arch}/airootfs/usr/share/applications/
410 # Add new cnchi icon for RebornOS Installer
411 rm ${work_dir}/${arch}/airootfs/usr/share/pixmaps/cnchi.png
412 cp ${script_path}/Cnchi/cnchi.png ${work_dir}/${arch}/airootfs/usr/share/pixmaps/
413 cp ${script_path}/Cnchi/reborn-icon-new.png ${work_dir}/${arch}/airootfs/usr/share/pixmaps/
414 cp ${script_path}/Cnchi/cnchi.png ${work_dir}/${arch}/airootfs/usr/share/applications/
415 # Add new wallpaper for RebornOS Live
416 rm ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-day.jpg
417 cp ${script_path}/Cnchi/adwaita-day.jpg ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/
418 rm ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-morning.jpg
419 cp ${script_path}/Cnchi/adwaita-day.jpg ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-morning.jpg
420 rm ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-night.jpg
421 cp ${script_path}/Cnchi/adwaita-day.jpg ${work_dir}/${arch}/airootfs/usr/share/backgrounds/gnome/adwaita-night.jpg
422 # Delete refresh.desktop in ~/.config/autostart and add new refresh-keys.desktop
423 # to refresh keys and run cnchi-start.sh when Live start
424 rm ${work_dir}/${arch}/airootfs/home/rebornos/.config/autostart/refresh.desktop
425 cp ${script_path}/Cnchi/refresh-keys.desktop ${work_dir}/${arch}/airootfs/home/rebornos/.config/autostart/
426 # Add refresh-keys.sh to /usr/bin (called by install.desktop)
427 # In the end, call cnchi-start.sh
428 cp ${script_path}/Cnchi/refresh-keys.sh ${work_dir}/${arch}/airootfs/usr/bin/
429 rm ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/10_antergos
430 cp ${script_path}/Cnchi/10_antergos ${work_dir}/${arch}/airootfs/usr/share/cnchi/scripts/
431 # Uncomplicated Firewall Workaround
432 cp ${script_path}/Cnchi/gufw.png ${work_dir}/${arch}/airootfs/usr/share/cnchi/
433 cp ${script_path}/Cnchi/gufw.svg ${work_dir}/${arch}/airootfs/usr/share/cnchi/
434 cp ${script_path}/Cnchi/gufw.desktop ${work_dir}/${arch}/airootfs/usr/share/cnchi/
436 cp ${script_path}/Cnchi/95_cinnamon.gschema.override ${work_dir}/${arch}/airootfs/usr/share/cnchi/
438 cp ${script_path}/Cnchi/101_gnome.gschema.override ${work_dir}/${arch}/airootfs/usr/share/cnchi/
441 echo "Replacing Antergos mentions with RebornOS"
442 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/advanced.py
443 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/alongside.py
444 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/ask.py
445 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/automatic.py
446 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/check.py
447 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/gtkbasebox.py
448 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/keymap.py
449 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/language.py
450 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/location.py
451 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/installation/process.py
452 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/slides.py
453 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/summary.py
454 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/timezone.py
455 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/user_info.py
456 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/wireless.py
457 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/zfs.py
458 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/desktop.py
459 sed -i "s/gnome/deepin/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/pages/desktop.py
460 #sed -i "s/Antergos/Reborn/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/encfs.py
461 sed -i "s/Antergos/RebornOS/g" ${work_dir}/${arch}/airootfs/usr/share/cnchi/src/main_window.py
464 echo "Removing Mycroft-RebornOS's startup file from the ISO..."
465 rm -f ${work_dir}/${arch}/airootfs/etc/xdg/autostart/mycroft1.desktop
468 # Prepare kernel/initramfs ${install_dir}/boot/
470 mkdir -p ${work_dir}/iso/${install_dir}/boot/${arch}
471 echo "Executed 'mkdir -p' Command Successfully"
472 cp ${work_dir}/${arch}/airootfs/boot/archiso.img ${work_dir}/iso/${install_dir}/boot/${arch}/archiso.img
473 echo "Built 'archiso.img' Successfully"
474 cp ${work_dir}/${arch}/airootfs/boot/vmlinuz-linux ${work_dir}/iso/${install_dir}/boot/${arch}/vmlinuz
475 echo "Built 'vmlinuz-linux' Successfully"
479 # Add other aditional/extra files to ${install_dir}/boot/
481 cp ${work_dir}/${arch}/airootfs/boot/memtest86+/memtest.bin ${work_dir}/iso/${install_dir}/boot/memtest
482 cp ${work_dir}/${arch}/airootfs/usr/share/licenses/common/GPL2/license.txt ${work_dir}/iso/${install_dir}/boot/memtest.COPYING
483 cp ${work_dir}/${arch}/airootfs/boot/intel-ucode.img ${work_dir}/iso/${install_dir}/boot/intel_ucode.img
484 cp ${work_dir}/${arch}/airootfs/usr/share/licenses/intel-ucode/LICENSE ${work_dir}/iso/${install_dir}/boot/intel_ucode.LICENSE
486 # Prepare /${install_dir}/boot/syslinux
488 mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux
489 for _cfg in ${script_path}/syslinux/*.cfg; do
490 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
491 s|%INSTALL_DIR%|${install_dir}|g" ${_cfg} > ${work_dir}/iso/${install_dir}/boot/syslinux/${_cfg##*/}
493 cp ${script_path}/syslinux/splash.png ${work_dir}/iso/${install_dir}/boot/syslinux
494 cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/*.c32 ${work_dir}/iso/${install_dir}/boot/syslinux
495 cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/lpxelinux.0 ${work_dir}/iso/${install_dir}/boot/syslinux
496 cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/memdisk ${work_dir}/iso/${install_dir}/boot/syslinux
497 mkdir -p ${work_dir}/iso/${install_dir}/boot/syslinux/hdt
498 gzip -c -9 ${work_dir}/${arch}/airootfs/usr/share/hwdata/pci.ids > ${work_dir}/iso/${install_dir}/boot/syslinux/hdt/pciids.gz
499 # gzip -c -9 ${work_dir}/${arch}/airootfs/usr/lib/modules/*-ARCH/modules.alias > ${work_dir}/iso/${install_dir}/boot/syslinux/hdt/modalias.gz
503 mkdir -p ${work_dir}/iso/isolinux
504 sed "s|%INSTALL_DIR%|${install_dir}|g" ${script_path}/isolinux/isolinux.cfg > ${work_dir}/iso/isolinux/isolinux.cfg
505 cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/isolinux.bin ${work_dir}/iso/isolinux/
506 cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/isohdpfx.bin ${work_dir}/iso/isolinux/
507 cp ${work_dir}/${arch}/airootfs/usr/lib/syslinux/bios/ldlinux.c32 ${work_dir}/iso/isolinux/
511 mkdir -p ${work_dir}/iso/EFI/boot
512 cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/PreLoader.efi ${work_dir}/iso/EFI/boot/bootx64.efi
513 cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/HashTool.efi ${work_dir}/iso/EFI/boot/
514 cp ${work_dir}/x86_64/airootfs/usr/lib/systemd/boot/efi/systemd-bootx64.efi ${work_dir}/iso/EFI/boot/loader.efi
515 mkdir -p ${work_dir}/iso/loader/entries
516 cp ${script_path}/efiboot/loader/loader.conf ${work_dir}/iso/loader/
517 cp ${script_path}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/iso/loader/entries/
518 cp ${script_path}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/iso/loader/entries/
519 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
520 s|%INSTALL_DIR%|${install_dir}|g" \
521 ${script_path}/efiboot/loader/entries/archiso-x86_64-usb.conf > ${work_dir}/iso/loader/entries/archiso-x86_64.conf
522 # EFI Shell 2.0 for UEFI 2.3+
523 curl -o ${work_dir}/iso/EFI/shellx64_v2.efi https://raw.githubusercontent.com/tianocore/edk2/master/ShellBinPkg/UefiShell/X64/Shell.efi
524 # EFI Shell 1.0 for non UEFI 2.3+
525 curl -o ${work_dir}/iso/EFI/shellx64_v1.efi https://raw.githubusercontent.com/tianocore/edk2/master/EdkShellBinPkg/FullShell/X64/Shell_Full.efi
527 # Prepare efiboot.img::/EFI for "El Torito" EFI boot mode
529 mkdir -p ${work_dir}/iso/EFI/archiso
530 truncate -s 40M ${work_dir}/iso/EFI/archiso/efiboot.img
531 mkfs.vfat -n ARCHISO_EFI ${work_dir}/iso/EFI/archiso/efiboot.img
532 mkdir -p ${work_dir}/efiboot
533 mount ${work_dir}/iso/EFI/archiso/efiboot.img ${work_dir}/efiboot
534 mkdir -p ${work_dir}/efiboot/EFI/archiso
535 cp ${work_dir}/iso/${install_dir}/boot/x86_64/vmlinuz ${work_dir}/efiboot/EFI/archiso/vmlinuz.efi
536 cp ${work_dir}/iso/${install_dir}/boot/x86_64/archiso.img ${work_dir}/efiboot/EFI/archiso/archiso.img
537 cp ${work_dir}/iso/${install_dir}/boot/intel_ucode.img ${work_dir}/efiboot/EFI/archiso/intel_ucode.img
538 mkdir -p ${work_dir}/efiboot/EFI/boot
539 cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/PreLoader.efi ${work_dir}/efiboot/EFI/boot/bootx64.efi
540 cp ${work_dir}/x86_64/airootfs/usr/share/efitools/efi/HashTool.efi ${work_dir}/efiboot/EFI/boot/
541 cp ${work_dir}/x86_64/airootfs/usr/lib/systemd/boot/efi/systemd-bootx64.efi ${work_dir}/efiboot/EFI/boot/loader.efi
542 mkdir -p ${work_dir}/efiboot/loader/entries
543 cp ${script_path}/efiboot/loader/loader.conf ${work_dir}/efiboot/loader/
544 cp ${script_path}/efiboot/loader/entries/uefi-shell-v2-x86_64.conf ${work_dir}/efiboot/loader/entries/
545 cp ${script_path}/efiboot/loader/entries/uefi-shell-v1-x86_64.conf ${work_dir}/efiboot/loader/entries/
546 sed "s|%ARCHISO_LABEL%|${iso_label}|g;
547 s|%INSTALL_DIR%|${install_dir}|g" \
548 ${script_path}/efiboot/loader/entries/archiso-x86_64-cd.conf > ${work_dir}/efiboot/loader/entries/archiso-x86_64.conf
549 cp ${work_dir}/iso/EFI/shellx64_v2.efi ${work_dir}/efiboot/EFI/
550 cp ${work_dir}/iso/EFI/shellx64_v1.efi ${work_dir}/efiboot/EFI/
551 umount -d ${work_dir}/efiboot
554 # Build airootfs filesystem image
556 cp -a -l -f ${work_dir}/${arch}/airootfs ${work_dir}
557 setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" pkglist
558 setarch ${arch} mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} prepare
559 rm -rf ${work_dir}/airootfs
560 # rm -rf ${work_dir}/${arch}/airootfs (if low space, this helps)
564 mkarchiso ${verbose} -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -o "${out_dir}" iso "${iso_name}-${iso_version}-x86_64.iso"
566 if [[ ${EUID} -ne 0 ]]; then
567 echo "This script must be run as root."
570 if [[ ${arch} != x86_64 ]]; then
571 echo "This script needs to be run on x86_64"
574 while getopts 'N:V:L:D:w:o:g:vh' arg; do
576 N) iso_name="${OPTARG}" ;;
577 V) iso_version="${OPTARG}" ;;
578 L) iso_label="${OPTARG}" ;;
579 D) install_dir="${OPTARG}" ;;
580 w) work_dir="${OPTARG}" ;;
581 o) out_dir="${OPTARG}" ;;
582 g) gpg_key="${OPTARG}" ;;
586 echo "Invalid argument '${arg}'"
592 run_once make_pacman_conf
594 for arch in x86_64; do
596 run_once make_packages
598 run_once make_packages_efi
599 for arch in x86_64; do
600 run_once make_setup_mkinitcpio
601 run_once make_customize_airootfs
603 for arch in x86_64; do
606 # Do all stuff for iso
607 run_once make_boot_extra
608 run_once make_syslinux
609 run_once make_isolinux
611 run_once make_efiboot
615 for arch in x86_64; do
616 run_once make_prepare