From nobody Tue Aug 13 17:31:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Wjz2f2NFgz5T5xt; Tue, 13 Aug 2024 17:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wjz2f10qmz4Z6n; Tue, 13 Aug 2024 17:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723570298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKyON0x8glbfP4TARQrSoQk9JAGJgvY276zLIKkjYDA=; b=MHXYENFMBczCmzM5nTCe3Ju8A5OPUaZNUJTqPGkasglzk5uIKYVvfXPQysZMfeWGnbyElZ Aw3SrZmHmum3kTd0U2AugLqIChPkVV/mnHhksA5TOwtHWlMH/mDUKXilJaNw40/e39gRz/ dqQqvnezV0qtZkoJEkJ4M5kJD9CCXCxj17gQ++/CWDflWTqj9yuygVJOSwNK4LDcaDPFaF XTLx/kpdVOPD341NiQUFbn38/n9Ye+wBIwXQx7dXSDPwJJQT8usQx8nkMh4xaUa8/klhuB +R608bpgSKj+XmLAxJvi040ddtqVzh57wpMVnZNBlfuTloyaqxtz7puYp2ttsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1723570298; a=rsa-sha256; cv=none; b=vWQXDdwq8FV1f1X+odBu8VboQlZvVV+MfHFrIse/1YbyKM/5q4dK6YbNywT+E9kXXSt+XW KxHCP1eoAKDg3KhZYEJjM9rxViB/wGRpV3FaOUFHl0NYqTtu2mdAbbefHBPRJCp4oDurah y1HX4toLnBSr1TuGFyAJrILiYr6FWpc46W5G4YTahZJVAJAwZcZAYtgPYwj4UeOuk6YMm+ ArihgJWr1y3kbD7/SOTuU5svqnzsyWBAVIyuYG0a3aZnMGbdjucLc+Z7870kINRDm/4WJy GB0mwVGDMnutIh6kuFhGA1DXxmsv3lVieBPePjMKkyl+sgMi5rovENGaTOe2kw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1723570298; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FKyON0x8glbfP4TARQrSoQk9JAGJgvY276zLIKkjYDA=; b=uvl538ESctYJIII0q97qfeRfs8b0ChteBORcCRju6g0kRJdPMvBHkoMWvQDBPnQkcQfz0P IpSFXnO0XvfnpbIPZY3bXdq5QF4l0lxcHhbepLCXE/KK0gRlXzrdGc77gtRuQ+lncXPygS 3RZow3QrREaJJGzml0kbkBMT8ccte+T15JitqOlryR8pugtbUi6NFVQHhz7FKc5eDy6RyO GZCqOpLXN1tAUBPRAkHu+V4sDatDuwTHjEj5j30lZjdZlarsjcNDKl2FY0mKVbiXyLT4Xm uV8vzuq01QVaB9Cu2FijW1mYMvh61Sk/sSMfxtXNqB7LqM485FdGJbXgDmUnWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Wjz2f0cX7zKP5; Tue, 13 Aug 2024 17:31:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47DHVbfE050936; Tue, 13 Aug 2024 17:31:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47DHVbSe050932; Tue, 13 Aug 2024 17:31:37 GMT (envelope-from git) Date: Tue, 13 Aug 2024 17:31:37 GMT Message-Id: <202408131731.47DHVbSe050932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: e91ae9079619 - stable/14 - pxeboot: Enforce a 500k limit here List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e91ae90796195afb6c58adb601f6d04dea865877 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e91ae90796195afb6c58adb601f6d04dea865877 commit e91ae90796195afb6c58adb601f6d04dea865877 Author: Warner Losh AuthorDate: 2024-08-05 21:19:36 +0000 Commit: Warner Losh CommitDate: 2024-08-13 17:31:38 +0000 pxeboot: Enforce a 500k limit here Have a separate PXEBOOTSIZE variable that acts much like LOADERSIZE variable to limit the size of the loader used for pxeldr. This allows people to override it independently of LOADERSIZE, which they may need to set larger for other reasons. Combined with PXEBOOT_DEFAULT_INTERP, you can build a larger lua loader, while still being able to build pxeldr with the 4th one, for example. MFC After: 3 days Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46214 (cherry picked from commit e1a6d93155cea7fbb038dee671ecf005c4846fd3) --- stand/i386/pxeldr/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/stand/i386/pxeldr/Makefile b/stand/i386/pxeldr/Makefile index 27f9a44cf21c..36d3d3ad878e 100644 --- a/stand/i386/pxeldr/Makefile +++ b/stand/i386/pxeldr/Makefile @@ -29,6 +29,12 @@ L=${PXEBOOT_DEFAULT_INTERP} L=${LOADER_DEFAULT_INTERP} .endif LOADERBIN= ${BOOTOBJ}/i386/loader_${L}/loader_${L}.bin +# pxeboot runs in an environment where there's 500k or less of space available +# due to space for packet buffers, network drivers, etc. While some environments +# may have a bit more, the limit of 500,000 (488k) provides enough margin to +# work in a huge array of environments. Larger values may work for specific +# environments. +PXEBOOTSIZE?=500000 CLEANFILES+= ${BOOT}.tmp @@ -44,6 +50,8 @@ CLEANFILES+= ${LOADER} # Note: pxeldr.S assumes a.out and will require changes for ELF if the output # format is changed to ELF. ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXKERN} + @set -- `ls -l ${LOADERBIN}` ; x=$$((${PXEBOOTSIZE}-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADERBIN}