Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Jammy (22.04) xubuntu image #144

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion auto_forensicate/stamp/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ def BasePathElements(self, stamp):

return remote_path_elems

def GetStamp(self):
def GetStamp(self, graphical=True):
"""Generates the "stamp" metadata to upload.

This contains information such as when the script is run, and the host's ID.

Args:
graphical(bool): Set to False if requesting the Stamp in an non-graphical
environment.

Returns:
BaseStamp: the content of the stamp.
Expand Down
45 changes: 30 additions & 15 deletions tools/remaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
# You should end up with a file called gift-image-$(date +%Y%m%d).img, unless
# you specify the destination with --image
#
# It requires the following packages, on ubuntu:
# gdisk genisoimage grub-efi-amd64-bin syslinux syslinux-utils
# initramfs-tools-core
# It requires the following packages, on ubuntu 22.04:
# gdisk xorriso grub-efi-amd64-bin initramfs-tools-core
#
# gdisk and grub-efi-amd64-bin are used for the EFI booting part.
#
Expand Down Expand Up @@ -387,17 +386,35 @@ function pack_iso {
local -r source_iso_dir=$1
local -r target_iso_file=$2

readonly mbr="${FLAGS_SOURCE_ISO}.mbr"
readonly efi="${FLAGS_SOURCE_ISO}.efi"

# Extract the MBR template
dd if="$FLAGS_SOURCE_ISO" bs=1 count=446 of="$mbr"

# Extract EFI partition image
readonly skip=$(/sbin/fdisk -l "$FLAGS_SOURCE_ISO" | fgrep '.iso2 ' | awk '{print $2}')
readonly size=$(/sbin/fdisk -l "$FLAGS_SOURCE_ISO" | fgrep '.iso2 ' | awk '{print $4}')
dd if="$FLAGS_SOURCE_ISO" bs=512 skip="$skip" count="$size" of="$efi"

msg "Packing the new ISO from ${source_iso_dir} to ${target_iso_file}"
sudo genisoimage -o "${target_iso_file}" \
-b "isolinux/isolinux.bin" \
-c "isolinux/boot.cat" \
-p "GiftStick" \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-V "GIFTSTICK-${TODAY}" -cache-inodes -r -J -l \
-x "${source_iso_dir}"/casper/manifest.diff \
-joliet-long \

sudo xorriso -as mkisofs \
-r -V "GIFTSTICK-${TODAY}" -J -joliet-long -l \
-iso-level 3 \
-partition_offset 16 \
--grub2-mbr "$mbr" \
--mbr-force-bootable \
-append_partition 2 0xEF "$efi" \
-appended_part_as_gpt \
-c /boot.catalog \
-b /boot/grub/i386-pc/eltorito.img \
-no-emul-boot -boot-load-size 4 -boot-info-table --grub2-boot-info \
-eltorito-alt-boot \
-e '--interval:appended_partition_2:all::' \
-no-emul-boot \
-o "${target_iso_file}" \
"${source_iso_dir}"
sudo isohybrid "${target_iso_file}"
}

# Unpack a LiveCD iso file to a directory.
Expand Down Expand Up @@ -757,11 +774,9 @@ function main {
# checking for package instalation status.
set +e
check_packages gdisk
check_packages genisoimage
check_packages xorriso
check_packages grub-efi-amd64-bin
check_packages squashfs-tools
check_packages syslinux
check_packages syslinux-utils
set -e

parse_arguments "$@"
Expand Down