poudriere jail -c -j JNAME -m null -M PREBUILT-WORLD-PATH -S /usr/src -v 12.0-CURRENT complains about "DIrectory not empty" for PREBUILT-WORLD-PATH

Mark Millard markmi at dsl-only.net
Mon Dec 4 05:30:01 UTC 2017


Note: /usr/ports/ (and so poudriere-devel) as of -r425204 
(poudriere-devel-3.2.99.20171129).

I expect that the below is from ports-mgmt/poudriere-=devel
-r454996 and its:

  - ports/jail -c NOZFS: Consider non-empty-already-existing-directory a failure

where the change did not cover an explicit use of -m null also
being involved to deliberately being using a pre-built
world that is located via use of -M PATH .

[There is one other side note about a potential
issue later below.]

# poudriere jail -c -j FBSDjailRPI2 -m null -M /usr/obj/DESTDIRs/clang-armv7-installworld-poud -S /usr/src -v 12.0-CURRENT
[00:00:00] Creating FBSDjailRPI2 fs at /usr/obj/DESTDIRs/clang-armv7-installworld-poud... fail
[00:00:00] Error: Directory not empty at /usr/obj/DESTDIRs/clang-armv7-installworld-poud

# ls -lTdt /usr/obj/DESTDIRs/clang-armv7-installworld-poud/*
drwxr-xr-x  26 root  wheel  2048 Nov 27 00:33:01 2017 /usr/obj/DESTDIRs/clang-armv7-installworld-poud/etc
drwxr-xr-x   2 root  wheel  2560 Nov 27 00:29:51 2017 /usr/obj/DESTDIRs/clang-armv7-installworld-poud/rescue
. . .

(So: a pre-built world, created via a cross build and
copied over beforehand.)

# poudriere jail -c -j FBSDjailRPI2 -m null -M /usr/obj/DESTDIRs/clang-armv7-installworld-poud -S /usr/src -v 12.0-CURRENT
[00:00:00] Creating FBSDjailRPI2 fs at /usr/obj/DESTDIRs/clang-armv7-installworld-poud... fail
[00:00:00] Error: Directory not empty at /usr/obj/DESTDIRs/clang-armv7-installworld-poud


/usr/local/etc/poudriere.conf has:

NO_ZFS=yes


/usr/local/share/poudriere/include/fs.sh has:

createfs() {
        [ $# -ne 3 ] && eargs createfs name mnt fs
        local name mnt fs
        name=$1
        mnt=$(echo $2 | sed -e "s,//,/,g")
        fs=$3

        [ -z "${NO_ZFS}" ] || fs=none

        if [ -n "${fs}" -a "${fs}" != "none" ]; then
. . .
        else
                msg_n "Creating ${name} fs at ${mnt}..."
                if ! mkdir -p "${mnt}"; then
                        echo " fail"
                        err 1 "Failed to create directory ${mnt}"
                fi
                # If the directory is non-empty then we didn't create it.
                if ! dirempty "${mnt}"; then
                        echo " fail"
                        err 1 "Directory not empty at ${mnt}"
                fi
                echo " done"
        fi
}

For -m null here -M /usr/obj/DESTDIRs/clang-armv7-installworld-poud
should point to a non-empty directory as far as I can tell. And
it does. But that leads to the above code rejecting the -M
path.



[Note: I also question, if, with -S /usr/src
in use, the SRC_BASE assignment below is
correct.]

/usr/local/share/poudriere/jail.sh has:

create_jail() {
        [ "${JAILNAME#*.*}" = "${JAILNAME}" ] ||
                err 1 "The jailname cannot contain a period (.). See jail(8)"
        
        if [ "${METHOD}" = "null" ]; then
                [ -z "${JAILMNT}" ] && \
                    err 1 "Must set -M to path of jail to use"
                [ "${JAILMNT}" = "/" ] && \
                    err 1 "Cannot use / for -M"
        fi
. . .
        SRC_BASE="${JAILMNT}/usr/src"
        
        case ${METHOD} in
. . .
        null)
                JAILFS=none
                FCT=
                ;;
        esac
    
        if [ "${JAILFS}" != "none" ]; then
                [ -d "${JAILMNT}" ] && \
                    err 1 "Directory ${JAILMNT} already exists"
        fi
    
        createfs ${JAILNAME} ${JAILMNT} ${JAILFS:-none}
. . .



===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ports mailing list