summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/catalyst/files')
-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
3 files changed, 122 insertions, 0 deletions
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