Skip to content

Commit

Permalink
Merge pull request #70 from Jalle19/leaner-builds
Browse files Browse the repository at this point in the history
Leaner builds
  • Loading branch information
Jalle19 committed May 29, 2023
2 parents f6c5be9 + 592fa3e commit c7ab7f5
Show file tree
Hide file tree
Showing 17 changed files with 31 additions and 267 deletions.
97 changes: 0 additions & 97 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,6 @@ ETHTOOL=ethtool-3.18

MTD_UTILS_COMMIT=9f107132a6a073cce37434ca9cda6917dd8d866b # v1.5.1

LIBTIRPC_VERSION=0.2.5
LIBTIRPC=libtirpc-$(LIBTIRPC_VERSION)

RPCBIND_VERSION=0.2.3
RPCBIND=rpcbind-$(RPCBIND_VERSION)
RPCBIND_SBIN_FILES=rpcbind rpcinfo

NFSUTILS_VERSION=1.3.4
NFSUTILS=nfs-utils-$(NFSUTILS_VERSION)
NFSUTILS_SBIN_FILES=utils/showmount/showmount \
utils/exportfs/exportfs \
utils/nfsstat/nfsstat \
utils/mountd/mountd \
utils/statd/start-statd \
utils/statd/sm-notify \
utils/statd/statd \
utils/nfsd/nfsd

NANO_VERSION=2.8.1
NANO=nano-$(NANO_VERSION)
NANO_FILENAME=$(NANO).tar.gz
Expand Down Expand Up @@ -136,7 +118,6 @@ CPIO_SRCS += ethtool
CPIO_SRCS += minisatip
CPIO_SRCS += oscam
CPIO_SRCS += tools/axehelper
CPIO_SRCS += nfsutils
CPIO_SRCS += nano
CPIO_SRCS += mtd-utils
CPIO_SRCS += iperf
Expand All @@ -146,7 +127,6 @@ CPIO_SRCS += binutils
fs.cpio: $(CPIO_SRCS)
fakeroot tools/do_min_fs.py \
-r "$(VERSION)" \
-b "bash strace openssl" \
-d "fs-add" \
$(foreach m,$(EXTRA_AXE_MODULES), -e "$(EXTRA_AXE_MODULES_DIR)/$(m):lib/modules/axe/$(m)") \
-e "patches/axe_dmxts_std.ko:lib/modules/axe/axe_dmxts_std.ko" \
Expand All @@ -162,8 +142,6 @@ fs.cpio: $(CPIO_SRCS)
$(foreach f,$(DROPBEAR_BIN_FILES), -e "apps/$(DROPBEAR)/$(f):usr/bin/$(f)") \
-e "apps/$(OPENSSH)/sftp-server:usr/libexec/sftp-server" \
-e "apps/$(ETHTOOL)/ethtool:sbin/ethtool" \
$(foreach f,$(RPCBIND_SBIN_FILES), -e "apps/$(RPCBIND)/$(f):usr/sbin/$(f)") \
$(foreach f,$(NFSUTILS_SBIN_FILES), -e "apps/$(NFSUTILS)/$(f):usr/sbin/$(notdir $(f))") \
$(foreach f,$(LIBDVBCSA_LIB_FILES), -e "apps/$(LIBDVBCSA)/src/.libs/$(f):lib/$(f)") \
-e "apps/minisatip/minisatip:sbin/minisatip" \
$(foreach f,$(notdir $(wildcard apps/minisatip/html/*)), -e "apps/minisatip/html/$f:usr/share/minisatip/html/$f") \
Expand Down Expand Up @@ -485,81 +463,6 @@ apps/$(LIBDVBCSA)/src/.libs/libdvbcsa.a: apps/$(LIBDVBCSA)/configure
.PHONY: libdvbcsa
libdvbcsa: apps/$(LIBDVBCSA)/src/.libs/libdvbcsa.a

#
# libtirpc
#

apps/$(LIBTIRPC)/configure:
$(call WGET,http://sourceforge.net/projects/libtirpc/files/libtirpc/$(LIBTIRPC_VERSION)/$(LIBTIRPC).tar.bz2,apps/$(LIBTIRPC).tar.bz2)
tar -C apps -xjf apps/$(LIBTIRPC).tar.bz2

apps/$(LIBTIRPC)/src/.libs/libtirpc.a: apps/$(LIBTIRPC)/configure
cd apps/$(LIBTIRPC) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
./configure \
--host=sh4-linux \
--prefix=/ \
--disable-shared \
--disable-gssapi \
--disable-ipv6
make -C apps/$(LIBTIRPC) -j $(CPUS)

.PHONY: libtirpc
libtirpc: apps/$(LIBTIRPC)/src/.libs/libtirpc.a

#
# rpcbind
#

apps/$(RPCBIND)/configure:
$(call WGET,http://sourceforge.net/projects/rpcbind/files/rpcbind/$(RPCBIND_VERSION)/$(RPCBIND).tar.bz2,apps/$(RPCBIND).tar.bz2)
tar -C apps -xjf apps/$(RPCBIND).tar.bz2

apps/$(RPCBIND)/rpcbind: apps/$(LIBTIRPC)/src/.libs/libtirpc.a apps/$(RPCBIND)/configure
cd apps/$(RPCBIND) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
TIRPC_CFLAGS="-I$(CURDIR)/apps/$(LIBTIRPC)/tirpc" \
TIRPC_LIBS="-L$(CURDIR)/apps/$(LIBTIRPC)/src/.libs -Wl,-Bstatic -ltirpc -Wl,-Bdynamic" \
./configure \
--host=sh4-linux \
--prefix=/ \
--with-systemdsystemunitdir=no
make -C apps/$(RPCBIND) -j $(CPUS)

.PHONY: rpcbind
rpcbind: apps/$(RPCBIND)/rpcbind

#
# nfs-utils
#

apps/$(NFSUTILS)/configure:
$(call WGET,http://sourceforge.net/projects/nfs/files/nfs-utils/$(NFSUTILS_VERSION)/$(NFSUTILS).tar.bz2,apps/$(NFSUTILS).tar.bz2)
tar -C apps -xjf apps/$(NFSUTILS).tar.bz2

apps/$(NFSUTILS)/utils/exportfs/exportfs: apps/$(RPCBIND)/rpcbind apps/$(NFSUTILS)/configure
cd apps/$(NFSUTILS) && \
CC=$(TOOLCHAIN)/bin/sh4-linux-gcc \
CFLAGS="-O2" \
TIRPC_CFLAGS="-I$(CURDIR)/apps/$(LIBTIRPC)/tirpc" \
TIRPC_LIBS="-L$(CURDIR)/apps/$(LIBTIRPC)/src/.libs -Wl,-Bstatic -ltirpc -Wl,-Bdynamic" \
./configure \
--host=sh4-linux \
--prefix=/ \
--disable-mount \
--disable-nfsdcltrack \
--disable-nfsv4 \
--disable-gss \
--disable-ipv6 \
--disable-uuid \
--without-tcp-wrappers
make -C apps/$(NFSUTILS) -j $(CPUS)

.PHONY: nfsutils
nfsutils: apps/$(NFSUTILS)/utils/exportfs/exportfs

#
# binutils (mainly for addr2line)
#
Expand Down
1 change: 0 additions & 1 deletion dist/README.md

This file was deleted.

11 changes: 0 additions & 11 deletions fs-add/etc/config.default
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,7 @@ INETD="yes"
#
CROND="yes"

#
# nfsd v3
#
NFSD="yes"
NFSD_HOTPLUG_EXPORT="*" # replace with host or subnet, '*' = world

#
# oscamd
#
OSCAMD="yes"

#
# custom daemon/service/setup executed from sysinit
#
#CUSTOMD="/etc/sysconfig/myboot"
2 changes: 0 additions & 2 deletions fs-add/etc/exports

This file was deleted.

7 changes: 0 additions & 7 deletions fs-add/etc/init.d/customd

This file was deleted.

19 changes: 0 additions & 19 deletions fs-add/etc/init.d/nfsd

This file was deleted.

18 changes: 1 addition & 17 deletions fs-add/etc/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ mv /var /var.2
mkdir /tmp/var
ln -s /tmp/var /var
rm -rf /var.2
mkdir -p /tmp/var/run /tmp/var/log /tmp/var/spool /var/lib/nfs
mount -t nfsd nfsd /proc/fs/nfsd
mkdir -p /tmp/var/run /tmp/var/log /tmp/var/spool

# sysctl.conf
sysctl -q -p
Expand Down Expand Up @@ -145,21 +144,6 @@ fi
ifconfig eth0 txqueuelen 2000 up
route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0

# run extra services
inithup=
for prg in /etc/init.extra/*; do
if test -x "$prg"; then
if test -z "$inithup"; then
echo "# Added by /etc/init.d/rcS - init.extra" >> /etc/inittab
fi
echo "::respawn:${prg}" >> /etc/inittab
inithup=1
fi
done
if test -n "$inithup"; then
kill -SIGHUP 1
fi

# local boot
if test -x /etc/sysconfig/localboot ; then
/etc/sysconfig/localboot
Expand Down
4 changes: 0 additions & 4 deletions fs-add/etc/inittab
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ ttyAS0::askfirst:/bin/sh
::once:/etc/init.d/network
# Time Network Protocol
::once:/etc/init.d/chronyd
# NFSD
::once:/etc/init.d/nfsd
# minisatip
::once:/etc/init.d/satip
# telnetd
Expand All @@ -20,8 +18,6 @@ ttyAS0::askfirst:/bin/sh
::once:/etc/init.d/crond
# oscamd
::once:/etc/init.d/oscamd
# custom service
::once:/etc/init.d/customd
# Others
::ctrlaltdel:/sbin/reboot
::shutdown:/sbin/swapoff -a
Expand Down
5 changes: 0 additions & 5 deletions fs-add/etc/netconfig

This file was deleted.

13 changes: 0 additions & 13 deletions fs-add/etc/nsswitch.conf

This file was deleted.

3 changes: 3 additions & 0 deletions fs-add/etc/skel/.bash_logout
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ~/.bash_logout

clear
15 changes: 15 additions & 0 deletions fs-add/etc/skel/.bash_profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""

export USERNAME BASH_ENV PATH

8 changes: 8 additions & 0 deletions fs-add/etc/skel/.bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
14 changes: 2 additions & 12 deletions fs-add/sbin/sd-hotplug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,7 @@ for fs_type in vfat msdos ext4 ext3 ext2 ; do
*) opts= ;;
esac
if $(mount -t $fs_type $opts /dev/$MDEV "$MOUNT_POINT" 2>/dev/null) ; then
nfs=
if test "$NFSD" = "yes" -a -n "$NFSD_HOTPLUG_EXPORT"; then
exportfs -o rw,nohide,insecure,no_subtree_check "$NFSD_HOTPLUG_EXPORT":"$MOUNT_POINT"
nfs=" (nfsd exported)"
fi
logger -p local0.notice "... $MDEV mounted using $fs_type filesystem${nfs}"
logger -p local0.notice "... $MDEV mounted using $fs_type filesystem"
exit 0
fi
done
Expand All @@ -40,11 +35,8 @@ logger -p local0.notice "Unmounting $MDEV"
for MOUNT_POINT in /media/* ; do
if test -d "$MOUNT_POINT"; then
d=$(mountpoint -n "$MOUNT_POINT" 2> /dev/null | cut -d ' ' -f 1)
if test "$d" = "$MDEV" -o "$d" = "/dev/$MDEV" -o "$d" = "UNKNOWN"; then
if test "$d" = "$MDEV" -o "$d" = "UNKNOWN"; then
logger -p local0.notice "Unmounting $MDEV : $MOUNT_POINT"
if test "$NFSD" = "yes" -a -n "$NFSD_HOTPLUG_EXPORT"; then
exportfs -u "$NFSD_HOTPLUG_EXPORT":"$MOUNT_POINT"
fi
umount -f "$MOUNT_POINT"
rmdir "$MOUNT_POINT"
fi
Expand All @@ -53,8 +45,6 @@ done

}

. /etc/sysconfig/config

case "$ACTION" in
add) add ;;
remove) remove ;;
Expand Down
3 changes: 1 addition & 2 deletions kernel/arch/sh/configs/idl4k_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,7 @@ CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
CONFIG_LOCKD=y
Expand Down
3 changes: 1 addition & 2 deletions patches/kernel.config
Original file line number Diff line number Diff line change
Expand Up @@ -1336,8 +1336,7 @@ CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
CONFIG_NFSD_V3=y
# CONFIG_NFSD is not set
# CONFIG_NFSD_V3_ACL is not set
# CONFIG_NFSD_V4 is not set
CONFIG_LOCKD=y
Expand Down
Loading

0 comments on commit c7ab7f5

Please sign in to comment.