Fix 351Files, autostart, samba, move games mount to userland.
This commit is contained in:
parent
2b8107b16c
commit
6236c1b5f0
23 changed files with 120 additions and 979 deletions
|
@ -12,7 +12,6 @@ EE_DEVICE=$(cat /ee_arch)
|
|||
source /etc/profile
|
||||
rp_registerAllModules
|
||||
|
||||
joy2keyStart
|
||||
clear
|
||||
|
||||
#rm "/storage/.config/dosbox/games/*.conf"
|
||||
|
|
|
@ -17,7 +17,7 @@ PKG_SHORTDESC="A Single panel file Manager tailored for Anbernic 351 devices: RG
|
|||
PKG_PATCH_DIRS="${DEVICE}"
|
||||
|
||||
make_target() {
|
||||
make DEVICE=${DEVICE} RES_PATH=/usr/share/351files/res START_PATH=/storage/roms SDL2_CONFIG=${SYSROOT_PREFIX}/usr/bin/sdl2-config CC=$CXX
|
||||
make DEVICE=${DEVICE^^} RES_PATH=/usr/share/351files/res START_PATH=/storage/roms SDL2_CONFIG=${SYSROOT_PREFIX}/usr/bin/sdl2-config CC=$CXX
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
|
|
|
@ -5,7 +5,7 @@ index 7b9afa5..bd964f1 100644
|
|||
@@ -1,5 +1,6 @@
|
||||
TARGET = 351Files
|
||||
|
||||
+# DEVICE ?= handheld
|
||||
+# DEVICE ?= HANDHELD
|
||||
# DEVICE ?= RG351P
|
||||
# DEVICE ?= RG351V
|
||||
# DEVICE ?= RGB10
|
||||
|
@ -18,20 +18,20 @@ index 92d1a01..db4fec4 100644
|
|||
#define KEYBOARD_KEY_SPACING 4
|
||||
|
||||
+// Parameters for handheld
|
||||
+#elif defined(DEVICE_handheld)
|
||||
+#elif defined(DEVICE_HANDHELD)
|
||||
+ #define SCREEN_WIDTH 1280
|
||||
+ #define SCREEN_HEIGHT 720
|
||||
+ #define HARDWARE_ACCELERATION 0
|
||||
+ #define FULLSCREEN 1
|
||||
+ #define FONT_NAME "NotoSans-Regular.ttf"
|
||||
+ #define FONT_NAME_MONO "NotoSansMono-Regular.ttf"
|
||||
+ #define FONT_SIZE 48
|
||||
+ #define LINE_HEIGHT 72
|
||||
+ #define ICON_SIZE 58
|
||||
+ #define MARGIN_X 24
|
||||
+ #define KEYBOARD_MARGIN 19
|
||||
+ #define KEYBOARD_KEY_SPACING 10
|
||||
+ #define KEYBOARD_SYMBOL_SIZE 58
|
||||
+ #define FONT_SIZE 20
|
||||
+ #define LINE_HEIGHT 32
|
||||
+ #define ICON_SIZE 24
|
||||
+ #define MARGIN_X 10
|
||||
+ #define KEYBOARD_MARGIN 8
|
||||
+ #define KEYBOARD_KEY_SPACING 4
|
||||
+ #define KEYBOARD_SYMBOL_SIZE 24
|
||||
+
|
||||
// Paramaters for desktop PC
|
||||
#else
|
||||
|
@ -41,11 +41,11 @@ index 92d1a01..db4fec4 100644
|
|||
|
||||
// Button events
|
||||
-#if defined(DEVICE_RG351P)
|
||||
+#if defined(DEVICE_handheld)
|
||||
+ #define BUTTON_PRESSED_UP event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_UP
|
||||
+ #define BUTTON_PRESSED_DOWN event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_DOWN
|
||||
+ #define BUTTON_PRESSED_LEFT event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_LEFT
|
||||
+ #define BUTTON_PRESSED_RIGHT event.type == SDL_JOYBUTTONDOWN && event.jhat.value == SDL_HAT_RIGHT
|
||||
+#if defined(DEVICE_HANDHELD)
|
||||
+ #define BUTTON_PRESSED_UP event.type == SDL_JOYHATMOTION && event.jhat.value == SDL_HAT_UP
|
||||
+ #define BUTTON_PRESSED_DOWN event.type == SDL_JOYHATMOTION && event.jhat.value == SDL_HAT_DOWN
|
||||
+ #define BUTTON_PRESSED_LEFT event.type == SDL_JOYHATMOTION && event.jhat.value == SDL_HAT_LEFT
|
||||
+ #define BUTTON_PRESSED_RIGHT event.type == SDL_JOYHATMOTION && event.jhat.value == SDL_HAT_RIGHT
|
||||
+ #define BUTTON_PRESSED_PAGEUP event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 4 || event.jbutton.button == 6)
|
||||
+ #define BUTTON_PRESSED_PAGEDOWN event.type == SDL_JOYBUTTONDOWN && (event.jbutton.button == 5 || event.jbutton.button == 7)
|
||||
+ #define BUTTON_PRESSED_VALIDATE event.type == SDL_JOYBUTTONDOWN && event.jbutton.button == 1
|
||||
|
|
|
@ -41,6 +41,7 @@ then
|
|||
done
|
||||
fi
|
||||
|
||||
clear >/dev/console
|
||||
/usr/bin/show_splash intro 2>&1 >>${BOOTLOG}
|
||||
|
||||
DEVICE_CPU_GOVERNOR=$(get_setting system.cpugovernor)
|
||||
|
|
76
packages/jelos/sources/autostart/common/003-mount_games
Executable file
76
packages/jelos/sources/autostart/common/003-mount_games
Executable file
|
@ -0,0 +1,76 @@
|
|||
#!/bin/bash
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
# Copyright (C) 2020 Fewtarius (https://github.com/fewtarius)
|
||||
|
||||
. /etc/profile
|
||||
. /etc/os-release
|
||||
|
||||
UPDATE_ROOT="/storage/.update"
|
||||
GAMES_DEVICE=$(get_setting system.gamesdevice)
|
||||
|
||||
mount_games() {
|
||||
NULL=$(grep ${1} /proc/mounts >/dev/null 2>&1)
|
||||
if [ ! "$?" = "0" ] && [ -e "${1}" ] && [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
mount ${1} /storage/roms >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
mount_update() {
|
||||
if [ -d "${UPDATE_ROOT}" ] && [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
/usr/bin/busybox rm -rf "${UPDATE_ROOT}" >/dev/null 2>&1
|
||||
/usr/bin/busybox mkdir -p "${UPDATE_ROOT}" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ ! -d "/storage/roms/update" ]
|
||||
then
|
||||
/usr/bin/busybox mkdir -p /storage/roms/update >/dev/null 2>&1
|
||||
fi
|
||||
if [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
/usr/bin/busybox mkdir -p "${UPDATE_ROOT}" >/dev/null 2>&1
|
||||
mount --bind "${UPDATE_ROOT}" /storage/roms/update >/dev/null 2>&1
|
||||
fi
|
||||
}
|
||||
|
||||
find_games() {
|
||||
if /usr/bin/busybox mountpoint -q /storage ; then
|
||||
if [ ! -d "/storage/roms" ]
|
||||
then
|
||||
/usr/bin/busybox mkdir -p /storage/roms >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
for DEV in $(blkid | awk 'BEGIN {FS=":"}; /ext4/ || /fat/ {print $1}' | sort -r)
|
||||
do
|
||||
ROOTDEV=$(echo ${DEV} | sed -e "s#^/.*/##g" -e "s#p[0-9].*\$##g")
|
||||
SIZE=$(awk '/'${ROOTDEV}'/ {print $3}' /proc/partitions)
|
||||
if [ "${SIZE}" -le "8388608" ]
|
||||
then
|
||||
# We don't want to mount partitions smaller than ~8GB.
|
||||
continue
|
||||
fi
|
||||
if [ -L "/sys/class/block/${ROOTDEV}boot0" ]
|
||||
then
|
||||
# Assume this is an android boot device and ignore it.
|
||||
continue
|
||||
fi
|
||||
NULL=$(grep ${DEV} /proc/mounts >/dev/null 2>&1)
|
||||
if [ ! "$?" = "0" ] && [ -e "${DEV}" ] && [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
GAMES_DEVICE=${DEV}
|
||||
mount_games "${DEV}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
if [ -e "${GAMES_DEVICE}" ]
|
||||
then
|
||||
mount_games ${GAMES_DEVICE}
|
||||
else
|
||||
find_games
|
||||
fi
|
||||
mount_update
|
||||
set_setting system.gamesdevice ${GAMES_DEVICE}
|
|
@ -4,8 +4,10 @@
|
|||
|
||||
. /etc/profile
|
||||
|
||||
for service in /usr/lib/autostart/daemons
|
||||
for SERVICE in /usr/lib/autostart/daemons/*
|
||||
do
|
||||
source ${SERVICE}
|
||||
|
||||
if [ ! -d "/storage/.cache/services" ]
|
||||
then
|
||||
mkdir -p "/storage/.cache/services"
|
||||
|
|
|
@ -2,3 +2,6 @@ STATE=$(get_setting samba.enabled)
|
|||
SVC="samba"
|
||||
CONF="smb.conf"
|
||||
DAEMONS=("nmbd" "smbd")
|
||||
|
||||
mkdir -p /run/${SVC}
|
||||
ln -s /etc/${SVC}/${CONF} /run/${SVC}/${CONF}
|
||||
|
|
|
@ -6,6 +6,5 @@
|
|||
|
||||
. /etc/profile
|
||||
jslisten set "killall 351Files"
|
||||
joy2keyStart
|
||||
|
||||
351Files
|
||||
|
|
|
@ -7,6 +7,6 @@ source /etc/profile
|
|||
|
||||
jslisten set "killall PPSSPPSDL"
|
||||
|
||||
cp -rf /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/roms/gamedata/ppsspp/assets/gamecontrollerdb.txt
|
||||
cp -f /storage/.config/SDL-GameControllerDB/gamecontrollerdb.txt /storage/.config/ppsspp/assets/gamecontrollerdb.txt
|
||||
|
||||
/usr/bin/PPSSPPSDL
|
||||
/usr/bin/PPSSPPSDL >/dev/null 2>&1
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
# samba share options
|
||||
map to guest = Bad User
|
||||
guest account = root
|
||||
security = user
|
||||
|
||||
# samba tuning options
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
SAMBA_AUTOSHARE="true"
|
||||
SAMBA_USERNAME="libreelec"
|
||||
SAMBA_PASSWORD="libreelec"
|
||||
SAMBA_SECURE="false"
|
||||
SAMBA_MINPROTOCOL="SMB2"
|
||||
SAMBA_MAXPROTOCOL="SMB3"
|
||||
SAMBA_WORKGROUP="WORKGROUP"
|
|
@ -3,12 +3,12 @@
|
|||
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
PKG_NAME="samba"
|
||||
PKG_VERSION="4.16.4"
|
||||
PKG_SHA256="9532f848fb125a17e4e5d98e1ae8b42f210ed4433835e815b97c5dde6dc4702f"
|
||||
PKG_VERSION="4.17.0"
|
||||
PKG_SHA256="04868ecda82fcbeda7b8bf519a2461a64d55c6e70efc6f6053b2fbba55f1823a"
|
||||
PKG_LICENSE="GPLv3+"
|
||||
PKG_SITE="https://www.samba.org"
|
||||
PKG_URL="https://download.samba.org/pub/samba/stable/${PKG_NAME}-${PKG_VERSION}.tar.gz"
|
||||
PKG_DEPENDS_TARGET="toolchain attr heimdal:host e2fsprogs Python3 libunwind zlib readline popt libaio ncurses connman gnutls wsdd2"
|
||||
PKG_DEPENDS_TARGET="toolchain attr heimdal:host e2fsprogs Python3 libunwind zlib readline popt libaio connman gnutls wsdd2"
|
||||
PKG_NEED_UNPACK="$(get_pkg_directory heimdal) $(get_pkg_directory e2fsprogs)"
|
||||
PKG_LONGDESC="A free SMB / CIFS fileserver and client."
|
||||
PKG_BUILD_FLAGS="-gold"
|
||||
|
@ -84,7 +84,7 @@ configure_package() {
|
|||
PKG_SAMBA_TARGET="smbclient,client/smbclient,smbtree,nmblookup,testparm"
|
||||
|
||||
if [ "${SAMBA_SERVER}" = "yes" ]; then
|
||||
PKG_SAMBA_TARGET+=",smbd/smbd,nmbd,smbpasswd"
|
||||
PKG_SAMBA_TARGET+=",nmbd,rpcd_classic,rpcd_epmapper,rpcd_winreg,samba-dcerpcd,smbpasswd,smbd/smbd"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ pre_configure_target() {
|
|||
rm -rf .${TARGET_NAME}
|
||||
|
||||
# work around link issues
|
||||
export LDFLAGS="${LDFLAGS} -lreadline -lncurses"
|
||||
export LDFLAGS="${LDFLAGS} -lreadline -lncursesw -ltinfow"
|
||||
|
||||
# support 64-bit offsets and seeks on 32-bit platforms
|
||||
if [ "${TARGET_ARCH}" = "arm" ]; then
|
||||
|
@ -155,6 +155,12 @@ perform_manual_install() {
|
|||
mkdir -p ${INSTALL}/usr/sbin
|
||||
cp -L ${PKG_BUILD}/bin/smbd ${INSTALL}/usr/sbin
|
||||
cp -L ${PKG_BUILD}/bin/nmbd ${INSTALL}/usr/sbin
|
||||
|
||||
mkdir -p ${INSTALL}/usr/libexec/samba
|
||||
cp -PR bin/default/source3/rpc_server/samba-dcerpcd ${INSTALL}/usr/libexec/samba
|
||||
cp -PR bin/default/source3/rpc_server/rpcd_classic ${INSTALL}/usr/libexec/samba
|
||||
cp -PR bin/default/source3/rpc_server/rpcd_epmapper ${INSTALL}/usr/libexec/samba
|
||||
cp -PR bin/default/source3/rpc_server/rpcd_winreg ${INSTALL}/usr/libexec/samba
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -166,11 +172,6 @@ post_makeinstall_target() {
|
|||
rm -rf ${INSTALL}/usr/share/perl*
|
||||
rm -rf ${INSTALL}/usr/lib64
|
||||
|
||||
mkdir -p ${INSTALL}/usr/lib/samba
|
||||
cp ${PKG_DIR}/scripts/samba-config ${INSTALL}/usr/lib/samba
|
||||
cp ${PKG_DIR}/scripts/smbd-config ${INSTALL}/usr/lib/samba
|
||||
cp ${PKG_DIR}/scripts/samba-autoshare ${INSTALL}/usr/lib/samba
|
||||
|
||||
if find_file_path config/smb.conf; then
|
||||
mkdir -p ${INSTALL}/etc/samba
|
||||
cp ${FOUND_PATH} ${INSTALL}/etc/samba
|
||||
|
@ -188,19 +189,6 @@ post_makeinstall_target() {
|
|||
mkdir -p ${INSTALL}/usr/bin
|
||||
cp -PR bin/default/source3/utils/smbpasswd ${INSTALL}/usr/bin
|
||||
|
||||
mkdir -p ${INSTALL}/usr/lib/systemd/system
|
||||
cp ${PKG_DIR}/system.d.opt/* ${INSTALL}/usr/lib/systemd/system
|
||||
|
||||
mkdir -p ${INSTALL}/usr/share/services
|
||||
cp -P ${PKG_DIR}/default.d/*.conf ${INSTALL}/usr/share/services
|
||||
fi
|
||||
}
|
||||
|
||||
post_install() {
|
||||
enable_service samba-config.service
|
||||
|
||||
if [ "${SAMBA_SERVER}" = "yes" ]; then
|
||||
enable_service nmbd.service
|
||||
enable_service smbd.service
|
||||
fi
|
||||
}
|
||||
|
|
|
@ -1,733 +0,0 @@
|
|||
From cf43283d9dac9116e178364b1005a32756fffa75 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Sat, 19 Feb 2022 08:52:17 +0100
|
||||
Subject: [PATCH 1/8] buildtools: Reformat shell scripts
|
||||
|
||||
shfmt -f buildtools | xargs shfmt -w -p -i 0 -fn
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
(cherry picked from commit 2d5d88ff34532ba2d78997467e5720bba480f07e)
|
||||
---
|
||||
buildtools/compare_config_h4.sh | 4 +-
|
||||
buildtools/compare_generated.sh | 59 ++++++++++++++-------------
|
||||
buildtools/compare_install.sh | 4 +-
|
||||
buildtools/scripts/abi_gen.sh | 22 +++++------
|
||||
buildtools/scripts/autogen-waf.sh | 6 +--
|
||||
buildtools/testwaf.sh | 66 +++++++++++++++----------------
|
||||
6 files changed, 80 insertions(+), 81 deletions(-)
|
||||
|
||||
diff --git a/buildtools/compare_config_h4.sh b/buildtools/compare_config_h4.sh
|
||||
index b78b36fdd0fa..fee8abfbd503 100755
|
||||
--- a/buildtools/compare_config_h4.sh
|
||||
+++ b/buildtools/compare_config_h4.sh
|
||||
@@ -3,8 +3,8 @@
|
||||
# compare the generated config.h from a waf build with existing samba
|
||||
# build
|
||||
|
||||
-grep "^.define" bin/default/source4/include/config.h | sort > waf-config.h
|
||||
-grep "^.define" $HOME/samba_old/source4/include/config.h | sort > old-config.h
|
||||
+grep "^.define" bin/default/source4/include/config.h | sort >waf-config.h
|
||||
+grep "^.define" $HOME/samba_old/source4/include/config.h | sort >old-config.h
|
||||
|
||||
comm -23 old-config.h waf-config.h
|
||||
|
||||
diff --git a/buildtools/compare_generated.sh b/buildtools/compare_generated.sh
|
||||
index ebef8a979bde..e62657958139 100755
|
||||
--- a/buildtools/compare_generated.sh
|
||||
+++ b/buildtools/compare_generated.sh
|
||||
@@ -10,41 +10,40 @@ gen_files=$(cd bin/default && find . -type f -name '*.[ch]')
|
||||
|
||||
strip_file()
|
||||
{
|
||||
- in_file=$1
|
||||
- out_file=$2
|
||||
- cat $in_file |
|
||||
- grep -v 'The following definitions come from' |
|
||||
- grep -v 'Automatically generated at' |
|
||||
- grep -v 'Generated from' |
|
||||
- sed 's|/home/tnagy/samba/source4||g' |
|
||||
- sed 's|/home/tnagy/samba/|../|g' |
|
||||
- sed 's|bin/default/source4/||g' |
|
||||
- sed 's|bin/default/|../|g' |
|
||||
- sed 's/define _____/define ___/g' |
|
||||
- sed 's/define __*/define _/g' |
|
||||
- sed 's/define _DEFAULT_/define _/g' |
|
||||
- sed 's/define _SOURCE4_/define ___/g' |
|
||||
- sed 's/define ___/define _/g' |
|
||||
- sed 's/ifndef ___/ifndef _/g' |
|
||||
- sed 's|endif /* ____|endif /* __|g' |
|
||||
- sed s/__DEFAULT_SOURCE4/__/ |
|
||||
- sed s/__DEFAULT_SOURCE4/__/ |
|
||||
- sed s/__DEFAULT/____/ > $out_file
|
||||
+ in_file=$1
|
||||
+ out_file=$2
|
||||
+ cat $in_file |
|
||||
+ grep -v 'The following definitions come from' |
|
||||
+ grep -v 'Automatically generated at' |
|
||||
+ grep -v 'Generated from' |
|
||||
+ sed 's|/home/tnagy/samba/source4||g' |
|
||||
+ sed 's|/home/tnagy/samba/|../|g' |
|
||||
+ sed 's|bin/default/source4/||g' |
|
||||
+ sed 's|bin/default/|../|g' |
|
||||
+ sed 's/define _____/define ___/g' |
|
||||
+ sed 's/define __*/define _/g' |
|
||||
+ sed 's/define _DEFAULT_/define _/g' |
|
||||
+ sed 's/define _SOURCE4_/define ___/g' |
|
||||
+ sed 's/define ___/define _/g' |
|
||||
+ sed 's/ifndef ___/ifndef _/g' |
|
||||
+ sed 's|endif /* ____|endif /* __|g' |
|
||||
+ sed s/__DEFAULT_SOURCE4/__/ |
|
||||
+ sed s/__DEFAULT_SOURCE4/__/ |
|
||||
+ sed s/__DEFAULT/____/ >$out_file
|
||||
}
|
||||
|
||||
compare_file()
|
||||
{
|
||||
- f=$f
|
||||
- bname=$(basename $f)
|
||||
- t1=/tmp/$bname.old.$$
|
||||
- t2=/tmp/$bname.new.$$
|
||||
- strip_file $old_build/$f $t1
|
||||
- strip_file bin/default/$f $t2
|
||||
- diff -u -b $t1 $t2 2>&1
|
||||
- rm -f $t1 $t2
|
||||
+ f=$f
|
||||
+ bname=$(basename $f)
|
||||
+ t1=/tmp/$bname.old.$$
|
||||
+ t2=/tmp/$bname.new.$$
|
||||
+ strip_file $old_build/$f $t1
|
||||
+ strip_file bin/default/$f $t2
|
||||
+ diff -u -b $t1 $t2 2>&1
|
||||
+ rm -f $t1 $t2
|
||||
}
|
||||
|
||||
for f in $gen_files; do
|
||||
- compare_file $f
|
||||
+ compare_file $f
|
||||
done
|
||||
-
|
||||
diff --git a/buildtools/compare_install.sh b/buildtools/compare_install.sh
|
||||
index b964117550b6..37772a46a4ca 100755
|
||||
--- a/buildtools/compare_install.sh
|
||||
+++ b/buildtools/compare_install.sh
|
||||
@@ -3,6 +3,6 @@
|
||||
prefix1="$1"
|
||||
prefix2="$2"
|
||||
|
||||
-(cd $prefix1 && find . ) | sort > p1.txt
|
||||
-(cd $prefix2 && find . ) | sort > p2.txt
|
||||
+(cd $prefix1 && find .) | sort >p1.txt
|
||||
+(cd $prefix2 && find .) | sort >p2.txt
|
||||
diff -u p[12].txt
|
||||
diff --git a/buildtools/scripts/autogen-waf.sh b/buildtools/scripts/autogen-waf.sh
|
||||
index 7a6e94c5ec4d..a0ed80c33fa6 100755
|
||||
--- a/buildtools/scripts/autogen-waf.sh
|
||||
+++ b/buildtools/scripts/autogen-waf.sh
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
-p=`dirname $0`
|
||||
+p=$(dirname $0)
|
||||
|
||||
echo "Setting up for waf build"
|
||||
|
||||
@@ -13,12 +13,12 @@ echo "Found buildtools in $p/$d"
|
||||
|
||||
echo "Setting up configure"
|
||||
rm -f $p/configure $p/include/config*.h*
|
||||
-sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure
|
||||
+sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" <"$p/$d/scripts/configure.waf" >$p/configure
|
||||
chmod +x $p/configure
|
||||
|
||||
echo "Setting up Makefile"
|
||||
rm -f $p/makefile $p/Makefile
|
||||
-sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/Makefile
|
||||
+sed "s|BUILDTOOLS|$d|g" <"$p/$d/scripts/Makefile.waf" >$p/Makefile
|
||||
|
||||
echo "done. Now run $p/configure or $p/configure.developer then make."
|
||||
if [ $p != "." ]; then
|
||||
diff --git a/buildtools/testwaf.sh b/buildtools/testwaf.sh
|
||||
index 127e52589103..3e8e6431c783 100755
|
||||
--- a/buildtools/testwaf.sh
|
||||
+++ b/buildtools/testwaf.sh
|
||||
@@ -9,52 +9,52 @@ cd $d/..
|
||||
PREFIX=$HOME/testprefix
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
- tests="$*"
|
||||
+ tests="$*"
|
||||
else
|
||||
- tests="lib/replace lib/talloc lib/tevent lib/tdb lib/ldb"
|
||||
+ tests="lib/replace lib/talloc lib/tevent lib/tdb lib/ldb"
|
||||
fi
|
||||
|
||||
echo "testing in dirs $tests"
|
||||
|
||||
for d in $tests; do
|
||||
- echo "`date`: testing $d"
|
||||
- pushd $d
|
||||
- rm -rf bin
|
||||
- type waf
|
||||
- waf dist
|
||||
- ./configure -C --enable-developer --prefix=$PREFIX
|
||||
- time make
|
||||
- make install
|
||||
- make distcheck
|
||||
- case $d in
|
||||
+ echo "$(date): testing $d"
|
||||
+ pushd $d
|
||||
+ rm -rf bin
|
||||
+ type waf
|
||||
+ waf dist
|
||||
+ ./configure -C --enable-developer --prefix=$PREFIX
|
||||
+ time make
|
||||
+ make install
|
||||
+ make distcheck
|
||||
+ case $d in
|
||||
"lib/ldb")
|
||||
- ldd bin/ldbadd
|
||||
- ;;
|
||||
+ ldd bin/ldbadd
|
||||
+ ;;
|
||||
"lib/replace")
|
||||
- ldd bin/replace_testsuite
|
||||
- ;;
|
||||
+ ldd bin/replace_testsuite
|
||||
+ ;;
|
||||
"lib/talloc")
|
||||
- ldd bin/talloc_testsuite
|
||||
- ;;
|
||||
+ ldd bin/talloc_testsuite
|
||||
+ ;;
|
||||
"lib/tdb")
|
||||
- ldd bin/tdbtool
|
||||
- ;;
|
||||
- esac
|
||||
- popd
|
||||
+ ldd bin/tdbtool
|
||||
+ ;;
|
||||
+ esac
|
||||
+ popd
|
||||
done
|
||||
|
||||
echo "testing python portability"
|
||||
pushd lib/talloc
|
||||
versions="python2.4 python2.5 python2.6 python3.0 python3.1"
|
||||
for p in $versions; do
|
||||
- ret=$(which $p || echo "failed")
|
||||
- if [ $ret = "failed" ]; then
|
||||
- echo "$p not found, skipping"
|
||||
- continue
|
||||
- fi
|
||||
- echo "Testing $p"
|
||||
- $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX
|
||||
- $p ../../buildtools/bin/waf build install
|
||||
+ ret=$(which $p || echo "failed")
|
||||
+ if [ $ret = "failed" ]; then
|
||||
+ echo "$p not found, skipping"
|
||||
+ continue
|
||||
+ fi
|
||||
+ echo "Testing $p"
|
||||
+ $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX
|
||||
+ $p ../../buildtools/bin/waf build install
|
||||
done
|
||||
popd
|
||||
|
||||
@@ -62,9 +62,9 @@ echo "testing cross compiling"
|
||||
pushd lib/talloc
|
||||
ret=$(which arm-linux-gnueabi-gcc || echo "failed")
|
||||
if [ $ret != "failed" ]; then
|
||||
- CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX --cross-compile --cross-execute='runarm'
|
||||
- make && make install
|
||||
+ CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX --cross-compile --cross-execute='runarm'
|
||||
+ make && make install
|
||||
else
|
||||
- echo "Cross-compiler not installed, skipping test"
|
||||
+ echo "Cross-compiler not installed, skipping test"
|
||||
fi
|
||||
popd
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From bccb8b807bb1c00ffc2cd95cadfee253eb0d0cff Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Mon, 28 Mar 2022 12:38:02 +0200
|
||||
Subject: [PATCH 2/8] buildtools: remove unused testwaf.sh
|
||||
|
||||
Signed-off-by: Stefan Metzmacher <metze@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
(cherry picked from commit 42eeed05f1aed10b48f7008a18e47cf15ac2c010)
|
||||
---
|
||||
buildtools/testwaf.sh | 70 -------------------------------------------
|
||||
1 file changed, 70 deletions(-)
|
||||
delete mode 100755 buildtools/testwaf.sh
|
||||
|
||||
diff --git a/buildtools/testwaf.sh b/buildtools/testwaf.sh
|
||||
deleted file mode 100755
|
||||
index 3e8e6431c783..000000000000
|
||||
--- a/buildtools/testwaf.sh
|
||||
+++ /dev/null
|
||||
@@ -1,70 +0,0 @@
|
||||
-#!/bin/bash
|
||||
-
|
||||
-set -e
|
||||
-set -x
|
||||
-
|
||||
-d=$(dirname $0)
|
||||
-
|
||||
-cd $d/..
|
||||
-PREFIX=$HOME/testprefix
|
||||
-
|
||||
-if [ $# -gt 0 ]; then
|
||||
- tests="$*"
|
||||
-else
|
||||
- tests="lib/replace lib/talloc lib/tevent lib/tdb lib/ldb"
|
||||
-fi
|
||||
-
|
||||
-echo "testing in dirs $tests"
|
||||
-
|
||||
-for d in $tests; do
|
||||
- echo "$(date): testing $d"
|
||||
- pushd $d
|
||||
- rm -rf bin
|
||||
- type waf
|
||||
- waf dist
|
||||
- ./configure -C --enable-developer --prefix=$PREFIX
|
||||
- time make
|
||||
- make install
|
||||
- make distcheck
|
||||
- case $d in
|
||||
- "lib/ldb")
|
||||
- ldd bin/ldbadd
|
||||
- ;;
|
||||
- "lib/replace")
|
||||
- ldd bin/replace_testsuite
|
||||
- ;;
|
||||
- "lib/talloc")
|
||||
- ldd bin/talloc_testsuite
|
||||
- ;;
|
||||
- "lib/tdb")
|
||||
- ldd bin/tdbtool
|
||||
- ;;
|
||||
- esac
|
||||
- popd
|
||||
-done
|
||||
-
|
||||
-echo "testing python portability"
|
||||
-pushd lib/talloc
|
||||
-versions="python2.4 python2.5 python2.6 python3.0 python3.1"
|
||||
-for p in $versions; do
|
||||
- ret=$(which $p || echo "failed")
|
||||
- if [ $ret = "failed" ]; then
|
||||
- echo "$p not found, skipping"
|
||||
- continue
|
||||
- fi
|
||||
- echo "Testing $p"
|
||||
- $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX
|
||||
- $p ../../buildtools/bin/waf build install
|
||||
-done
|
||||
-popd
|
||||
-
|
||||
-echo "testing cross compiling"
|
||||
-pushd lib/talloc
|
||||
-ret=$(which arm-linux-gnueabi-gcc || echo "failed")
|
||||
-if [ $ret != "failed" ]; then
|
||||
- CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX --cross-compile --cross-execute='runarm'
|
||||
- make && make install
|
||||
-else
|
||||
- echo "Cross-compiler not installed, skipping test"
|
||||
-fi
|
||||
-popd
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From 8b609eb416bd737578a79beabb3bd736d341e326 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Mon, 28 Mar 2022 12:49:24 +0200
|
||||
Subject: [PATCH 3/8] lib/fuzzing/README.md: don't use waf directly
|
||||
|
||||
Signed-off-by: Stefan Metzmacher <metze@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
(cherry picked from commit 10d69da1d34b2b11920d9bf051f5a26dbbcadf02)
|
||||
---
|
||||
lib/fuzzing/README.md | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/lib/fuzzing/README.md b/lib/fuzzing/README.md
|
||||
index 33d33b923905..d3e34bd79a36 100644
|
||||
--- a/lib/fuzzing/README.md
|
||||
+++ b/lib/fuzzing/README.md
|
||||
@@ -17,9 +17,9 @@ Example command line to build binaries for use with
|
||||
[honggfuzz](https://github.com/google/honggfuzz/):
|
||||
|
||||
```sh
|
||||
-buildtools/bin/waf -C --without-gettext --enable-debug --enable-developer \
|
||||
+./configure -C --without-gettext --enable-debug --enable-developer \
|
||||
--address-sanitizer --enable-libfuzzer --abi-check-disable \
|
||||
- CC=.../honggfuzz/hfuzz_cc/hfuzz-clang configure \
|
||||
+ CC=.../honggfuzz/hfuzz_cc/hfuzz-clang \
|
||||
LINK_CC=.../honggfuzz/hfuzz_cc/hfuzz-clang
|
||||
```
|
||||
|
||||
@@ -30,7 +30,7 @@ Example for fuzzing `tiniparser` using `honggfuzz` (see `--help` for more
|
||||
options):
|
||||
|
||||
```sh
|
||||
-buildtools/bin/waf --targets=fuzz_tiniparser build && \
|
||||
+make bin/fuzz_tiniparser && \
|
||||
.../honggfuzz/honggfuzz --sanitizers --timeout 3 --max_file_size 256 \
|
||||
--rlimit_rss 100 -f .../tiniparser-corpus -- bin/fuzz_tiniparser
|
||||
```
|
||||
@@ -43,9 +43,9 @@ Example command line to build binaries for use with
|
||||
[afl](http://lcamtuf.coredump.cx/afl/)
|
||||
|
||||
```sh
|
||||
-buildtools/bin/waf -C --without-gettext --enable-debug --enable-developer \
|
||||
+./configure -C --without-gettext --enable-debug --enable-developer \
|
||||
--enable-afl-fuzzer --abi-check-disable \
|
||||
- CC=afl-gcc configure
|
||||
+ CC=afl-gcc
|
||||
```
|
||||
|
||||
## Fuzzing tiniparser
|
||||
@@ -54,7 +54,7 @@ Example for fuzzing `tiniparser` using `afl-fuzz` (see `--help` for more
|
||||
options):
|
||||
|
||||
```sh
|
||||
-buildtools/bin/waf --targets=fuzz_tiniparser build && \
|
||||
+make bin/fuzz_tiniparser build && \
|
||||
afl-fuzz -m 200 -i inputdir -o outputdir -- bin/fuzz_tiniparser
|
||||
```
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From 16d566b1139f56686fac969d3bc362be162bad28 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Mon, 28 Mar 2022 12:50:55 +0200
|
||||
Subject: [PATCH 5/8] wafsamba: let test_duplicate_symbol.sh export
|
||||
PYTHONHASHSEED=1
|
||||
|
||||
Signed-off-by: Stefan Metzmacher <metze@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
(cherry picked from commit a6b1e4b5766205b7337e0e4b00944184289bfc36)
|
||||
---
|
||||
buildtools/wafsamba/test_duplicate_symbol.sh | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/buildtools/wafsamba/test_duplicate_symbol.sh b/buildtools/wafsamba/test_duplicate_symbol.sh
|
||||
index 46f44a67dcf8..dffac7570022 100755
|
||||
--- a/buildtools/wafsamba/test_duplicate_symbol.sh
|
||||
+++ b/buildtools/wafsamba/test_duplicate_symbol.sh
|
||||
@@ -5,6 +5,9 @@
|
||||
|
||||
subunit_start_test duplicate_symbols
|
||||
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
if $PYTHON ./buildtools/bin/waf build --dup-symbol-check; then
|
||||
subunit_pass_test duplicate_symbols
|
||||
else
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From 73295e83a14b1ed662ca842b531c1f84143301ca Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Mon, 28 Mar 2022 12:59:12 +0200
|
||||
Subject: [PATCH 6/8] configure/Makefile: export PYTHONHASHSEED=1 in all
|
||||
'configure/Makefile' scripts
|
||||
|
||||
Signed-off-by: Stefan Metzmacher <metze@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
(cherry picked from commit 22c46d9f41876d9ec7187148e658d1692bf37cdd)
|
||||
---
|
||||
buildtools/scripts/Makefile.waf | 4 ++--
|
||||
buildtools/scripts/configure.waf | 11 +++++++++--
|
||||
configure | 4 ++++
|
||||
ctdb/Makefile | 2 +-
|
||||
ctdb/configure | 7 +++++++
|
||||
lib/ldb/configure | 7 +++++++
|
||||
lib/replace/configure | 7 +++++++
|
||||
lib/talloc/configure | 7 +++++++
|
||||
lib/tdb/configure | 7 +++++++
|
||||
lib/tevent/configure | 7 +++++++
|
||||
10 files changed, 58 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/buildtools/scripts/Makefile.waf b/buildtools/scripts/Makefile.waf
|
||||
index 5fc939c99e03..a15a5f87607e 100644
|
||||
--- a/buildtools/scripts/Makefile.waf
|
||||
+++ b/buildtools/scripts/Makefile.waf
|
||||
@@ -1,7 +1,7 @@
|
||||
# simple makefile wrapper to run waf
|
||||
|
||||
-WAF_BINARY=BUILDTOOLS/bin/waf
|
||||
-WAF=WAF_MAKE=1 $(WAF_BINARY)
|
||||
+WAF_BINARY=$(PYTHON) BUILDTOOLS/bin/waf
|
||||
+WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY)
|
||||
|
||||
all:
|
||||
$(WAF) build
|
||||
diff --git a/buildtools/scripts/configure.waf b/buildtools/scripts/configure.waf
|
||||
index a7d8d1dbd641..ccb62849a54f 100755
|
||||
--- a/buildtools/scripts/configure.waf
|
||||
+++ b/buildtools/scripts/configure.waf
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
-PREVPATH=`dirname $0`
|
||||
+PREVPATH=$(dirname $0)
|
||||
|
||||
WAF=BUILDTOOLS/bin/waf
|
||||
|
||||
@@ -9,6 +9,13 @@ WAF=BUILDTOOLS/bin/waf
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd BUILDPATH || exit 1
|
||||
-$WAF configure "$@" || exit 1
|
||||
+$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/configure b/configure
|
||||
index a6ca50feb470..9153c0e5f784 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -12,6 +12,10 @@ export JOBS
|
||||
# Make sure we don't have any library preloaded.
|
||||
unset LD_PRELOAD
|
||||
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/ctdb/Makefile b/ctdb/Makefile
|
||||
index ec362e294082..5dbc7acdc54e 100644
|
||||
--- a/ctdb/Makefile
|
||||
+++ b/ctdb/Makefile
|
||||
@@ -1,7 +1,7 @@
|
||||
# simple makefile wrapper to run waf
|
||||
|
||||
WAF_BINARY=$(PYTHON) ../buildtools/bin/waf
|
||||
-WAF=WAF_MAKE=1 $(WAF_BINARY)
|
||||
+WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY)
|
||||
|
||||
all:
|
||||
$(WAF) build
|
||||
diff --git a/ctdb/configure b/ctdb/configure
|
||||
index dbb0c1446b51..48b786b1612d 100755
|
||||
--- a/ctdb/configure
|
||||
+++ b/ctdb/configure
|
||||
@@ -10,6 +10,13 @@ WAF=buildtools/bin/waf
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/lib/ldb/configure b/lib/ldb/configure
|
||||
index 6c931bfbf5e2..28d62ab27ae2 100755
|
||||
--- a/lib/ldb/configure
|
||||
+++ b/lib/ldb/configure
|
||||
@@ -16,6 +16,13 @@ fi
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/lib/replace/configure b/lib/replace/configure
|
||||
index d8a8d2ac2f39..091f814e5f2c 100755
|
||||
--- a/lib/replace/configure
|
||||
+++ b/lib/replace/configure
|
||||
@@ -16,6 +16,13 @@ fi
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/lib/talloc/configure b/lib/talloc/configure
|
||||
index d8a8d2ac2f39..091f814e5f2c 100755
|
||||
--- a/lib/talloc/configure
|
||||
+++ b/lib/talloc/configure
|
||||
@@ -16,6 +16,13 @@ fi
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/lib/tdb/configure b/lib/tdb/configure
|
||||
index d8a8d2ac2f39..091f814e5f2c 100755
|
||||
--- a/lib/tdb/configure
|
||||
+++ b/lib/tdb/configure
|
||||
@@ -16,6 +16,13 @@ fi
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
diff --git a/lib/tevent/configure b/lib/tevent/configure
|
||||
index c3c444754e3d..0dc9bace4356 100755
|
||||
--- a/lib/tevent/configure
|
||||
+++ b/lib/tevent/configure
|
||||
@@ -16,6 +16,13 @@ fi
|
||||
JOBS=1
|
||||
export JOBS
|
||||
|
||||
+# Make sure we don't have any library preloaded.
|
||||
+unset LD_PRELOAD
|
||||
+
|
||||
+# Make sure we get stable hashes
|
||||
+PYTHONHASHSEED=1
|
||||
+export PYTHONHASHSEED
|
||||
+
|
||||
cd . || exit 1
|
||||
$PYTHON $WAF configure "$@" || exit 1
|
||||
cd $PREVPATH
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From 2cd1e53284c0c212c62d909028c5bd9872493934 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Mon, 28 Mar 2022 12:38:36 +0200
|
||||
Subject: [PATCH 7/8] ctdb/packaging/RPM: don't use waf directly
|
||||
|
||||
./configure && make && make install is will always work.
|
||||
|
||||
Signed-off-by: Stefan Metzmacher <metze@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
(cherry picked from commit aa02cf3c4449cb0a22da8f359f0b3edc4f1d9bb7)
|
||||
---
|
||||
ctdb/packaging/RPM/ctdb.spec.in | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/ctdb/packaging/RPM/ctdb.spec.in b/ctdb/packaging/RPM/ctdb.spec.in
|
||||
index 80eb2945e419..ea5c5a256ec9 100644
|
||||
--- a/ctdb/packaging/RPM/ctdb.spec.in
|
||||
+++ b/ctdb/packaging/RPM/ctdb.spec.in
|
||||
@@ -88,7 +88,7 @@ fi
|
||||
export CC
|
||||
|
||||
CFLAGS="$RPM_OPT_FLAGS $EXTRA -D_GNU_SOURCE" \
|
||||
-$PYTHON ./buildtools/bin/waf configure \
|
||||
+./configure \
|
||||
--builtin-libraries=replace,popt \
|
||||
--bundled-libraries=!talloc,!tevent,!tdb \
|
||||
--minimum-library-version=talloc:%libtalloc_version,tdb:%libtdb_version,tevent:%libtevent_version \
|
||||
@@ -103,7 +103,7 @@ $PYTHON ./buildtools/bin/waf configure \
|
||||
--mandir=%{_mandir} \
|
||||
--localstatedir=%{_localstatedir}
|
||||
|
||||
-$PYTHON ./buildtools/bin/waf build
|
||||
+make -j
|
||||
|
||||
%install
|
||||
# Clean up in case there is trash left from a previous build
|
||||
@@ -112,7 +112,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
# Create the target build directory hierarchy
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sudoers.d
|
||||
|
||||
-DESTDIR=$RPM_BUILD_ROOT $PYTHON ./buildtools/bin/waf install
|
||||
+DESTDIR=$RPM_BUILD_ROOT make -j install
|
||||
|
||||
install -m644 config/ctdb.conf $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
|
||||
install -m644 config/ctdb.tunables $RPM_BUILD_ROOT%{_sysconfdir}/ctdb
|
||||
--
|
||||
2.25.1
|
||||
|
||||
|
||||
From 5a6029aa55d806647fe1e2e0c3a6ca58aaf79ca0 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Metzmacher <metze@samba.org>
|
||||
Date: Mon, 28 Mar 2022 13:00:03 +0200
|
||||
Subject: [PATCH 8/8] wafsamba: require PYTHONHASHSEED=1 to be exported
|
||||
|
||||
This avoids a lot of trouble with random build failures,
|
||||
if people try to use waf directly.
|
||||
|
||||
Signed-off-by: Stefan Metzmacher <metze@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
|
||||
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
|
||||
Autobuild-Date(master): Tue Mar 29 23:31:38 UTC 2022 on sn-devel-184
|
||||
|
||||
(cherry picked from commit 420bbb1d92fd2a28725b53f425ba3d214831b660)
|
||||
|
||||
The last 8 patches are backported to avoid people running into:
|
||||
https://bugzilla.samba.org/show_bug.cgi?id=15033
|
||||
and
|
||||
https://bugzilla.samba.org/show_bug.cgi?id=15037
|
||||
---
|
||||
buildtools/wafsamba/wscript | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
|
||||
index a4d6f3e5c49e..8729b0829daa 100644
|
||||
--- a/buildtools/wafsamba/wscript
|
||||
+++ b/buildtools/wafsamba/wscript
|
||||
@@ -8,6 +8,10 @@ import wafsamba
|
||||
from samba_utils import symlink
|
||||
from optparse import SUPPRESS_HELP
|
||||
|
||||
+phs = os.environ.get("PYTHONHASHSEED", None)
|
||||
+if phs != "1":
|
||||
+ raise Errors.WafError('''PYTHONHASHSEED=1 missing! Don't use waf directly, use ./configure and make!''')
|
||||
+
|
||||
# this forces configure to be re-run if any of the configure
|
||||
# sections of the build scripts change. We have to check
|
||||
# for this in sys.argv as options have not yet been parsed when
|
||||
--
|
||||
2.25.1
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
|
||||
--- a/docs-xml/wscript_build 2020-12-05 09:01:19.652459634 +0000
|
||||
+++ b/docs-xml/wscript_build 2020-12-05 09:10:10.639446971 +0000
|
||||
@@ -154,31 +154,3 @@
|
||||
target=parameter_all,
|
||||
rule=smbdotconf_generate_parameter_list,
|
||||
@@ -175,32 +175,3 @@
|
||||
target=path_entities,
|
||||
rule=generate_path_entity_file,
|
||||
dep_vars=bld.dynconfig_varnames())
|
||||
-
|
||||
-
|
||||
-def SMBDOTCONF_MANPAGE(bld, target):
|
||||
- ''' assemble and build smb.conf.5 manual page'''
|
||||
- bld.SAMBAMANPAGES(target, parameter_all)
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2009-2017 Stephan Raue (stephan@openelec.tv)
|
||||
|
||||
if [ -f /storage/.cache/services/samba.conf ]; then
|
||||
. /storage/.cache/services/samba.conf
|
||||
|
||||
if [ "$SAMBA_AUTOSHARE" == "true" ] ; then
|
||||
/usr/lib/samba/samba-config
|
||||
[ -f /run/samba/smbd.pid ] && pkill -HUP smbd
|
||||
fi
|
||||
fi
|
|
@ -1,41 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2009-2017 Stephan Raue (stephan@openelec.tv)
|
||||
|
||||
SMB_USERCONF="/storage/.config/samba.conf"
|
||||
SMB_DEFCONF="/etc/samba/smb.conf"
|
||||
SMB_CONF="/run/samba/smb.conf"
|
||||
|
||||
SMB_USERCONF_IS_VALID=no
|
||||
SMB_CONFIG_VERSION=4
|
||||
|
||||
# If user config is based on legacy OpenELEC, or old version (or no version)
|
||||
# then don't use it, and log a warning.
|
||||
if [ -f $SMB_USERCONF ]; then
|
||||
SMB_IS_LEGACY="$(awk 'NR <= 2 && /This file is part of OpenELEC/{ print }' $SMB_USERCONF)"
|
||||
SMB_THIS_VER="$(awk '/^# samba.conf v[0-9\.]*/{ print substr($3,2); exit }' $SMB_USERCONF)"
|
||||
if [ -n "${SMB_IS_LEGACY}" ]; then
|
||||
echo "WARNING: Ignoring user config $SMB_USERCONF due to incompatibility [Old style OpenELEC]"
|
||||
elif [ -z "${SMB_THIS_VER}" ]; then
|
||||
echo "WARNING: Ignoring user config $SMB_USERCONF due to incompatibility [version is unknown or invalid]"
|
||||
elif [ ${SMB_THIS_VER} != ${SMB_CONFIG_VERSION} ]; then
|
||||
echo "WARNING: Ignoring user config $SMB_USERCONF due to incompatibility [version ${SMB_THIS_VER} is not the required version $SMB_CONFIG_VERSION]"
|
||||
else
|
||||
SMB_USERCONF_IS_VALID=yes
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p $(dirname $SMB_CONF)
|
||||
if [ $SMB_USERCONF_IS_VALID = yes ]; then
|
||||
cp $SMB_USERCONF $SMB_CONF
|
||||
else
|
||||
cp $SMB_DEFCONF $SMB_CONF
|
||||
fi
|
||||
|
||||
# Generate smb.conf, unless disabled
|
||||
if [ ! -f /storage/.cache/services/samba.disabled ]; then
|
||||
/usr/lib/samba/smbd-config
|
||||
fi
|
||||
|
||||
exit 0
|
|
@ -1,77 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
# Copyright (C) 2009-2017 Stephan Raue (stephan@openelec.tv)
|
||||
# Copyright (C) 2020-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
SMB_CONF="/run/samba/smb.conf"
|
||||
SMB_TMP="$(mktemp -p /run/samba)"
|
||||
|
||||
cp -f $SMB_CONF $SMB_TMP
|
||||
|
||||
if [ ! -f /storage/.cache/services/samba.conf ]; then
|
||||
cp /usr/share/services/samba.conf /storage/.cache/services
|
||||
fi
|
||||
|
||||
# Specify defaults here, in case these new properties not yet added in .cache
|
||||
SAMBA_WORKGROUP=WORKGROUP
|
||||
SAMBA_MINPROTOCOL=SMB2
|
||||
SAMBA_MAXPROTOCOL=SMB3
|
||||
|
||||
. /storage/.cache/services/samba.conf
|
||||
|
||||
# fixup synonyms
|
||||
sed -i 's/browsable/browseable/g; s/writable/writeable/g' $SMB_TMP
|
||||
|
||||
# handle external drives
|
||||
if [ "$SAMBA_AUTOSHARE" == "true" ] ; then
|
||||
for dir in /media/* ; do
|
||||
if [ -d "$dir" ] ; then
|
||||
name=$(basename "$dir")
|
||||
echo -e "[$name]\n path = $dir\n available = yes\n browseable = yes\n public = yes\n writeable = yes\n" >> $SMB_TMP
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Allow access to a "failed" (safe mode) Kodi installation
|
||||
if [ -d /storage/.kodi.FAILED ]; then
|
||||
echo -e "[Kodi-Failed]\n path = /storage/.kodi.FAILED\n available = yes\n browseable = yes\n public = yes\n writeable = yes\n" >> $SMB_TMP
|
||||
fi
|
||||
|
||||
ADD_CONFIG=
|
||||
|
||||
# If workgroup is not set, don't set it - who knows, user may know better.
|
||||
if [ -n "$SAMBA_WORKGROUP" ]; then
|
||||
# Remove any existing workgroup setting
|
||||
sed -E '/^[[:space:]]*workgroup[[:space:]]*=/d' -i $SMB_TMP
|
||||
ADD_CONFIG="${ADD_CONFIG} workgroup = ${SAMBA_WORKGROUP:-WORKGROUP}\n"
|
||||
fi
|
||||
|
||||
ADD_CONFIG="${ADD_CONFIG} server min protocol = ${SAMBA_MINPROTOCOL/SMB1/NT1}\n"
|
||||
ADD_CONFIG="${ADD_CONFIG} server max protocol = ${SAMBA_MAXPROTOCOL/SMB1/NT1}\n"
|
||||
|
||||
# Add extra config after [global], escaping spaces so that all are retained by sed
|
||||
sed -e "/\[global\]/ a ${ADD_CONFIG// /\\ }" -i $SMB_TMP
|
||||
|
||||
if [ "$SAMBA_SECURE" == "true" -a ! "$SAMBA_USERNAME" == "" -a ! "$SAMBA_PASSWORD" == "" ] ; then
|
||||
# username map: first line makes sure plain root does not work all the time
|
||||
# processing continues, so if user chooses root as username, second line overrides the first
|
||||
# this is done always in case user uses passwords in userconf.
|
||||
# many thanks to viljoviitanen for this
|
||||
printf "%s\n%s" "$SAMBA_PASSWORD" "$SAMBA_PASSWORD" | smbpasswd -s -a root >/dev/null 2>&1
|
||||
printf "nobody = root\nroot = %s" "$SAMBA_USERNAME" > /run/samba/samba.map
|
||||
|
||||
sed -e 's|^.[ \t]*.public.=.*| public = no |' \
|
||||
-e 's|^.[ \t]*.username map.=.*||' \
|
||||
-e 's|^.[ \t]*.security.=.*| security = user\n username map = /run/samba/samba.map|' \
|
||||
-e 's|^.[ \t]*.map.to.guest.=.*| map to guest = Never|' \
|
||||
-i $SMB_TMP
|
||||
else
|
||||
sed -e 's|^.[ \t]*.public.=.*| public = yes |' \
|
||||
-e 's|^.[ \t]*.username map.=.*||' \
|
||||
-e 's|^.[ \t]*.security.=.*| security = user|' \
|
||||
-e 's|^.[ \t]*.map.to.guest.=.*| map to guest = Bad User|' \
|
||||
-i $SMB_TMP
|
||||
fi
|
||||
|
||||
mv -f $SMB_TMP $SMB_CONF
|
|
@ -1,10 +0,0 @@
|
|||
[Unit]
|
||||
Description=Samba Configuration
|
||||
DefaultDependencies=false
|
||||
After=basic.target
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/lib/samba/samba-config
|
||||
StartLimitInterval=0
|
|
@ -697,55 +697,6 @@ mount_storage() {
|
|||
fi
|
||||
}
|
||||
|
||||
mount_games() {
|
||||
if /usr/bin/busybox mountpoint -q /storage ; then
|
||||
progress "Mounting games"
|
||||
if [ ! -d "/storage/roms" ]
|
||||
then
|
||||
/usr/bin/busybox mkdir -p /storage/roms >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
for DEV in $(blkid | awk 'BEGIN {FS=":"}; /ext4/ || /fat/ {print $1}' 2>/dev/null | sort -r)
|
||||
do
|
||||
ROOTDEV=$(echo ${DEV} | sed -e "s#^/.*/##g" -e "s#p[0-9].*\$##g" 2>/dev/null)
|
||||
SIZE=$(awk '/'${ROOTDEV}'/ {print $3}' /proc/partitions 2>/dev/null)
|
||||
if [ "${SIZE}" -le "8388608" ]
|
||||
then
|
||||
# We don't want to mount partitions smaller than ~8GB.
|
||||
continue
|
||||
fi
|
||||
if [ -L "/sys/class/block/${ROOTDEV}boot0" ]
|
||||
then
|
||||
# Assume this is an android boot device and ignore it.
|
||||
continue
|
||||
fi
|
||||
NULL=$(grep ${DEV} /proc/mounts >/dev/null 2>&1)
|
||||
if [ ! "$?" = "0" ] && [ -e "${DEV}" ] && [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
mount ${DEV} /storage/roms >/dev/null 2>&1
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -d "/storage/.update" ] && [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
/usr/bin/busybox rm -rf /storage/.update >/dev/null 2>&1
|
||||
/usr/bin/busybox mkdir -p /storage/.update >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ ! -d "/storage/roms/update" ]
|
||||
then
|
||||
/usr/bin/busybox mkdir -p /storage/roms/update >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [ ! -e "/storage/.please_resize_me" ]
|
||||
then
|
||||
/usr/bin/busybox mkdir -p "$UPDATE_ROOT" >/dev/null 2>&1
|
||||
mount --bind /storage/roms/update "$UPDATE_ROOT" >/dev/null 2>&1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Make last bootloader label (installer, live, run etc.) as the new default
|
||||
update_bootmenu() {
|
||||
local crnt_default
|
||||
|
@ -1300,7 +1251,6 @@ for BOOT_STEP in \
|
|||
load_splash \
|
||||
mount_sysroot \
|
||||
mount_storage \
|
||||
mount_games \
|
||||
check_update \
|
||||
prepare_sysroot \
|
||||
check_amlogic_dtb; do
|
||||
|
@ -1369,6 +1319,8 @@ else
|
|||
rm -f /sysroot/storage/init.log
|
||||
fi
|
||||
|
||||
clear >/dev/console
|
||||
|
||||
# switch to new sysroot and start real init
|
||||
exec /usr/bin/busybox switch_root /sysroot /usr/lib/systemd/systemd $INIT_ARGS $INIT_UNIT
|
||||
|
||||
|
|
|
@ -2313,7 +2313,7 @@
|
|||
<hardware>system</hardware>
|
||||
<path>/storage/.config/modules</path>
|
||||
<extension>.sh</extension>
|
||||
<command>/usr/bin/runemu.sh %ROM% -Pshell</command>
|
||||
<command>/usr/bin/run %ROM%</command>
|
||||
<platform>tools</platform>
|
||||
<theme>tools</theme>
|
||||
</system>
|
||||
|
|
|
@ -2352,7 +2352,7 @@
|
|||
<hardware>system</hardware>
|
||||
<path>/storage/.config/modules</path>
|
||||
<extension>.sh</extension>
|
||||
<command>/usr/bin/runemu.sh %ROM% -Pshell</command>
|
||||
<command>/usr/bin/run %ROM%</command>
|
||||
<platform>tools</platform>
|
||||
<theme>tools</theme>
|
||||
</system>
|
||||
|
|
Loading…
Reference in a new issue