1
0
mirror of https://github.com/krglaws/MyLFS.git synced 2025-07-26 15:46:59 +00:00

rename pkgs -> packages

This commit is contained in:
Kyle Glaws
2022-07-30 00:23:30 -04:00
parent 2cc7195f21
commit 1489a9b6ad
8 changed files with 107 additions and 108 deletions

4
.gitignore vendored
View File

@ -1,5 +1,7 @@
*.img
*.swp
pkgs/
packages/
logs/
mnt/
example_extension/packages/
example_extension/logs/

View File

@ -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.
@ -41,7 +39,7 @@ on the device you specify.
-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
-d|--download-packages Download all packages into the 'packages' directory, then
exit.
-i|--init Create the .img file, partition it, setup basic directory
@ -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.

View File

@ -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

View File

@ -1 +0,0 @@
pkgs/

View File

@ -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.

View File

@ -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

View File

@ -38,7 +38,7 @@ on the device you specify.
-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
-d|--download-packages Download all packages into the 'packages' directory, then
exit.
-i|--init Create the .img file, partition it, setup basic directory
@ -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