-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakeiso
More file actions
executable file
·47 lines (35 loc) · 1.25 KB
/
Copy pathmakeiso
File metadata and controls
executable file
·47 lines (35 loc) · 1.25 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
#!/bin/bash
# ubicaciones del mbr de isolinux
mbrs=(/usr/lib/syslinux/bios/isohdpfx.bin /usr/lib/ISOLINUX/isohdpfx.bin /usr/lib/syslinux/isohdpfx.bin)
for mbr_ in ${mbrs[@]}; do
test -f "${mbr_}" && mbr="${mbr_}"
done
if test -z "${mbr}"; then
echo "No se puede encontrar el MBR para la ISO, instalá isolinux o syslinux"
exit 1
fi
umount jail/proc
umount jail/var/cache/apt/archives
rm -v iso/casper/filesystem.squashfs jail/etc/mtab
rm -rv jail/tmp/*
cp -vf splash.png iso/isolinux/
cp -vf isolinux.cfg iso/isolinux/
if ! mksquashfs jail iso/casper/filesystem.squashfs ; then
echo "No se pudo crear filesystem.squashfs"
exit 1
fi
pushd iso
chroot ../jail dpkg-query -W --showformat='${Package} ${Version}\n' > casper/filesystem.manifest
cp casper/filesystem.manifest{,-desktop}
sed -i -e '/ubiquity/d' -e '/casper/d' casper/filesystem.manifest-desktop
md5sum casper/* > md5sum.txt
printf $(du -sx --block-size=1 ../jail | cut -f1) > casper/filesystem.size
xorriso -as genisoimage \
-D -r -J -joliet-long -l -V "$1" \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-iso-level 3 -no-emul-boot -partition_offset 16 -boot-load-size 4 -boot-info-table \
-isohybrid-mbr "${mbr}" \
-o ../"${1// /-}"-$(date +%Y.%m.%d).iso .
popd
exit $?