WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Compile Requests  (Read 417 times)

Offline centralware

  • Sr. Member
  • ****
  • Posts: 296
Compile Requests
« on: May 21, 2018, 08:19:40 PM »
If/when time permits, please add these to the 64 repo:

dropbear
dnsmasq
aoetools
vblade
busybox-httpd
ethtools

Offline centralware

  • Sr. Member
  • ****
  • Posts: 296
Re: Compile Requests
« Reply #1 on: June 06, 2018, 03:16:26 AM »
Build script for ethtool x64
Please compile and update the 9.x repository
Code: [Select]
#!/bin/sh

    ###########
   # ethtool #
  ######################################################
 # Build script for Core 9.0 x86_64                   #
######################################################
if [ ! "$(whoami)" == "root" ]; then echo "Must be run as root!"; exit 1; fi

  ######################################################
 # Configure extension parameters                     #
######################################################
cur=`pwd`
SRCNAM=ethtool-3.15.tar.xz
WRKDIR=ethtool-3.15
EXTNAM=ethtool
TMPDIR=/tmp/ethtool


  ######################################################
 # Let's make sure we have the needed extensions      #
######################################################
su -c "app-load -wi compiletc squashfs-tools" tc
if [ ! -f ethtool-3.15.tar.xz ]; then
    wget -q http://tinycorelinux.net/6.x/x86/tcz/src/ethtool/ethtool-3.15.tar.xz
fi

  ######################################################
 # Prepare for compilation                            #
######################################################

# Remove dirs and files left from previous creation
rm -r -f $WRKDIR >/dev/null 2>&1
rm -r -f $TMPDIR >/dev/null 2>&1
rm -r -f $TMPDIR-doc >/dev/null 2>&1

# Crete temporary directory
mkdir -p $TMPDIR

  ######################################################
 # Compile extension                                  #
######################################################

# Unpack source in current directory
tar -xf $SRCNAM
cd $WRKDIR

# Configure it
./configure --prefix=/usr/local

# Compile
make

# Install in base temp dir
touch /tmp/stamp; sudo rm /tmp/stamp -f; touch /tmp/stamp
make install DESTDIR=$TMPDIR

# Delete compilation work directory
cd ..
rm -r -f $WRKDIR

# Adjust directory access rights
find $TMPDIR/ -type d | xargs chmod -v 755;

# Strip executables
find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded

# Move files to doc extension
mkdir -p $TMPDIR-doc/usr/local
mv $TMPDIR/usr/local/share $TMPDIR-doc/usr/local

  ###################################################
 # Create base extension in temp dir               #
###################################################

cd $TMPDIR; cd ..
mksquashfs $TMPDIR $EXTNAM.tcz
cd $TMPDIR
find usr -not -type d > $EXTNAM.tcz.list
mv ../$EXTNAM.tcz .

# Create md5 file
md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt

# Cleanup temp directory
rm -r -f usr

  ###################################################
 # Create doc extension in temp dir                #
###################################################
cd $TMPDIR-doc; cd ..
mksquashfs $TMPDIR-doc $EXTNAM-doc.tcz
cd $TMPDIR-doc
find usr -not -type d > $EXTNAM-doc.tcz.list
mv ../$EXTNAM-doc.tcz .

# Create md5 file
md5sum $EXTNAM-doc.tcz > $EXTNAM-doc.tcz.md5.txt

# Cleanup temp directory
rm -r -f usr

# Relocate our new files back where we started
cd $cur
mkdir -p $cur/build
mv $TMPDIR/* $cur/build/
mv $TMPDIR-doc/* $cur/build/

touch $cur/build/$EXTNAM.tcz.dep
cat > $cur/build/$EXTNAM.tcz.info << "EOF"
Title:          ethtool.tcz
Description:    Utility for examining and tuning Ethernet-based interfaces
Version:        3.15
Author:         Many, see source tarball for list
Original-site:  https://www.kernel.org/pub/software/network/ethtool/
Copying-policy: GPL v2
Size:           102k
Extension_by:   CentralWare Development Centers
Tags:           CLI SYSTEM NETWORK ETHERNET
Comments:       Binaries only
                ----
                Compiled for CorePure64
Change-log:     ----
Current:        2018/06/06 First x64 version, 3.15
EOF


Offline centralware

  • Sr. Member
  • ****
  • Posts: 296
Re: Compile Requests
« Reply #2 on: June 06, 2018, 03:53:42 AM »
Dropbear x64
Code: [Select]
#!/bin/sh

######################################################
# Build script for Core 9.x 86_64                    #
######################################################
cur=`pwd`

load=tce-load
exts="compiletc.tcz squashfs-tools.tcz"
for ext in $exts
do
    ext=${ext/.tcz/}; ext=${ext/-KERNEL/-$(uname -r)}
    if [ ! -d /tmp/tcloop/$ext ]; then su -c "${load} -wi $ext" tc; fi
done

if [ ! -f dropbear-2014.65.tar.bz2 ]; then wget http://tinycorelinux.net/6.x/x86/tcz/src/dropbear/dropbear-2014.65.tar.bz2; fi
if [ ! -f dropbear ]; then                 wget http://tinycorelinux.net/6.x/x86/tcz/src/dropbear/dropbear; sudo chmod +x dropbear; fi
if [ ! -f banner ]; then                   wget http://tinycorelinux.net/6.x/x86/tcz/src/dropbear/banner; fi

######################################################
# Configure extension creation parameters            #
######################################################
SRCNAM=dropbear-2014.65.tar.bz2
WRKDIR=dropbear-2014.65
EXTNAM=dropbear
TMPDIR=/tmp/dropbear

######################################################
# Prepare extension creation                         #
######################################################

# Remove dirs and files left from previous creation
rm -r -f $WRKDIR
rm -r -f $TMPDIR
rm -r -f $TMPDIR-doc

######################################################
# Compile extension                                  #
######################################################

# Export variables needed for compilation
#export CFLAGS="-O2 -pipe -march=i486 -mtune=i686"
#export CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=i486 -mtune=i686"
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

# Unpack source in current directory
tar -xf $SRCNAM

# Configure it
cd $WRKDIR
./configure  --prefix=/usr/local

# Compile
make PRGRAMS="dropbear dbclient dropbearkey dropbearconvert" MULTI=1
make PRGRAMS="dropbear dbclient dropbearkey dropbearconvert" MULTI=1 install
make scp

# Install in base temp dir
mkdir -p $TMPDIR/usr/local/bin
mkdir -p $TMPDIR/usr/local/sbin
mkdir -p $TMPDIR/usr/local/etc/dropbear
mkdir -p $TMPDIR/usr/local/etc/init.d

mv /usr/local/bin/dropbearmulti $TMPDIR/usr/local/bin
mv scp $TMPDIR/usr/local/bin

# Delete compilation work directory
cd ..
rm -r -f $WRKDIR

# Add TC specific files
cp banner $TMPDIR/usr/local/etc/dropbear
cp dropbear $TMPDIR/usr/local/etc/init.d

# Create symlinks
cd $TMPDIR/usr/local/bin
ln -s dropbearmulti ssh
ln -s dropbearmulti dbclient
ln -s dropbearmulti dropbearkey
ln -s dropbearmulti dropbearconvert
cd $TMPDIR/usr/local/sbin
ln -s ../bin/dropbearmulti dropbear

# Adjust directory access rigths
find $TMPDIR/ -type d | xargs chmod -v 755;

chmod +x $TMPDIR/usr/local/etc/init.d/$EXTNAM

# Strip executables
find $TMPDIR | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded

# Move files to doc extension
mkdir -p $TMPDIR-doc/usr/local/share/man/man1
mkdir -p $TMPDIR-doc/usr/local/share/man/man8

mv /usr/local/share/man/man1/dbclient.1 $TMPDIR-doc/usr/local/share/man/man1
mv /usr/local/share/man/man1/dropbear* $TMPDIR-doc/usr/local/share/man/man1
mv /usr/local/share/man/man8/dropbear* $TMPDIR-doc/usr/local/share/man/man8

###################################################
# Create base extension in temp dir               #
###################################################
cd $TMPDIR; cd ..
mksquashfs $TMPDIR $EXTNAM.tcz
cd $TMPDIR; find usr -not -type d > $EXTNAM.tcz.list
mv ../$EXTNAM.tcz .

# Create md5 file
md5sum $EXTNAM.tcz > $EXTNAM.tcz.md5.txt

# Cleanup temp directory
rm -r -f usr

###################################################
# Create doc extension in temp dir                #
###################################################
cd $TMPDIR-doc; cd ..
mksquashfs $TMPDIR-doc $EXTNAM-doc.tcz
cd $TMPDIR-doc
find usr -not -type d > $EXTNAM-doc.tcz.list
mv ../$EXTNAM-doc.tcz .

# Create md5 file
md5sum $EXTNAM-doc.tcz > $EXTNAM-doc.tcz.md5.txt

# Cleanup temp directory
rm -r -f usr

mkdir -p $cur/build
mv $TMPDIR/* $cur/build; rmdir $TMPDIR
mv $TMPDIR-doc/* $cur/build; rmdir $TMPDIR-doc

touch $cur/build/dropbear.tcz.dep
cat > $cur/build/dropbear.tcz.info << "EOF"
Title:          dropbear.tcz
Description:    Small SSH server and client
Version:        2014.65
Author:         Matt Johnston
Original-site:  https://matt.ucc.asn.au/dropbear/dropbear.html
Copying-policy: Varying by code portion, see source tarball
Size:           136K
Extension_by:   CentralWare Development Centers
Tags:           SECURITY CLI SSH
Comments:       Binaries only
                ----
                Compiled for CorePure64 9.x
                ----
                Use /usr/local/etc/init.d/dropbear start|stop|retart|status
                to manage service as root
Change-log:     2018/06/06 First version, 2014.65
EOF

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5830
Re: Compile Requests
« Reply #3 on: June 06, 2018, 05:15:18 AM »
Hi centralware
Since you already have the build scripts worked out, why don't you build and submit the extensions yourself?

Offline centralware

  • Sr. Member
  • ****
  • Posts: 296
Re: Compile Requests
« Reply #4 on: June 07, 2018, 12:06:40 AM »
@Rich, @Curaga, etc.

Regarding AoE (aoetools/vblade) is the AoE driver still being compiled into the kernel by default and if so, is this across all platforms?
(A quick modprobe/lsmod shows AoE is still inside TCL CorePure64 9.x but I haven't tested x86, RasPi, etc.)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9830
Re: Compile Requests
« Reply #5 on: June 07, 2018, 12:36:29 AM »
The 32-bit and 64-bit configs are identical, sans things only available in one bitness. Rpi does its own thing.
The only barriers that can stop you are the ones you create yourself.

Offline centralware

  • Sr. Member
  • ****
  • Posts: 296
Re: Compile Requests
« Reply #6 on: June 07, 2018, 08:03:44 PM »
@curaga: Thank you!  I did a quick peek into PiCore 8.x and I'm happy to report AoE is still in there as well from the looks of it. One less thing to compile! :)

@rich: Compilation scripts are done for the items on the list; just a few odds and ends (ie: tce.installed, init's, etc.) before they're legitimate TCZs.
BusyBox-HTTPd may have to be fine-tuned (not certain all unrelated features were disabled within the make-config process - the resulting .config is included in the src.tcz) but we'll see!

A quick pointer to where in the wiki exact specs for submitting extensions would be appreciated!

Take care guys!

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5830
Re: Compile Requests
« Reply #7 on: June 07, 2018, 08:13:08 PM »
Hi centralware
This is the Wiki link on creating extensions:
http://wiki.tinycorelinux.net/wiki:creating_extensions
Information on submitting is at the bottom of the page:
http://wiki.tinycorelinux.net/wiki:creating_extensions#submitting

Offline centralware

  • Sr. Member
  • ****
  • Posts: 296
Re: Compile Requests
« Reply #8 on: June 07, 2018, 08:17:12 PM »
@rich: Thank you kind sir! :)  I'll ship 'em off once they're up to snuff!