Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Dec 2017 20:29:52 -0800
From:      Mark Millard <markmi@dsl-only.net>
To:        Bryan Drewery <bdrewery@FreeBSD.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD Ports <freebsd-ports@freebsd.org>
Subject:   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
Message-ID:  <225E5187-55F9-4BEA-907D-79E04B1FA4A1@dsl-only.net>

next in thread | raw e-mail | index | archive | help
Note: /usr/ports/ (and so poudriere-devel) as of -r425204=20
(poudriere-devel-3.2.99.20171129).

I expect that the below is from ports-mgmt/poudriere-=3Ddevel
-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=3Dyes


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

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

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

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



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?225E5187-55F9-4BEA-907D-79E04B1FA4A1>