2018-02-20 21:30:34 +01:00
|
|
|
DEPENDS=$(cat_file_merge "ROOTFS" | sort -u)
|
2018-01-24 12:52:41 +01:00
|
|
|
|
2018-01-16 17:44:43 +01:00
|
|
|
build() {
|
2019-04-18 12:42:11 +02:00
|
|
|
local listing="$PKGDEPLOYDIR/$PKGNAME.files"
|
|
|
|
local desc="$PKGDEPLOYDIR/$PKGNAME.desc"
|
|
|
|
|
|
|
|
# generate package description and file listing
|
2020-03-13 14:17:50 +01:00
|
|
|
pkg install -l pkg -r "$SYSROOT" $DEPENDS | sort -u > "$listing"
|
2019-04-18 12:42:11 +02:00
|
|
|
touch "$desc"
|
2018-01-18 14:23:48 +01:00
|
|
|
|
2018-04-19 07:23:15 +02:00
|
|
|
# move configuration to preserve directory
|
2020-03-13 14:17:50 +01:00
|
|
|
mkdir -pv "$SYSROOT/cfg/preserve" "$SYSROOT/cfg/overlay"
|
2019-03-07 08:23:09 +01:00
|
|
|
|
2020-03-13 14:17:50 +01:00
|
|
|
mv "$SYSROOT/etc" "$SYSROOT/cfg/preserve/etc"
|
|
|
|
mv "$SYSROOT/usr" "$SYSROOT/cfg/preserve/usr"
|
|
|
|
mv "$SYSROOT/var/lib" "$SYSROOT/cfg/preserve/var_lib"
|
|
|
|
rm -rf "$SYSROOT/var"
|
2018-01-23 16:34:33 +01:00
|
|
|
|
2019-04-18 12:42:11 +02:00
|
|
|
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
|
2018-01-16 17:44:43 +01:00
|
|
|
}
|