Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
emmett1 committed Oct 6, 2019
1 parent 810d86d commit 48d4e94
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.iso
sources
packages
13 changes: 8 additions & 5 deletions 01-toolchain
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash

fetch() {

fetch() {
tarballname=$(echo $1 | rev | cut -d / -f 1 | rev)
WGETCMD="wget --passive-ftp --tries=3 --waitretry=3 --output-document=$2/$tarballname.partial"
WGETRESUME="-c"
Expand All @@ -22,8 +21,10 @@ fetch() {

if [ $? = 0 ]; then
mv $2/$tarballname.partial $2/$tarballname
fi

else
echo "Failed fetching source: $tarballname"
exit 1
fi
}

fetch_src() {
Expand Down Expand Up @@ -73,8 +74,10 @@ checkdone() {
if [ -e $LFS/tools/$(basename $script) ]; then
echo "*** skip $(basename $script) ***"
return 1
else
echo ">>> building $(basename $script) <<<"
return 0
fi
return 0
}

build_stage1() {
Expand Down
27 changes: 18 additions & 9 deletions 02-base
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,20 @@ umount_pseudo() {
mountpoint -q $LFS/sys && umount $LFS/sys
}

mountbind_cache() {
# mount bind cachedir
mkdir -p $LFS/var/lib/pkg/{pkg,src} $CWD/{sources,packages}
mount --bind $CWD/sources $LFS/var/lib/pkg/src
mount --bind $CWD/packages $LFS/var/lib/pkg/pkg
}

umountbind_cache() {
# umount binded cachedir
umount $LFS/var/lib/pkg/src &>/dev/null
umount $LFS/var/lib/pkg/pkg &>/dev/null
}


runinchroot() {
pushd $LFS &>/dev/null
mount_pseudo
Expand All @@ -96,6 +110,7 @@ interrupted() {

die() {
[ "$@" ] && printerror $@
umountbind_cache
umount_pseudo
exit 1
}
Expand Down Expand Up @@ -136,15 +151,7 @@ mkdir -p $LFS/usr/ports/
echo "==> Copying ports"
cp -Ra ports/* $LFS/usr/ports/

if [ -d sources/ ]; then
echo "==> Copying sources"
cp -Ra sources/* $LFS/var/lib/pkg/src/
fi

if [ -d packages/ ]; then
echo "==> Copying packages"
cp -Ra packages/* $LFS/var/lib/pkg/pkg/
fi
mountbind_cache

for pkg in $PKGS; do
case $pkg in
Expand All @@ -153,4 +160,6 @@ for pkg in $PKGS; do
esac
done

umountbind_cache

exit 0
2 changes: 1 addition & 1 deletion ports/sysvinit/Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
name=sysvinit
version=2.96
release=1
source=(https://download.savannah.gnu.org/releases/$name/$name-$version.tar.xz)
source=(http://download.savannah.gnu.org/releases/sysvinit/sysvinit-$version.tar.xz)

build() {
cd $name-$version
Expand Down
2 changes: 1 addition & 1 deletion toolchain/19-findutils
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name=findutils
version=4.7.0
source=(http://ftp.gnu.org/gnu/findutils/findutils-$version.tar.gz)
source=(http://ftp.gnu.org/gnu/findutils/findutils-$version.tar.xz)

build() {
cd $name-$version
Expand Down

0 comments on commit 48d4e94

Please sign in to comment.