1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-06-29 06:20:12 +02:00
build/pkg/rootfs/build
David Oberhollenzer 5bc2523af5 Create regular package for root filesystem, use pkg2sqfs in release
This commit overhauls the rootfs package to create a regular package
for the root filesystem instead of creating a packaged squashfs. The
release packages then use pkg2sqfs to turn it into a squashfs image.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-04-18 22:02:21 +02:00

48 lines
1.1 KiB
Plaintext
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 "$REPODIR" -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
}