/*
 * Copyright 2024 Sony Corporation
 */

#include <string.h>
#include <common.h>
#include <utility.h>
#include <debug_impl.h>
#include "os_launch_version.h"

int sony_fstab_init(void)
{
	int ret = -1;
	int os_launch_version = 0;
	static const char fstab_suffix_key[] = "androidboot.fstab_suffix";
	char fstab_suffix_value[64] = { 0 };

	os_launch_version = get_os_launch_version();
	snprintf(fstab_suffix_value, sizeof(fstab_suffix_value) - 1, "%s=m6_%d", fstab_suffix_key, os_launch_version);
	ret = add_bootargs((char *)fstab_suffix_key, fstab_suffix_value, 0);
	if (ret != 0) {
		UBOOT_ERROR("failed to add bootargs %s.\n", fstab_suffix_value);
	}

	return ret;
}

