Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 338 lines (308 sloc) 16.978 kb
4eafa41 @svenstaro Initial commit
authored
1 #!/bin/bash
2
3 # This is a buildscript to build lglive (http://live.linux-gamers.net)
4 # To understand what is going on here, you should read the Arch Linux wiki
5 # article on "Archiso". Basically, this script prepares 2 editions of lglive:
6 # A 'big' edition and a 'lite' edition which both double as a CD/USB image.
7 # This file will need to be called as root because of nature of device files
8 # and my lazyness to handle this properly. As you know, this is dangerous and
9 # I do not advise the inexperienced user to attempt this. However, I'm trying
10 # my best to make the script work as well as possible.
11 # I know it is ugly.
12 #
13 # This script and the rest of the lglive distribution is licensed under
14 # GPLv3.
15 #
16 # If you have questions or feedback just shoot me a mail or ask on IRC.
17 #
18 # Sven-Hendrik 'Svenstaro' Haase (sh@lutzhaase.com)
19 #
20
21 #### Change these settings to modify how this ISO is built.
22 # The directory that we use for working files.
23 WORKDIR="work"
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
24 # Directory on the iso where our stuff is installed.
25 INSTALL_DIR=lglive
4eafa41 @svenstaro Initial commit
authored
26 # Output directory for built images.
27 OUTDIR="out"
28 # Directory where packages are cached.
29 PKGCACHE="pkgcache"
30 # The name of our ISO. Does not specify the architecture!
31 NAME="lglive"
32 # Version will be appended to the ISO.
ef44f2f @svenstaro Increasing version number and adding note about kernel version
authored
33 VER="0.9.7"
4eafa41 @svenstaro Initial commit
authored
34 # Kernel version. We'll need this.
ffa5f68 @svenstaro Fixed project to work with recent archiso versions
authored
35 KVER="$(grep ^ALL_kver /etc/mkinitcpio.d/kernel26.kver | cut -d= -f2 | sed s/\'//g)"
ef44f2f @svenstaro Increasing version number and adding note about kernel version
authored
36 #KVER="2.6.38" # You shouldn't attempt to make this on a kernel you aren't running.
4eafa41 @svenstaro Initial commit
authored
37 # Architecture will also be appended to the ISO name.
38 ARCH="i686"
39 #ARCH="`uname -m`" # we can't build x86_64 just yet! :(
40 # Bootloader for our livecd/liveusb to use. Valid values: "grub-gfx", "syslinux"
41 # However, "syslinux" is the only acceptable value at the moment because it is
42 # not possible to build hybrid images using grub as of this writing.
43 BOOTLOADER="syslinux"
44 # A list of packages to install, either space separated in a string or line separated in a file. Can include groups.
45 PACKAGES="`cat packages.list` ${BOOTLOADER}"
46 # Directory we originate from.
47 BASEDIR="`pwd`"
48 # Resulting long name for iso/img.
49 FULLNAME="${BASEDIR}/${OUTDIR}/${NAME}-${VER}-${ARCH}-hybrid"
50 # Set quiet for now.
51 VERBOSE="n"
52 QUIET="n"
53 # Absolute path to makepkg.conf.
54 MAKEPKGCNF=`readlink -f makepkg.conf`
53b7ee3 @svenstaro Making xz default compressor
authored
55 # Compress the squashfs with this compressor. Values: "xz", "gzip", "lzo"
56 COMPRESS="xz"
4eafa41 @svenstaro Initial commit
authored
57
58 # usage: usage <exitvalue>
59 usage ()
60 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
61 echo "usage `basename "${0}"` [-v | -q] <target> .. <target>"
62 echo "options:"
63 echo " -v Be verbose"
64 echo " -q Be quiet"
65 echo " -h Usage help"
66 echo "targets:"
67 echo " 'all': makes all available targets"
68 echo " 'clean': clean workdir and outdir"
69 echo " 'lglive-lite-iso': reduced games selection; produces isohybrid for 700MB CD or USB drive"
70 echo " 'lglive-big-iso': full games selection; produces isohybrid for 4700MB DVD or USB drive"
71 exit $1
4eafa41 @svenstaro Initial commit
authored
72 }
73
74 # overlay: overlay <target>
75 overlay ()
76 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
77 TARGET="$1"
78 echo ${TARGET} | grep -q "lite" && gamelist=gamelist_lite || gamelist=gamelist_big
79 [ ! ${QUIET} == "y" ] && echo "===== Making overlay ====="
80 [ ! ${QUIET} == "y" ] && echo "overlay: Target is: ${TARGET}"
4eafa41 @svenstaro Initial commit
authored
81
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
82 [ ! ${QUIET} == "y" ] && echo "overlay: Updating drivers"
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
83 cd "${BASEDIR}/overlay/opt/drivers"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
84 [ ! ${QUIET} == "y" ] && echo "overlay: Cleaning old drivers"
85 rm *.tar.* &> /dev/null
86 find . -type l|xargs rm &> /dev/null
87 [ ! ${QUIET} == "y" ] && echo "overlay: Making NVIDIA driver packages"
4eafa41 @svenstaro Initial commit
authored
88 if [ ${VERBOSE} == "y" ]; then
6e9cfec @svenstaro Fixed NVIDIA packages
authored
89 pacman -Sywd --config ${BASEDIR}/pacman.conf --cachedir `pwd` --noconfirm nvidia nvidia-utils nvidia-173xx nvidia-173xx-utils nvidia-96xx nvidia-96xx-utils
4eafa41 @svenstaro Initial commit
authored
90 else
6e9cfec @svenstaro Fixed NVIDIA packages
authored
91 pacman -Sywd --config ${BASEDIR}/pacman.conf --cachedir `pwd` --noconfirm nvidia nvidia-utils nvidia-173xx nvidia-173xx-utils nvidia-96xx nvidia-96xx-utils &> /dev/null
4eafa41 @svenstaro Initial commit
authored
92 fi
93 [ "$?" -ne 0 ] && echo -e "\e[01;31moverlay: Exiting due to error while getting NVIDIA driver packages\e[00m" && exit 1
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
94 mv -f `ls nvidia-173xx*pkg.tar.*|grep -v utils` nvidia-legacy.tar.xz || return 1
95 mv -f `ls nvidia-173xx*pkg.tar.*|grep utils` nvidia-utils-legacy.tar.xz || return 1
96 mv -f `ls nvidia-96xx*pkg.tar.*|grep -v utils` nvidia-prelegacy.tar.xz || return 1
97 mv -f `ls nvidia-96xx*pkg.tar.*|grep utils` nvidia-utils-prelegacy.tar.xz || return 1
98 mv -f `ls nvidia-*pkg.tar.*|grep -v utils|grep -v 173xx|grep -v 96xx` nvidia-recent.tar.xz || return 1
99 mv -f `ls nvidia-*pkg.tar.*|grep utils|grep -v 173xx|grep -v 96xx` nvidia-utils-recent.tar.xz || return 1
4eafa41 @svenstaro Initial commit
authored
100
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
101 [ ! ${QUIET} == "y" ] && echo "overlay: Making ATI driver package"
3b200f3 @svenstaro Fixed ATI package building
authored
102 if [ ${VERBOSE} == "y" ]; then
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
103 pacman -Sywd --config ${BASEDIR}/pacman.conf --cachedir `pwd` --noconfirm catalyst
3b200f3 @svenstaro Fixed ATI package building
authored
104 else
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
105 pacman -Sywd --config ${BASEDIR}/pacman.conf --cachedir `pwd` --noconfirm catalyst &> /dev/null
106 fi
107 [ "$?" -ne 0 ] && echo -e "\e[01;31moverlay: Exiting due to error while making ATI driver packages\e[00m" && exit 1
108 mv -f `ls catalyst-*.tar.*|grep -v utils` catalyst-recent.tar.xz || return 1
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
109 cd "${BASEDIR}"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
110 [ ! ${QUIET} == "y" ] && echo "overlay: Finished preparing driver packages"
4eafa41 @svenstaro Initial commit
authored
111
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
112 [ ! ${QUIET} == "y" ] && echo "overlay: Setting gamelist '$gamelist'"
113 [ ! ${QUIET} == "y" ] && echo "overlay: Deleting old copied game data"
114 cp -rp "${BASEDIR}"/overlay "${BASEDIR}"/"${WORKDIR}"/overlay/ || return 1
115 if [ ${gamelist} == "gamelist_lite" ]; then
116 cp -f "${BASEDIR}"/gamelist_lite "${BASEDIR}"/"${WORKDIR}"/overlay/
117 elif [ ${gamelist} == "gamelist_big" ]; then
118 cp -f "${BASEDIR}"/gamelist_{lite,big} "${BASEDIR}"/"${WORKDIR}"/overlay/
119 fi
7ad37f7 @svenstaro Cleanups, docs, games update
authored
120
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
121 if [ ${VERBOSE} == "y" ]; then
122 pacman -Sy --config ${BASEDIR}/pacman.conf --dbpath "${BASEDIR}"/"${WORKDIR}"/root-image/var/lib/pacman || return 1
123 else
124 pacman -Sy --config ${BASEDIR}/pacman.conf --dbpath "${BASEDIR}"/"${WORKDIR}"/root-image/var/lib/pacman &> /dev/null || return 1
125 fi
7ad37f7 @svenstaro Cleanups, docs, games update
authored
126
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
127 mkdir -p "${BASEDIR}/${WORKDIR}/overlay/opt/games/" || return 1
ecad704 @svenstaro Changing while loop into for loop because pacman seems to group packages...
authored
128 for game in $(cat ${BASEDIR}/${gamelist}); do
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
129 [ ! ${QUIET} == "y" ] && echo "overlay: Installing ${game}"
130 if [ ${VERBOSE} == "y" ]; then
ecad704 @svenstaro Changing while loop into for loop because pacman seems to group packages...
authored
131 echo "pacman -S --config ${BASEDIR}/pacman.conf --noconfirm --root \"${BASEDIR}/${WORKDIR}/overlay/\" --dbpath \"${BASEDIR}/${WORKDIR}/root-image/var/lib/pacman\" ${game} || return 1"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
132 pacman -S --config ${BASEDIR}/pacman.conf --noconfirm --root "${BASEDIR}/${WORKDIR}/overlay/" --dbpath "${BASEDIR}/${WORKDIR}/root-image/var/lib/pacman" ${game} || return 1
133 else
134 pacman -S --config ${BASEDIR}/pacman.conf --noconfirm --root "${BASEDIR}/${WORKDIR}/overlay/" --dbpath "${BASEDIR}/${WORKDIR}/root-image/var/lib/pacman" ${game} &> /dev/null || return 1
135 fi
136 if [ -d "${BASEDIR}/games/${game}" ]; then
137 cp -rp "${BASEDIR}/games/${game}" "${BASEDIR}/${WORKDIR}/overlay/opt/games/" || return 1
138 fi
ecad704 @svenstaro Changing while loop into for loop because pacman seems to group packages...
authored
139 done
7ad37f7 @svenstaro Cleanups, docs, games update
authored
140
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
141 cd "${BASEDIR}"
142 #[ ! ${QUIET} == "y" ] && echo "overlay: Copying overlay to workdir"
143 #cp -rpL overlay "${WORKDIR}/" || return 1
144 [ "$?" -ne 0 ] && echo -e "\e[01;31moverlay: Exiting due to error while copying overlay\e[00m" && exit 1
145 [ ! ${QUIET} == "y" ] && echo "===== Finished overlay ====="
146 return 0
4eafa41 @svenstaro Initial commit
authored
147 }
148
149 base-iso ()
150 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
151 [ ! ${QUIET} == "y" ] && echo "===== Making base-iso ====="
152 [ ! ${QUIET} == "y" ] && echo "base-iso: Copying boot-files"
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
153 mv "${WORKDIR}/root-image/boot" "${WORKDIR}/iso/${INSTALL_DIR}/boot" || true
154 mv "${WORKDIR}/iso/${INSTALL_DIR}/boot/memtest86+/memtest.bin" "${WORKDIR}/iso/${INSTALL_DIR}/boot/memtest"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
155 [ "$?" -ne 0 ] && echo -e "\e[01;31mbase-iso: Exiting due to error while moving boot files\e[00m" && exit 1
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
156 mkdir -p ${WORKDIR}/iso/syslinux
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
157 cp boot-files/splash.png ${WORKDIR}/iso/${INSTALL_DIR}/boot/ || return 1
158 cp boot-files/syslinux/* ${WORKDIR}/iso/syslinux/ || return 1
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
159 [ "$?" -ne 0 ] && echo -e "\e[01;31mbase-iso: Exiting due to error while copying boot files\e[00m" && exit 1
160 [ ! ${QUIET} == "y" ] && echo "base-iso: Preparing isomounts"
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
161 cp isomounts "${WORKDIR}/iso/${INSTALL_DIR}/isomounts" || return 1
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
162 [ "$?" -ne 0 ] && echo -e "\e[01;31mbase-iso: Exiting because no isomounts file was found\e[00m" && exit 1
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
163 sed -i "s|@ARCH@|${ARCH}|g" "${WORKDIR}/iso/${INSTALL_DIR}/isomounts"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
164 [ ! ${QUIET} == "y" ] && echo "base-iso: Making initrd image"
165 git clone git://projects.archlinux.org/archiso.git archiso-temp &>/dev/null || return 1
166 cp -r archiso-temp/archiso/{hooks,install} ${BASEDIR}/${WORKDIR}/root-image/lib/initcpio/ || return 1
167 # TODO: Hacky workaround until klibc-utils fstype supports udf
168 #sed '/if mount -r -t "${_FSTYPE}" \/dev\/archiso \/bootmnt >\/dev\/null 2>&1; then/c\if mount -r -t udf \/dev\/archiso \/bootmnt >\/dev\/null 2>&1; then' -i ${BASEDIR}/${WORKDIR}/root-image/lib/initcpio/hooks/archiso || return 1
169 rm -r archiso-temp
170 cp ${BASEDIR}/mkinitcpio.conf ${BASEDIR}/${WORKDIR}/root-image/etc/mkinitcpio.conf || return 1
171 if [ ${VERBOSE} == "y" ]; then
172 chroot ${BASEDIR}/${WORKDIR}/root-image mkinitcpio -c /etc/mkinitcpio.conf -k ${KVER} -g "/lglive.img" || return 1
173 else
174 chroot ${BASEDIR}/${WORKDIR}/root-image mkinitcpio -c /etc/mkinitcpio.conf -k ${KVER} -g "/lglive.img" &>/dev/null || return 1
175 fi
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
176 mv ${BASEDIR}/${WORKDIR}/root-image/lglive.img "${BASEDIR}/${WORKDIR}/iso/${INSTALL_DIR}/boot/lglive.img" &>/dev/null ||return 1
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
177 sed -i "s/^CacheDir/\#CacheDir/" "${BASEDIR}/${WORKDIR}/root-image/etc/pacman.conf"
178 sed -i "/localrepo/,+2d" "${BASEDIR}/${WORKDIR}/root-image/etc/pacman.conf"
179 [ "$?" -ne 0 ] && echo -e "\e[01;31mbase-iso: Exiting due to error while running mkinitcpio\e[00m" && exit 1
180 [ ! ${QUIET} == "y" ] && echo "===== Finished base-iso ====="
181 return 0
4eafa41 @svenstaro Initial commit
authored
182 }
183
184 root-image ()
185 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
186 [ ! ${QUIET} == "y" ] && echo "===== Making root-image ====="
187 [ ! -d "${BASEDIR}"/"${OUTDIR}" ] && mkdir "${BASEDIR}"/"${OUTDIR}"
188 [ ! -d "${BASEDIR}"/"${WORKDIR}" ] && mkdir "${BASEDIR}"/"${WORKDIR}"
189 [ ! -d "${BASEDIR}"/"${PKGCACHE}" ] && mkdir "${BASEDIR}"/"${PKGCACHE}"
190 sed -i "s|^CacheDir.*$|CacheDir = ${BASEDIR}\/${PKGCACHE}|" pacman.conf
191 sed -i "/localrepo/{n; s|.*|Server = file\:\/\/${BASEDIR}/localrepo\/|}" pacman.conf
192 [ ! ${QUIET} == "y" ] && echo "root-image: Installing packages"
193 if [ ${VERBOSE} == "y" ]; then
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
194 mkarchiso -D ${INSTALL_DIR} -C pacman.conf -p base -v create "${WORKDIR}"
195 mkarchiso -D ${INSTALL_DIR} -C pacman.conf -p "${PACKAGES}" -v create "${WORKDIR}"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
196 else
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
197 mkarchiso -D ${INSTALL_DIR} -C pacman.conf -p base -v create "${WORKDIR}" &> /dev/null
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
198 mkarchiso -D ${INSTALL_DIR} -C pacman.conf -p "${PACKAGES}" -v create "${WORKDIR}" &> /dev/null
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
199 fi
200 rm -r "${BASEDIR}"/"${WORKDIR}"/root-image/home/* || true
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
201 #rm -r "${BASEDIR}"/"${WORKDIR}"/root-image/root/* || true
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
202 [ "$?" -ne 0 ] && echo -e "\e[01;31mroot-image: Exiting due to error with mkarchiso\e[00m" && exit 1
203 [ ! ${QUIET} == "y" ] && echo "===== Finished root-image ====="
204 return 0
4eafa41 @svenstaro Initial commit
authored
205 }
206
207 bootloader ()
208 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
209 [ ! ${QUIET} == "y" ] && echo "===== Making bootloader ====="
210 if [ ${BOOTLOADER} == "grub-gfx" ]; then
211 [ ! ${QUIET} == "y" ] && echo "bootloader: Copying files for 'grub-gfx'"
212 cp -r "${WORKDIR}/root-image/usr/lib/grub/i386-pc/"* "${WORKDIR}/iso/boot/grub" || return 1
213 [ "$?" -ne 0 ] && echo -e "\e[01;31mbootloader: Exiting due to error while copying bootloader\e[00m" && exit 1
214 elif [ ${BOOTLOADER} == "syslinux" ]; then
215 [ ! ${QUIET} == "y" ] && echo "bootloader: Copying files for 'syslinux'"
a3f051a @svenstaro Merging INSTALL_DIR changes
authored
216 cp "${WORKDIR}/root-image/usr/lib/syslinux/isolinux.bin" "${WORKDIR}/iso/syslinux/" || return 1
217 cp "${WORKDIR}/root-image/usr/lib/syslinux/memdisk" "${WORKDIR}/iso/syslinux/" || return 1
218 cp "${WORKDIR}/root-image/usr/lib/syslinux/pxelinux.0" "${WORKDIR}/iso/syslinux/" || return 1
219 cp "${WORKDIR}/root-image/usr/lib/syslinux/gpxelinux.0" "${WORKDIR}/iso/syslinux/" || return 1
220 cp "${WORKDIR}/root-image/usr/lib/syslinux/"*.c32 "${WORKDIR}/iso/syslinux/" || return 1
221 cp "${WORKDIR}/root-image/usr/lib/syslinux/poweroff.com" "${WORKDIR}/iso/syslinux/" || return 1
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
222 #sed "s|archisolabel=[^ ]*|archisolabel=${NAME}-${VER//./}|" -i ${WORKDIR}/iso/boot/pxelinux.cfg/default || return 1
223 [ "$?" -ne 0 ] && echo -e "\e[01;31mbootloader Exiting due to error while copying bootloader\e[00m" && exit 1
224 fi
225 [ ! ${QUIET} == "y" ] && echo "===== Finished bootloader ====="
226 return 0
4eafa41 @svenstaro Initial commit
authored
227 }
228
229 # build: build <target>
230 build ()
231 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
232 TARGET="$1"
696343c @svenstaro Fixed ATI package building
authored
233
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
234 #TODO: Persistent storage
235 #dd if=/dev/zero of="${BASEDIR}"/"${WORKDIR}"/iso/persistent.ext4 bs=1M count=4
236 #mkfs.ext4 -m0 -F "${BASEDIR}"/"${WORKDIR}"/iso/persistent.ext4
237 #mkdir "${BASEDIR}"/"${WORKDIR}"/archiso-mount-tmp
238 #mount -o loop -t ext4 "${BASEDIR}"/"${WORKDIR}"/iso/persistent.ext4 "${BASEDIR}"/"${WORKDIR}"/archiso-mount-tmp
239 #mkdir -p /tmp/archiso-mount-tmp/home/gamer/persistent
240 #umount "${BASEDIR}"/"${WORKDIR}"/archiso-mount-tmp
241 #rmdir "${BASEDIR}"/"${WORKDIR}"/archiso-mount-tmp
242 #TODO
4eafa41 @svenstaro Initial commit
authored
243
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
244 [ ! ${QUIET} == "y" ] && echo "===== Building final image for target: ${TARGET} ====="
245 [ ! ${QUIET} == "y" ] && echo "build: Removing ballast"
246 rm -rf "${WORKDIR}"/root-image/usr/include/*
247 rm -rf "${WORKDIR}"/root-image/usr/src/
54a1bed @svenstaro Image size adjustments
authored
248 pacman -Rsn --root "${BASEDIR}/${WORKDIR}/root-image/" --dbpath "${BASEDIR}/${WORKDIR}/root-image/var/lib/pacman" --config ${BASEDIR}/pacman.conf --noconfirm man-db man-pages || return 1
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
249 #pacman -Q --root "${BASEDIR}/${WORKDIR}/root-image/" --dbpath "${BASEDIR}/${WORKDIR}/root-image/var/lib/pacman" --config ${BASEDIR}/pacman.conf --noconfirm doxygen && pacman -Rsn --root "${BASEDIR}/${WORKDIR}/root-image/" --dbpath "${BASEDIR}/${WORKDIR}/root-image/var/lib/pacman" --config ${BASEDIR}/pacman.conf --noconfirm doxygen
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
250 echo ${TARGET} | grep -q "lite" && edition="lite" || edition="big"
251 [ ! ${QUIET} == "y" ] && echo "build: Setting edition to '${edition}'"
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
252 [ ! ${QUIET} == "y" ] && echo "build: Saving to ${FULLNAME}-${edition}.iso"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
253 [ ! ${QUIET} == "y" ] && echo "build: Starting build, this will take some time"
254 if [ ${VERBOSE} == "y" ]; then
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
255 mkarchiso -D ${INSTALL_DIR} -c ${COMPRESS} -f -v -L "${NAME}-${VER//./}" -P "Linux-Gamers <live.linux-gamers.net>" -A "live.linux-gamers" -p "${BOOTLOADER}" iso "${WORKDIR}" "${FULLNAME}-${edition}.iso"
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
256 else
95a975e @svenstaro Finalizing fixes for merge to new archiso upstream
authored
257 mkarchiso -D ${INSTALL_DIR} -c ${COMPRESS} -f -v -L "${NAME}-${VER//./}" -P "Linux-Gamers <live.linux-gamers.net>" -A "live.linux-gamers" -p "${BOOTLOADER}" iso "${WORKDIR}" "${FULLNAME}-${edition}.iso" &> /dev/null
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
258 fi
259 [ "$?" -ne 0 ] && echo -e "\e[01;31mbuild: Exiting due to error while running mkarchiso\e[00m" && exit 1
260 [ ! ${QUIET} == "y" ] && echo "===== Finished building final image for target: ${TARGET} ====="
261 return 0
4eafa41 @svenstaro Initial commit
authored
262 }
263
264 clean ()
265 {
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
266 [ ! ${QUIET} == "y" ] && echo "===== Cleaning ====="
267 [ ! ${QUIET} == "y" ] && echo "clean: Deleting '${BASEDIR}/${WORKDIR}'"
268 rm -rf "${BASEDIR}/${WORKDIR}"
269 [ "$?" -ne 0 ] && echo -e "\e[01;31mclean: Exiting due to error while cleaning workdir\e[00m" && exit 1
270 [ ! ${QUIET} == "y" ] && echo "===== Cleaning finished successfully ====="
271 return 0
4eafa41 @svenstaro Initial commit
authored
272 }
273
274 # Catch options here
275 while getopts "hvq" opt; do
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
276 case "${opt}" in
277 v) VERBOSE="y" ;;
278 q) QUIET="y" ;;
279 h|?) usage 0 ;;
280 *) echo "ERROR: Invalid argument '${opt}'"; usage 1 ;;
281 esac
4eafa41 @svenstaro Initial commit
authored
282 done
283
284 shift $(($OPTIND - 1))
285
286 if [ $# -lt 1 ]; then
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
287 echo "ERROR: No build targets"
288 usage 1
4eafa41 @svenstaro Initial commit
authored
289 fi
290
291 if [ "${USER}" != "root" ]; then
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
292 echo "ERROR: Need to be root"
293 exit 1
4eafa41 @svenstaro Initial commit
authored
294 fi
295
296 START_TIME=`date +%s`
297 START_DATE=`date`
298
299 LAUNCH_ARGS="$@"
300
301 if echo "$@" | grep -q "clean"; then
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
302 clean
303 exit 0
4eafa41 @svenstaro Initial commit
authored
304 fi
305
306 if echo "$@" | grep -q "all"; then
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
307 LAUNCH_ARGS="lglive-lite-iso lglive-big-iso"
4eafa41 @svenstaro Initial commit
authored
308 fi
309
310 for arg in ${LAUNCH_ARGS}; do
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
311 if [[ ${arg} != "lglive-lite-iso" && ${arg} != "lglive-big-iso" ]]; then
312 echo "ERROR: Invalid target"
313 usage 1
314 fi
315 [ ! ${QUIET} == "y" ] && echo -e "\e[01;33m===== Starting build for target: ${arg} =====\e[00m"
316 clean || (echo -e "\e[01;31mclean: Exiting due to error while cleaning\e[00m"; exit 1)
317 root-image || (echo -e "\e[01;31mroot-image: Exiting due to error while making root-image\e[00m"; exit 1)
318 base-iso || (echo -e "\e[01;31mbase-iso: Exiting due to error while making base-iso\e[00m"; exit 1)
319 overlay ${arg} || (echo -e "\e[01;31moverlay: Exiting due to error while making overlay\e[00m"; exit 1) # pass target info to get correct gameset
320 bootloader || (echo -e "\e[01;31mbootloader: Exiting due to error while making bootloader\e[00m"; exit 1)
321 build ${arg} || (echo -e "\e[01;31mbuild: Exiting due to error while building iso\e[00m"; exit 1) # pass target info to build correct image
322 [ ! ${QUIET} == "y" ] && echo -e "\e[01;33m===== Finished build for target: ${arg} =====\e[00m"
4eafa41 @svenstaro Initial commit
authored
323 done
324
325 END_TIME=`date +%s`
326 ELAPSED=`expr ${END_TIME} - ${START_TIME}`
327 h=$(( ELAPSED / 3600 ))
328 m=$(( ( ELAPSED / 60 ) % 60 ))
329 s=$(( ELAPSED % 60 ))
330 echo -e "\e[01;34m===== FINISHED ALL BUILDS =====\e[00m"
331 echo "BUILDING STARTED at" ${START_DATE}
332 echo "BUILDING FINISHED at" `date`
333 printf "ELAPSED TIME: %02d:%02d:%02d\n" $h $m $s
334 du -h out/*
335
d930014 @svenstaro Fixed overlay/opt/games directory not being created
authored
336 # vim:ts=2:sw=2:et
4eafa41 @svenstaro Initial commit
authored
337
Something went wrong with that request. Please try again.