Closed
Bug 1197325
Opened 9 years ago
Closed 7 years ago
Figure out how to set volume icon for DMG in Linux->Mac cross compiles
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox54 fixed)
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: ted, Assigned: Callek)
References
Details
Attachments
(3 files)
Right now we call `SetFile -a C <path>` to set an HFS+ attribute on the root of the DMG to tell it to use a custom icon. On Linux we don't have that command, and we also don't have an HFS+ filesystem lying around to run it on, so we'll have to figure something else out.
Reporter | ||
Comment 1•9 years ago
|
||
I think we can do this by formatting a hfs+ disk image locally and then using the "hfs" tool from libdmg-hfsplus to manipulate the image: dd if=/dev/zero of=/tmp/file.hfs bs=1M count=1 mkfs.hfsplus -v Test /tmp/file.hfs ./hfs/hfsplus /tmp/file.hfs add /build/mozilla-central/browser/branding/nightly/disk.icns .VolumeIcon.icns ./hfs/hfsplus /tmp/file.hfs attr / C ./dmg/dmg dmg /tmp/file.hfs /tmp/file.dmg ...gives me a DMG with a volume icon that works fine in OS X.
Reporter | ||
Comment 3•7 years ago
|
||
I poked around at this recently while I was sorting out the commands for bug 1324834. The bits from comment 1 still basically work, but this is the log I wound up with: dd if=/dev/zero of=temp.hfs bs=1M count=205 mkfs.hfsplus -v Test temp.hfs hfsplus temp.hfs addall buildbot2 hfsplus temp.hfs attr / C hfsplus temp.hfs symlink '/ ' /Applications dmg build temp.hfs compressed.dmg Notes: 1) The desktop-build image doesn't have mkfs.hfsplus, and there's no package available with that binary for CentOS 6. I was able to get the source from http://pkgs.fedoraproject.org/repo/pkgs/hfsplus-tools/diskdev_cmds-540.1.linux3.tar.gz/0435afc389b919027b69616ad1b05709/diskdev_cmds-540.1.linux3.tar.gz , and then in a desktop-build container run `yum install clang` and `make` in the unpacked source directory to generate `newfs_hfs.tproj/newfs_hfs`, which is the same binary as mkfs.hfsplus. We could just put that in tooltool. 2) The `hfsplus addall` command does not handle symlinks correctly. I briefly looked at fixing that but decided I didn't want to go down that route. Not creating the symlink in the stage dir, but using `hfsplus symlink` does seem to work properly. We'd have to change the code here to accomodate: https://dxr.mozilla.org/mozilla-central/rev/80eac484366ad881c6a10bf81e8d9b8f7a676c75/python/mozbuild/mozpack/dmg.py#114 3) I changed `dmg dmg file.hfs file.dmg` to `dmg build file.hfs file.dmg`. The latter seems to create a DMG that more closely resembles what we get out of OS X.
Reporter | ||
Comment 4•7 years ago
|
||
Oh, I forgot 4) The `hfsplus` command doesn't seem to be able to dynamically expand the disk image when doing `addall`, which is a PITA. Note that the `dd` command makes a 205MB file to start with. We'll probably have to sum up the size of all the files in the staged directory and then use a size slightly larger than that. I wish the hfsplus tool actually worked well. :-/
Comment 5•7 years ago
|
||
I can take a look after 'make check' goes away. If there's someone else available to work on this, I'd be happy to help provide guidance in the meantime.
Flags: needinfo?(mshal)
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 8•7 years ago
|
||
Callek is working on this.
Assignee: nobody → bugspam.Callek
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Reporter | ||
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8832186 [details] Bug 1197325 - Generate mkfs.hfsplus. https://reviewboard.mozilla.org/r/108514/#review110606 Thanks for putting this all in-tree! ::: build/unix/build-hfsplus/build-hfsplus.sh:8 (Diff revision 2) > +set -x > + > +hfplus_version=540.1.linux3 > +md5sum=0435afc389b919027b69616ad1b05709 > +filename=diskdev_cmds-${hfplus_version}.tar.gz > +make_flags='-j12' I usually like `-j$(getconf _NPROCESSORS_ONLN)` ::: build/unix/build-hfsplus/build-hfsplus.sh:41 (Diff revision 2) > +make $make_flags || exit 1 > +cd .. > + > +mkdir hfsplus-tools > +cp hfsplus-source/newfs_hfs.tproj/newfs_hfs hfsplus-tools/newfs_hfs > +cp hfsplus-source/fsck_hfs.tproj/fsck_hfs hfsplus-tools/fsck_hfs We don't actually need fsck for anything. ::: taskcluster/scripts/misc/build-hfsplus-linux.sh:4 (Diff revision 2) > +#!/bin/bash > +set -x -e -v > + > +# This script is for building binutils for Linux. s/binutils/hfsplus/
Attachment #8832186 -
Flags: review?(ted) → review+
Reporter | ||
Comment 13•7 years ago
|
||
mozreview-review |
Comment on attachment 8832896 [details] Bug 1197325 - Remove now unused genisoimage. https://reviewboard.mozilla.org/r/109148/#review110608
Attachment #8832896 -
Flags: review?(ted) → review+
Reporter | ||
Comment 14•7 years ago
|
||
mozreview-review |
Comment on attachment 8832187 [details] Bug 1197325 -- Set volume icon for DMG in Linux->Mac cross compiles. https://reviewboard.mozilla.org/r/108516/#review110610 This looks great, thanks! I was a little worried that having to do the symlink after creating the hfs volume would make things painful, but I like how you moved things around to make that work. ::: moz.configure:257 (Diff revision 2) > def extra_programs(target): > if target.kernel == 'Darwin': > return namespace( > DSYMUTIL=('dsymutil', 'llvm-dsymutil'), > GENISOIMAGE=('genisoimage',), > + MKFSHFS=('newfs_hfs',), This can also be named `mkfs.hfsplus`, so you could list that here. ::: python/mozbuild/mozpack/dmg.py:43 (Diff revision 2) > 'Set HFS attributes of dir to use a custom icon' > if not is_linux: > - #TODO: bug 1197325 - figure out how to support this on Linux > subprocess.check_call(['SetFile', '-a', 'C', dir]) > + else: > + import buildconfig I think you could just move the `import buildconfig` to the top-level of the script. I'm not sure why I had it where it is currently anyway.
Attachment #8832187 -
Flags: review?(ted) → review+
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 27•7 years ago
|
||
Pushed by Callek@gmail.com: https://hg.mozilla.org/integration/autoland/rev/55a8ad127517 Generate mkfs.hfsplus. r=ted https://hg.mozilla.org/integration/autoland/rev/b5ac3fa0bbe7 Set volume icon for DMG in Linux->Mac cross compiles. r=ted https://hg.mozilla.org/integration/autoland/rev/158233bce738 Remove now unused genisoimage. r=ted
Comment 28•7 years ago
|
||
Backed out in https://hg.mozilla.org/integration/autoland/rev/c028fc346ac9 for making that Cc(hfsplus) job just a little too bright a shade of red, https://treeherder.mozilla.org/logviewer.html#?job_id=75007712&repo=autoland
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 32•7 years ago
|
||
Pushed by Callek@gmail.com: https://hg.mozilla.org/integration/autoland/rev/f9f33149db8a Generate mkfs.hfsplus. r=ted https://hg.mozilla.org/integration/autoland/rev/ab096d7edae3 Set volume icon for DMG in Linux->Mac cross compiles. r=ted https://hg.mozilla.org/integration/autoland/rev/e4c86796a079 Remove now unused genisoimage. r=ted
Comment 33•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f9f33149db8a https://hg.mozilla.org/mozilla-central/rev/ab096d7edae3 https://hg.mozilla.org/mozilla-central/rev/e4c86796a079
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•