]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/scripts/backupiso
3 # FIXME: edit this lines before release
5 COREVER
=$
(cat /opt
/pakfire
/db
/core
/mine
)
12 echo "Your arch is $arch"
16 echo "Your arch is $arch"
19 echo "Arch is not supported"
24 URL
="https://downloads.ipfire.org/releases/ipfire-2.x/$IPFVER-core$COREVER/"
25 ISO
="ipfire-$IPFVER.$arch-full-core$COREVER.iso"
33 # Add EFI options when EFI image is present
34 if [ -e "${dir}/boot/isolinux/efiboot.img" ]; then
35 args
="${args} -eltorito-alt-boot -e boot/isolinux/efiboot.img -no-emul-boot"
39 mkisofs
-J -r -V "IPFire ${IPFVER} ${arch}" \
40 -b boot
/isolinux
/isolinux.bin
-no-emul-boot -boot-load-size 4 -boot-info-table \
41 -c boot
/isolinux
/boot.catalog \
42 ${args} ${dir} > ${output}
44 # Add DOS paritition table
45 if [ -e "${dir}/boot/isolinux/efiboot.img" ]; then
46 isohybrid
--uefi ${output}
55 echo usage
: $0 backup-file
61 mkdir
-p /var
/tmp
/backupiso
66 echo "Fetching ${URL}${ISO}"
67 wget
--quiet -c ${URL}${ISO}
70 echo "Fetching ${URL}${ISO}.md5"
71 wget
--quiet -O ${ISO}.md5 ${URL}${ISO}.md5
73 echo "Checking md5 of ${ISO}"
74 md5sum --status -c ${ISO}.md5
75 if [ $?
-eq 0 ] ||
[ $?
-eq 24 ]
80 echo "Fetching again ${URL}${ISO}"
81 wget
--quiet -O ${ISO} ${URL}${ISO}
82 echo "Checking again md5 of ${ISO}"
83 md5sum --status -c ${ISO}.md5
84 if [ $?
-eq 0 ] ||
[ $?
-eq 24 ]
89 echo "aborting backup because md5 mismatch"
95 echo "Remastering iso"
96 mkdir
-p backupiso.tmp.
${TS}
97 mount
-o loop
${ISO} backupiso.tmp.
${TS}
98 cp -pr backupiso.tmp.
${TS} backupiso.
${TS}
99 umount backupiso.tmp.
${TS}
100 rm -r backupiso.tmp.
${TS}
102 # Copy backup file to disk
103 cp "/var/ipfire/backup/${TS}.ipf" "backupiso.${TS}/backup.ipf"
106 touch "backupiso.${TS}/backup-${TS}.media"
108 echo "Running mkisofs"
109 makeiso backupiso.
${TS} $(basename ${ISO} .iso)-${TS}.iso
112 rm -rf backupiso.
${TS}