mirror of
https://github.com/pygos/build.git
synced 2024-11-22 11:09:46 +01:00
9b7c8c5730
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
41 lines
997 B
Text
Executable file
41 lines
997 B
Text
Executable file
build() {
|
|
local SOURCE="$1"
|
|
local BUILD="$2"
|
|
local DEPLOY="$3"
|
|
|
|
# setup skeleton
|
|
mkdir -pv ${BUILD}/{bin,lib,etc,dev,sys,proc,tmp,var,run}
|
|
mkdir -pv ${BUILD}/{boot,usr,srv,mnt,opt}
|
|
mkdir -pv ${BUILD}/cfg/{preserve,overlay}
|
|
|
|
echo "/lib" > "$BUILD/etc/ld-musl-i386.path"
|
|
|
|
# install packages to rootfs
|
|
cat "$SCRIPTDIR/pkg/rootfs-alix/depends" | sort -u > "$BUILD/rawpkg"
|
|
|
|
dependencies "$BUILD/rawpkg" "$BUILD/etc/packages" "pkg"
|
|
echo "toolchain" >> "$BUILD/etc/packages"
|
|
rm -f "$BUILD/rawpkg"
|
|
|
|
while read pkgname; do
|
|
if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then
|
|
continue
|
|
fi
|
|
|
|
cp -ru --remove-destination ${PKGDEPLOYDIR}/${pkgname}/* "$BUILD"
|
|
done < "$BUILD/etc/packages"
|
|
|
|
# move configuration to preserve directory
|
|
mv ${BUILD}/etc ${BUILD}/cfg/preserve
|
|
mkdir -p ${BUILD}/etc
|
|
|
|
mv ${BUILD}/var/lib ${BUILD}/cfg/preserve/var_lib
|
|
}
|
|
|
|
deploy() {
|
|
local SOURCE="$1"
|
|
local BUILD="$2"
|
|
local DEPLOY="$3"
|
|
|
|
mksquashfs "$BUILD" "$DEPLOY/rootfs.img" -all-root -no-progress -no-xattrs
|
|
}
|