Step6: add python and snake.

Now we have a programming environment and
we have a small game for amusement :).

Signed-off-by: Chen Wang <wangchen20@iscas.ac.cn>
This commit is contained in:
Chen Wang
2025-12-05 16:24:46 +08:00
committed by Chen Wang
parent 083402650e
commit 28320bba62
22 changed files with 1128 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ source $(dirname "$0")/../common.sh
PKGNAME=target-finalize
PYTHON3_BUILD_DIR=${BUILD_DIR}/python3-3.13.7
mkdir -p ${TARGET_DIR}/etc
echo ">>> Installing ifupdown-scripts"
@@ -28,6 +30,9 @@ if grep -q CONFIG_HUSH=y ${BUILD_DIR}/busybox-1.37.0/.config; then grep -qsE '^/
grep -qsE '^/bin/sh$' ${TARGET_DIR}/etc/shells || echo "/bin/sh" >> ${TARGET_DIR}/etc/shells
grep -qsE '^/bin/bash$' ${TARGET_DIR}/etc/shells || echo "/bin/bash" >> ${TARGET_DIR}/etc/shells
ln -sf bash ${TARGET_DIR}/bin/sh
PYTHONPATH="${STAGING_DIR}/usr/lib/python3.13/" ${HOST_DIR}/bin/python3.13 ${PYTHON3_BUILD_DIR}/Lib/compileall.py -b -s ${TARGET_DIR} -p / ${TARGET_DIR}/usr/lib/python3.13
find ${TARGET_DIR}/usr/lib/python3.13 -name '*.py' -print0 | xargs -0 --no-run-if-empty rm -f
find ${TARGET_DIR}/usr/lib/python3.13 -name '*.opt-1.pyc' -print0 -o -name '*.opt-2.pyc' -print0 | xargs -0 --no-run-if-empty rm -f
echo "buildlinux" > ${TARGET_DIR}/etc/hostname
/usr/bin/sed -i -e '$a \127.0.1.1\tbuildlinux' -e '/^127.0.1.1/d' ${TARGET_DIR}/etc/hosts
echo "Welcome to Build Linux System From Scratch" > ${TARGET_DIR}/etc/issue