WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: a bodge script roughly akin to kernel environment script  (Read 114 times)

Online aus9

  • Full Member
  • ***
  • Posts: 177
a bodge script roughly akin to kernel environment script
« on: May 26, 2020, 05:58:31 AM »
Try at own risk. Tested only on 64 bit 11x. In case you miss it....one compile takes about 1.5 hours
After you have a good laugh at my own efforts or lack thereof, do the right thing and offer to pm coreplayer2 and take over the maintainership of his excellent script. I am not sure what it needs but I know it needs you! 8)

Code: [Select]
#!/bin/sh
# test we are root
if [ "$(id -u)" != "0" ]; then
   echo "run as root now exitting"
   exit 1
fi

# I lack the skills of coreplayer2.....this is a bodge job

# I strongly recommend you copy /usr/src to your persistent dir
# as one the steps below takes so longggggggggg
# does not hurt to have copies of KC, KM and KP

KC=config-5.4.3-tinycore64
KM=Module.symvers-5.4.3-tinycore64.gz
KP=linux-5.4.3-patched.txz
KV=$(uname -r)
KB=/lib/modules/$KV/build
LB=/lib/modules/build
REPO=http://www.tinycorelinux.net/11.x/x86_64/release/src/kernel
SRC=/usr/src
SYM1=/lib/modules/build
SYM2=/lib/modules/$KV/build
USER=`cat /etc/sysconfig/tcuser`
LIST="compiletc wget glibc_apps automake bash ncursesw-dev xz bc elfutils-dev"
for Z in $LIST
    do
    su -c "tce-load -i $Z" $USER
done
su -c "/usr/local/bin/wget -nc --no-check-certificate \
REPO/$KP \
$REPO/$KC  \
REPO/$KM " $USER

echo 'exitting now so you can take copies of downloads'
exit 1

# redo the Variables and start from here
echo 'unpacking  kernel takes awhile and delete tar file'
xz -d linux-5.4.3-patched.txz
tar xvf linux-5.4.3*tar
rm -rf linux-5.4.3-patched.tar
echo 'unpacking module file'
gunzip $KM
echo 'start /usr/src stuff'
mkdir /usr/src
mv linux-5.4.3  /usr/src
cd $SRC/linux*
echo 'make mrproper,  make oldconfig, make prepare and  make modules_prepare takes seconds each'
make mrproper
mv /tmp/$KC .config
make oldconfig
make prepare
make modules_prepare
mv /tmp/*symvers* Module.symvers
echo 'next command takes yonks....about 1H 30  '
make SUBDIRS=scripts/mod
export KBUILD=/usr/src/linux-${KV%%-*}
cd /
ln -s $KBUILD $SYM1
ln -s $KBUILD $SYM2