updated tools to 8.2

This commit is contained in:
K D Hedger
2019-03-15 12:54:52 +00:00
parent 35835e78cc
commit d4e5c3faf1
13 changed files with 285 additions and 176 deletions

View File

@ -43,7 +43,6 @@ pushd $LFS
ln -sv /tools/bin/{perl,env,mkdir} usr/bin ln -sv /tools/bin/{perl,env,mkdir} usr/bin
ln -sv /tools/lib/libgcc_s.so{,.1} usr/lib ln -sv /tools/lib/libgcc_s.so{,.1} usr/lib
ln -sv /tools/lib/libstdc++.so{,.6} 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 bash bin/sh
ln -sv /proc/self/mounts etc/mtab ln -sv /proc/self/mounts etc/mtab
@ -242,6 +241,28 @@ DISTRIB_ID="Linux From Scratch"
DISTRIB_RELEASE="$LFSVERSION" DISTRIB_RELEASE="$LFSVERSION"
DISTRIB_CODENAME="$LFSNAME" DISTRIB_CODENAME="$LFSNAME"
DISTRIB_DESCRIPTION="Linux From Scratch" 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 EOF
chown -R root:root $LFS/* 2>/dev/null chown -R root:root $LFS/* 2>/dev/null
@ -251,12 +272,6 @@ EOF
chgrp -v utmp var/log/lastlog chgrp -v utmp var/log/lastlog
chmod 777 /tmp chmod 777 /tmp
cat > root/.lfspkg.rc << EOF
OUTPUT=$BUILTPACKAGES
SOURCEARCHIVES=$SOURCEARCHIVES
BUILDSCRIPTS=$BUILDSCRIPTS
EOF
popd popd

View File

@ -1,105 +1,166 @@
1) 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: #Get the build scripts and helper scripts from:
#https://github.com/KeithDHedger/LFSPkgBuilds #https://github.com/KeithDHedger/LFSPkgBuilds
#either via git clone or downloading the zip file and unpacking it. #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 #you should place the LFSPkgBuildScripts and LFSScripts folder in the root of what will be your new LFS eg /mnt/lfs/LFSPkgBuildScripts
###RECOMMENDED#### ###RECOMMENDED####
#or cd into the mounted partition wher you intend to build LFS #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 #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 Own the files:
#sudo ln -sv LFSPkgBuilds/LFSPkgBuildScripts LFSPkgBuildScripts [sudo] chown -R $USER:$USER $LFS/LFSPkgBuilds
#sudo ln -sv LFSPkgBuilds/LFSScripts LFSScripts [sudo] ln -sv LFSPkgBuilds/LFSPkgBuildScripts $LFS/LFSPkgBuildScripts
[sudo] ln -sv LFSPkgBuilds/LFSScripts $LFS/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
3) 3)
#cd into the lfsscripts folder #cd into the lfsscripts folder
cd ./LFSScripts cd /mnt/LFS/LFSScripts
#Set variables in ./SystemData !!IMPORTANT!! #Set up config files !!IMPORTANT!!
#Run #You can just press 'Return' to accept the default.
#Run:
[sudo] ./LFSSetUp
#To check config:
./ShowSystemData ./ShowSystemData
#to check all ok.
4) 4)
#Run BuildTools script. #Run BuildTools script:
./BuildTools ./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) 5)
#Run BuildFileSystem script. #Run BuildFileSystem script:
./BuildFileSystem ./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) 6)
#Chroot into tempory system. #Change back to $LFS/LFSScripts folder.
./Chroot system 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) 7)
#You should now be in the chroot #You should now be in the chroot
#First install lfspkg #First install lfspkg:
cd /LFSPkgBuildScripts/admin/LFSPkg cd /LFSPkgBuildScripts/admin/LFSPkg
BOOTSTRAP=1 ./LFSPkg.LFSBuild install 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. #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.
#The default SOURCEARCHIVES vaiable is set to /tmp/LFSSourceArchives. #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.
#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. #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.
#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.
# #You should run lfspkg --setup to create the lfspkg.rc file ( in ~ (/root) )
#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. #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) 8)
#Build main system #Build main system:
cd /LFSPkgBuildScripts/system/system-meta 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 ./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 ./system-bbinit-meta.LFSBuild install
#Or for ##experimental## custom init system use: #Or for ##experimental## custom init system use:
./system-LFSInit-meta.LFSBuild install ./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) 9)
#logout from temporary system #logout from temporary system:
exit exit
10) 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 sudo rm /tools
#Remove the tools folder from your LFS install disk. #Remove the tools folder from your LFS install disk:
sudo rm -rf ${LFS}/tools [sudo] rm -rf /mnt/LFS/tools
11) 11)
#Re-enter the chroot ( this time and subsequent times don't use the 'system' argument to Chroot ). #Re-enter the chroot ( this time and subsequent times don't use the 'system' argument to Chroot ):
sudo ./Chroot [sudo] ./Chroot
12) 12)
#You MUST rebuild lfspkg after completeing the the basic system and removing the tools folder. #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 #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 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 cd /LFSPkgBuildScripts/admin/LFSPkg
./LFSPkg.LFSBuild install ./LFSPkg.LFSBuild install
13) 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 cd /LFSPkgBuildScripts/kernel
./kernel.LFSBuild install ./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) 13.5)
#No grub on pi
#Optional install of grub, see here: #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. #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: #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 grub-install /dev/sda
cat > /boot/grub/grub.cfg << "EOF" cat > /boot/grub/grub.cfg << "EOF"
@ -110,13 +171,14 @@ set timeout=30
insmod ext2 insmod ext2
set root=(hd0,1) set root=(hd0,1)
menuentry "GNU/Linux, Linux 4.9.9-lfs-8.0" { menuentry "GNU/Linux, Linux 4.9.9" {
linux /boot/vmlinuz-4.9.9-lfs-8.0 root=/dev/sda1 ro linux /boot/vmlinuz-4.9.9 root=/dev/sda1 ro
} }
EOF EOF
14) 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/ cd /LFSPkgBuildScripts/xorg/xorg-meta/
./xorg-meta.LFSBuild install ./xorg-meta.LFSBuild install
@ -139,6 +201,10 @@ cd /LFSPkgBuildScripts/print/cups
cd /LFSPkgBuildScripts/gtk/gtk cd /LFSPkgBuildScripts/gtk/gtk
./gtk.LFSBuild install ./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 #rest of printing stuff
cd /LFSPkgBuildScripts/print/printing-meta cd /LFSPkgBuildScripts/print/printing-meta
./printing-meta.LFSBuild install ./printing-meta.LFSBuild install
@ -159,7 +225,7 @@ cd /LFSPkgBuildScripts/devel/development-meta
#this is for an xfce4 desktop. #this is for an xfce4 desktop.
cd /LFSPkgBuildScripts/desktop/desktop-meta cd /LFSPkgBuildScripts/desktop/desktop-meta
./desktop-meta.LFSBuild install ./desktop-meta.LFSBuild install
#Or for an LFSDesktop #Or fo r an LFSDesktop
cd /LFSPkgBuildScripts/lfsdesktop/LFSDesktop-meta cd /LFSPkgBuildScripts/lfsdesktop/LFSDesktop-meta
./LFSDesktop-meta.LFSBuild install ./LFSDesktop-meta.LFSBuild install
@ -202,24 +268,14 @@ cd /LFSPkgBuildScripts/net/davfs2
cd /LFSPkgBuildScripts/net/curlftpfs cd /LFSPkgBuildScripts/net/curlftpfs
./curlftpfs.LFSBuild install ./curlftpfs.LFSBuild install
#Qt5 stuff
#cd /LFSPkgBuildScripts/qt/lxqt-meta
#./lxqt-meta.LFSBuild install
#TODO #TODO
cd /LFSPkgBuildScripts/qt/qt-creator cd /LFSPkgBuildScripts/qt/qt-creator
./qt-creator.LFSBuild install ./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 cd /LFSPkgBuildScripts/admin/mariadb
./mariadb.LFSBuild install ./mariadb.LFSBuild install
#Busybox init
#cd /LFSPkgBuildScripts/sys/busybox
#./busybox.LFSBuild install
#
#cd /LFSPkgBuildScripts/sys/bootfiles
#./bootfiles.LFSBuild install
#Odd stuff #Odd stuff
cd /LFSPkgBuildScripts/xorg/xbindkeys cd /LFSPkgBuildScripts/xorg/xbindkeys
./xbindkeys.LFSBuild install ./xbindkeys.LFSBuild install
@ -230,7 +286,29 @@ cd /LFSPkgBuildScripts/net/libcddb
cd /LFSPkgBuildScripts/desktop/epdfview cd /LFSPkgBuildScripts/desktop/epdfview
./epdfview.LFSBuild install ./epdfview.LFSBuild install
cd /LFSPkgBuildScripts/desktop/conky #Conky is getting increasingly tied to gnome and difficult ( impossible! )to build.
./conky.LFSBuild install #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

View File

@ -1,73 +1,66 @@
#!/bin/bash #!/bin/bash
#©keithhedger Mon 2 Feb 12:38:29 GMT 2015 kdhedger68713@gmail.com #©keithhedger Mon 2 Feb 12:38:29 GMT 2015 keithdhedger@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
#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 if [ -e "SystemData.local" ];then
. "SystemData.local" . "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 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

View File

@ -1,8 +1,8 @@
VERSION=8.2
TOPDIR=$(shell pwd) TOPDIR=$(shell pwd)
ISODEPS=$(shell find $(TOPDIR)/cdtree -not -name "\.*") ISODEPS=$(shell find $(TOPDIR)/cdtree -not -name "\.*")
VERSION=8.0 BOOTCDNAME=LFSBootCD-$(VERSION).iso
BOOTCDNAME=bootcd-$(VERSION).iso
export TOPDIR BOOTCDNAME export TOPDIR BOOTCDNAME
@ -15,7 +15,7 @@ export TOPDIR BOOTCDNAME
# $(TOPDIR)/build_iso.sh # $(TOPDIR)/build_iso.sh
PACKAGE: 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) CD: $(TOPDIR)/$(BOOTCDNAME)
@ -48,14 +48,16 @@ $(TOPDIR)/hostkeys/ssh_host_rsa_key.pub:
cp $(TOPDIR)/hostkeys/*.pub publickeys cp $(TOPDIR)/hostkeys/*.pub publickeys
clean: clean:
rm -rf $(TOPDIR)/cdtree/LFS/*
rm -f $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/cdtree/isolinux/sdisk32.img $(TOPDIR)/cdtree/isolinux/sdisk64.img rm -f $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/cdtree/isolinux/sdisk32.img $(TOPDIR)/cdtree/isolinux/sdisk64.img
rm -rf $(TOPDIR)/loop2 rm -rf $(TOPDIR)/loop2
rm -f $(TOPDIR)/wget-list*
distclean: distclean:
rm -f $(TOPDIR)/$(BOOTCDNAME) $(TOPDIR)/cdtree/isolinux/sdisk32.img $(TOPDIR)/cdtree/isolinux/sdisk64.img $(TOPDIR)/tftp_area.tar.gz||true 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 -rf $(TOPDIR)/hostkeys||true
rm $(TOPDIR)/*~ ||true rm $(TOPDIR)/*~ ||true
rm -rf $(TOPDIR)/cdtree/LFS/LFSSourceArchives||true rm -rf $(TOPDIR)/cdtree/LFS/*||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)/root_tree32.tar.xz $(TOPDIR)/root_tree64.tar.xz||true
rm $(TOPDIR)/bootcd-$(VERSION).tar.xz||true rm $(TOPDIR)/bootcd.tar.xz||true

View File

@ -11,7 +11,7 @@ OR to remove the ssh keys folder
*make distclean *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 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 *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: A pre-built iso is avaialable here:
https://www.dropbox.com/s/5ut7v7sgobgykyu/bootcd-8.0.iso 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 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. 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.

View File

@ -15,9 +15,6 @@ fi
. $TOPDIR/settings.sh . $TOPDIR/settings.sh
# in case the loop device doesn't exist, we try to load the module # in case the loop device doesn't exist, we try to load the module
if ! [ -b $LOOP ] ; then if ! [ -b $LOOP ] ; then
modprobe loop modprobe loop

View File

@ -24,7 +24,7 @@ mkisofs -b isolinux/isolinux.bin -c isolinux/boot.cat \
-o $TOPDIR/$BOOTCDNAME \ -o $TOPDIR/$BOOTCDNAME \
-no-emul-boot -boot-load-size 4 -boot-info-table \ -no-emul-boot -boot-load-size 4 -boot-info-table \
-J -r \ -J -r \
-p "keithhedger@keithhedger.darktech.org" \ -p "keithdhedger@gmail.com" \
-A "LFS CD Build System" \ -A "LFS CD Build System" \
. .

Binary file not shown.

View File

@ -2,34 +2,36 @@
#©keithhedger Wed 14 Jun 19:51:12 BST 2017 kdhedger68713@gmail.com #©keithhedger Wed 14 Jun 19:51:12 BST 2017 kdhedger68713@gmail.com
LFSVERSION="8.0" LFSVERSION="8.2"
SYSTEMSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/SYSTEM SYSTEMSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/SYSTEM
NETSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/NET NETSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/NET
SYSSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/SYS SYSSOURCE=cdtree/LFS/LFSSourceArchives/$LFSVERSION/SYS
WGETTAR="http://ftp.gnu.org/gnu/wget/wget-1.19.1.tar.xz" WGETTAR="http://ftp.gnu.org/gnu/wget/wget-1.19.4.tar.gz"
OPENSSLTAR="https://openssl.org/source/openssl-1.0.2k.tar.gz"
UNZIPTAR="http://downloads.sourceforge.net/infozip/unzip60.tar.gz" UNZIPTAR="http://downloads.sourceforge.net/infozip/unzip60.tar.gz"
TOOLS32TAR="https://www.dropbox.com/s/00d9g99v1h7yzpn/tools-${LFSVERSION}_32.tar.bz2" #TOOLS32TAR="https://www.dropbox.com/s/00d9g99v1h7yzpn/tools-8.0_32.tar.bz2"
TOOLS64TAR="https://www.dropbox.com/s/m8spbezuuc1e9q2/tools-${LFSVERSION}_64.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" ROOT32TAR="https://www.dropbox.com/s/ktxt3pwljmki6ns/root_tree32.tar.xz"
ROOT64TAR="https://www.dropbox.com/s/wqxswj35gvrqqfv/root_tree64.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" LFSPKG="https://github.com/KeithDHedger/LFSPkg/archive/master.zip"
mkdir -vp cdtree/LFS $NETSOURCE $SYSSOURCE $SYSTEMSOURCE||true mkdir -vp cdtree/LFS $NETSOURCE $SYSSOURCE $SYSTEMSOURCE||true
if [ ! -e $SYSTEMSOURCE/gotsystemsources ];then if [ ! -e $SYSTEMSOURCE/gotsystemsources ];then
wget http://www.linuxfromscratch.org/lfs/view/$LFSVERSION/wget-list 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 wget http://www.linuxfromscratch.org/lfs/view/$LFSVERSION/md5sums
mv md5sums $SYSTEMSOURCE mv md5sums $SYSTEMSOURCE
wget -i wget-list -c -P $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 "$WGETTAR" -P $NETSOURCE
wget -c "$OPENSSLTAR" -P $NETSOURCE
wget -c "$UNZIPTAR" -P $SYSSOURCE wget -c "$UNZIPTAR" -P $SYSSOURCE
touch $SYSTEMSOURCE/gotsystemsources touch $SYSTEMSOURCE/gotsystemsources
@ -49,18 +51,22 @@ if [ ! -e $SYSTEMSOURCE/gotsystemsources ];then
wget -c "$ROOT64TAR" wget -c "$ROOT64TAR"
fi fi
rm -r cdtree/LFS/LFSPkgBuilds #rm -r cdtree/LFS/LFSPkgBuilds
pushd cdtree/LFS if [ ! -e cdtree/LFS/gotpkgbuilds ];then
wget -c "$LFSPKGBUILDS" pushd cdtree/LFS
unzip version8.zip wget -c "$LFSPKGBUILDS"
mv LFSPkgBuilds-version8 LFSPkgBuilds unzip ${LFSVERSION}.zip
rm -r LFSPkgBuilds/.gitignore LFSPkgBuilds/Updating/ version8.zip LFSPkgBuilds/LFSScripts mv LFSPkgBuilds-${LFSVERSION} LFSPkgBuilds
cp -r ../../LFSScripts LFSPkgBuilds rm -r LFSPkgBuilds/.gitignore ${LFSVERSION}.zip
cd LFSPkgBuilds/LFSPkgBuildScripts/admin/LFSPkg cp -r ../../LFSScripts/BuildFileSystem LFSPkgBuilds/LFSScripts
wget -c $LFSPKG pushd LFSPkgBuilds/LFSPkgBuildScripts/admin/LFSPkg
unzip master.zip wget -c $LFSPKG
rm master.zip unzip master.zip
popd rm master.zip
popd
touch gotpkgbuilds
popd
fi
exit 0 exit 0

BIN
xtras32/sbin/kilo Executable file

Binary file not shown.

BIN
xtras64/sbin/kilo Executable file

Binary file not shown.

View File

@ -13,7 +13,7 @@
# BootCD is distributed in the hope that it will be useful, # BootCD is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 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 # You should have received a copy of the GNU General Public License
# along with BootCD. If not, see <http://www.gnu.org/licenses/>. # 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" readWithDefault "LFS" "Enter Mountpoint For LFS"
#LFS Version #LFS Version
LFSVERSION=${LFSVERSION:-8.0} LFSVERSION=${LFSVERSION:-8.2}
readWithDefault "LFSVERSION" "Enter Version" readWithDefault "LFSVERSION" "Enter Version"
#Computer name #Computer name
@ -61,7 +61,7 @@ LFSNAME=${LFSNAME:-"LFSDev"}
readWithDefault "LFSNAME" "Enter Hostname" readWithDefault "LFSNAME" "Enter Hostname"
#LFS init type eithe bbinit or sysvinit #LFS init type eithe bbinit or sysvinit
INITTYPE=${INITTYPE:-"LFSInit"} INITTYPE=${INITTYPE:-"sysvinit"}
readWithDefault "INITTYPE" "Enter Init Type (LFSInit|bbinit|sysvinit)" readWithDefault "INITTYPE" "Enter Init Type (LFSInit|bbinit|sysvinit)"
#libdir suffix #libdir suffix
@ -81,7 +81,7 @@ readWithDefault "SOURCEARCHIVES" "Enter Folder For Source Archives"
#kernal version #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 #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" readWithDefault "KERNELVERSION" "Enter Kernel Version"
#keyboard #keyboard
@ -129,7 +129,7 @@ echo "LFSNAME=$LFSNAME"
echo "INITTYPE=$INITTYPE" echo "INITTYPE=$INITTYPE"
echo "LIBDIRSUFFIX=$LIBDIRSUFFIX" echo "LIBDIRSUFFIX=$LIBDIRSUFFIX"
#echo "BUILDSCRIPTS=$BUILDSCRIPTS" echo "BUILDSCRIPTS=$BUILDSCRIPTS"
echo "BUILTPACKAGES=$BUILTPACKAGES" echo "BUILTPACKAGES=$BUILTPACKAGES"
echo "SOURCEARCHIVES=$SOURCEARCHIVES" echo "SOURCEARCHIVES=$SOURCEARCHIVES"
echo "KERNELVERSION=$KERNELVERSION" echo "KERNELVERSION=$KERNELVERSION"
@ -155,23 +155,23 @@ fi
#cp files etc #cp files etc
cp -r ${CDROMMOUNT}/LFS/LFSPkgBuilds ${LFS} cp -r ${CDROMMOUNT}/LFS/LFSPkgBuilds ${LFS}
ln -sv LFSPkgBuilds/LFSPkgBuildScripts ${LFS}/LFSPkgBuildScripts ln -sfv LFSPkgBuilds/LFSPkgBuildScripts .
ln -sv LFSPkgBuilds/LFSScripts ${LFS}/LFSScripts ln -sfv LFSPkgBuilds/LFSScripts .
mkdir ${LFS}/tools mkdir ${LFS}/tools
pushd ${LFS}/tools pushd ${LFS}/tools
case $(uname -m) in case $(uname -m) in
*64) *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 esac
popd popd
mkdir -vp "${LFS}/$SOURCEARCHIVES" mkdir -vp "${LFS}/$SOURCEARCHIVES" "${LFS}/$BUILTPACKAGES"
cp -rv ${CDROMMOUNT}/LFS/LFSSourceArchives/8.0/* ${LFS}/$SOURCEARCHIVES cp -rv ${CDROMMOUNT}/LFS/LFSSourceArchives/${LFSVERSION}/* ${LFS}/$SOURCEARCHIVES
#set kernel version in build scripts #set kernel version in build scripts
#build scripts should be at $LFS/LFSPkgBuildScripts #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/^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 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 cat > $LFS/LFSScripts/SystemData.local << EOF
CDROMMOUNT=$CDROMMOUNT CDROMMOUNT=$CDROMMOUNT
@ -208,6 +210,7 @@ EOF
mkdir -vp $LFS/root||true mkdir -vp $LFS/root||true
cat > $LFS/root/.lfspkg.rc << EOF cat > $LFS/root/.lfspkg.rc << EOF
LFSVERSION=$LFSVERSION
OUTPUT=$BUILTPACKAGES OUTPUT=$BUILTPACKAGES
SOURCEARCHIVES=$SOURCEARCHIVES SOURCEARCHIVES=$SOURCEARCHIVES
BUILDSCRIPTS=$BUILDSCRIPTS BUILDSCRIPTS=$BUILDSCRIPTS

View File

@ -51,6 +51,15 @@ cd /mnt/LFS/LFSScripts
Run Build File System script: Run Build File System script:
./BuildFileSystem ./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 into temporary system:
./Chroot system ./Chroot system
@ -71,6 +80,11 @@ Build main system:
cd /LFSPkgBuildScripts/system/system-meta 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: Use system-sysvinit-meta for standard sysvinit like so:
./system-sysvinit-meta.LFSBuild install ./system-sysvinit-meta.LFSBuild install