mirror of
https://github.com/KeithDHedger/LFSBootCD.git
synced 2025-07-29 12:49:36 +00:00
updated tools to 8.2
This commit is contained in:
@ -43,7 +43,6 @@ pushd $LFS
|
||||
ln -sv /tools/bin/{perl,env,mkdir} usr/bin
|
||||
ln -sv /tools/lib/libgcc_s.so{,.1} usr/lib
|
||||
ln -sv /tools/lib/libstdc++.so{,.6} usr/lib
|
||||
sed 's/tools/usr/' tools/lib/libstdc++.la > usr/lib/libstdc++.la
|
||||
ln -sv bash bin/sh
|
||||
ln -sv /proc/self/mounts etc/mtab
|
||||
|
||||
@ -242,6 +241,28 @@ DISTRIB_ID="Linux From Scratch"
|
||||
DISTRIB_RELEASE="$LFSVERSION"
|
||||
DISTRIB_CODENAME="$LFSNAME"
|
||||
DISTRIB_DESCRIPTION="Linux From Scratch"
|
||||
EOF
|
||||
|
||||
cat > etc/shells << EOF
|
||||
# Begin /etc/shells
|
||||
|
||||
/bin/sh
|
||||
/bin/bash
|
||||
|
||||
# End /etc/shells
|
||||
EOF
|
||||
|
||||
cat > root/.lfspkg.rc << EOF
|
||||
LFSVERSION=$LFSVERSION
|
||||
KERNELVERSION=$KERNELVERSION
|
||||
LIBDIRSUFFIX=$LIBDIRSUFFIX
|
||||
SCRIPTLOG=1
|
||||
OUTPUT=$BUILTPACKAGES
|
||||
SOURCEARCHIVES=$SOURCEARCHIVES
|
||||
BUILDSCRIPTS=$BUILDSCRIPTS
|
||||
COMPILEAT=\${COMPILEAT:-"\$SOURCEARCHIVES"}
|
||||
CONFIGOPTIONS="--disable-option-checking --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/libexec --libdir=/usr/lib$LIBDIRSUFFIX --disable-debug --disable-nls"
|
||||
CHECKETC=1
|
||||
EOF
|
||||
|
||||
chown -R root:root $LFS/* 2>/dev/null
|
||||
@ -251,12 +272,6 @@ EOF
|
||||
chgrp -v utmp var/log/lastlog
|
||||
chmod 777 /tmp
|
||||
|
||||
cat > root/.lfspkg.rc << EOF
|
||||
OUTPUT=$BUILTPACKAGES
|
||||
SOURCEARCHIVES=$SOURCEARCHIVES
|
||||
BUILDSCRIPTS=$BUILDSCRIPTS
|
||||
EOF
|
||||
|
||||
popd
|
||||
|
||||
|
||||
|
198
LFSScripts/HowTo
198
LFSScripts/HowTo
@ -1,105 +1,166 @@
|
||||
|
||||
1)
|
||||
|
||||
#It will be assumed that your LFS partition is mounted on /mnt/LFS, using /dev/sda1 and /dev/sda2 as swap, alter as needed.
|
||||
#Use sudo where necessary to create links etc.
|
||||
|
||||
#If compiling on raspberian you need to install some extra files like so:
|
||||
apt-get update
|
||||
apt-get install bison gawk m4 texinfo
|
||||
#Also make sure /bin/sh points to /bin/bash
|
||||
|
||||
#Get the build scripts and helper scripts from:
|
||||
#https://github.com/KeithDHedger/LFSPkgBuilds
|
||||
#either via git clone or downloading the zip file and unpacking it.
|
||||
#you should place the LFSPkgBuildScripts and LFSScripts folder in the root of what will be your new LFS eg /mnt/lfs/LFSPkgBuildScripts
|
||||
|
||||
###RECOMMENDED####
|
||||
#or cd into the mounted partition wher you intend to build LFS
|
||||
#sudo git clone https://github.com/KeithDHedger/LFSPkgBuilds.git --branch version8 --single-branch
|
||||
#or cd into the mounted partition wher you intend to build LFS:
|
||||
#LFS should point to your mounted LFS partition ( eg LFS=/mnt/LFS ).
|
||||
cd /mnt/LFS
|
||||
[sudo] git clone https://github.com/KeithDHedger/LFSPkgBuilds.git
|
||||
|
||||
#sudo chown -R $USER:$USER LFSPkgBuilds
|
||||
#sudo ln -sv LFSPkgBuilds/LFSPkgBuildScripts LFSPkgBuildScripts
|
||||
#sudo ln -sv LFSPkgBuilds/LFSScripts LFSScripts
|
||||
|
||||
2)
|
||||
#get the package manager archive wvia the host system
|
||||
cd LFSPkgBuildScripts/admin/LFSPkg
|
||||
wget -c --no-check-certificate "https://github.com/KeithDHedger/LFSPkg/archive/master.zip" -O LFSPkg.zip||true
|
||||
unzip LFSPkg.zip
|
||||
Own the files:
|
||||
[sudo] chown -R $USER:$USER $LFS/LFSPkgBuilds
|
||||
[sudo] ln -sv LFSPkgBuilds/LFSPkgBuildScripts $LFS/LFSPkgBuildScripts
|
||||
[sudo] ln -sv LFSPkgBuilds/LFSScripts $LFS/LFSScripts
|
||||
|
||||
3)
|
||||
#cd into the lfsscripts folder
|
||||
cd ./LFSScripts
|
||||
#Set variables in ./SystemData !!IMPORTANT!!
|
||||
#Run
|
||||
cd /mnt/LFS/LFSScripts
|
||||
#Set up config files !!IMPORTANT!!
|
||||
#You can just press 'Return' to accept the default.
|
||||
#Run:
|
||||
[sudo] ./LFSSetUp
|
||||
|
||||
#To check config:
|
||||
./ShowSystemData
|
||||
#to check all ok.
|
||||
|
||||
4)
|
||||
#Run BuildTools script.
|
||||
#Run BuildTools script:
|
||||
./BuildTools
|
||||
|
||||
4.5)
|
||||
#Mount bind external folder if set and if not already mounted.
|
||||
. ./SystemData
|
||||
mkdir -vp ${LFS}/${SOURCEARCHIVES}||true
|
||||
mkdir -vp ${LFS}/${BUILTPACKAGES}||true
|
||||
if [ "X$EXTFOLDER" != "X" ];then
|
||||
sudo mount --bind $EXTFOLDER/${BUILTPACKAGES} $LFS/${BUILTPACKAGES}
|
||||
sudo mount --bind $EXTFOLDER/${SOURCEARCHIVES} $LFS/${SOURCEARCHIVES}
|
||||
fi
|
||||
|
||||
5)
|
||||
#Run BuildFileSystem script.
|
||||
#Run BuildFileSystem script:
|
||||
./BuildFileSystem
|
||||
|
||||
5.2)
|
||||
#You may/will have to re-own the source folder etc, so:
|
||||
[sudo] chown -R $USER:$USER $LFS/LFSPkgBuilds
|
||||
|
||||
5.5)
|
||||
#Create a link from downloaded linux tarball to /LFSSourceArchives/8.2/KERNEL to prevent re-downloading source tarball.
|
||||
mkdir $LFS/LFSSourceArchives/$LFSVERSION/KERNEL
|
||||
cd $LFS/LFSSourceArchives/$LFSVERSION/KERNEL
|
||||
ln -sv ../SYSTEM/linux-$KERNELVERSION.tar.xz linux-$KERNELVERSION.tar.xz
|
||||
|
||||
5.6)
|
||||
#get the package manager archive via the host system:
|
||||
cd $LFS/LFSPkgBuildScripts/admin/LFSPkg
|
||||
wget -c --no-check-certificate "https://github.com/KeithDHedger/LFSPkg/archive/master.zip" -O LFSPkg.zip
|
||||
unzip LFSPkg.zip
|
||||
|
||||
6)
|
||||
#Chroot into tempory system.
|
||||
./Chroot system
|
||||
#Change back to $LFS/LFSScripts folder.
|
||||
cd $LFS/LFSScripts
|
||||
|
||||
#If you are building over ssh you may want to start a screen session that you can come back to later.
|
||||
screen
|
||||
|
||||
#Chroot into temporary system:
|
||||
[sudo] ./Chroot system
|
||||
|
||||
7)
|
||||
#You should now be in the chroot
|
||||
#First install lfspkg
|
||||
#First install lfspkg:
|
||||
cd /LFSPkgBuildScripts/admin/LFSPkg
|
||||
BOOTSTRAP=1 ./LFSPkg.LFSBuild install
|
||||
|
||||
#Set $LFS/etc/lfspkg.rc or $LFS/root/.lfspkg.rc (preferred) variables, make sure the SOURCEARCHIVES points to the same place as $SOURCEARCHIVES from SystemData as that's where the main LFS sytem source files are, you can do this either from in the chroot environment or from the host with root permisions.
|
||||
#The default SOURCEARCHIVES vaiable is set to /tmp/LFSSourceArchives.
|
||||
#You may also want to save built packages by setting the OUTPUT variable in lfspkg.rc, you may want to mount another folder in the chroot environment from the host for this, as you will need a fair amount of storage space for all the built packages for a full desktop system, you don't of course need to keep the built packages you can if space is short just delete them, in which case leave the OUTPUT variable as is and periodically delete everything in it.
|
||||
#It is handy to keep the built packages as if somthing goes wrong its's usually simpler and quicker to reinstall the binary package rather than building from source again, things like qt5 and firefox take a LOOooooonnng time to build from source.
|
||||
#
|
||||
#after first installing lfspkg and setting up $LFS/etc/lfspkg.rc you may want to manually move the lfspkg built package tarball to the folders set in the rc file, if you have changed them that is.
|
||||
#As part of the LFSSetUp script /mnt/LFS/root/.lfspkg.rc has been created to contain basic info needed by lfspkg, review and change if needed.
|
||||
#Set /mnt/LFS/etc/lfspkg.rc or /mnt/LFS/root/.lfspkg.rc (preferred) variables, make sure the SOURCEARCHIVES points to the same place as $SOURCEARCHIVES from #SystemData.local as that's where the main LFS system source files are, you can do this either from in the chroot environment or from the host with root permissions.
|
||||
#At this point wget/openssl is not installed so you will get a load of complaints from lfspkg, ignore them as lfspkg will be reinstalled later with the main system.
|
||||
|
||||
#You should run lfspkg --setup to create the lfspkg.rc file ( in ~ (/root) )
|
||||
#Rc files are sourced from /etc/lfspkg.rc then ~/.lfspkg.rc.
|
||||
#lfspkg --setup can be run again later if you need/want to change source/build folders etc.
|
||||
#For building the main system you should probably set the configure options config files in /etc and log options.
|
||||
lfspkg --setup
|
||||
|
||||
8)
|
||||
#Build main system
|
||||
#Build main system:
|
||||
cd /LFSPkgBuildScripts/system/system-meta
|
||||
#Use system-sysvinit-meta
|
||||
#for standard sysvinit like so:
|
||||
|
||||
#Use system-sysvinit-meta for standard sysvinit like so:
|
||||
./system-sysvinit-meta.LFSBuild install
|
||||
#Or use system-bbinit-meta.LFSBuild
|
||||
#for a RECOMMENDED busy box init system ( non standard ) like so:
|
||||
|
||||
#Or use system-bbinit-meta.LFSBuildfor a busy box init system ( non standard ) like so:
|
||||
./system-bbinit-meta.LFSBuild install
|
||||
|
||||
#Or for ##experimental## custom init system use:
|
||||
./system-LFSInit-meta.LFSBuild install
|
||||
|
||||
#Or for rpi sysvinit system use:
|
||||
./system-pi-sysvinit-meta.LFSBuild install
|
||||
|
||||
Wait for script to complete:
|
||||
...
|
||||
Have coffee
|
||||
Walk the dog
|
||||
...
|
||||
|
||||
9)
|
||||
#logout from temporary system
|
||||
#logout from temporary system:
|
||||
exit
|
||||
|
||||
10)
|
||||
#Remove tools folder link from host and if you want to save tools archive for futre use move/copy the ${LFS}/tools-${LFSVERSION}.tar.gz somewhere safe.
|
||||
#Remove tools folder link from host and if you want to save tools archive for futre use move/copy the ${LFS}/tools-${LFSVERSION}.tar.gz somewhere safe:
|
||||
sudo rm /tools
|
||||
#Remove the tools folder from your LFS install disk.
|
||||
sudo rm -rf ${LFS}/tools
|
||||
#Remove the tools folder from your LFS install disk:
|
||||
[sudo] rm -rf /mnt/LFS/tools
|
||||
|
||||
11)
|
||||
#Re-enter the chroot ( this time and subsequent times don't use the 'system' argument to Chroot ).
|
||||
sudo ./Chroot
|
||||
#Re-enter the chroot ( this time and subsequent times don't use the 'system' argument to Chroot ):
|
||||
[sudo] ./Chroot
|
||||
|
||||
12)
|
||||
#You MUST rebuild lfspkg after completeing the the basic system and removing the tools folder.
|
||||
#Use same process as 2)/7) EXCEPT do NOT use BOOTSTRAP=1
|
||||
#If you have set any vairiable in /etc/lfspkg.rc then reply 'R' ( without the quotes ) when asked about replacing files in /etc.
|
||||
#If you forgot to do the above bit just re-edit /etc/lfspkg.rc
|
||||
#If you forgot to do the above bit just re-edit /etc/lfspkg.rc:
|
||||
|
||||
cd /LFSPkgBuildScripts/admin/LFSPkg
|
||||
./LFSPkg.LFSBuild install
|
||||
|
||||
13)
|
||||
#Configure and build the kernel
|
||||
#No point in compiling your own kernel on pi so prebuilt one is used, so skip this bit on pi.
|
||||
#Configure and build the kernel:
|
||||
cd /LFSPkgBuildScripts/kernel
|
||||
./kernel.LFSBuild install
|
||||
|
||||
#Again on pi skip this bit as firmware is installed by the pi-system-meta package.
|
||||
#You may prefer to manually copy all firmware modules from the host sytem from /lib/firmware to your new LFS system.
|
||||
#Or use the firmware build script to install all the latest firmware from https://git.kernel.org/ eg Whilst still in the kernel build folder:
|
||||
./firmware.LFSBuild install
|
||||
|
||||
13.5)
|
||||
#No grub on pi
|
||||
#Optional install of grub, see here:
|
||||
http://www.linuxfromscratch.org/lfs/view/stable/chapter08/grub.html
|
||||
#http://www.linuxfromscratch.org/lfs/view/stable/chapter08/grub.html
|
||||
|
||||
The LFSSetup script will install a basic grub.cfg file in ${LFS}/${BUILDSCRIPTS}/system/grub/ based on the details given to the script.
|
||||
Check that the grub.cfg file is OK, make any changes and just copy it to /boot/grub, or manually do this:
|
||||
#The LFSSetup script will install a basic grub.cfg file in ${LFS}/${BUILDSCRIPTS}/system/grub/ based on the details given to the script.
|
||||
#Check that the grub.cfg file is OK, make any changes and just copy it to /boot/grub, or manually do this:
|
||||
|
||||
#assuming root device is /dev/sda and LFS system is on /dev/sda1 mounted at /mnt/LFS
|
||||
#assuming root device is /dev/sda and LFS system is on /dev/sda1 mounted at /mnt/LFS:
|
||||
grub-install /dev/sda
|
||||
|
||||
cat > /boot/grub/grub.cfg << "EOF"
|
||||
@ -110,13 +171,14 @@ set timeout=30
|
||||
insmod ext2
|
||||
set root=(hd0,1)
|
||||
|
||||
menuentry "GNU/Linux, Linux 4.9.9-lfs-8.0" {
|
||||
linux /boot/vmlinuz-4.9.9-lfs-8.0 root=/dev/sda1 ro
|
||||
menuentry "GNU/Linux, Linux 4.9.9" {
|
||||
linux /boot/vmlinuz-4.9.9 root=/dev/sda1 ro
|
||||
}
|
||||
EOF
|
||||
|
||||
14)
|
||||
#Build xorg
|
||||
#Before building the X server now is a good time to quickly boot into your new system and make sure all is OK, you can then reboot back to the host and continue building in the chroot or build in the 'real' system, the choice is yours but this HowTo assumes all building is done in the chroot.
|
||||
#Build xorg:
|
||||
cd /LFSPkgBuildScripts/xorg/xorg-meta/
|
||||
./xorg-meta.LFSBuild install
|
||||
|
||||
@ -139,6 +201,10 @@ cd /LFSPkgBuildScripts/print/cups
|
||||
cd /LFSPkgBuildScripts/gtk/gtk
|
||||
./gtk.LFSBuild install
|
||||
|
||||
#xsane frontends and xsane require gimp installed first to build the plugin
|
||||
cd /LFSPkgBuildScripts/desktop/gimp
|
||||
./gimp.LFSBuild install
|
||||
|
||||
#rest of printing stuff
|
||||
cd /LFSPkgBuildScripts/print/printing-meta
|
||||
./printing-meta.LFSBuild install
|
||||
@ -159,7 +225,7 @@ cd /LFSPkgBuildScripts/devel/development-meta
|
||||
#this is for an xfce4 desktop.
|
||||
cd /LFSPkgBuildScripts/desktop/desktop-meta
|
||||
./desktop-meta.LFSBuild install
|
||||
#Or for an LFSDesktop
|
||||
#Or fo r an LFSDesktop
|
||||
cd /LFSPkgBuildScripts/lfsdesktop/LFSDesktop-meta
|
||||
./LFSDesktop-meta.LFSBuild install
|
||||
|
||||
@ -202,24 +268,14 @@ cd /LFSPkgBuildScripts/net/davfs2
|
||||
cd /LFSPkgBuildScripts/net/curlftpfs
|
||||
./curlftpfs.LFSBuild install
|
||||
|
||||
#Qt5 stuff
|
||||
#cd /LFSPkgBuildScripts/qt/lxqt-meta
|
||||
#./lxqt-meta.LFSBuild install
|
||||
|
||||
#TODO
|
||||
cd /LFSPkgBuildScripts/qt/qt-creator
|
||||
./qt-creator.LFSBuild install
|
||||
|
||||
#If you are building in chroot you will pobably have to rerun the postinstall script for this package AFTER booting to the 'real' system.
|
||||
cd /LFSPkgBuildScripts/admin/mariadb
|
||||
./mariadb.LFSBuild install
|
||||
|
||||
#Busybox init
|
||||
#cd /LFSPkgBuildScripts/sys/busybox
|
||||
#./busybox.LFSBuild install
|
||||
#
|
||||
#cd /LFSPkgBuildScripts/sys/bootfiles
|
||||
#./bootfiles.LFSBuild install
|
||||
|
||||
#Odd stuff
|
||||
cd /LFSPkgBuildScripts/xorg/xbindkeys
|
||||
./xbindkeys.LFSBuild install
|
||||
@ -230,7 +286,29 @@ cd /LFSPkgBuildScripts/net/libcddb
|
||||
cd /LFSPkgBuildScripts/desktop/epdfview
|
||||
./epdfview.LFSBuild install
|
||||
|
||||
cd /LFSPkgBuildScripts/desktop/conky
|
||||
./conky.LFSBuild install
|
||||
#Conky is getting increasingly tied to gnome and difficult ( impossible! )to build.
|
||||
#cd /LFSPkgBuildScripts/desktop/conky
|
||||
#./conky.LFSBuild install
|
||||
|
||||
#Try an alternative!
|
||||
cd /LFSPkgBuildScripts/desktop/gkrellm
|
||||
./gkrellm.LFSBuild install
|
||||
|
||||
#System admin/security stuff
|
||||
cd /LFSPkgBuildScripts/admin/logrotate
|
||||
./logrotate.LFSBuild install
|
||||
|
||||
cd /LFSPkgBuildScripts/admin/fcron
|
||||
./fcron.LFSBuild install
|
||||
|
||||
cd /LFSPkgBuildScripts/admin/iptables
|
||||
./iptables.LFSBuild install
|
||||
|
||||
cd /LFSPkgBuildScripts/admin/fail2ban
|
||||
./fail2ban.LFSBuild install
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,73 +1,66 @@
|
||||
#!/bin/bash
|
||||
|
||||
#©keithhedger Mon 2 Feb 12:38:29 GMT 2015 kdhedger68713@gmail.com
|
||||
|
||||
#Warn and quit
|
||||
#Set The variables between this -------------->
|
||||
#And then remove/comment out the next line
|
||||
#echo -e "\n!!! WARNING !!!\nYou must set the variables in ./SystemData before proceeding!\n";exit 1
|
||||
#©keithhedger Mon 2 Feb 12:38:29 GMT 2015 keithdhedger@gmail.com
|
||||
|
||||
#You should use the LFSSetUp script to create SystemData.local, you can do it manually by setting the vars below ( not recommended ).
|
||||
if [ -e "SystemData.local" ];then
|
||||
. "SystemData.local"
|
||||
else
|
||||
#For example ...
|
||||
#Set The variables between this -------------->
|
||||
#basic stuff
|
||||
#Mount point for your new LFS system
|
||||
LFS=${LFS:-/media/LFSJane}
|
||||
#LFS Version
|
||||
LFSVERSION=${LFSVERSION:-8.0}
|
||||
#Computer name
|
||||
LFSNAME=${LFSNAME:-"LFSJane"}
|
||||
#LFS init type eithe bbinit or sysvinit
|
||||
INITTYPE=LFSInit
|
||||
#Place to store built packages, defaults to /tmp
|
||||
BUILTPACKAGES=${BUILTPACKAGES:-"/media/SkyNet/LFSBuiltPackages-${LFSVERSION}"}
|
||||
#Place to store downloaded source archives, defaults to /tmp
|
||||
SOURCEARCHIVES=${SOURCEARCHIVES:-"/media/SkyNet/LFSSourceArchives/${LFSVERSION}"}
|
||||
|
||||
#kernal version
|
||||
#if the kernel version you want to use is not the same as the book you will have to manually download the source to $SOURCEARCHIVES
|
||||
KERNELVERSION=4.9.9
|
||||
|
||||
#keyboard
|
||||
#set keyboad lang for auto detect use
|
||||
#KEYBOARD="$(setxkbmap -print | awk -F'+' '/xkb_symbols/ {print $2}')"
|
||||
KEYBOARD=uk
|
||||
|
||||
#network
|
||||
#Set up the network
|
||||
GATEWAY="192.168.1.254"
|
||||
SUBNET="255.255.255.0"
|
||||
NAMESERVERS="208.67.222.222 208.67.220.220 8.8.8.8 $GATEWAY"
|
||||
|
||||
#File system type, probably ext2 or ext4
|
||||
ROOTFSTYPE="ext2"
|
||||
#And this <------------
|
||||
|
||||
#Variable below this line are computed and probably don't need changing, but feel free.
|
||||
#computed stuff
|
||||
LANGUAGE=$LANG
|
||||
ROOTDEV=$(df|grep -i $LFS|awk '{print $1}')
|
||||
SWAP=$(fdisk -l|grep swap|awk '{print $1}')
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
LIBDIRSUFFIX=64
|
||||
;;
|
||||
*)
|
||||
LIBDIRSUFFIX=""
|
||||
;;
|
||||
esac
|
||||
|
||||
#set kernel version in build scripts
|
||||
#build scripts should be at $LFS/LFSPkgBuildScripts
|
||||
sed -ri 's/^VERSION="[0-9]+.[0-9]+.[0-9]+"/VERSION="'"${KERNELVERSION}"'"/' ${LFS}/LFSPkgBuildScripts/system/linuxheaders/linuxheaders.LFSBuild
|
||||
sed -ri 's/^VERSION="[0-9]+.[0-9]+.[0-9]+"/VERSION="'"${KERNELVERSION}"'"/' ${LFS}/LFSPkgBuildScripts/kernel/kernel.LFSBuild
|
||||
sed -ri "s/linuxheaders-[0-9]+.[0-9]+.[0-9]+/linuxheaders-${KERNELVERSION}/i" ${LFS}/LFSPkgBuildScripts/system/system-meta/system-${INITTYPE}-meta.LFSBuild
|
||||
|
||||
#network
|
||||
IP="192.168.1.1"$(echo $ROOTDEV|sed 's/^[a-zA-Z\/]*//')
|
||||
fi
|
||||
|
||||
#basic stuff
|
||||
#Mount point for your new LFS system
|
||||
LFS=${LFS:-/media/LFSJane}
|
||||
#LFS Version
|
||||
LFSVERSION=${LFSVERSION:-8.0}
|
||||
#Computer name
|
||||
LFSNAME=${LFSNAME:-"LFSJane"}
|
||||
#LFS init type eithe bbinit or sysvinit
|
||||
INITTYPE=LFSInit
|
||||
#Place to store built packages, defaults to /tmp
|
||||
BUILTPACKAGES=${BUILTPACKAGES:-"/media/SkyNet/LFSBuiltPackages-${LFSVERSION}"}
|
||||
#Place to store downloaded source archives, defaults to /tmp
|
||||
SOURCEARCHIVES=${SOURCEARCHIVES:-"/media/SkyNet/LFSSourceArchives/${LFSVERSION}"}
|
||||
|
||||
#kernal version
|
||||
#if the kernel version you want to use is not the same as the book you will have to manually download the source to $SOURCEARCHIVES
|
||||
KERNELVERSION=4.9.9
|
||||
|
||||
#keyboard
|
||||
#set keyboad lang for auto detect use
|
||||
#KEYBOARD="$(setxkbmap -print | awk -F'+' '/xkb_symbols/ {print $2}')"
|
||||
KEYBOARD=uk
|
||||
|
||||
#network
|
||||
#Set up the network
|
||||
GATEWAY="192.168.1.254"
|
||||
SUBNET="255.255.255.0"
|
||||
NAMESERVERS="208.67.222.222 208.67.220.220 8.8.8.8 $GATEWAY"
|
||||
|
||||
#File system type, probably ext2 or ext4
|
||||
ROOTFSTYPE="ext2"
|
||||
#And this <------------
|
||||
|
||||
#Variable below this line are computed and probably don't need changing, but feel free.
|
||||
#computed stuff
|
||||
LANGUAGE=$LANG
|
||||
ROOTDEV=$(df|grep -i $LFS|awk '{print $1}')
|
||||
SWAP=$(fdisk -l|grep swap|awk '{print $1}')
|
||||
case $(uname -m) in
|
||||
x86_64)
|
||||
LIBDIRSUFFIX=64
|
||||
;;
|
||||
*)
|
||||
LIBDIRSUFFIX=""
|
||||
;;
|
||||
esac
|
||||
|
||||
#set kernel version in build scripts
|
||||
#build scripts should be at $LFS/LFSPkgBuildScripts
|
||||
sed -ri 's/^VERSION="[0-9]+.[0-9]+.[0-9]+"/VERSION="'"${KERNELVERSION}"'"/' ${LFS}/LFSPkgBuildScripts/system/linuxheaders/linuxheaders.LFSBuild
|
||||
sed -ri 's/^VERSION="[0-9]+.[0-9]+.[0-9]+"/VERSION="'"${KERNELVERSION}"'"/' ${LFS}/LFSPkgBuildScripts/kernel/kernel.LFSBuild
|
||||
sed -ri "s/linuxheaders-[0-9]+.[0-9]+.[0-9]+/linuxheaders-${KERNELVERSION}/i" ${LFS}/LFSPkgBuildScripts/system/system-meta/system-${INITTYPE}-meta.LFSBuild
|
||||
|
||||
#network
|
||||
IP="192.168.1.1"$(echo $ROOTDEV|sed 's/^[a-zA-Z\/]*//')
|
||||
|
||||
if [ -e SystemData.local ];then
|
||||
. SystemData.local
|
||||
fi
|
||||
|
||||
|
14
Makefile
14
Makefile
@ -1,8 +1,8 @@
|
||||
|
||||
VERSION=8.2
|
||||
TOPDIR=$(shell pwd)
|
||||
ISODEPS=$(shell find $(TOPDIR)/cdtree -not -name "\.*")
|
||||
VERSION=8.0
|
||||
BOOTCDNAME=bootcd-$(VERSION).iso
|
||||
BOOTCDNAME=LFSBootCD-$(VERSION).iso
|
||||
|
||||
export TOPDIR BOOTCDNAME
|
||||
|
||||
@ -15,7 +15,7 @@ export TOPDIR BOOTCDNAME
|
||||
# $(TOPDIR)/build_iso.sh
|
||||
|
||||
PACKAGE:
|
||||
tar -cvaf $(TOPDIR)/bootcd-$(VERSION).tar.xz $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/publickeys
|
||||
tar -cvaf $(TOPDIR)/bootcd.tar.xz $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/publickeys
|
||||
|
||||
CD: $(TOPDIR)/$(BOOTCDNAME)
|
||||
|
||||
@ -48,14 +48,16 @@ $(TOPDIR)/hostkeys/ssh_host_rsa_key.pub:
|
||||
cp $(TOPDIR)/hostkeys/*.pub publickeys
|
||||
|
||||
clean:
|
||||
rm -rf $(TOPDIR)/cdtree/LFS/*
|
||||
rm -f $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/cdtree/isolinux/sdisk32.img $(TOPDIR)/cdtree/isolinux/sdisk64.img
|
||||
rm -rf $(TOPDIR)/loop2
|
||||
rm -f $(TOPDIR)/wget-list*
|
||||
|
||||
distclean:
|
||||
rm -f $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/cdtree/isolinux/sdisk32.img $(TOPDIR)/cdtree/isolinux/sdisk64.img $(TOPDIR)/tftp_area.tar.gz||true
|
||||
rm -rf $(TOPDIR)/hostkeys||true
|
||||
rm $(TOPDIR)/*~ ||true
|
||||
rm -rf $(TOPDIR)/cdtree/LFS/LFSSourceArchives||true
|
||||
rm $(TOPDIR)/cdtree/LFS/tools-8.0_32.tar.bz2 $(TOPDIR)/cdtree/LFS/tools-8.0_64.tar.bz2 $(TOPDIR)/root_tree32.tar.xz $(TOPDIR)/root_tree64.tar.xz||true
|
||||
rm $(TOPDIR)/bootcd-$(VERSION).tar.xz||true
|
||||
rm -rf $(TOPDIR)/cdtree/LFS/*||true
|
||||
rm $(TOPDIR)/root_tree32.tar.xz $(TOPDIR)/root_tree64.tar.xz||true
|
||||
rm $(TOPDIR)/bootcd.tar.xz||true
|
||||
|
||||
|
@ -11,7 +11,7 @@ OR to remove the ssh keys folder
|
||||
*make distclean
|
||||
|
||||
Grab external sources etc, this may take some time if you have a slow connection approx download 825M, this includes all the sources to build a functioning LFS system
|
||||
make SOURCES
|
||||
*make SOURCES
|
||||
|
||||
*make CD
|
||||
|
||||
@ -23,6 +23,7 @@ See the file "Roll your own Linux Rescue or Setup CD.html" for more details ( or
|
||||
|
||||
A pre-built iso is avaialable here:
|
||||
https://www.dropbox.com/s/5ut7v7sgobgykyu/bootcd-8.0.iso
|
||||
https://www.dropbox.com/s/7o09ayfg9pc3pyo/LFSBootCD-8.2.iso
|
||||
|
||||
This uses the ssh public keys in the pulblickeys folder.
|
||||
This will need to be burnt to a dvd writable if you mean to use a physical disk as it's slightly too large for a cdrom.
|
||||
|
@ -15,9 +15,6 @@ fi
|
||||
|
||||
. $TOPDIR/settings.sh
|
||||
|
||||
|
||||
|
||||
|
||||
# in case the loop device doesn't exist, we try to load the module
|
||||
if ! [ -b $LOOP ] ; then
|
||||
modprobe loop
|
||||
|
@ -24,7 +24,7 @@ mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat \
|
||||
-o $TOPDIR/$BOOTCDNAME \
|
||||
-no-emul-boot -boot-load-size 4 -boot-info-table \
|
||||
-J -r \
|
||||
-p "keithhedger@keithhedger.darktech.org" \
|
||||
-p "keithdhedger@gmail.com" \
|
||||
-A "LFS CD Build System" \
|
||||
.
|
||||
|
||||
|
Binary file not shown.
46
getSources
46
getSources
@ -2,34 +2,36 @@
|
||||
|
||||
#©keithhedger Wed 14 Jun 19:51:12 BST 2017 kdhedger68713@gmail.com
|
||||
|
||||
LFSVERSION="8.0"
|
||||
LFSVERSION="8.2"
|
||||
SYSTEMSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/SYSTEM
|
||||
NETSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/NET
|
||||
SYSSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/SYS
|
||||
|
||||
WGETTAR="http://ftp.gnu.org/gnu/wget/wget-1.19.1.tar.xz"
|
||||
OPENSSLTAR="https://openssl.org/source/openssl-1.0.2k.tar.gz"
|
||||
WGETTAR="http://ftp.gnu.org/gnu/wget/wget-1.19.4.tar.gz"
|
||||
UNZIPTAR="http://downloads.sourceforge.net/infozip/unzip60.tar.gz"
|
||||
|
||||
TOOLS32TAR="https://www.dropbox.com/s/00d9g99v1h7yzpn/tools-${LFSVERSION}_32.tar.bz2"
|
||||
TOOLS64TAR="https://www.dropbox.com/s/m8spbezuuc1e9q2/tools-${LFSVERSION}_64.tar.bz2"
|
||||
#TOOLS32TAR="https://www.dropbox.com/s/00d9g99v1h7yzpn/tools-8.0_32.tar.bz2"
|
||||
#TOOLS64TAR="https://www.dropbox.com/s/m8spbezuuc1e9q2/tools-8.0_64.tar.bz2"
|
||||
TOOLS32TAR="https://www.dropbox.com/s/a7keub18zn90esl/tools-8.2_32.tar.bz2"
|
||||
TOOLS64TAR="https://www.dropbox.com/s/wtis8ag8nwz1nzy/tools-8.2_64.tar.bz2"
|
||||
ROOT32TAR="https://www.dropbox.com/s/ktxt3pwljmki6ns/root_tree32.tar.xz"
|
||||
ROOT64TAR="https://www.dropbox.com/s/wqxswj35gvrqqfv/root_tree64.tar.xz"
|
||||
|
||||
LFSPKGBUILDS="https://github.com/KeithDHedger/LFSPkgBuilds/archive/version8.zip"
|
||||
LFSPKGBUILDS="https://github.com/KeithDHedger/LFSPkgBuilds/archive/${LFSVERSION}.zip"
|
||||
LFSPKG="https://github.com/KeithDHedger/LFSPkg/archive/master.zip"
|
||||
|
||||
mkdir -vp cdtree/LFS $NETSOURCE $SYSSOURCE $SYSTEMSOURCE||true
|
||||
|
||||
if [ ! -e $SYSTEMSOURCE/gotsystemsources ];then
|
||||
wget http://www.linuxfromscratch.org/lfs/view/$LFSVERSION/wget-list
|
||||
#bzip2 link broken in wget-list
|
||||
sed -i 's@.*bzip2-1\.0\.6\.tar\.gz*@http://anduin.linuxfromscratch.org/LFS/bzip2-1.0.6.tar.gz@' wget-list
|
||||
wget http://www.linuxfromscratch.org/lfs/view/$LFSVERSION/md5sums
|
||||
mv md5sums $SYSTEMSOURCE
|
||||
wget -i wget-list -c -P $SYSTEMSOURCE
|
||||
|
||||
#wget/openssl/unzip from the blfs book I prefer to make this as part of the main system
|
||||
#wget/unzip from the blfs book I prefer to make this as part of the main system
|
||||
wget -c "$WGETTAR" -P $NETSOURCE
|
||||
wget -c "$OPENSSLTAR" -P $NETSOURCE
|
||||
wget -c "$UNZIPTAR" -P $SYSSOURCE
|
||||
|
||||
touch $SYSTEMSOURCE/gotsystemsources
|
||||
@ -49,18 +51,22 @@ if [ ! -e $SYSTEMSOURCE/gotsystemsources ];then
|
||||
wget -c "$ROOT64TAR"
|
||||
fi
|
||||
|
||||
rm -r cdtree/LFS/LFSPkgBuilds
|
||||
pushd cdtree/LFS
|
||||
wget -c "$LFSPKGBUILDS"
|
||||
unzip version8.zip
|
||||
mv LFSPkgBuilds-version8 LFSPkgBuilds
|
||||
rm -r LFSPkgBuilds/.gitignore LFSPkgBuilds/Updating/ version8.zip LFSPkgBuilds/LFSScripts
|
||||
cp -r ../../LFSScripts LFSPkgBuilds
|
||||
cd LFSPkgBuilds/LFSPkgBuildScripts/admin/LFSPkg
|
||||
wget -c $LFSPKG
|
||||
unzip master.zip
|
||||
rm master.zip
|
||||
popd
|
||||
#rm -r cdtree/LFS/LFSPkgBuilds
|
||||
if [ ! -e cdtree/LFS/gotpkgbuilds ];then
|
||||
pushd cdtree/LFS
|
||||
wget -c "$LFSPKGBUILDS"
|
||||
unzip ${LFSVERSION}.zip
|
||||
mv LFSPkgBuilds-${LFSVERSION} LFSPkgBuilds
|
||||
rm -r LFSPkgBuilds/.gitignore ${LFSVERSION}.zip
|
||||
cp -r ../../LFSScripts/BuildFileSystem LFSPkgBuilds/LFSScripts
|
||||
pushd LFSPkgBuilds/LFSPkgBuildScripts/admin/LFSPkg
|
||||
wget -c $LFSPKG
|
||||
unzip master.zip
|
||||
rm master.zip
|
||||
popd
|
||||
touch gotpkgbuilds
|
||||
popd
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
BIN
xtras32/sbin/kilo
Executable file
BIN
xtras32/sbin/kilo
Executable file
Binary file not shown.
BIN
xtras64/sbin/kilo
Executable file
BIN
xtras64/sbin/kilo
Executable file
Binary file not shown.
@ -13,7 +13,7 @@
|
||||
# BootCD is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with BootCD. If not, see <http://www.gnu.org/licenses/>.
|
||||
@ -53,7 +53,7 @@ LFS=${LFS:-"/mnt/LFS"}
|
||||
readWithDefault "LFS" "Enter Mountpoint For LFS"
|
||||
|
||||
#LFS Version
|
||||
LFSVERSION=${LFSVERSION:-8.0}
|
||||
LFSVERSION=${LFSVERSION:-8.2}
|
||||
readWithDefault "LFSVERSION" "Enter Version"
|
||||
|
||||
#Computer name
|
||||
@ -61,7 +61,7 @@ LFSNAME=${LFSNAME:-"LFSDev"}
|
||||
readWithDefault "LFSNAME" "Enter Hostname"
|
||||
|
||||
#LFS init type eithe bbinit or sysvinit
|
||||
INITTYPE=${INITTYPE:-"LFSInit"}
|
||||
INITTYPE=${INITTYPE:-"sysvinit"}
|
||||
readWithDefault "INITTYPE" "Enter Init Type (LFSInit|bbinit|sysvinit)"
|
||||
|
||||
#libdir suffix
|
||||
@ -81,7 +81,7 @@ readWithDefault "SOURCEARCHIVES" "Enter Folder For Source Archives"
|
||||
|
||||
#kernal version
|
||||
#if the kernel version you want to use is not the same as the book you will have to manually download the source to $SOURCEARCHIVES
|
||||
KERNELVERSION=${KERNELVERSION:-"4.9.9"}
|
||||
KERNELVERSION=${KERNELVERSION:-"4.15.3"}
|
||||
readWithDefault "KERNELVERSION" "Enter Kernel Version"
|
||||
|
||||
#keyboard
|
||||
@ -129,7 +129,7 @@ echo "LFSNAME=$LFSNAME"
|
||||
echo "INITTYPE=$INITTYPE"
|
||||
|
||||
echo "LIBDIRSUFFIX=$LIBDIRSUFFIX"
|
||||
#echo "BUILDSCRIPTS=$BUILDSCRIPTS"
|
||||
echo "BUILDSCRIPTS=$BUILDSCRIPTS"
|
||||
echo "BUILTPACKAGES=$BUILTPACKAGES"
|
||||
echo "SOURCEARCHIVES=$SOURCEARCHIVES"
|
||||
echo "KERNELVERSION=$KERNELVERSION"
|
||||
@ -155,23 +155,23 @@ fi
|
||||
|
||||
#cp files etc
|
||||
cp -r ${CDROMMOUNT}/LFS/LFSPkgBuilds ${LFS}
|
||||
ln -sv LFSPkgBuilds/LFSPkgBuildScripts ${LFS}/LFSPkgBuildScripts
|
||||
ln -sv LFSPkgBuilds/LFSScripts ${LFS}/LFSScripts
|
||||
ln -sfv LFSPkgBuilds/LFSPkgBuildScripts .
|
||||
ln -sfv LFSPkgBuilds/LFSScripts .
|
||||
|
||||
mkdir ${LFS}/tools
|
||||
pushd ${LFS}/tools
|
||||
case $(uname -m) in
|
||||
*64)
|
||||
tar -xvf ${CDROMMOUNT}/LFS/tools-8.0_64.tar.bz2
|
||||
tar -xvf ${CDROMMOUNT}/LFS/tools-${LFSVERSION}_64.tar.bz2
|
||||
;;
|
||||
*)
|
||||
tar -xvf ${CDROMMOUNT}/LFS/tools-8.0_32.tar.bz2
|
||||
tar -xvf ${CDROMMOUNT}/LFS/tools-${LFSVERSION}_32.tar.bz2
|
||||
;;
|
||||
esac
|
||||
popd
|
||||
|
||||
mkdir -vp "${LFS}/$SOURCEARCHIVES"
|
||||
cp -rv ${CDROMMOUNT}/LFS/LFSSourceArchives/8.0/* ${LFS}/$SOURCEARCHIVES
|
||||
mkdir -vp "${LFS}/$SOURCEARCHIVES" "${LFS}/$BUILTPACKAGES"
|
||||
cp -rv ${CDROMMOUNT}/LFS/LFSSourceArchives/${LFSVERSION}/* ${LFS}/$SOURCEARCHIVES
|
||||
|
||||
#set kernel version in build scripts
|
||||
#build scripts should be at $LFS/LFSPkgBuildScripts
|
||||
@ -179,6 +179,8 @@ sed -ri 's/^VERSION="[0-9]+.[0-9]+.[0-9]+"/VERSION="'"${KERNELVERSION}"'"/' ${LF
|
||||
sed -ri 's/^VERSION="[0-9]+.[0-9]+.[0-9]+"/VERSION="'"${KERNELVERSION}"'"/' ${LFS}/${BUILDSCRIPTS}/kernel/kernel.LFSBuild
|
||||
sed -ri "s/linuxheaders-[0-9]+.[0-9]+.[0-9]+/linuxheaders-${KERNELVERSION}/i" ${LFS}/${BUILDSCRIPTS}/system/system-meta/system-${INITTYPE}-meta.LFSBuild
|
||||
|
||||
ln -svf system-${INITTYPE}-meta.LFSBuild ${LFS}/${BUILDSCRIPTS}/system/system-meta/system-meta.LFSBuild
|
||||
|
||||
cat > $LFS/LFSScripts/SystemData.local << EOF
|
||||
CDROMMOUNT=$CDROMMOUNT
|
||||
|
||||
@ -208,6 +210,7 @@ EOF
|
||||
|
||||
mkdir -vp $LFS/root||true
|
||||
cat > $LFS/root/.lfspkg.rc << EOF
|
||||
LFSVERSION=$LFSVERSION
|
||||
OUTPUT=$BUILTPACKAGES
|
||||
SOURCEARCHIVES=$SOURCEARCHIVES
|
||||
BUILDSCRIPTS=$BUILDSCRIPTS
|
||||
|
@ -51,6 +51,15 @@ cd /mnt/LFS/LFSScripts
|
||||
Run Build File System script:
|
||||
./BuildFileSystem
|
||||
|
||||
#Include the data set up previously
|
||||
. SystemData
|
||||
|
||||
#Create a link from downloaded linux tarball to /LFSSourceArchives/8.2/KERNEL to prevent re-downloading source tarball.
|
||||
mkdir /mnt/LFS/LFSSourceArchives/8.2/KERNEL
|
||||
pushd /mnt/LFS/LFSSourceArchives/$LFSVERSION/KERNEL
|
||||
ln -sv ../SYSTEM/linux-$KERNELVERSION.tar.xz linux-$KERNELVERSION.tar.xz
|
||||
popd
|
||||
|
||||
Chroot into temporary system:
|
||||
./Chroot system
|
||||
|
||||
@ -71,6 +80,11 @@ Build main system:
|
||||
|
||||
cd /LFSPkgBuildScripts/system/system-meta
|
||||
|
||||
LFSSetUp will have created a symlink to your desired init type so use:
|
||||
./system-meta.LFSBuild install
|
||||
|
||||
Or if you have changed your mind you can install a different init system like so:
|
||||
|
||||
Use system-sysvinit-meta for standard sysvinit like so:
|
||||
./system-sysvinit-meta.LFSBuild install
|
||||
|
||||
|
Reference in New Issue
Block a user