summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/mkhybrid
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-10-01 17:05:06 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-10-01 17:05:06 +0000
commit9712a0af728c990877f5890334544693ff3f7f35 (patch)
tree7f9ebf1a2b7983181ba60cb0a8f9f0fa6a3320a0 /gnu/usr.sbin/mkhybrid
parente2e357a54c8b18d23c58e203b3f0d3f15d4ad597 (diff)
Merge support for hfs_bless from the newer version of mkisofs into this
version of mkhybrid. Allows creation of bootable CDs on apple machines.
Diffstat (limited to 'gnu/usr.sbin/mkhybrid')
-rw-r--r--gnu/usr.sbin/mkhybrid/src/libhfs_iso/hfs.c14
-rw-r--r--gnu/usr.sbin/mkhybrid/src/mkisofs.c11
-rw-r--r--gnu/usr.sbin/mkhybrid/src/mkisofs.h3
-rw-r--r--gnu/usr.sbin/mkhybrid/src/volume.c12
4 files changed, 38 insertions, 2 deletions
diff --git a/gnu/usr.sbin/mkhybrid/src/libhfs_iso/hfs.c b/gnu/usr.sbin/mkhybrid/src/libhfs_iso/hfs.c
index bcf8997b41e..bf4e6be5b8f 100644
--- a/gnu/usr.sbin/mkhybrid/src/libhfs_iso/hfs.c
+++ b/gnu/usr.sbin/mkhybrid/src/libhfs_iso/hfs.c
@@ -2057,4 +2057,18 @@ hfs_set_drAllocPtr(hfsfile *file, unsigned short drAllocPtr, int size)
return result;
}
+
+/*
+ * NAME: hfs->vsetbless()
+ * DESCRIPTION: set blessed folder
+ *
+ * adapted from vsetattr() from v3.2.6
+ */
+void
+hfs_vsetbless(hfsvol *vol, unsigned long cnid)
+{
+ vol->mdb.drFndrInfo[0] = cnid;
+
+ vol->flags |= HFS_UPDATE_MDB;
+}
#endif /* APPLE_HYB */
diff --git a/gnu/usr.sbin/mkhybrid/src/mkisofs.c b/gnu/usr.sbin/mkhybrid/src/mkisofs.c
index 130d38c8741..99b78e16eb4 100644
--- a/gnu/usr.sbin/mkhybrid/src/mkisofs.c
+++ b/gnu/usr.sbin/mkhybrid/src/mkisofs.c
@@ -20,7 +20,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-static char rcsid[] ="$Id: mkisofs.c,v 1.2 2001/04/15 00:48:35 deraadt Exp $";
+static char rcsid[] ="$Id: mkisofs.c,v 1.3 2001/10/01 17:05:05 drahn Exp $";
/* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 12/3/99 */
@@ -147,6 +147,8 @@ char *deftype = DEFTYPE; /* default Apple TYPE */
char *defcreator = DEFCREATOR; /* default Apple CREATOR */
char *trans_tbl = "TRANS.TBL"; /* default name for translation table */
char *hfs_volume_id = NULL; /* HFS volume ID */
+char *hfs_bless = NULL; /* name of folder to 'bless' (System Folder) */
+
#endif /* APPLE_HYB */
struct rcopts{
@@ -249,6 +251,8 @@ struct ld_option
#define OPTION_I_LIST 242
#define OPTION_J_LIST 243
#define OPTION_X_LIST 244
+
+#define OPTION_HFS_BLESS 245
#endif /* APPLE_HYB */
static const struct ld_option ld_options[] =
@@ -389,6 +393,8 @@ static const struct ld_option ld_options[] =
'\0', "TABLE_NAME", "translation table file name", ONE_DASH },
{ {"hfs-volid", required_argument, NULL, OPTION_HFS_VOLID},
'\0', "HFS_VOLID", "Volume name for the HFS partition", ONE_DASH },
+ {{"hfs-bless", required_argument, NULL, OPTION_HFS_BLESS},
+ '\0', "FOLDER_NAME", "Name of Folder to be blessed", ONE_DASH},
{ {"cap", no_argument, NULL, OPTION_CAP},
'\0', NULL, "Look for AUFS CAP Macintosh files", TWO_DASHES },
{ {"netatalk", no_argument, NULL, OPTION_NETA},
@@ -1070,6 +1076,9 @@ int FDECL2(main, int, argc, char **, argv){
case OPTION_HFS_VOLID:
hfs_volume_id = optarg;
break;
+ case OPTION_HFS_BLESS:
+ hfs_bless = optarg;
+ break;
/* Mac/Unix types to include */
case OPTION_CAP:
hfs_select |= DO_CAP;
diff --git a/gnu/usr.sbin/mkhybrid/src/mkisofs.h b/gnu/usr.sbin/mkhybrid/src/mkisofs.h
index 7856f4b4654..6afe66e8c09 100644
--- a/gnu/usr.sbin/mkhybrid/src/mkisofs.h
+++ b/gnu/usr.sbin/mkhybrid/src/mkisofs.h
@@ -20,7 +20,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/*
- * $Id: mkisofs.h,v 1.1 2000/10/10 20:40:19 beck Exp $
+ * $Id: mkisofs.h,v 1.2 2001/10/01 17:05:05 drahn Exp $
*/
/* APPLE_HYB James Pearson j.pearson@ge.ucl.ac.uk 12/3/99 */
@@ -321,6 +321,7 @@ extern char *hfs_volume_id; /* HFS volume ID */
#define ASSOC_FLAG 4 /* ISO flag for "associated" file */
#define MAP_LAST 1 /* process magic then map file */
#define MAG_LAST 2 /* process map then magic file */
+extern char *hfs_bless; /* name of folder to 'bless' (System Folder) */
#endif /* APPLE_HYB */
/* tree.c */
diff --git a/gnu/usr.sbin/mkhybrid/src/volume.c b/gnu/usr.sbin/mkhybrid/src/volume.c
index 5f0a8f0ebfb..056e8e3fc19 100644
--- a/gnu/usr.sbin/mkhybrid/src/volume.c
+++ b/gnu/usr.sbin/mkhybrid/src/volume.c
@@ -521,6 +521,18 @@ int FDECL2(copy_to_mac_vol, hfsvol *, vol, struct directory *, node)
s_entry->whole_name);
}
+ /* see if we need to "bless" this folder */
+ if (hfs_bless && strcmp(s_entry->whole_name, hfs_bless) == 0) {
+ hfs_stat(vol, ent->name, ent);
+ hfs_vsetbless(vol, ent->cnid);
+ if (verbose > 0) {
+ fprintf(stderr, "Blessing %s (%s)\n",
+ ent->name, s_entry->whole_name);
+ }
+ /* stop any further checks */
+ hfs_bless = NULL;
+ }
+
/* change to sub-folder */
if (hfs_chdir(vol, ent->name) < 0)
return(-1);