1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-13 06:57:11 +01:00
build/pkg/rootfs/build
David Oberhollenzer 0ef38e31ee cleanup: new pkg tool can be built with default root/repodir
Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-06-10 17:03:06 +02:00

45 lines
1.1 KiB
Text
Executable file

DEPENDS=$(cat_file_merge "ROOTFS" | sort -u)
build() {
local listing="$PKGDEPLOYDIR/$PKGNAME.files"
local desc="$PKGDEPLOYDIR/$PKGNAME.desc"
# generate package description and file listing
pkg install -l pkg -r "$TCDIR/$TARGET" $DEPENDS | sort -u > "$listing"
touch "$desc"
# move configuration to preserve directory
mkdir -pv "$TCDIR/$TARGET/cfg/preserve" "$TCDIR/$TARGET/cfg/overlay"
mv "$TCDIR/$TARGET/etc" "$TCDIR/$TARGET/cfg/preserve/etc"
mv "$TCDIR/$TARGET/usr" "$TCDIR/$TARGET/cfg/preserve/usr"
mv "$TCDIR/$TARGET/var/lib" "$TCDIR/$TARGET/cfg/preserve/var_lib"
rm -rf "$TCDIR/$TARGET/var"
sed -i 's#etc/#cfg/preserve/etc/#g' "$listing"
sed -i 's#var/lib/#cfg/preserve/var_lib/#g' "$listing"
sed -i 's#usr/#cfg/preserve/usr/#g' "$listing"
egrep -v "^(dir|file|slink) (var|etc|usr)" "$listing" > "./temp"
mv "./temp" "$listing"
cat <<_EOF >> "$listing"
dir etc 0755 0 0
dir var 0755 0 0
dir usr 0755 0 0
dir cfg 0755 0 0
dir cfg/preserve 0755 0 0
dir cfg/preserve/etc 0755 0 0
dir cfg/preserve/usr 0755 0 0
dir cfg/preserve/var_lib 0755 0 0
dir cfg/overlay 0755 0 0
_EOF
}
deploy() {
return
}
check_update() {
return
}