OSDN Git Service

[update] : Supported customize_airootfs.sh
[alterlinux/LUBS.git] / lubs
1 #!/usr/bin/env bash
2 # SPDX-License-Identifier: GPL-3.0
3 #
4 # mk-linux419
5 # Twitter: @fascoder_4
6 # Email  : m.k419sabuaka@gmail.com
7 #
8 # Yamada Hayao
9 # Twitter: @Hayao0819
10 # Email  : hayao@fascode.net
11 #
12 # (c) 2019-2020 Fascode Network.
13 #
14 # lubs
15 #
16
17 set -e
18 # set -u
19
20 export LANG=C
21
22 script_path=$(readlink -f "${0%/*}")
23
24 cache_dir="${script_path}/cache"
25 channels_dir="${script_path}/channels"
26 nfb_dir="${script_path}/nfb"
27
28 codename="focal"
29 mirror="http://linux.yz.yamagata-u.ac.jp/ubuntu/"
30 os_name="Ubuntu"
31 iso_name="ubuntu"
32
33 arch=amd64
34 work_dir="${script_path}/work"
35 out_dir="${script_path}/out"
36 iso_label="${os_name}_${codename}_${arch}"
37 iso_publisher='Fascode Network <https://fascode.net>'
38 iso_application="${os_name} Live/Rescue CD"
39 iso_version="${codename}-$(date +%Y.%m.%d)"
40
41 channel_name="serene"
42
43 username="liveuser"
44 usershell="/bin/bash"
45
46 debug=false
47 cache_only=false
48
49
50 start_time="$(date +%s)"
51
52 _msg_common() {
53     if [[ "${debug}" = true ]]; then
54         local _current_time
55         local _time
56         _current_time="$(date +%s)"
57         _time="$(("${_current_time}"-"${start_time}"))"
58
59         if [[ "${_time}" -ge 3600 ]]; then
60             echo "[$(date -d @${_time} +%H:%M.%S)]$("${script_path}/echo_color" -t 6 "[LUBS Core]")"
61         elif [[ "${_time}" -ge 60 ]]; then
62             echo "[00:$(date -d @${_time} +%M.%S)]$("${script_path}/echo_color" -t 6 "[LUBS Core]")"
63         else
64             echo "[00:00.$(date -d @${_time} +%S)] $("${script_path}/echo_color" -t 6 "[LUBS Core]")"
65         fi
66     else
67         "${script_path}/echo_color" -t 6 "[LUBS Core]"
68     fi
69 }
70
71 # Show an INFO message
72 # _msg_info <message>
73 _msg_info() {
74     local _msg
75     _msg="${@}"
76     echo "$(_msg_common)  $("${script_path}/echo_color" -t 2 "Info:") ${_msg}"
77 }
78
79 # Show an debug message
80 # _msg_debug <message>
81 _msg_debug() {
82     if [[ "${debug}" = true ]]; then
83         local _msg
84         _msg="${@}"
85         echo "$(_msg_common)  $("${script_path}/echo_color" -t 3 "Debug:") ${_msg}"
86     fi
87 }
88
89 # Show an ERROR message then exit with status
90 # _msg_error <message> <exit code>
91 _msg_error() {
92     local _msg
93     local _error
94     _msg="${1}"
95     _error=${2}
96     echo "$(_msg_common)  $("${script_path}/echo_color" -t 1 "Error:") ${_msg}"
97
98     if [[ ! ${_error} = 0 ]]; then
99         exit ${_error}
100     fi
101 }
102
103 # Unmount chroot dir
104 umount_chroot () {
105     local mount
106
107     for mount in $(mount | awk '{print $3}' | grep "$(realpath "${work_dir}")" | sort -r); do
108         _msg_info "Unmounting ${mount}"
109         umount -fl "${mount}"
110     done
111 }
112
113 # Helper function to run make_*() only one time.
114 run_once() {
115     local name
116     umount_chroot
117     name="$1"
118
119     if [[ ! -e "${work_dir}/build.${name}" ]]; then
120         _msg_info "$(echo $name | sed "s@_@ @g") is starting."
121         "${1}"
122         _msg_info "$(echo $name | sed "s@_@ @g") was done!"
123         touch "${work_dir}/build.${name}"
124     fi
125 }
126
127 run_cmd() {
128     local mount
129
130     for mount in "dev" "dev/pts" "proc" "sys" "run/systemd/resolve/stub-resolv.conf"; do
131         if [[ "${mount}" == "run/systemd/resolve/stub-resolv.conf" ]]; then
132             mount --bind /etc/resolv.conf "${work_dir}/airootfs/${mount}"
133         else
134             mount --bind /${mount} "${work_dir}/airootfs/${mount}"
135         fi
136     done
137     
138     chroot "${work_dir}/airootfs" "${@}"
139
140     for mount in $(mount | awk '{print $3}' | grep "$(realpath "${work_dir}")" | sort -r); do
141         umount -fl "${mount}"
142     done
143 }
144
145 _apt_install() {
146     run_cmd apt-get --no-install-recommends --yes install ${@}
147 }
148
149 # rm helper
150 # Delete the file if it exists.
151 # For directories, rm -rf is used.
152 # If the file does not exist, skip it.
153 # remove <file> <file> ...
154 remove() {
155     local _list
156     local _file
157     _list=($(echo "$@"))
158
159     for _file in "${_list[@]}"; do
160         _msg_debug "Removeing ${_file}"
161
162         if [[ -f ${_file} ]]; then
163             rm -f "${_file}"
164         elif [[ -d ${_file} ]]; then
165             rm -rf "${_file}"
166         fi
167     done
168 }
169
170 # Show help
171 _usage () {
172     echo "usage ${0} [options] [channel]"
173     echo
174     echo " General options:"
175     echo
176     echo "    -a | --arch <str>      Set architecture"
177     echo "                           Default: ${arch}"
178     echo "    -c | --codename <str>  Set ubuntu codename"
179     echo "                           Default: ${codename}"
180     echo "    -m | --mirror <url>    Set apt mirror server."
181     echo "                           Default: ${mirror}"
182     echo "    -o | --out <out_dir>   Set the output directory"
183     echo "                           Default: ${out_dir}"
184     echo "    -w | --work <work_dir> Set the working directory"
185     echo "                           Default: ${work_dir}"
186     echo
187     echo "    -d | --debug           "
188     echo "    -h | --help            This help message and exit"
189     echo
190     echo "You can switch between installed packages, files included in images, etc. by channel."
191     echo
192     echo " Channel:"
193     
194     local _channel
195     local channel_list
196     local description
197
198     for _channel in $(ls -l "${channels_dir}" | awk '$1 ~ /d/ {print $9 }'); do
199         if [[ -n $(ls "${channels_dir}/${_channel}") ]] && [[ ! "${_channel}" = "share" ]]; then
200             channel_list+=( "${_channel}" )
201         fi
202     done
203
204     for _channel in ${channel_list[@]}; do
205         if [[ -f "${channels_dir}/${_channel}/description.txt" ]]; then
206             description=$(cat "${channels_dir}/${_channel}/description.txt")
207         else
208             description="This channel does not have a description.txt."
209         fi
210
211         echo -ne "    ${_channel}"
212
213         for i in $( seq 1 $(( 23 - ${#_channel} )) ); do
214             echo -ne " "
215         done
216         
217         echo -ne "${description}\n"
218     done
219 }
220
221
222 prepare_build() {
223     if [[ ${EUID} -ne 0 ]]; then
224         msg_warn "This script must be run as root." >&2
225         msg_warn "Re-run 'sudo ${0} ${@}'"
226         sudo "${0}" ${@}
227         exit "${?}"
228     fi
229
230     [[ ! -d "${work_dir}" ]] && mkdir -p "${work_dir}"
231     [[ ! -d "${out_dir}" ]] && mkdir -p "${out_dir}"
232     umount_chroot
233
234     # Load channel config
235     local _load_config
236     _load_config() {
237         [[ -f "${1}" ]] && source "${1}"
238     }
239     _load_config "${channels_dir}/${channel_name}/config.any"
240     _load_config "${channels_dir}/${channel_name}/config.${arch}"
241
242     # Check codename
243     if [[ -z $(grep -h -v ^'#' ${channels_dir}/${channel_name}/codename.${arch} | grep -x ${codename}) ]]; then
244         _msg_error "This codename (${channel_name}) is not supported on this channel (${codename})."
245     fi
246
247     # Set iso file name
248     iso_filename="${iso_name}-${iso_version}-${arch}.iso"
249
250 }
251
252
253 make_basefs() {
254     local debootstrap_status
255     statusfile="${cache_dir}/${codename}/status"
256
257     debootstrap_status() {
258         if [[ ! -d "$(dirname ${statusfile})" ]]; then
259             mkdir -p "$(dirname ${statusfile})"
260         fi
261         echo "${1}" > "${statusfile}"
262     }
263
264     if [[ -f "${statusfile}" ]] && [[ $(cat "${statusfile}" 2> /dev/null) = "Done" ]]; then
265         _msg_info "${codename} cache is found."
266     else
267         remove "${cache_dir}/${codename}"
268         debootstrap_status "Running"
269         _msg_info "Installing Ubuntu to '${cache_dir}/${codename}/airootfs'..."
270         mkdir -p "${cache_dir}/${codename}/airootfs"
271         debootstrap --arch="${arch}" --verbose --merged-usr "${codename}" "${cache_dir}/${codename}/airootfs" "${mirror}"
272         _msg_info "${codename} installed successfully!"
273         debootstrap_status "Done"
274     fi
275
276     if [[ "${cache_only}" = true ]]; then
277         exit 0
278     fi
279
280     rm -rf "${work_dir}/airootfs" && mkdir -p "${work_dir}/airootfs"
281     _msg_info "copy base files from '${cache_dir}/${codename}/airootfs' to '${work_dir}/airootfs'..."
282     rsync  -au "${cache_dir}/${codename}/airootfs/" "${work_dir}/airootfs"
283     echo 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH}' >> "${work_dir}/airootfs/etc/bash.bashrc"
284     run_cmd apt-get update
285     # run_cmd apt-get upgrade
286 }
287
288 make_sourcelist() {
289     cp ${script_path}/source.list.d/${codename}/* ${work_dir}/airootfs/etc/apt
290     sed -i "s@http://archive.ubuntu.com/ubuntu/@${mirror}@g"  ${work_dir}/airootfs/etc/apt/sources.list
291     run_cmd apt-get update
292
293     if [[ -n $(find ${channels_dir}/*/repo -type f) ]]; then
294         _apt_install gnupg
295
296         for repo in $(find ${channels_dir}/*/repo -name '*.list'); do
297             key="$(dirname ${repo})/$(basename ${repo} | sed "s/list/key/")"
298
299             if [[ -f "${key}" ]]; then
300                 if file ${key} | grep -q "PGP/GPG key"; then
301                     cp "${key}" "${work_dir}/airootfs/$(basename ${key})"
302                 else
303                     wget -q -O "${work_dir}/airootfs/$(basename ${key})" "$(cat ${key})"
304                 fi
305
306                 run_cmd apt-key add "$(basename ${key})"
307                 rm "${work_dir}/airootfs/$(basename ${key})"
308                 cp "${repo}" "${work_dir}/airootfs/etc/apt/sources.list.d"
309             fi
310         done
311         run_cmd apt-get update
312     fi
313
314     # PPA
315     local PPA_FILELIST
316     local _PPA_FILE
317     local _ppa
318     PPA_FILELIST=("${channels_dir}/share/ppa_list.${arch}" "${channels_dir}/${channel_name}/ppa_list.${arch}")
319     _apt_install software-properties-common
320
321     for _PPA_FILE in ${PPA_FILELIST[@]}; do
322         if [[ -f "${_PPA_FILE}" ]]; then
323             for _ppa in $(grep -h -v ^'#' ${_PPA_FILE}); do
324                 run_cmd add-apt-repository --yes "${_ppa}"
325             done
326         fi
327     done
328 }
329
330 make_systemd() {
331     _apt_install systemd-sysv
332     run_cmd dbus-uuidgen --ensure=/etc/machine-id
333     run_cmd ln -sf /etc/machine-id /var/lib/dbus/machine-id
334 }
335
336 make_apt_packages() {
337     remove "${work_dir}/airootfs/aptpkglist"
338     _apt_install initramfs-tools
339     run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade --yes'
340
341     if [[ -f "${channels_dir}/share/packages.${arch}" ]]; then
342         grep -h -v ^'#' "${channels_dir}/share/packages.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/aptpkglist"
343     fi
344
345     if [[ -f "${channels_dir}/${channel_name}/packages.${arch}" ]]; then
346         grep -h -v ^'#' "${channels_dir}/${channel_name}/packages.${arch}" | grep -v "^$" >> "${work_dir}/airootfs/aptpkglist"
347     fi
348
349     if [[ -s "${work_dir}/airootfs/aptpkglist" ]]; then
350         run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --yes install $(echo $(<aptpkglist))'
351     fi
352
353     remove "${work_dir}/airootfs/aptpkglist"
354 }
355
356 make_config() {
357     # Locales
358     run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8 LC_ALL=C LANGUAGE=en_US.UTF-8 dpkg-reconfigure locales'
359
360     # resolvconf
361     run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive dpkg-reconfigure resolvconf'
362
363     # NetworkManager
364     cp ${channels_dir}/share/airootfs/etc/NetworkManager/NetworkManager.conf ${work_dir}/airootfs/etc/NetworkManager/NetworkManager.conf
365
366     # Timezone
367     #run_cmd echo -ne "UTC" > '/etc/timezone'
368     #run_cmd dpkg-reconfigure -f noninteractive tzdata
369
370     run_cmd env -i bash -c 'DEBIAN_FRONTEND=noninteractive dpkg-reconfigure network-manager'
371     run_cmd truncate -s 0 /etc/machine-id
372 }
373
374 make_add_user() {
375     sed "s|%USERNAME%|${username}|g;s|%OS_NAME%|${os_name}|g" "${nfb_dir}/casper.conf" > "${work_dir}/airootfs/etc/casper.conf"
376     chmod 755 "${work_dir}"/airootfs/usr/share/initramfs-tools/scripts/casper-bottom/*adduser "${work_dir}"/airootfs/usr/share/initramfs-tools/scripts/casper-bottom/*autologin
377     run_cmd env -i bash -c 'mkinitramfs -o /boot/initrd.img-`uname -r` `uname -r`'
378 }
379
380 make_customize_airootfs() {
381     local _run_customize_airootfs_script
382
383     _run_customize_airootfs_script() {
384         [[ -f "${work_dir}/airootfs${1}" ]] && run_cmd "${1}"
385     }
386
387     _run_customize_airootfs_script "/root/customize_airootfs.sh"
388     _run_customize_airootfs_script "/root/customize_airootfs_${channel_name}.sh"
389 }
390
391 make_clean() {
392     sed -i "s@${mirror}@http://archive.ubuntu.com/ubuntu/@g"  ${work_dir}/airootfs/etc/apt/sources.list
393     run_cmd apt-get update
394     run_cmd apt-get clean
395     run_cmd apt-get --yes autoremove
396     run_cmd rm -rf "/tmp/* ~/.bash_history"
397 }
398
399 make_squashfs() {
400     # prepare
401     [[ -d "${bootfiles_dir}" ]] && rm -r "${bootfiles_dir}"
402     mkdir -p "${bootfiles_dir}"/{casper,isolinux,install}
403
404     # make squashfs
405     mksquashfs "${work_dir}/airootfs" "${bootfiles_dir}/casper/filesystem.squashfs"
406 }
407
408 make_nfb() {
409     # prepare
410     touch "${bootfiles_dir}/ubuntu"
411     sed "s|%OS_NAME%|${os_name}|g" "${nfb_dir}/README.diskdefines" > "${bootfiles_dir}/README.diskdefines"
412
413     # casper setup
414     cp "${work_dir}/airootfs/boot/vmlinuz" "${bootfiles_dir}/casper/vmlinuz"
415     cp "${work_dir}/airootfs/boot/initrd.img" "${bootfiles_dir}/casper/initrd"
416     run_cmd dpkg-query -W --showformat='${Package} ${Version}\n' > ${bootfiles_dir}/casper/filesystem.manifest
417     cp -v "${bootfiles_dir}/casper/filesystem.manifest" "${bootfiles_dir}/casper/filesystem.manifest-desktop"
418     sed -i '/casper/d;/discover/d;/laptop-detect/d;/os-prober/d;/ubiquity/d' "${bootfiles_dir}/casper/filesystem.manifest-desktop"
419     printf $(du -sx --block-size=1 "${work_dir}/airootfs" | cut -f1) > "${bootfiles_dir}/casper/filesystem.size"
420
421     # isolinux setup
422     cp "${work_dir}"/airootfs/usr/lib/syslinux/modules/bios/*.c32 "${bootfiles_dir}/isolinux/"
423     cp "${work_dir}/airootfs/usr/lib/ISOLINUX/isolinux.bin" "${bootfiles_dir}/isolinux/"
424     cp "${work_dir}/airootfs/usr/lib/ISOLINUX/isohdpfx.bin" "${bootfiles_dir}/isolinux/"
425     sed "s|%OS_NAME%|${os_name}|g" "${nfb_dir}/grub.cfg" > "${bootfiles_dir}/isolinux/grub.cfg"
426     sed "s|%OS_NAME%|${os_name}|g" "${nfb_dir}/isolinux.cfg" > "${bootfiles_dir}/isolinux/isolinux.cfg"
427
428     # memtest86+ setup
429     _apt_install memtest86+
430     cp "${work_dir}/airootfs/boot/memtest86+.bin" "${bootfiles_dir}/install/memtest86+"
431
432     # memtest86 setup
433     if [[ ! -f "${cache_dir}/memtest86-usb.zip" ]]; then
434         wget -O "${cache_dir}/memtest86-usb.zip" "https://www.memtest86.com/downloads/memtest86-usb.zip"
435         bash -c "(unzip -p ${cache_dir}/memtest86-usb.zip memtest86-usb.img > ${cache_dir}/memtest86)"
436     fi
437
438     cp "${cache_dir}/memtest86" "${bootfiles_dir}/install/memtest86"
439 }
440
441 make_efi() {
442     # UEFI 32bit (ia32)
443     grub-mkstandalone \
444         --format=i386-efi \
445         --output="${bootfiles_dir}/isolinux/bootia32.efi" \
446         --locales="" \
447         --fonts="" \
448         "boot/grub/grub.cfg=${bootfiles_dir}/isolinux/grub.cfg"
449     
450     # UEFI 64bit (x64)
451     grub-mkstandalone \
452         --format=x86_64-efi \
453         --output="${bootfiles_dir}/isolinux/bootx64.efi" \
454         --locales="" \
455         --fonts="" \
456         "boot/grub/grub.cfg=${bootfiles_dir}/isolinux/grub.cfg"
457
458     # create efiboot.img
459     truncate -s 50M "${bootfiles_dir}/isolinux/efiboot.img"
460     mkfs.fat -F 16 -f 1 -r 112 "${bootfiles_dir}/isolinux/efiboot.img"
461     mount "${bootfiles_dir}/isolinux/efiboot.img" "${bootfiles_dir}/mnt"
462     mkdir -p "${bootfiles_dir}/mnt/efi/boot"
463     cp "${bootfiles_dir}/isolinux/bootia32.efi" "${bootfiles_dir}/mnt/efi/boot/"
464     cp "${bootfiles_dir}/isolinux/bootx64.efi" "${bootfiles_dir}/mnt/efi/boot/"
465     umount -d "${bootfiles_dir}/mnt"
466     rm -r "${bootfiles_dir}/mnt"
467 }
468
469 make_iso() {
470     cd "${bootfiles_dir}"
471
472     # create checksum (using at booting)
473     bash -c "(find . -type f -print0 | xargs -0 md5sum | grep -v "\./md5sum.txt" > md5sum.txt)"
474
475     # create iso
476     xorriso \
477         -as mkisofs \
478         -iso-level 3 \
479         -full-iso9660-filenames \
480         -volid "${iso_label}" \
481         -appid "${iso_application}" \
482         -publisher "${iso_publisher}" \
483         -preparer "prepared by LUBS" \
484         -eltorito-boot isolinux/isolinux.bin \
485             -no-emul-boot \
486             -boot-load-size 4 \
487             -boot-info-table \
488         -eltorito-alt-boot \
489             -eltorito-platform efi \
490             -eltorito-boot EFI/efiboot.img \
491             -no-emul-boot \
492         -isohybrid-mbr "${bootfiles_dir}/isolinux/isohdpfx.bin" \
493         -isohybrid-gpt-basdat \
494         -eltorito-catalog isolinux/boot.cat \
495         -output "${out_dir}/${iso_filename}" \
496         -graft-points \
497             "." \
498             "/isolinux/isolinux.bin=isolinux/isolinux.bin" \
499             "/EFI/efiboot.img=isolinux/efiboot.img"
500     
501     cd - > /dev/null
502 }
503
504 make_checksum() {
505     cd "${out_dir}"
506     _msg_info "Creating md5 checksum ..."
507     md5sum "${iso_filename}" > "${iso_filename}.md5"
508
509     _msg_info "Creating sha256 checksum ..."
510     sha256sum "${iso_filename}" > "${iso_filename}.sha256"
511     cd - > /dev/null 2>&1
512 }
513
514
515 # 引数解析()
516 # 参考記事:https://0e0.pw/ci83 https://0e0.pw/VJlg
517
518 _opt_short="w:o:ha:-:m:c:d"
519 _opt_long="help,arch:,codename:,debug,help,mirror:,out:,work,cache-only"
520 OPT=$(getopt -o ${_opt_short} -l ${_opt_long} -- "${@}")
521
522 if [[ ${?} != 0 ]]; then
523     exit 1
524 fi
525
526 eval set -- "${OPT}"
527
528 while :; do
529     case ${1} in
530         -a | --arch)
531             if [[ -z ${2} ]]; then
532                 _msg_error "Please specify the architecture."
533                 exit 1
534             else
535                 arch="${2}"
536             fi
537             shift 2
538             ;;
539         -c | --codename)
540             if [[ -z ${2} ]]; then
541                 _msg_error "Please specify the codename."
542                 exit 1
543             else
544                 codename="${2}"
545             fi
546             shift 2
547             ;;
548         -d | --debug)
549             debug=true
550             shift 1
551             ;;
552         -h | --help)
553             _usage
554             exit 0
555             ;;
556         -m | --mirror)
557             if [[ -z ${2} ]]; then
558                 _msg_error "Please specify the mirror server."
559                 exit 1
560             else
561                 mirror="${2}"
562             fi
563
564             shift 2
565             ;;
566         -o | --out)
567             if [[ -z ${2} ]]; then
568                 _msg_error "Please specify the out dir."
569                 exit 1
570             else
571                 out_dir="${2}"
572             fi
573
574             shift 2
575             ;;
576         -w | --work)
577             if [[ -z ${2} ]]; then
578                 _msg_error "Please specify the out dir."
579                 exit 1
580             else
581                 work_dir="${2}"
582             fi
583
584             shift 2
585             ;;
586         --cache-only)
587             cache_only=true
588             shift 1
589             ;;
590         --)
591             shift
592             break
593             ;;
594         *)
595             _msg_error "Invalid argument '${1}'"
596             _usage 1
597             ;;
598     esac
599 done
600
601 bootfiles_dir="${work_dir}/bootfiles"
602 trap  umount_chroot 0 2 15
603
604 if [[ -n "${1}" ]]; then
605     channel_name="${1}"
606
607     check_channel() {
608         local channel_list
609         local i
610         channel_list=()
611
612         for _channel in $(ls -l "${channels_dir}" | awk '$1 ~ /d/ {print $9 }'); do
613             if [[ -n $(ls "${channels_dir}/${_channel}") ]] && [[ ! "${_channel}" = "share" ]]; then
614                 channel_list+=( "${_channel}" )
615             fi
616         done
617
618         for i in ${channel_list[@]}; do
619             if [[ "${i}" = "${channel_name}" ]]; then
620                 echo -n "true"
621                 return 0
622             fi
623         done
624
625         echo -n "false"
626         return 1
627     }
628
629     if [[ $(check_channel ${channel_name}) = false ]]; then
630         _msg_error "Invalid channel ${channel_name}"
631         exit 1
632     fi
633 fi
634
635
636 prepare_build
637 run_once make_basefs
638 run_once make_sourcelist
639 run_once make_systemd
640 run_once make_apt_packages
641 run_once make_config
642 run_once make_add_user
643 run_once make_customize_airootfs
644 run_once make_clean
645 run_once make_squashfs
646 run_once make_nfb
647 run_once make_efi
648 run_once make_iso
649 run_once make_checksum