Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Adds default value "no" to FORCE_MOUNT_HASH option. Value of "yes" will force Poudriere to use hashes in nullfs mounts (for using Poudriere in jails)
--- common.sh 2017-11-22 16:38:55.159040000 +0200
+++ common.sh 2017-11-22 16:45:07.890728000 +0200
@@ -7357,6 +7357,7 @@
: ${MUTABLE_BASE:=yes}
: ${HTML_JSON_UPDATE_INTERVAL:=2}
: ${HTML_TRACK_REMAINING:=no}
+: ${FORCE_MOUNT_HASH:=no}
DRY_RUN=0
# Be sure to update poudriere.conf to document the default when changing these
Owner

gynter commented Aug 17, 2015

Temporary fix for mount_nullfs file name too long issue. File to patch is /usr/local/share/poudriere/common.sh and set USE_MASTERMNT_HASH=yes in poudriere.conf.

Owner

gynter commented Aug 30, 2016

Updated according to current master branch.

bdrewery commented Oct 18, 2017

What path is too long? This is supposed to be finding the longest possible path (/compat/linux/proc)

@bdrewery when running poudriere in a freebsd jail i get:

11.1-RELEASE-p3
[00:00:02] Recording filesystem state for clean... done
building in jail freebsd_11_1_amd64 ...
[00:00:00] Creating the reference jail... done
[00:00:10] Mounting system devices for freebsd_11_1_amd64-default
mount_nullfs: /usr/local/poudriere/data/.m/freebsd_11_1_amd64-default/ref/rescue: File name too long
[00:00:10] Cleaning up
[00:00:10] Unmounting file systems

This is poudriere 3.2 where the USE_MASTERMNT_HASH patch doesn't work any longer.

guggemand commented Nov 22, 2017

Owner

gynter commented Nov 22, 2017

@bdrewery @maackintosh @guggemand Yes, just checked. This patch is no longer needed, use FORCE_MOUNT_HASH instead. Thou it probably should have a default defined, as stated in this patch:

--- common.sh      2017-11-22 16:38:55.159040000 +0200
+++ common.sh   2017-11-22 16:45:07.890728000 +0200
@@ -7357,6 +7357,7 @@
 : ${MUTABLE_BASE:=yes}
 : ${HTML_JSON_UPDATE_INTERVAL:=2}
 : ${HTML_TRACK_REMAINING:=no}
+: ${FORCE_MOUNT_HASH:=no}
 DRY_RUN=0
 
 # Be sure to update poudriere.conf to document the default when changing these

That patch is wrong, no default is expected. It's not a yes/no value so to add this default you need to fix the check on the value too. The problem is probably that the if is doing if x || y && z and is ambiguous.

Owner

gynter commented Dec 5, 2017

@bdrewery Ah yes, correct. Was the $FORCE_MOUNT_HASH meant to be user over-writable anyway? If yes, then -n "${FORCE_MOUNT_HASH}" isn't a good idea anyway, because for me it seems to be a yes/no value then and should be checked as that. If not, then I still need to make correction to that if statement, because I need to have this option over-writable :)

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