Skip to content

Instantly share code, notes, and snippets.

@lvzongting
Created October 27, 2014 03:28
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lvzongting/609b0d115ac32ca2ccf0 to your computer and use it in GitHub Desktop.
Save lvzongting/609b0d115ac32ca2ccf0 to your computer and use it in GitHub Desktop.
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。
Mac os 打印驱动 for linux
很多打印机只提供Mac os 打印驱动, 因为linux和Mac os 都使用的是标准的Unix 通用打印系统,所以提取Mac OS下的驱动ppd文件即可在linux使用打印机了。这里只是记录了一个方法,为了方便大家使用,我正在寻找一个网络空间可以将我提取出来的这些ppd驱动文件上传上去提供大家下载,可能还会提供一个便于检索的网页,如果大家有需要什么打印驱动的话,可以在这个gist后面留言。
当然,我也会积极的将这些文件进行打包,然后丢到各大软件源中。以方便大家的使用。
真心希望,linux这样好用的系统能快速发展,普及,能让更多的人感受到使用linux的快乐。
苹果系统 Mac OS 打印驱动用在linux系统。(通过cups 通用Unix打印系统ppd格式化文件驱动打印机)
以富士施乐(Fuji Xerox)打印机为例。
很多打印机比如FX普及型打印机,并不为linux提供ppd文件,即使和Mac OS系统是一致的。
现在,通过解包的方法来提取ppd文件,苹果的安装包是*.img 文件。这里提供了详细的步骤引导各位,从而节省各位的时间。
1、下载Mac OS打印驱动从官方网站上,比如富士施乐的网站下载ApeosPort IV打印机驱动,
2、安装dmg2img工具,可以通过AUR源下载安装,也可以直接下载源代码进行安装。
3、转换dmg文件为虚拟磁盘镜像
./dmg2img ~/Downloads/fxmacprnps1208am105iml.dmg /tmp/out.img
4、挂载刚才那个虚拟磁盘镜像
sudo mount -o loop /tmp/out.img /mnt/iso/
5、使用unix解压工具xar,来解压pkg苹果安装包文件
cp /mnt/iso/Fuji\ Xerox\ PS\ Plug-in\ Installer.pkg /tmp/
cd /tmp && mkdir fx && cd fxxar -xf ../Fuji\ Xerox\ PS\ Plug-in\ Installer.pkg
6、在解压的文件夹中,定位到pkg安装包的载荷,我们需要的ppd文件就在这个载荷当中。
cp ppd.pkg/Payload /tmp/Payload.cpio.gz
7、通过gunzip解压这个载荷文件,并解压其中的cpio压缩包
cd /tmpgunzip Payload.cpio.gzmkdir ppd && cd /tmp/ppdcpio -id < ../Payload.cpio
8、这样,你所需要的ppd文件就在这里了 Library/Printers/PPDs/Contents/Resources/:
$ls
Fuji Xerox 4112 PS.gz FX ApeosPort-IV C4475 PS.gz FX DocuCentre-IV 7080 PS.gz
Fuji Xerox 4127 PS.gz FX ApeosPort-IV C5570 PS.gz FX DocuCentre-IV C2260 PS.gz
Fuji Xerox D110 PS.gz FX ApeosPort-IV C5575 PS.gz FX DocuCentre-IV C2263 PS.gz
Fuji Xerox D125 PS.gz FX ApeosPort-IV C5580 PS.gz FX DocuCentre-IV C2265 PS.gz
Fuji Xerox D95 PS.gz FX ApeosPort-IV C6680 PS.gz FX DocuCentre-IV C2270 PS.gz
FX ApeosPort 350 I PS B.gz FX ApeosPort-IV C7780 PS.gz FX DocuCentre-IV C2275 PS.gz
FX ApeosPort 350 I PS.gz FX DocuCentre 450 I PS B.gz FX DocuCentre-IV C3370 PS.gz
(...)
以下为英文版。
Mac OS printers driver for linux (ppd)
For example: Fuji Xerox printers
The cheapskates at FX don't provide PPDs for Linux, even though they are the same as the MacOS files.
Now, opening apple's *.dmg files is surprisingly convoluted. Here's a step-by-step guide to, hopefully, save you some time.
1. Download the MacOS ApeosPort IV drivers from Fuji Xerox's site.
2. Download dmg2img (I downloaded the source code for dmg2img and ran `make' - you guys rock!).
3. Convert the dmg file into an image:
./dmg2img ~/Downloads/fxmacprnps1208am105iml.dmg /tmp/out.img
4. Mount the obtained image:
sudo mount -o loop /tmp/out.img /mnt/iso/
5. Use xar (yum install xar) to extract the pkg file:
cp /mnt/iso/Fuji\ Xerox\ PS\ Plug-in\ Installer.pkg /tmp/
cd /tmp && mkdir fx && cd fxxar -xf ../Fuji\ Xerox\ PS\ Plug-in\ Installer.pkg
6. Inside the extracted folders, locate and copy the Payload file with the PPDs:
cp ppd.pkg/Payload /tmp/Payload.cpio.gz
7. Gunzip the file and extract the cpio archive:
cd /tmpgunzip Payload.cpio.gzmkdir ppd && cd /tmp/ppdcpio -id < ../Payload.cpio
8. Voilà! your PPD files are in Library/Printers/PPDs/Contents/Resources/:
$ls
Fuji Xerox 4112 PS.gz FX ApeosPort-IV C4475 PS.gz FX DocuCentre-IV 7080 PS.gz
Fuji Xerox 4127 PS.gz FX ApeosPort-IV C5570 PS.gz FX DocuCentre-IV C2260 PS.gz
Fuji Xerox D110 PS.gz FX ApeosPort-IV C5575 PS.gz FX DocuCentre-IV C2263 PS.gz
Fuji Xerox D125 PS.gz FX ApeosPort-IV C5580 PS.gz FX DocuCentre-IV C2265 PS.gz
Fuji Xerox D95 PS.gz FX ApeosPort-IV C6680 PS.gz FX DocuCentre-IV C2270 PS.gz
FX ApeosPort 350 I PS B.gz FX ApeosPort-IV C7780 PS.gz FX DocuCentre-IV C2275 PS.gz
FX ApeosPort 350 I PS.gz FX DocuCentre 450 I PS B.gz FX DocuCentre-IV C3370 PS.gz
(...)
Enjoy.
@lau-jay
Copy link

lau-jay commented Aug 4, 2015

mount的时候会报错,貌似因为mac标识的问题

@zhezh
Copy link

zhezh commented Jan 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment