Skip to content
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
5 changes: 4 additions & 1 deletion sonic_installer/bootloader/onie.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def get_current_image(self):
cmdline = open('/proc/cmdline', 'r')
current = re.search(r"loop=(\S+)/fs.squashfs", cmdline.read()).group(1)
cmdline.close()
return current.replace(IMAGE_DIR_PREFIX, IMAGE_PREFIX)
# Replace only the first occurrence, since we are using branch name as
# tagging for version, IMAGE_PREFIX in the name of the branch may be
# replaced as well.
return current.replace(IMAGE_DIR_PREFIX, IMAGE_PREFIX, 1)

def get_binary_image_version(self, image_path):
"""returns the version of the image"""
Expand Down