mirror of
https://github.com/krglaws/MyLFS.git
synced 2025-07-22 18:27:10 +00:00
rename pkgs -> packages
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1,7 @@
|
||||
*.img
|
||||
*.swp
|
||||
pkgs/
|
||||
packages/
|
||||
logs/
|
||||
mnt/
|
||||
example_extension/packages/
|
||||
example_extension/logs/
|
||||
|
96
README.md
96
README.md
@ -11,8 +11,6 @@ Basically, just run `sudo ./mylfs.sh --build-all` and then stare at your termina
|
||||
```
|
||||
$ sudo ./build.sh --help
|
||||
|
||||
Welcome to MyLFS.
|
||||
|
||||
WARNING: Most of the functionality in this script requires root privilages,
|
||||
and involves the partitioning, mounting and unmounting of device files. Use at
|
||||
your own risk.
|
||||
@ -27,53 +25,53 @@ on the commandline. Be careful with that last one - it WILL destroy all partitio
|
||||
on the device you specify.
|
||||
|
||||
options:
|
||||
-v|--version Print the LFS version this build is based on, then exit.
|
||||
|
||||
-V|--verbose The script will output more information where applicable
|
||||
(careful what you wish for).
|
||||
|
||||
-e|--check Output LFS dependency version information, then exit.
|
||||
It is recommended that you run this before proceeding
|
||||
with the rest of the build.
|
||||
|
||||
-b|--build-all Run the entire script from beginning to end.
|
||||
-v|--version Print the LFS version this build is based on, then exit.
|
||||
|
||||
-x|--extend Pass in the path to a custom build extension. See the
|
||||
'example_extension' directory for reference.
|
||||
-V|--verbose The script will output more information where applicable
|
||||
(careful what you wish for).
|
||||
|
||||
-e|--check Output LFS dependency version information, then exit.
|
||||
It is recommended that you run this before proceeding
|
||||
with the rest of the build.
|
||||
|
||||
-b|--build-all Run the entire script from beginning to end.
|
||||
|
||||
-x|--extend Pass in the path to a custom build extension. See the
|
||||
'example_extension' directory for reference.
|
||||
|
||||
-d|--download-packages Download all packages into the 'packages' directory, then
|
||||
exit.
|
||||
|
||||
-i|--init Create the .img file, partition it, setup basic directory
|
||||
structure, then exit.
|
||||
|
||||
-d|--download-pkgs Download all packages into the 'pkgs' directory, then
|
||||
exit.
|
||||
|
||||
-i|--init Create the .img file, partition it, setup basic directory
|
||||
structure, then exit.
|
||||
|
||||
-p|--start-phase
|
||||
-a|--start-package Select a phase and optionally a package
|
||||
within that phase to start building from.
|
||||
These options are only available if the preceeding
|
||||
phases have been completed. They should really only
|
||||
be used when something broke during a build, and you
|
||||
don't want to start from the beginning again.
|
||||
|
||||
-o|--one-off Only build the specified phase/package.
|
||||
|
||||
-k|--kernel-config Optional path to kernel config file to use during linux
|
||||
build.
|
||||
|
||||
-a|--start-package Select a phase and optionally a package
|
||||
within that phase to start building from.
|
||||
These options are only available if the preceeding
|
||||
phases have been completed. They should really only
|
||||
be used when something broke during a build, and you
|
||||
don't want to start from the beginning again.
|
||||
|
||||
-o|--one-off Only build the specified phase/package.
|
||||
|
||||
-k|--kernel-config Optional path to kernel config file to use during linux
|
||||
build.
|
||||
|
||||
-m|--mount
|
||||
-u|--umount These options will mount or unmount the disk image to the
|
||||
filesystem, and then exit the script immediately.
|
||||
You should be sure to unmount prior to running any part of
|
||||
the build, since the image will be automatically mounted
|
||||
and then unmounted at the end.
|
||||
|
||||
-n|--install Specify the path to a block device on which to install the
|
||||
fully built img file.
|
||||
|
||||
-c|--clean This will unmount and delete the image, and clear the
|
||||
logs.
|
||||
|
||||
-h|--help Show this message.
|
||||
-u|--umount These options will mount or unmount the disk image to the
|
||||
filesystem, and then exit the script immediately.
|
||||
You should be sure to unmount prior to running any part of
|
||||
the build, since the image will be automatically mounted
|
||||
and then unmounted at the end.
|
||||
|
||||
-n|--install Specify the path to a block device on which to install the
|
||||
fully built img file.
|
||||
|
||||
-c|--clean This will unmount and delete the image, and clear the
|
||||
logs.
|
||||
|
||||
-h|--help Show this message.
|
||||
```
|
||||
|
||||
## How It Works
|
||||
@ -81,7 +79,7 @@ on the device you specify.
|
||||
The script builds LFS by completing the following steps:
|
||||
|
||||
|
||||
1. Download package source code and save to the `./pkgs/` directory.
|
||||
1. Download package source code and save to the `./packages/` directory.
|
||||
|
||||
|
||||
2. Create a 10 gigabyte IMG file called `lfs.img`. This will serve as a virtual hard drive on which to build LFS.
|
||||
@ -102,7 +100,7 @@ The script builds LFS by completing the following steps:
|
||||
7. Enter chroot environment, and build remaing tools needed to build the entire LFS system. (chapter 7)
|
||||
|
||||
|
||||
8. Build the entire LFS system from within chroot envirnment, including the kernel, GRUB, and others.
|
||||
8. Build the entire LFS system from within chroot envirnment, including the kernel, GRUB, and others. (chapter 8)
|
||||
|
||||
|
||||
That's it.
|
||||
@ -152,8 +150,8 @@ Finally, to clean your workspace:
|
||||
```sh
|
||||
sudo ./mylfs.sh --clean
|
||||
```
|
||||
This will unmount the IMG file (if it is mounted), delete it, and delete the logs under `./logs`. It will not delete the cached package archives under `./pkgs`, but if you really want to do that you can easily `rm -f ./pkgs/*`.
|
||||
This will unmount the IMG file (if it is mounted), delete it, and delete the logs under `./logs/`. It will not delete the cached package archives under `./packages/`, but if you really want to do that you can easily `rm -f ./packages/*`.
|
||||
|
||||
|
||||
## Booting
|
||||
So far, I have only managed to boot the IMG file from a flash drive on bare metal. It would be cool to be able to just boot it up with a VM, but I have yet to figure out how to get that to work. Suggestions are welcome.
|
||||
So far, I have managed to boot the IMG file using QEMU (see the [runqemu.sh](runqemu.sh) script) and on bare metal using a flash drive. I have not been able to boot it up on a VM yet.
|
||||
|
@ -6,8 +6,8 @@ FULLPATH=$(cd $(dirname $0) && pwd)
|
||||
|
||||
export LFS_VERSION=11.1
|
||||
export KERNELVERS=5.16.9
|
||||
export PACKAGE_LIST=$FULLPATH/pkgs.sh
|
||||
export PACKAGE_DIR=$FULLPATH/pkgs
|
||||
export PACKAGE_LIST=$FULLPATH/packages.sh
|
||||
export PACKAGE_DIR=$FULLPATH/packages
|
||||
export LOG_DIR=$FULLPATH/logs
|
||||
export KEEP_LOGS=true
|
||||
export LFS=$FULLPATH/mnt/lfs
|
||||
|
1
example_extension/.gitignore
vendored
1
example_extension/.gitignore
vendored
@ -1 +0,0 @@
|
||||
pkgs/
|
@ -18,7 +18,7 @@ How to create an extension:
|
||||
my_extension/
|
||||
|
||||
|
||||
- Inside of your repository, add a file called "pkgs.sh". This will contain
|
||||
- Inside of your repository, add a file called "packages.sh". This will contain
|
||||
a listing of the URLs of all of the packages your extension will be
|
||||
building. The format should look like this:
|
||||
|
||||
@ -37,7 +37,7 @@ How to create an extension:
|
||||
```
|
||||
|
||||
|
||||
- Once you have established the list of package URLs inside of pkgs.sh,
|
||||
- Once you have established the list of package URLs inside of packages.sh,
|
||||
you can add the build scripts for each respective package.
|
||||
|
||||
For example:
|
||||
@ -153,8 +153,8 @@ How to create an extension:
|
||||
|
||||
More Notes:
|
||||
|
||||
- The package tarballs for extensions will be saved to "<extension-dir>/pkgs/",
|
||||
separate from the LFS packages that are kept in "MyLFS/pkgs/". The same is true
|
||||
- The package tarballs for extensions will be saved to "<extension-dir>/packages/",
|
||||
separate from the LFS packages that are kept in "MyLFS/packages/". The same is true
|
||||
for the extension build logs, which will be kept in "<extension-dir>/logs/".
|
||||
|
||||
- mylfs.sh treats extensions as a fifth phase, ontop of the four builtin phases.
|
||||
|
@ -1,4 +1,4 @@
|
||||
# pkgs.sh
|
||||
# packages.sh
|
||||
#export PKG_<SCRIPTNAME>=<pkg URL>
|
||||
|
||||
export PKG_LYNX=https://invisible-mirror.net/archives/lynx/tarballs/lynx2.8.9rel.1.tar.bz2
|
100
mylfs.sh
100
mylfs.sh
@ -24,53 +24,53 @@ on the commandline. Be careful with that last one - it WILL destroy all partitio
|
||||
on the device you specify.
|
||||
|
||||
options:
|
||||
-v|--version Print the LFS version this build is based on, then exit.
|
||||
-v|--version Print the LFS version this build is based on, then exit.
|
||||
|
||||
-V|--verbose The script will output more information where applicable
|
||||
(careful what you wish for).
|
||||
-V|--verbose The script will output more information where applicable
|
||||
(careful what you wish for).
|
||||
|
||||
-e|--check Output LFS dependency version information, then exit.
|
||||
It is recommended that you run this before proceeding
|
||||
with the rest of the build.
|
||||
-e|--check Output LFS dependency version information, then exit.
|
||||
It is recommended that you run this before proceeding
|
||||
with the rest of the build.
|
||||
|
||||
-b|--build-all Run the entire script from beginning to end.
|
||||
-b|--build-all Run the entire script from beginning to end.
|
||||
|
||||
-x|--extend Pass in the path to a custom build extension. See the
|
||||
'example_extension' directory for reference.
|
||||
-x|--extend Pass in the path to a custom build extension. See the
|
||||
'example_extension' directory for reference.
|
||||
|
||||
-d|--download-pkgs Download all packages into the 'pkgs' directory, then
|
||||
exit.
|
||||
-d|--download-packages Download all packages into the 'packages' directory, then
|
||||
exit.
|
||||
|
||||
-i|--init Create the .img file, partition it, setup basic directory
|
||||
structure, then exit.
|
||||
-i|--init Create the .img file, partition it, setup basic directory
|
||||
structure, then exit.
|
||||
|
||||
-p|--start-phase
|
||||
-a|--start-package Select a phase and optionally a package
|
||||
within that phase to start building from.
|
||||
These options are only available if the preceeding
|
||||
phases have been completed. They should really only
|
||||
be used when something broke during a build, and you
|
||||
don't want to start from the beginning again.
|
||||
-a|--start-package Select a phase and optionally a package
|
||||
within that phase to start building from.
|
||||
These options are only available if the preceeding
|
||||
phases have been completed. They should really only
|
||||
be used when something broke during a build, and you
|
||||
don't want to start from the beginning again.
|
||||
|
||||
-o|--one-off Only build the specified phase/package.
|
||||
-o|--one-off Only build the specified phase/package.
|
||||
|
||||
-k|--kernel-config Optional path to kernel config file to use during linux
|
||||
build.
|
||||
-k|--kernel-config Optional path to kernel config file to use during linux
|
||||
build.
|
||||
|
||||
-m|--mount
|
||||
-u|--umount These options will mount or unmount the disk image to the
|
||||
filesystem, and then exit the script immediately.
|
||||
You should be sure to unmount prior to running any part of
|
||||
the build, since the image will be automatically mounted
|
||||
and then unmounted at the end.
|
||||
-u|--umount These options will mount or unmount the disk image to the
|
||||
filesystem, and then exit the script immediately.
|
||||
You should be sure to unmount prior to running any part of
|
||||
the build, since the image will be automatically mounted
|
||||
and then unmounted at the end.
|
||||
|
||||
-n|--install Specify the path to a block device on which to install the
|
||||
fully built img file.
|
||||
-n|--install Specify the path to a block device on which to install the
|
||||
fully built img file.
|
||||
|
||||
-c|--clean This will unmount and delete the image, and clear the
|
||||
logs.
|
||||
-c|--clean This will unmount and delete the image, and clear the
|
||||
logs.
|
||||
|
||||
-h|--help Show this message.
|
||||
-h|--help Show this message.
|
||||
EOF
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ function init_image {
|
||||
mkdir -p $LFS/home/tester
|
||||
chown 101:101 $LFS/home/tester
|
||||
mkdir -p $LFS/sources
|
||||
cp ./pkgs/* $LFS/sources
|
||||
cp ./packages/* $LFS/sources
|
||||
|
||||
# create symlinks
|
||||
for i in bin lib sbin
|
||||
@ -311,13 +311,13 @@ function cleanup_cancelled_download {
|
||||
[ -f $PKG ] && rm -f $PKG
|
||||
}
|
||||
|
||||
function download_pkgs {
|
||||
function download_packages {
|
||||
if [ -n "$1" ]
|
||||
then
|
||||
# if an extension is being built, it will
|
||||
# override the pkgs and pkgs.sh paths
|
||||
local PACKAGE_DIR=$1/pkgs
|
||||
local PACKAGE_LIST=$1/pkgs.sh
|
||||
# override the packages and packages.sh paths
|
||||
local PACKAGE_DIR=$1/packages
|
||||
local PACKAGE_LIST=$1/packages.sh
|
||||
fi
|
||||
|
||||
mkdir -p $PACKAGE_DIR
|
||||
@ -564,9 +564,9 @@ function build_extension {
|
||||
then
|
||||
echo "ERROR: extension '$EXTENSION' is not a directory, or does not exist."
|
||||
return 1
|
||||
elif [ ! -f "$EXTENSION/pkgs.sh" ]
|
||||
elif [ ! -f "$EXTENSION/packages.sh" ]
|
||||
then
|
||||
echo "ERROR: extension '$EXTENSION' is missing a 'pkgs.sh' file."
|
||||
echo "ERROR: extension '$EXTENSION' is missing a 'packages.sh' file."
|
||||
return 1
|
||||
elif [ ! -f "$EXTENSION/build_order.txt" ]
|
||||
then
|
||||
@ -574,21 +574,21 @@ function build_extension {
|
||||
return 1
|
||||
fi
|
||||
|
||||
mkdir -p $EXTENSION/{logs,pkgs}
|
||||
mkdir -p $EXTENSION/{logs,packages}
|
||||
|
||||
# read in extension config.sh if present
|
||||
[ -f "$EXTENSION/config.sh" ] && source "$EXTENSION/config.sh"
|
||||
|
||||
# read pkgs.sh
|
||||
source "$EXTENSION/pkgs.sh"
|
||||
# read packages.sh
|
||||
source "$EXTENSION/packages.sh"
|
||||
|
||||
# download extension packages
|
||||
download_pkgs $EXTENSION
|
||||
download_packages $EXTENSION
|
||||
|
||||
$VERBOSE && set -x
|
||||
|
||||
# copy packages onto LFS image
|
||||
cp -f $EXTENSION/pkgs/* $LFS/sources/
|
||||
cp -f $EXTENSION/packages/* $LFS/sources/
|
||||
|
||||
# install static files if present
|
||||
if [ -d "$EXTENSION/static" ]
|
||||
@ -746,7 +746,7 @@ cd $(dirname $0)
|
||||
source ./config.sh
|
||||
|
||||
# import package list
|
||||
source ./pkgs.sh
|
||||
source ./packages.sh
|
||||
|
||||
|
||||
VERBOSE=false
|
||||
@ -784,7 +784,7 @@ while [ $# -gt 0 ]; do
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-d|--download-pkgs)
|
||||
-d|--download-packages)
|
||||
DOWNLOAD=true
|
||||
shift
|
||||
;;
|
||||
@ -913,8 +913,8 @@ fi
|
||||
|
||||
# Perform single operations
|
||||
$CHECKDEPS && check_dependencies && exit
|
||||
$DOWNLOAD && download_pkgs && exit
|
||||
$INIT && download_pkgs && init_image && unmount_image && exit
|
||||
$DOWNLOAD && download_packages && exit
|
||||
$INIT && download_packages && init_image && unmount_image && exit
|
||||
$MOUNT && mount_image && exit
|
||||
$UNMOUNT && unmount_image && exit
|
||||
$CLEAN && clean_image && exit
|
||||
@ -922,11 +922,11 @@ $CLEAN && clean_image && exit
|
||||
|
||||
if [ -n "$STARTPHASE" ]
|
||||
then
|
||||
download_pkgs
|
||||
download_packages
|
||||
mount_image
|
||||
elif $BUILDALL
|
||||
then
|
||||
download_pkgs
|
||||
download_packages
|
||||
init_image
|
||||
else
|
||||
usage
|
||||
|
Reference in New Issue
Block a user