-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #806
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. line 16 ~ 24 are in installer/x86_64/install.sh. can you try to embed the logic into install.sh https://github.com/Azure/sonic-buildimage/blob/master/installer/x86_64/install.sh#L411 |
||
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" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to have a grub directory in this sonic partition, so that you can chain the grub in ftos to grub in sonic. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is much easier for later sonic-to-sonic upgrade scenario. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how can this script work? it does not have kernel, squashfs???