function create_enviroment() {
echo -n "Installation of packages needed to build immudex...";
- sudo apt update >> ~/immudex_build.log 2>&1;
+ sudo apt update >> immudex_build.log 2>&1;
sudo apt install -y debootstrap squashfs-tools xorriso isolinux syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools >> immudex_build.log 2>&1;
if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi
}
#Copying chroot script to chroot directory:
echo -n "Copying chroot script to chroot directory...";
-sudo cp -vv ${HOME}/immudex-testing/versions/base.sh ${HOME}/build/immudex-testing/${arch}/chroot >> ~/immudex_build.log 2>&1;
+sudo cp -vv ${HOME}/immudex-testing/versions/base.sh ${HOME}/build/immudex-testing/${arch}/chroot >> immudex_build.log 2>&1;
if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi
#Executing chroot script, at least i trying:
if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi
#Creating additional EFI partition:
+oldcwd=$(pwd);
cd ${HOME}/build/immudex-testing/${arch}/staging/boot/grub;
echo -n "Creating addtitional EFI partition...";
-dd if=/dev/zero bs=1M of=efiboot.img count=20 >> immudex_build.log 2>&1;
+dd if=/dev/zero bs=1M of=efiboot.img count=20 >> ${oldcwd}/immudex_build.log 2>&1;
sudo mkfs.vfat efiboot.img >> immudex_build.log 2>&1;
-echo "-==Creating MS-DOS directory: $(date)==-" >> immudex_build.log;
-sudo mmd -i efiboot.img efi efi/boot >> immudex_build.log 2>&1;
-sudo mcopy -vi efiboot.img ${HOME}/build/immudex-testing/${arch}/staging/EFI/boot/bootx64.efi ::efi/boot >> immudex_build.log 2>&1;
+echo "-==Creating MS-DOS directory: $(date)==-" >> ${oldcwd}/immudex_build.log;
+sudo mmd -i efiboot.img efi efi/boot >> ${oldcwd}/immudex_build.log 2>&1;
+sudo mcopy -vi efiboot.img ${HOME}/build/immudex-testing/${arch}/staging/EFI/boot/bootx64.efi ::efi/boot >> ${oldcwd}/immudex_build.log 2>&1;
if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi
#Create iso image:
+cd $oldcwd;
echo -n "Creating iso image...";
xorriso as mkisofs -iso-level 3 -o "immudex-testing${arch}.iso" -full-iso9660-filenames -volid "immudex-testing${arch}" -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -eltorito-boot isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table --eltorito-catalog isolinux/isolinux.cat -eltorito-alt-boot -e /boot/grub/efiboot.img -no-emul-boot -isohybrid-gpt-basdat -append_partition 2 0xef ${HOME}/build/immudex-testing/${arch}/staging/boot/grub/efiboot.img ${HOME}/build/immudex-testing/${arch}/staging >> immudex_build.log 2>&1;
if [ $? -eq 0 ]; then echo -e "[ ${GREEN}OK${ENDCOLOR} ]"; fi