summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuta SATOH <nigoro.dev@gmail.com>2017-12-10 07:29:07 +0900
committerYuta SATOH <nigoro.dev@gmail.com>2017-12-10 07:29:07 +0900
commit577e2305cbb5ee32eb808b3728dd84b291f02db2 (patch)
tree1977128f91d9ae46f4715d68613be566415717e9
parentdev-util/catalyst: import from the main tree. (diff)
downloadgentoo-bsd-577e2305cbb5ee32eb808b3728dd84b291f02db2.tar.gz
gentoo-bsd-577e2305cbb5ee32eb808b3728dd84b291f02db2.tar.bz2
gentoo-bsd-577e2305cbb5ee32eb808b3728dd84b291f02db2.zip
dev-util/catalyst: add the patches for Gentoo/FreeBSD.
-rw-r--r--dev-util/catalyst/Manifest5
-rw-r--r--dev-util/catalyst/catalyst-2.0.18-r4.ebuild21
-rw-r--r--dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch48
-rw-r--r--dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch22
-rw-r--r--dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch52
5 files changed, 143 insertions, 5 deletions
diff --git a/dev-util/catalyst/Manifest b/dev-util/catalyst/Manifest
index 3ba594e..40152ac 100644
--- a/dev-util/catalyst/Manifest
+++ b/dev-util/catalyst/Manifest
@@ -1,7 +1,10 @@
AUX catalyst-2.0.18-Do-notuntarwith--acls.patch 6156 SHA256 2b8160bba1207cf45412a8133b6ed3b039d6705f76074651b6d42c4488b9bc1e SHA512 500d72f7e11f99eb53275aac3e1b94394826cfa271312ee268092d12a70128b46455c5da1122fb70e21459f56ded3e3ad2752c33516cd3dc4ea4ac70cd0ec32f WHIRLPOOL f348eb0507d9fed5d5e05ba27b4b662fa1fd25e5d87afd886732a45173d2c3b27fee18ad4435c0fdefdb92d6606d0b11a9c54dff459692eff5db3aeb05f2c459
+AUX catalyst-2.0.18-fbsd-add-tmpfs-support.patch 1916 SHA256 a917386049e8a6dc9ac7656a2ebcb6ae909c2528994f93dce0df10cbacd3787a SHA512 90bdb046b348d6c661c8321443b65041f8ccfd0e9834f4a76a73dc8136d632a7641b9c394db1bbf4f49b07c20572d82f24f4c76c812d400386b09f773c9463ce WHIRLPOOL 43c7d81ec56c44e76f9e6fbee98c06c3b3b673f6ba6cc529b4cd9b926f585abb7930767da9b6091bcb46c703eadf82c296c5cf51924931baefc0eb405041f19f
+AUX catalyst-2.0.18-fbsd-fix-linux32.patch 1008 SHA256 633abcdb6fc1b36a1335c7b203d9db7fd14e4efdd1d45907c63c56fcdbfb5757 SHA512 d10d96bba17be410b88a38e3d341617d7a9a27e6439106dfb907347fcdcaf6d47d2e15fe3ec63f1fa52f773d69bab5fe94825090959bd4364e43d35c16d83a71 WHIRLPOOL a35ca75490b453e4952b996b4c52ec10b75c7b7b11c0f7c7c8ae0bbbb5638380885c9e678e37e093069f02bfe9947e4b976eb13c0b0e0b7d5b6943f91c3ed905
+AUX catalyst-2.0.18-fbsd-fix-sed.patch 1878 SHA256 cec0e2edc73a021a28e700465e752ce576e70a9a8d21719bd89fe2be06332a54 SHA512 7abd0aec481c2c32b9fc0664d3db968f6447d77cc7533808d4f122ccd8515b86b90343b8455a964793694a3bf4c7a1c2d38b19e9aeaa0b5e75735925ff975e28 WHIRLPOOL 4443334e2bf791c2a30a98fe76a6b56198a28b11e06973c0be6f7e17f2b1c2520f84407880d5cd8b582fc50ea95440feff528227f59140aa4c8eb6cf1fedb6a0
AUX catalyst-2.0.18-fix-quotes.patch 1663 SHA256 5d99b200bef45e3a69003687d00a1939e9ab696bd1d2653f7a76f7ea66972c88 SHA512 185705eba562dfeb52740ad3a0c3ea611648d508079ad54c9e5680d318888cc5123c5ff365b1c575a5348ddfd8210763277daed226b564ed3a59e15f18bff205 WHIRLPOOL 7b9434459c31207e8d36bcbf57df7751739848b2c8e5e081b7b219029deb7257f33652027ca22a94fa0452439e6e97e16467554423435a5bd17cdb293d1942a2
AUX catalyst-2.0.18-remove-machine-id.patch 778 SHA256 dc40a3c469a80e40eed68c46ea61ce6ac802aa56ade300eee372c3eb79741d33 SHA512 7e5230eacc6ca7b535d416cd2dd846fa9fbc58951ef4cbdb14108afcbcd63f2d8a7b082920d04dc51b9eb47a6d44eeb5a07d704b14e71b6a972d96ca79f807d6 WHIRLPOOL 1645f5ccf29272d2cb97c86dbd638021d452051e167231807bbf5ecc75f9c059230e3009ff1adc3224694901a392104ad0418b591ce474ef03b96866d247b7af
AUX catalyst-2.0.18-stage1-export-ROOT.patch 1274 SHA256 bfd9470df1b53c0313731c22d740a4f0ce613326037144808cf37e2c3c280690 SHA512 6372917d395d8129c49c4dd8de7e6a8e7797f6c535e39713fa68059d82f398aa1fb0ffb1b6a65c91f9b5a4861f29cffd4717b7a612276e78d22ac1985ee32113 WHIRLPOOL b3f4b7678ff196ee00e65961894b19ec58868c2e769bc573ab4cb0570fbbbbebb7b5ca0b5f2e3534bc4582db872e4da4f49d9d98fc9d82c473a627194bd63c0b
DIST catalyst-2.0.18.tar.bz2 861398 SHA256 f3c2583fb8da425a9c57d3a00aac559e6bfde5951f1c7ef30ddf4fa00d6bedbd SHA512 5a1408ffe06ce5c06a6bca8f0e3ecd91c17cdc36e2dfa37881d843432bdfe987fd2cfd988cd5719bdf378c18c2e79ee59e281c3b4dba4ae9edfc2dd654b8ee4a WHIRLPOOL 73abb541bd9984e26e43dbeee3156ca84104aedfe16a027b97790274aaffa8678a29677da4ada908fe9c2184268eb9c266a8961a5e0681fccc463c47a6d83542
-EBUILD catalyst-2.0.18-r4.ebuild 3297 SHA256 5dba6296b5cb985f89946b1575d9e2ce07fda0820ee47ce346abecbbbfcd14ac SHA512 e397fb7205d4bf4823b5d328fb9059aa37ed8ad97deb2fa0fd7a7b1cafe694daa2f9f5705ff1a83905101b9679755b875a79063039a63743f6ef2e96dce4efea WHIRLPOOL f78adcfbac9738183d489c2f59992fce333b77f98b46e757731342660454de1bb342b3483a096d820601ea5e8cdba5093cb1872ecbbd3e3f4426102e1e8f6218
+EBUILD catalyst-2.0.18-r4.ebuild 3958 SHA256 6041422e3dfe0a210ad4ab10404965af161c79f7f58937fffb95508c9c32e076 SHA512 11ac663fd9fba8222ac1450ad693f32d4dd51f26a4ff5154b60a4461b80a25953c77d0e52c9fec55b191096fa159e7919a59edaa39b62d5fec8a8f4e63f16cdc WHIRLPOOL 0bbad9897ef184195549bdafc93182e3ec547fb99a25de9b16dfe24b50a3066b87b569d9ee5c7272b3c74703e90f0d1deddc0fad71395179587778a54bcedb5c
MISC metadata.xml 417 SHA256 7368ace310e6ad01b264004c144e7c690f0f3106c851514190df206122ceb357 SHA512 ba623747ea22b2e886740d771dcd80ac54df9b29762d1d1f3eb46701e9463d245a2e310eb03695dc9342a57da486a9a8d56892da709727476a2d6afed5e63cb8 WHIRLPOOL 32a9aa02498e87b255aab36b0195bec07d95ecc9cb10eb3f5eb8393cc3a5910263ef2e4cb507924a29b822845b5ccc54af25ac5e226e3900bdc379d72e1d2cc6
diff --git a/dev-util/catalyst/catalyst-2.0.18-r4.ebuild b/dev-util/catalyst/catalyst-2.0.18-r4.ebuild
index 45b66c3..08d2610 100644
--- a/dev-util/catalyst/catalyst-2.0.18-r4.ebuild
+++ b/dev-util/catalyst/catalyst-2.0.18-r4.ebuild
@@ -14,7 +14,7 @@ else
https://dev.gentoo.org/~mattst88/distfiles/${P}.tar.bz2
https://dev.gentoo.org/~zerochaos/distfiles/${P}.tar.bz2
https://dev.gentoo.org/~dolsen/releases/catalyst/${P}.tar.bz2"
- KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
+ KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd"
fi
PYTHON_COMPAT=( python2_7 )
@@ -26,7 +26,7 @@ HOMEPAGE="https://wiki.gentoo.org/wiki/Catalyst"
LICENSE="GPL-2"
SLOT="0"
-IUSE="ccache kernel_linux"
+IUSE="ccache kernel_linux kernel_FreeBSD"
DEPEND="
app-text/asciidoc
@@ -35,13 +35,12 @@ DEPEND="
RDEPEND="
app-arch/lbzip2
app-crypt/shash
- app-arch/tar[xattr]
virtual/cdrtools
amd64? ( >=sys-boot/syslinux-3.72 )
ia64? ( sys-fs/dosfstools )
x86? ( >=sys-boot/syslinux-3.72 )
ccache? ( dev-util/ccache )
- kernel_linux? ( app-misc/zisofs-tools >=sys-fs/squashfs-tools-2.1 )
+ kernel_linux? ( app-arch/tar[xattr] app-misc/zisofs-tools >=sys-fs/squashfs-tools-2.1 )
${PYTHON_DEPS}
"
@@ -52,6 +51,9 @@ PATCHES=(
"${FILESDIR}/catalyst-2.0.18-fix-quotes.patch"
"${FILESDIR}/catalyst-2.0.18-remove-machine-id.patch"
"${FILESDIR}/catalyst-2.0.18-stage1-export-ROOT.patch"
+ "${FILESDIR}/catalyst-2.0.18-fbsd-add-tmpfs-support.patch"
+ "${FILESDIR}/catalyst-2.0.18-fbsd-fix-linux32.patch"
+ "${FILESDIR}/catalyst-2.0.18-fbsd-fix-sed.patch"
)
pkg_setup() {
@@ -75,6 +77,17 @@ pkg_setup() {
src_prepare() {
epatch "${PATCHES[@]}"
+
+ if use kernel_FreeBSD ; then
+ # FreeBSD's tar doesn't support the --xattrs and -I lbzip2 options.
+ sed -i 's:--xattrs::g' "${S}"/modules/catalyst_support.py
+ sed -i 's:tar --xattrs --xattrs-include=security.capability --xattrs-include=user.pax.flags --selinux:tar:g' \
+ "${S}"/modules/generic_stage_target.py
+ for f in modules/catalyst_support.py modules/generic_stage_target.py modules/snapshot_target.py
+ do
+ sed -i 's:-I lbzip2:-j:g' "${S}/${f}"
+ done
+ fi
}
src_install() {
diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch
new file mode 100644
index 0000000..dee3183
--- /dev/null
+++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-add-tmpfs-support.patch
@@ -0,0 +1,48 @@
+https://bugs.gentoo.org/show_bug.cgi?id=363577
+
+diff --git a/catalyst-2.0.18/modules/generic_stage_target.py b/catalyst-2.0.18/modules/generic_stage_target.py
+index cc24c63..75101e7 100644
+--- a/catalyst-2.0.18/modules/generic_stage_target.py
++++ b/catalyst-2.0.18/modules/generic_stage_target.py
+@@ -911,25 +911,26 @@ class generic_stage_target(generic_target):
+ src=self.mountmap[x]
+ if "SNAPCACHE" in self.settings and x == "/usr/portage":
+ self.snapshot_lock_object.read_lock()
+- if os.uname()[0] == "FreeBSD":
+- if src == "/dev":
+- retval=os.system("mount -t devfs none "+\
+- self.settings["chroot_path"]+x)
+- else:
+- retval=os.system("mount_nullfs "+src+" "+\
++ if src == "tmpfs":
++ if "var_tmpfs_portage" in self.settings:
++ retval=os.system("mount -t tmpfs -o size="+\
++ self.settings["var_tmpfs_portage"]+"G "+src+" "+\
+ self.settings["chroot_path"]+x)
+ else:
+- if src == "tmpfs":
+- if "var_tmpfs_portage" in self.settings:
+- retval=os.system("mount -t tmpfs -o size="+\
+- self.settings["var_tmpfs_portage"]+"G "+src+" "+\
++ if os.uname()[0] == "FreeBSD":
++ if src == "/dev":
++ retval=os.system("mount -t devfs none "+\
++ self.settings["chroot_path"]+x)
++ else:
++ retval=os.system("mount_nullfs "+src+" "+\
+ self.settings["chroot_path"]+x)
+- elif src == "shmfs":
+- retval=os.system("mount -t tmpfs -o noexec,nosuid,nodev shm "+\
+- self.settings["chroot_path"]+x)
+ else:
+- retval=os.system("mount --bind "+src+" "+\
+- self.settings["chroot_path"]+x)
++ if src == "shmfs":
++ retval=os.system("mount -t tmpfs -o noexec,nosuid,nodev shm "+\
++ self.settings["chroot_path"]+x)
++ else:
++ retval=os.system("mount --bind "+src+" "+\
++ self.settings["chroot_path"]+x)
+ if retval!=0:
+ self.unbind()
+ raise CatalystError,"Couldn't bind mount "+src
diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch
new file mode 100644
index 0000000..8a394f2
--- /dev/null
+++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-linux32.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/show_bug.cgi?id=363577
+
+diff --git a/catalyst-2.0.18/arch/x86.py b/catalyst-2.0.18/arch/x86.py
+index 0391b79..2b67dba 100644
+--- a/catalyst-2.0.18/arch/x86.py
++++ b/catalyst-2.0.18/arch/x86.py
+@@ -7,9 +7,12 @@ class generic_x86(builder.generic):
+ def __init__(self,myspec):
+ builder.generic.__init__(self,myspec)
+ if self.settings["buildarch"]=="amd64":
+- if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
+- raise CatalystError,"required executable linux32 not found (\"emerge setarch\" to fix.)"
+- self.settings["CHROOT"]="linux32 chroot"
++ if os.uname()[0] == "Linux":
++ if not os.path.exists("/bin/linux32") and not os.path.exists("/usr/bin/linux32"):
++ raise CatalystError,"required executable linux32 not found (\"emerge setarch\" to fix.)"
++ self.settings["CHROOT"]="linux32 chroot"
++ else:
++ self.settings["CHROOT"]="chroot"
+ self.settings["crosscompile"] = False;
+ else:
+ self.settings["CHROOT"]="chroot"
diff --git a/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch
new file mode 100644
index 0000000..33e5325
--- /dev/null
+++ b/dev-util/catalyst/files/catalyst-2.0.18-fbsd-fix-sed.patch
@@ -0,0 +1,52 @@
+https://bugs.gentoo.org/show_bug.cgi?id=363577
+
+diff --git a/catalyst-2.0.18/modules/generic_stage_target.py b/catalyst-2.0.18/modules/generic_stage_target.py
+index cc24c63..ad8138d 100644
+--- a/catalyst-2.0.18/modules/generic_stage_target.py
++++ b/catalyst-2.0.18/modules/generic_stage_target.py
+@@ -1124,11 +1124,17 @@ class generic_stage_target(generic_target):
+ self.settings["chroot_path"]+"/etc/hosts",\
+ "Could not replace /etc/hosts",env=self.env)
+
++ """ GNU sed should be used on Gentoo/FreeBSD """
++ if os.uname()[0] == "FreeBSD":
++ self.settings["sed"]="gsed"
++ else:
++ self.settings["sed"]="sed"
++
+ """ Remove our overlay """
+ if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"):
+ cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage",\
+ "Could not remove /usr/local/portage",env=self.env)
+- cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
++ cmd(self.settings["sed"]+" -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+\
+ "/etc/portage/make.conf",\
+ "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env)
+
+diff --git a/catalyst-2.0.18/targets/support/chroot-functions.sh b/catalyst-2.0.18/targets/support/chroot-functions.sh
+index 67874a0..983a3a7 100755
+--- a/catalyst-2.0.18/targets/support/chroot-functions.sh
++++ b/catalyst-2.0.18/targets/support/chroot-functions.sh
+@@ -422,5 +422,22 @@ Comment=This is a link to the local copy of the Gentoo Linux Handbook.
+ Icon=text-editor" > /usr/share/applications/gentoo-handbook.desktop
+ }
+
++# GNU sed wrapper
++sed(){
++ if [ -e /usr/bin/gsed ]
++ then
++ /usr/bin/gsed "$@"
++ elif [ -e /bin/sed ]
++ then
++ /bin/sed "$@"
++ elif [ -e /usr/bin/sed ]
++ then
++ /usr/bin/sed "$@"
++ else
++ echo "ERROR: Failed to select sed."
++ exit 1
++ fi
++}
++
+ # We do this everywhere, so why not put it in this script
+ run_default_funcs