Lines 1843-1851
Link Here
|
1843 |
gchar *src = NULL; |
1843 |
gchar *src = NULL; |
1844 |
IsoNode *node = NULL; |
1844 |
IsoNode *node = NULL; |
1845 |
IsoDir *dir = NULL; |
1845 |
IsoDir *dir = NULL; |
1846 |
int r; |
1846 |
int r, skipped; |
1847 |
gchar *basename; |
1847 |
gchar *basename; |
1848 |
|
1848 |
|
|
|
1849 |
skipped = 0; |
1849 |
gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_TYPE, &type, |
1850 |
gtk_tree_model_get (model, iter, DATA_COMPOSITION_COLUMN_TYPE, &type, |
1850 |
DATA_COMPOSITION_COLUMN_CONTENT, &name, DATA_COMPOSITION_COLUMN_PATH, &src, -1); |
1851 |
DATA_COMPOSITION_COLUMN_CONTENT, &name, DATA_COMPOSITION_COLUMN_PATH, &src, -1); |
1851 |
|
1852 |
|
Lines 1858-1866
Link Here
|
1858 |
* then its owner will be set to root:root. Not sure what a better |
1859 |
* then its owner will be set to root:root. Not sure what a better |
1859 |
* default could be, so I'll just leave it like that. */ |
1860 |
* default could be, so I'll just leave it like that. */ |
1860 |
} else { |
1861 |
} else { |
1861 |
/* something existing on the filesystem, creating a node |
1862 |
gchar * src_name=NULL; |
1862 |
* will copy its attributes */ |
1863 |
src_name=strrchr(src,'/'); |
1863 |
r = iso_tree_add_node (image, parent, src, &node); |
1864 |
// do not include /isolinux/boot.cat into bootable cd (will be created by iso_image_set_boot_image) |
|
|
1865 |
if( (NULL != src_name && 0 == strcmp("/boot.cat",src_name)) |
1866 |
&& (0==strcmp("isolinux",iso_node_get_name((IsoNode *)parent))) |
1867 |
// is node isolinux a sub node of root node? |
1868 |
&& (iso_node_get_parent((IsoNode *)parent)==iso_node_get_parent((IsoNode *)iso_node_get_parent((IsoNode *)parent))) |
1869 |
) { |
1870 |
if (xfburn_settings_get_boolean ("is-bootable", TRUE)) { |
1871 |
skipped = 1; |
1872 |
r = 0; |
1873 |
printf("info: bootable cd: /isolinux/boot.cat will be replaced by newly created version.\n"); |
1874 |
} else |
1875 |
r = iso_tree_add_node (image, parent, src, &node); |
1876 |
} else { |
1877 |
/* something existing on the filesystem, creating a node |
1878 |
* will copy its attributes */ |
1879 |
r = iso_tree_add_node (image, parent, src, &node); |
1880 |
} |
1864 |
} |
1881 |
} |
1865 |
|
1882 |
|
1866 |
if (r < 0) { |
1883 |
if (r < 0) { |
Lines 1857-1863
Link Here
|
1857 |
basename = g_path_get_basename (src); |
1874 |
basename = g_path_get_basename (src); |
1858 |
|
1875 |
|
1859 |
/* check if the file has been renamed */ |
1876 |
/* check if the file has been renamed */ |
1860 |
if (strcmp (basename, name) != 0) { |
1877 |
if (skipped == 0 && strcmp (basename, name) != 0) { |
1861 |
/* rename the iso_node */ |
1878 |
/* rename the iso_node */ |
1862 |
r = iso_node_set_name (node, name); |
1879 |
r = iso_node_set_name (node, name); |
1863 |
|
1880 |
|
Lines 1928-1933
Link Here
|
1928 |
fill_image_with_composition (model, image, iso_image_get_root (image), &iter); |
1945 |
fill_image_with_composition (model, image, iso_image_get_root (image), &iter); |
1929 |
} |
1946 |
} |
1930 |
|
1947 |
|
|
|
1948 |
// check if boot catalog, file boot_cat, exists in newly created iso image: |
1949 |
// already done in fill_image_with_composition |
1950 |
|
1951 |
if (xfburn_settings_get_boolean ("is-bootable", TRUE)) { |
1952 |
/* adds El-Torito boot info. Tuned for isolinux */ |
1953 |
ElToritoBootImage *bootimg; |
1954 |
int result; |
1955 |
gchar *boot_folder="/isolinux"; // path in image (NOT in /boot) |
1956 |
gchar *boot_foldername=boot_folder+1; |
1957 |
// do not change /isolinux/boot.cat (hardcoded into fill_image_with_composition) |
1958 |
gchar *boot_cat="/isolinux/boot.cat"; // path in image (NOT in /boot) |
1959 |
gchar *boot_catname="boot.cat"; |
1960 |
gchar *boot_img="/isolinux/isolinux.bin"; // path in image (NOT in /boot) |
1961 |
gchar *boot_imgname="isolinux.bin"; |
1962 |
gchar *boot_img_src="/usr/share/xfburn/isolinux.bin"; // path on harddisk |
1963 |
IsoDir *dir_isolinux = NULL; |
1964 |
IsoNode *node_isolinux = NULL; |
1965 |
|
1966 |
// check if folder /isolinux exists in image; if not, add folder |
1967 |
// result = iso_tree_path_to_node(image, "/isolinux", &node_isolinux); |
1968 |
result = iso_dir_get_node(iso_image_get_root (image), boot_foldername, &node_isolinux); |
1969 |
if (result <= 0) { |
1970 |
if (result < 0) { |
1971 |
printf ("Error looking up %s in iso image %X\n", boot_folder, result); |
1972 |
} |
1973 |
if (node_isolinux && iso_node_get_type(node_isolinux) != LIBISO_DIR) { |
1974 |
printf ("Error, not a directory, %s in iso image %X\n", boot_folder, result); |
1975 |
} |
1976 |
// try to add |
1977 |
result = iso_tree_add_new_dir (iso_image_get_root (image), boot_foldername, &dir_isolinux); |
1978 |
if (result < 0) { |
1979 |
printf ("Error adding directory %s %X\n", boot_folder, result); |
1980 |
} |
1981 |
} else { |
1982 |
if (node_isolinux && iso_node_get_type(node_isolinux) == LIBISO_DIR) { |
1983 |
dir_isolinux=(IsoDir *)node_isolinux; |
1984 |
} else { |
1985 |
printf ("Error looking up %s in iso image %X\n", boot_folder, result); |
1986 |
} |
1987 |
} |
1988 |
// check if file boot_img exists in image; if not, add file |
1989 |
result = iso_dir_get_node(dir_isolinux, boot_imgname, &node_isolinux); |
1990 |
if (result <= 0) { |
1991 |
if (result < 0) { |
1992 |
printf ("Error looking up %s in iso image %X\n", boot_img, result); |
1993 |
} else { |
1994 |
if (node_isolinux && iso_node_get_type(node_isolinux) != LIBISO_FILE) { |
1995 |
printf ("Error, not a file, %s in iso image %X\n", boot_img, result); |
1996 |
} |
1997 |
} |
1998 |
// try to add |
1999 |
result = iso_tree_add_node (image, dir_isolinux, boot_img_src, &node_isolinux); |
2000 |
if (result < 0) { |
2001 |
printf ("Error adding %s to folder %s/ %X\n", boot_img_src, boot_folder, result); |
2002 |
} |
2003 |
} else { |
2004 |
if (node_isolinux && iso_node_get_type(node_isolinux) != LIBISO_FILE) { |
2005 |
printf ("Error, not a file, %s in iso image %X\n", boot_img, result); |
2006 |
} |
2007 |
} |
2008 |
result = iso_image_set_boot_image(image, boot_img, ELTORITO_NO_EMUL, |
2009 |
boot_cat, &bootimg); |
2010 |
if (result < 0) { |
2011 |
printf ("Error adding boot image %X (does file %s exist?)\n", result, boot_img); |
2012 |
} else { |
2013 |
el_torito_set_load_size(bootimg, 4); |
2014 |
el_torito_patch_isolinux_image(bootimg); |
2015 |
} |
2016 |
} |
2017 |
|
1931 |
return image; |
2018 |
return image; |
1932 |
} |
2019 |
} |
1933 |
|
2020 |
|