1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-25 04:20:41 +01:00
build/pkg/rootfs/build
David Oberhollenzer fc0b587074 Cleanup deployed files and directories
- Remove empty directories installed to / by install targets
 - Make sure we strip everything
 - Remove charset.alias file installed by every pacakge, add
   centralized version to rootfs package

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
2018-02-24 22:44:59 +01:00

56 lines
1.4 KiB
Text
Executable file

DEPENDS=$(cat "$SCRIPTDIR/board/$BOARD/ROOTFS")
DEPENDS="$DEPENDS toolchain"
build() {
local SOURCE="$1"
local DEPLOY="$2"
# setup skeleton
mkdir -pv ${PKGBUILDDIR}/{bin,lib,etc,dev,sys,proc,tmp,var,run}
mkdir -pv ${PKGBUILDDIR}/{boot,usr,srv,mnt,opt}
mkdir -pv ${PKGBUILDDIR}/cfg/{preserve,overlay}
cp -r "$SCRIPTDIR/pkg/$PKGNAME/etc" "$PKGBUILDDIR"
cp -r "$SCRIPTDIR/pkg/$PKGNAME/lib" "$PKGBUILDDIR"
# install packages to rootfs
dependencies | tsort | tac | \
grep -v "$PKGNAME" > "$PKGBUILDDIR/etc/packages"
while read pkgname; do
if [ ! -e "$PKGDEPLOYDIR/$pkgname" ]; then
continue
fi
cp -ru --remove-destination ${PKGDEPLOYDIR}/${pkgname}/* \
"$PKGBUILDDIR"
done < "$PKGBUILDDIR/etc/packages"
# version info
local fname=$(echo "${OS_NAME}-release" | tr '[:upper:]' '[:lower:]')
echo $OS_RELEASE > $PKGBUILDDIR/etc/$fname
# setup root home directory
cp -r "$PKGBUILDDIR/etc/skel" "$PKGBUILDDIR/root"
chmod 750 "$PKGBUILDDIR/root"
# move configuration to preserve directory
mv ${PKGBUILDDIR}/etc ${PKGBUILDDIR}/cfg/preserve
mkdir -p ${PKGBUILDDIR}/etc
mv ${PKGBUILDDIR}/var/lib ${PKGBUILDDIR}/cfg/preserve/var_lib
mv ${PKGBUILDDIR}/root ${PKGBUILDDIR}/cfg/preserve
mkdir -p ${PKGBUILDDIR}/root
chmod 750 ${PKGBUILDDIR}/root
chmod 750 ${PKGBUILDDIR}/cfg/preserve/root
}
deploy() {
local SOURCE="$1"
local DEPLOY="$2"
mksquashfs "$PKGBUILDDIR" "$DEPLOY/rootfs.img" \
-all-root -no-progress -no-xattrs
}