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

Script to create the 8GB blob that can be used in lieu of onie installer #802

Closed
wants to merge 1 commit into from
Closed
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
34 changes: 34 additions & 0 deletions scripts/dell/build_dd_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
PLATFORM=dell_broadcom
IMAGE=image-HEAD

#remove older image
rm -f target/${PLATFORM}_8GB_dd.img.gz

echo -e "\n# Creating ${PLATFORM}_8GB_dd.img..."
fallocate -l 8G ${PLATFORM}_8GB_dd.img
mkfs.ext4 ${PLATFORM}_8GB_dd.img

echo -e "\n# Mounting ${PLATFORM}_8GB_dd.img on ${PLATFORM}_mount..."
mkdir ${PLATFORM}_mount
mount -t auto -o loop ${PLATFORM}_8GB_dd.img ${PLATFORM}_mount

echo -e "\n# Extracting tarballs into ${PLATFORM}_mount..."
mkdir -p ${PLATFORM}_mount/${IMAGE}/docker
unzip -o fs.zip -x dockerfs.tar.gz -d ${PLATFORM}_mount/${IMAGE}
unzip -op fs.zip dockerfs.tar.gz | tar xz --numeric-owner -f - -C ${PLATFORM}_mount/${IMAGE}/docker

echo -e "\n# Creating 4GB logger..."
mkdir -p ${PLATFORM}_mount/disk-img
dd if=/dev/zero of=${PLATFORM}_mount/disk-img/var-log.ext4 count=8388608
mkfs.ext4 -q ${PLATFORM}_mount/disk-img/var-log.ext4 -F

echo -e "\n# Unmounting and removing ${PLATFORM}_mount..."
umount ${PLATFORM}_mount
rmdir ${PLATFORM}_mount

echo -e "\n# Creating ${PLATFORM}_8GB_dd.img.gz..."
gzip ${PLATFORM}_8GB_dd.img
mv ${PLATFORM}_8GB_dd.img.gz target
echo -e "\n# Done. DD image is under target/${PLATFORM}_8GB_dd.img.gz\n"