How to reduce rpm size using rpmbuild

编译出来的rpm就是比deb大,就去研究如何减少rpm的大小
关键还是在SPECS文件上,要改变默认的压缩方式,在%prep后面加上这句就行了:
%define _binary_payload w7.xzdio
# Compression type and level for source/binary package payloads.
# “w9.gzdio”: gzip level 9 (default).
# “w9.bzdio”: bzip2 level 9.
# “w7.xzdio”: xz level 7, xz’s default.
# “w7.lzdio”: lzma-alone level 7, lzma’s default

 

参考:
https://stackoverflow.com/questions/9292243/rpmbuild-change-compression-format

[win10 linux subsystem] dpkg-deb error: control directory has bad permissions 777 (must be >=0755 and <=0775)

打算用win10 linux 子系统来打包ubuntu使用的deb安装包,结果运行dpkg-deb报错:
control directory has bad permissions 777 (must be >=0755 and <=0775)

解决方案:
sudo umount /mnt/e
sudo mount -t drvfs -o uid=1000,gid=1000,umask=022 e: /mnt/e

就是说要重新mount一下,mount的时候就决定了目录权限

[2019-07-06 updated]
按照http://zuyunfei.com/2018/06/15/file-system-configuration-in-wsl/的方法,
在C:\Users\%CurrentUser%\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc\LocalState\rootfs\etc上建立一个文件,名字叫wsl.conf,内容如下:
[automount]
enabled = true
root = /mnt/
options = “uid=1000,gid=1000,metadata,umask=022”
mountFsTab = false

进入任一目录,打开linux shell,再mount看一下,完美~

 

参考:
https://www.askingbox.com/question/error-message-dpkg-deb-error-control-directory-has-bad-permissions-777
https://www.askingbox.com/question/linux-get-own-user-id-uid-gid
http://zuyunfei.com/2018/06/15/file-system-configuration-in-wsl/