{
char value[32];
char *pos = NULL;
+ char *last = NULL;
const char *id = NULL;
img_info *cur = NULL;
(void)ctxt;
- if (argc < 1 || argc > 2)
+ if (argc < 1 || argc > 3)
{
return grub_error(GRUB_ERR_BAD_ARGUMENT, "Usage: %s {var}", cmd_raw_name);
}
if (g_fake_vlnk_src[0] && g_fake_vlnk_dst[0])
{
- grub_env_set(args[0], grub_strchr(g_fake_vlnk_src, '/'));
+ pos = grub_strchr(g_fake_vlnk_src, '/');
+ grub_env_set(args[0], pos);
if (argc > 1)
{
grub_snprintf(value, sizeof(value), "%llu", (ulonglong)(g_fake_vlnk_size));
grub_env_set(args[1], value);
}
+
+ if (argc > 2)
+ {
+ for (last = pos; *pos; pos++)
+ {
+ if (*pos == '/')
+ {
+ last = pos;
+ }
+ }
+ grub_env_set(args[2], last + 1);
+ }
goto end;
}
grub_snprintf(value, sizeof(value), "%llu", (ulonglong)(cur->size));
grub_env_set(args[1], value);
}
+
+ if (argc > 2)
+ {
+ grub_snprintf(value, sizeof(value), "%llu", (ulonglong)(cur->size));
+ grub_env_set(args[2], cur->name);
+ }
end:
g_svd_replace_offset = 0;
unset vt_system_id
unset vt_volume_id
- vt_chosen_img_path vt_chosen_path vt_chosen_size
+ vt_chosen_img_path vt_chosen_path vt_chosen_size vt_chosen_name
vt_parse_iso_volume "${vtoy_iso_part}${vt_chosen_path}" vt_system_id vt_volume_id vt_volume_space
if [ $vt_volume_space -ne $vt_chosen_size ]; then
elif vt_iso_vd_id_begin 0 1 "KolibriOS"; then
set vtMemDiskBoot=1
fi
- fi
+ fi
+
+ #For iKuai8 (<64MB)
+ if [ $vt_chosen_size -le 67108864 ]; then
+ if vt_str_begin "$vt_chosen_name" "iKuai"; then
+ set vtMemDiskBoot=1
+ fi
+ fi
fi
vt_iso_vd_id_clear
-
+
if [ "$grub_platform" = "pc" ]; then
if [ -n "$vtMemDiskBoot" ]; then