Repository navigation
Expand file tree
/
Copy pathGoboALFS
More file actions
executable file
·561 lines (486 loc) · 19.1 KB
/
Copy pathGoboALFS
File metadata and controls
executable file
·561 lines (486 loc) · 19.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
#!/bin/bash
################################################################################
# GoboALFS script to automate the bootstrap of GoboLinux based on the ALFS book.
# No assumptions are made regarding the Linux distribution running on the host.
#
# Lucas C. Villa Real <lucasvr@gobolinux.org>
################################################################################
if [ "$1" = "--batch" ]
then
arg="$2"
batch=yes
elif [ "$2" = "--batch" ]
then
arg="$1"
batch=yes
else
arg="$1"
if [ ! -z "$arg" -a ! -d "$arg" ]
then
# reset arg so that usage help is shown
arg=""
fi
fi
if [ "$arg" = "" ]
then
echo "Usage: $0 [--batch] <workdir>"
echo
echo "<workdir> must be an initially empty directory. It will be populated with the"
echo "JHALFS tree, compiled packages and with the ISO development files."
echo
exit 1
fi
WORKDIR=$(readlink -f "$arg")
GOBOALFS_DIR=$(readlink -f $(dirname "$0"))
PATCHES=(
$GOBOALFS_DIR/01-gobolinux-jhalfs.patch
$GOBOALFS_DIR/02-gobolinux-book.patch
)
export SRC_ARCHIVE="$WORKDIR/src_archive"
export WORKDIR
GOBO_JHALFS_DIR="$GOBOALFS_DIR/jhalfs"
ALFS_CONFIGURATION="$GOBOALFS_DIR/jhalfs/configuration"
PACKAGEDIR=$WORKDIR/Packages
BUILDDIR=$WORKDIR/RootFS
echo "WORKDIR=$WORKDIR" > $(dirname "$0")/.workdir.conf
# Do not let our calls to git fail upon certificate validation issues
export GIT_SSL_NO_VERIFY=1
# LocalFunctions must be imported after all global definitions have been set
source $GOBOALFS_DIR/LocalFunctions
###################################################################################################
### Sanity checks
###################################################################################################
if ! grep -q "^lfs:" /etc/passwd || ! grep -q "^lfs:" /etc/group
then
echo "Please create the 'lfs' user and group before proceeding."
echo "Also, certify that 'lfs' has suid rights."
exit 1
fi
if [ $UID = 0 ]
then
echo "This script should not be run as root. Please invoke it with a regular"
echo "user account with sudo privileges."
exit 1
fi
sudo whoami >& /dev/null
if [ $? != 0 ]
then
echo "Please make sure that your user has sudo privileges before continuing."
exit 1
fi
sudo su lfs -c "ls $WORKDIR &> /dev/null"
if [ $? != 0 ]
then
echo "Please make sure that the user 'lfs' has full access to $WORKDIR."
echo $WORKDIR | grep -q $HOME && echo "You might want to use a directory not inside your \$HOME."
exit 1
fi
svn --version &> /dev/null
if [ $? != 0 ]
then
echo "Please make sure that svn in installed (used to download the LFS snapshot)."
exit 1
fi
if [ ! -e /dev/fuse ]
then
echo "/dev/fuse has not been found. Please run 'modprobe fuse' and try again."
exit 1
fi
###################################################################################################
### Operation -- LFS part of the script
###################################################################################################
[ ! -d "$BUILDDIR" ] && mkdir -p "$BUILDDIR/Users/lfs"
[ ! -d "$PACKAGEDIR" ] && mkdir -p "$PACKAGEDIR"
if [ $(ls "$BUILDDIR"/ | wc -l | awk {'print $1'}) -gt 0 ]
then
echo "Using existing build directory $BUILDDIR"
fi
mkdir -p "$SRC_ARCHIVE"
if [ ! -d "$WORKDIR/jhalfs-trunk" ]
then
echo "Downloading JHALFS from Subversion"
svn co svn://svn.linuxfromscratch.org/ALFS/jhalfs/trunk "$WORKDIR/jhalfs-trunk"
mkdir -p "$WORKDIR/jhalfs-trunk/custom"
pushd "$WORKDIR/jhalfs-trunk" > /dev/null
echo "Obtaining patches"
for patchFile in ${PATCHES[@]}; do cp "$patchFile" custom/$(basename "$patchFile"); done
echo "Patching"
jhalfsPatch=$(ls custom/*gobolinux-jhalfs.patch)
if [ ! -e ".gobolinux-patched" ]
then
patch -i "$jhalfsPatch" -p0
touch .gobolinux-patched
fi
if [ ! -e BLFS/libs/gobolinux_patch_buildscript ]
then
cp -a "$GOBO_JHALFS_DIR"/* .
fi
popd > /dev/null
fi
if [ ! -e "$BUILDDIR/blfs_root/work/.done" ]
then
pushd "$WORKDIR/jhalfs-trunk" > /dev/null
if [ "$batch" = "yes" ]
then
yes "" | make config
else
echo "Running menuconfig."
# E for exit, Y for yes
BatchRun "ey" make menuconfig LIBS="$(pkg-config --libs ncurses)"
fi
echo "Processing JHALFS configuration file"
perl -pi -e "s,^BUILDDIR=.*,BUILDDIR=\"$BUILDDIR\",g" configuration
[ -d "/Users" ] && perl -pi -e 's,LHOME=.*,LHOME=\"/Users\",g' configuration
BatchRun "yes\n" ./jhalfs run || exit 1
popd > /dev/null
echo "LFS/BLFS processing complete" > "$BUILDDIR/blfs_root/work/.done"
fi
if [ ! -d "$BUILDDIR/Programs/Sudo" ]
then
sudo tee "$BUILDDIR/bin/sudo" << EOF > /dev/null
#!/bin/bash
if [ "\$1" = "-u" ]
then shift 2
fi
exec "\$@"
EOF
sudo chmod +x "$BUILDDIR/bin/sudo"
fi
# Move left-over files to the packages where they belong
MoveSettingsFile nsswitch.conf Glibc
MoveSettingsFile udev/hwdb.bin Eudev
MoveSettingsFile inittab BootScripts-ALFS
MoveSettingsFile syslog.conf Sysklogd
MoveFile lib/libstdc++.la GCC
MoveFile lib/locale Glibc
MoveFile share/zoneinfo Glibc
# Fix broken installation of LibXML2
libxml2Version=$(GetPackageVersion LibXML2)
duplicatedDir="$BUILDDIR/Programs/LibXML2/$libxml2Version/Programs"
if [ -d "$duplicatedDir" ]
then
libdir=$(find "$duplicatedDir" -name lib -type d)
for i in "$libdir/"*; do sudo mv "$i" "$BUILDDIR/Programs/LibXML2/$libxml2Version/lib/"; done
sudo rm -rf "$duplicatedDir"
InChroot /tools/bin/SymlinkProgram -c overwrite LibXML2 $libxml2Version
fi
# Update CAcerts version and broken paths
cacertsVersion=$(GetPackageVersion CAcerts)
if [ "$cacertsVersion" = "cacerts-certdata.txt" ]
then
sudo mv "$BUILDDIR/Programs/CAcerts/$cacertsVersion" "$BUILDDIR/Programs/CAcerts/20120211"
InChroot /tools/bin/SymlinkProgram -c overwrite CAcerts 20120211
fi
# Fix several broken paths generated by JHALFS
wgetVersion=$(GetPackageVersion Wget)
sudo perl -pi -e "s,/tmp/wget,,g" "$BUILDDIR/Programs/Wget/Settings/wgetrc"
sudo perl -pi -e "s,/tmp/wget,,g" "$BUILDDIR/Programs/Wget/${wgetVersion}/Resources/Defaults/Settings/wgetrc"
sudo perl -pi -e "s,/tmp/cacerts,,g" "$BUILDDIR"/Programs/CAcerts/${cacertsVersion}/bin/*
sudo perl -pi -e "s,/tmp/cacerts,,g" "$BUILDDIR"/Programs/CAcerts/${cacertsVersion}/sbin/*
# Install extra locales. Please refer to 'localedef --list-archive' on a regular desktop machine
# for a list of common locales.
InChroot localedef -i pt_BR -f ISO-8859-1 pt_BR
InChroot localedef -i pt_BR -f UTF-8 pt_BR
InChroot localedef -i pl_PL -f ISO-8859-2 pl_PL
InChroot localedef -i pl_PL -f UTF-8 pl_PL
InChroot localedef -i hu_HU -f ISO-8859-2 hu_HU
InChroot localedef -i hu_HU -f UTF-8 hu_HU
# Update /etc/passwd, /etc/group, /etc/resolv.conf, /etc/sudoers, and udev settings
if ! grep -q "^fibo:" "$BUILDDIR/System/Settings/passwd"
then
echo "fibo:x:21:21::/tmp:/bin/bash" | sudo tee -a "$BUILDDIR/System/Settings/passwd" > /dev/null
echo "fibo:x:21:" | sudo tee -a "$BUILDDIR/System/Settings/group" > /dev/null
fi
if ! grep -q "^`whoami`:" "$BUILDDIR/System/Settings/passwd"
then
grep "^`whoami`:" /etc/passwd | sudo tee -a "$BUILDDIR/System/Settings/passwd" > /dev/null
fi
if grep -q "EDITME" "$BUILDDIR/System/Settings/resolv.conf"
then
sudo cp /etc/resolv.conf "$BUILDDIR/System/Settings/resolv.conf"
fi
eudevVersion=$(GetPackageVersion Eudev)
if [ -z "$eudevVersion" ]
then
echo "ERROR: Eudev has not been found at $BUILDDIR/Programs/Eudev/"
exit 1
fi
for rulefile in "$BUILDDIR/Programs/Eudev/$eudevVersion/Resources/Defaults/Settings/udev/rules.d"/*
do
grep -q "pci-db" "$rulefile" && sudo perl -pi -e "s,pci-db,hwdb --subsystem=pci,g" "$rulefile"
grep -q "usb-db" "$rulefile" && sudo perl -pi -e "s,usb-db,hwdb --subsystem=usb,g" "$rulefile"
done
sudo rm -f "$BUILDDIR/Programs/Eudev/$eudevVersion/Resources/Defaults/Settings/udev/rules.d/55-lfs.rules"
# Make sure we have /bin/sh
if [ ! -e "$BUILDDIR/bin/sh" ]
then
bashVersion=$(GetPackageVersion Bash)
sudo ln -sf "bash" "$BUILDDIR/Programs/Bash/$bashVersion/bin/sh"
sudo ln -sf "/Programs/Bash/$bashVersion/bin/sh" "$BUILDDIR/bin/sh"
fi
# Fix /proc and /dev
if [ ! -h "$BUILDDIR/proc" ]
then
if ! grep -q "$BUILDDIR/proc" /proc/mounts
then
sudo rm -rf "$BUILDDIR/proc"
sudo ln -s System/Kernel/Status "$BUILDDIR/proc"
fi
fi
if [ ! -h "$BUILDDIR/dev" ]
then
if ! grep -q "$BUILDDIR/dev" /proc/mounts
then
sudo rm -rf "$BUILDDIR/dev"
sudo ln -s System/Kernel/Devices "$BUILDDIR/dev"
fi
fi
CreatePackageList "LFS"
###################################################################################################
### Operation -- GoboLinux part of the script
###################################################################################################
if [ ! -e "$BUILDDIR/Programs/Perl/Current/Resources/Description" ]
then
# GoboLinux needs its special Perl package to support /System/Aliens
sudo rm -rf "$BUILDDIR/Programs/Perl"
# .cpan holds references to /tools, which we don't want to keep.
sudo rm -rf "$BUILDDIR/root/.cpan"
fi
libtoolVersion=$(GetPackageVersion LibTool)
if [ -e "$BUILDDIR/Programs/LibTool/$libtoolVersion/bin/libtool" ]
then
sudo perl -pi -e 's,func_fatal_error \"error: cannot install.*,/bin/true,g' \
"$BUILDDIR/Programs/LibTool/$libtoolVersion/bin/libtool"
fi
# Checkout GoboLinux scripts
if [ ! -d "$WORKDIR/BuildLiveCD" ]
then
pushd "$WORKDIR"
git clone https://github.com/gobolinux/BuildLiveCD
popd
fi
if [ ! -d "$WORKDIR/ISO/LocalGit/tools" ]
then
mkdir -p "$WORKDIR/ISO/LocalGit/tools"
pushd "$WORKDIR/ISO/LocalGit/tools"
git clone https://github.com/gobolinux/Scripts
git clone https://github.com/gobolinux/Compile
popd
fi
if [ ! -d "$BUILDDIR/Programs/Compile" ]
then
# Install Scripts and Compile in the chroot
InstallGoboPackage Scripts
InstallGoboPackage Compile
# Rename Coreutils' install to real_install
coreutilsVersion=$(GetPackageVersion CoreUtils)
coreutilsDir="$BUILDDIR/Programs/CoreUtils/$coreutilsVersion"
if [ ! -e "$coreutilsDir/bin/real_install" ]
then
sudo mv "$coreutilsDir/bin/install" "$coreutilsDir/bin/real_install"
InChroot SymlinkProgram CoreUtils "$coreutilsVersion"
fi
# Rename LibXML2' xmlcatalog to real_xmlcatalog
libxml2Version=$(GetPackageVersion LibXML2)
libxml2Dir="$BUILDDIR/Programs/LibXML2/$libxml2Version"
if [ ! -e "$libxml2Dir/bin/real_xmlcatalog" ]
then
sudo mv "$libxml2Dir/bin/xmlcatalog" "$libxml2Dir/bin/real_xmlcatalog"
InChroot SymlinkProgram LibXML2 "$libxml2Version"
fi
fi
if [ ! -d "$WORKDIR/ISO/Output/ROLayer" ]
then
# Update the ISO environment
pushd "$WORKDIR/ISO" > /dev/null
ln -fs ../Packages .
(
export PATH="$PATH:$BUILDDIR/Programs/Scripts/Current/bin:$BUILDDIR/Programs/Compile/Current/bin"
export goboPrefix="$BUILDDIR"
export livecdDataDir="$WORKDIR/BuildLiveCD/Data"
source "$BUILDDIR/Programs/Scripts/Current/bin/GoboPath"
"$WORKDIR/BuildLiveCD/bin/UpdateEnvironment"
)
popd > /dev/null
fi
# Compile extra packages needed to run Compile and to boot the ISO nicely.
for appName in \
Sudo Fuse UnionFS-Fuse CMake Perl Git GoboHide Linux Help2Man Net-Tools \
Linux-PAM Dialog DHCPCD Acpid Hdparm ZSH ReiserFSProgs LVM2 Parted SYSLINUX \
Atool Htop Mdadm LibNL PowerTOP Unzip Mtail GPM GRUB GRUB-EFI EFIBootMgr DosFSTools \
Linux-Firmware Pinfo OS-Prober ELFUtils SetupTools PIP CryptSetup Json-C Listener
do
if [ "$appName" = "GRUB" ] && [ ! -d "$BUILDDIR/Programs/GRUB/2.02_beta3" ]
then
# Remove GRUB installation from JHALFS
sudo rm -rf -- "$BUILDDIR/Programs/GRUB"
fi
if [ "$appName" = "Unzip" ] && [ ! -e "$BUILDDIR/Programs/Unzip/Current/bin/unzip" ]
then
# Remove broken installation from JHALFS
sudo rm -rf -- "$BUILDDIR/Programs/Unzip"
fi
if [ ! -d "$BUILDDIR/Programs/$appName" ]
then
InChroot Compile --batch --no-sign "$appName" || exit 1
InChroot SymlinkProgram -u install -c overwrite "$appName"
SanityCheckProgram "$appName" || exit 1
fi
if [ -d "$BUILDDIR/Programs/Linux-PAM" ] && [ ! -e "$BUILDDIR/Programs/Shadow/Current" ]
then
# Recompile Shadow with Linux-PAM support
shadowVersion=$(GetPackageVersion Shadow)
InChroot Compile --batch --no-sign Shadow $shadowVersion || exit 1
SanityCheckProgram Shadow || exit 1
# Remove Settings/skel (we use the one from EnhancedSkel)
sudo rm -rf -- "$BUILDDIR/Programs/Shadow/$shadowVersion/Resources/Defaults/Settings/skel"
sudo rm -rf -- "$BUILDDIR/Programs/Shadow/Settings/skel"
sudo rm -f "$BUILDDIR/System/Settings/skel"
fi
done
CreatePackageList "Base"
# BLFS installs DocBook and DocBook-XSL, both featuring broken catalog files.
#
# Since we have replacements for these packages (named DocBook-XML-DTD and
# DocBook-XSL-Stylesheets, respectively), we stick with our own.
#
# Note that differently from BLFS, we ship our catalog files under /var/lib/xml
# rather than /etc/xml.
if [ -d "$BUILDDIR/Programs/DocBook" ]
then
InChroot RemoveProgram -u remove DocBook
InChroot SymlinkProgram -u install -c overwrite DocBook-XML-DTD
RemoveFromPackageList "LFS" "DocBook"
fi
if [ -d "$BUILDDIR/Programs/DocBook-XSL" ]
then
InChroot RemoveProgram -u remove DocBook-XSL
InChroot SymlinkProgram -u install -c overwrite DocBook-XSL-Stylesheets
RemoveFromPackageList "LFS" "DocBook-XSL"
fi
function CompileExtras() {
local listname="$1"
shift
for entry in "$@"; do
appName="$(echo "$entry" | awk {'print $1'})"
appVersion="$(echo "$entry" | awk {'print $2'})"
if [ ! -d "$BUILDDIR/Programs/$appName" ]
then
InChroot Compile --batch --no-sign "$appName" $appVersion || exit 1
SanityCheckProgram "$appName" || exit 1
fi
done
CreatePackageList "$listname"
}
# At this point we can build all the extra packages that we want to have in the ISO
CompileExtras "Xorg" LibJPEG-Turbo Xorg XTerm
CompileExtras "Printing" CUPS CUPS-Filters Ghostscript Gutenprint Hplip
CompileExtras "GTKMM" LibSigc++ GLibmm PangoMM Cairomm ATKMM GTKMM GParted
CompileExtras "Networking" OpenSSH WPA_Supplicant Wireless-Tools NSS PPP Iptables Pinentry RFKill GoboNet
CompileExtras "Bindings" PyQt
CompileExtras "Desktop" RXVT-Unicode "Compton git" Lua GObject-Introspection LuaRocks "Awesome git" Lode-Fonts DejaVu-Fonts-TTF Dit "Tabbedex-URxvt git" Tk APulse
CompileExtras "Multimedia" ALSA-Utils FFmpeg
# Create packages using plain tar. Please notice the revision number (r0), for there are
# no GoboLinux recipes to produce them yet.
# We also update the package list based on what's been compiled so far.
# GoboLinux' own DevelScripts package is used to ensure that packages built
# through JHALFS have metadata under Resources.
if [ ! -d "$BUILDDIR/Programs/DevelScripts" ]
then
InChroot Compile DevelScripts git || exit 1
SanityCheckProgram DevelScripts || exit 1
CreatePackageList "GoboLinux-Devel"
# Checkout the whole git recipe tree. It doesn't matter which recipe we
# ask to checkout at this point.
InChroot CheckoutRecipe --batch "ZLib"
else
# Make sure we have an up-to-date git recipe tree
pushd "$BUILDDIR/Data/Compile/Git/Recipes" > /dev/null
ProxySudo git pull
popd > /dev/null
fi
pushd "$BUILDDIR/Programs" > /dev/null
for appName in *
do
grep -q "^${appName}$" "$WORKDIR/BuildLiveCD/Data/Packages-List-GoboLinuxTools-Git" && continue
CreateGoboPackage "$appName"
done
popd > /dev/null
if [ -d "$WORKDIR/ISO/Output/ROLayer/Programs" ]
then
# Remove duplicated copies of GoboLinux specific packages inside ROLayer
pushd "$WORKDIR/ISO/Output/ROLayer/Programs" > /dev/null
for appName in AbsTK BootScripts Compile ConfigTools EnhancedSkel Installer LiveCD Scripts
do
if [ ! -d "$appName" ]
then
echo "Warning: package $appName is not installed (yet?)"
continue
fi
for appVersion in $(ls $appName/ | grep -v "Current\|Settings\|Variable" | sort -n)
do
echo "$appVersion" | grep -q "GIT" || continue
appVersionAlone=$(echo "$appVersion" | sed 's,[-A-Z],,g')
today=`date +%Y%m%d`
timeofday=`date +%H%M`
if [ $appVersionAlone -lt $today ] || [ $timeofday -gt 2358 ]
then
# Remove (potentially) old snapshot, and also make sure to remove the 'Current' symlink
sudo rm -rf -- "$appName/$appVersion"
sudo rm -f "$appName/Current"
fi
done
if [ ! -h "$appName/Current" ]
then
# Create Current symlink
sudo ln -sf $(ls $appName/ | grep -v "Current\|Settings\|Variable" | sort -n | tail -n1) "$appName/Current"
fi
done
popd > /dev/null
fi
# Create the ROLayer environment to force GoboLinux tools to be fetched
CreateISO rolayer rolayer
# Rehash certificates
sudo chroot "$WORKDIR/ISO/Output/ROLayer" c_rehash
# Fix permissions and file ownership
if [ -e "$WORKDIR/ISO/Output/ROLayer/Programs/DBus/Current/lib/dbus/dbus-daemon-launch-helper" ]
then
messagebus_gid=$(grep messagebus:x: "$WORKDIR/ISO/Output/ROLayer/System/Settings/group" | cut -d: -f3)
sudo chgrp $messagebus_gid "$WORKDIR/ISO/Output/ROLayer/Programs/DBus/Current/lib/dbus/dbus-daemon-launch-helper"
fi
if [ -d "$WORKDIR/ISO/Output/ROLayer/Data/Variable/empty" ]
then
sys_gid=$(grep sys:x: "$WORKDIR/ISO/Output/ROLayer/System/Settings/group" | cut -d: -f3)
sudo chgrp $sys_gid "$WORKDIR/ISO/Output/ROLayer/Data/Variable/empty"
fi
# Workaround for a nasty Aufs bug: it will not honor the owner of files from the upper
# layer (read-write) if they differ from that of the lower layer (read-only).
livecd_uid=$(grep polkitd:x: "$WORKDIR/ISO/Output/ROLayer/System/Settings/passwd" | cut -d: -f3)
chroot_uid=$(grep polkitd:x: "$BUILDDIR/System/Settings/passwd" | cut -d: -f3)
if [ "x$chroot_uid" != "x$livecd_uid" ]
then
sudo perl -pi -e "s/polkitd:x:$livecd_uid:/polkitd:x:$chroot_uid:/g" "$WORKDIR/ISO/Output/ROLayer/System/Settings/passwd"
fi
# Create/update Installer's Programs_du file
pushd "$WORKDIR/ISO/Output/ROLayer/Programs" > /dev/null
installerVersion=$(ls Installer/ | grep -v "Current\|Settings\|Variable" | sort -n | tail -n1)
duFile="$PWD/Installer/$installerVersion/share/Installer/Information/Programs_du.txt"
if [ ! -e "$duFile" ] || [ $(stat -c '%s' "$duFile") = 0 ]
then sudo du -s ./* | sudo tee "$duFile" > /dev/null
else UpdateProgramsDu "$duFile"
fi
popd > /dev/null
# Update programs descriptions
pushd "$WORKDIR/ISO/Output/ROLayer/Programs" > /dev/null
descriptionsFile="$PWD/Installer/$installerVersion/share/Installer/Information/ShortDescriptions.txt"
[ -e "$descriptionsFile" ] && UpdateProgramsDescriptions "$descriptionsFile"
popd > /dev/null
# Remove left-overs from SandboxInstall and any .git/.gitignore files
pushd "$WORKDIR/ISO/Output/ROLayer/Programs" > /dev/null
sudo rm -rf */*/.SandboxInstall_Root 2> /dev/null
sudo rm -rf */*/.git 2> /dev/null
sudo rm -f */*/.gitignore 2> /dev/null
popd > /dev/null
# Create the ISO
CreateISO squashfs iso
echo "Done!"