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-03-07 08:23:09 +01:00
|
|
|
# generate pseudo file listing for squashfs
|
2019-03-09 14:22:55 +01:00
|
|
|
pkg install -l sqfs -R "$REPODIR" -r "$TCDIR/$TARGET" $DEPENDS |\
|
|
|
|
sort -u > "$PKGDEPLOYDIR/pseudo"
|
2018-01-18 14:23:48 +01:00
|
|
|
|
2018-04-19 07:23:15 +02:00
|
|
|
# move configuration to preserve directory
|
2019-03-07 08:38:16 +01:00
|
|
|
mkdir -pv "$TCDIR/$TARGET/cfg/preserve" "$TCDIR/$TARGET/cfg/overlay"
|
2019-03-07 08:23:09 +01:00
|
|
|
|
|
|
|
echo <<_EOF >> "$PKGDEPLOYDIR/pseudo"
|
|
|
|
cfg m 755 0 0
|
|
|
|
cfg/preserve m 755 0 0
|
|
|
|
cfg/preserve/etc m 755 0 0
|
|
|
|
cfg/preserve/usr m 755 0 0
|
|
|
|
cfg/preserve/var_lib m 755 0 0
|
|
|
|
cfg/overlay m 755 0 0
|
|
|
|
_EOF
|
|
|
|
|
|
|
|
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"
|
2018-01-23 16:34:33 +01:00
|
|
|
|
2019-03-07 08:23:09 +01:00
|
|
|
mkdir -p $TCDIR/$TARGET/{etc,var,usr}
|
2018-06-16 17:46:17 +02:00
|
|
|
|
2019-03-06 10:03:12 +01:00
|
|
|
sed -i 's#etc/#cfg/preserve/etc/#g' "$PKGDEPLOYDIR/pseudo"
|
|
|
|
sed -i 's#var/lib/#cfg/preserve/var_lib/#g' "$PKGDEPLOYDIR/pseudo"
|
|
|
|
sed -i 's#usr/#cfg/preserve/usr/#g' "$PKGDEPLOYDIR/pseudo"
|
2018-07-15 16:19:44 +02:00
|
|
|
|
|
|
|
# don't add stuff for the boot partition to the squashfs image
|
2019-03-07 08:23:09 +01:00
|
|
|
mv $TCDIR/$TARGET/boot/* "$PKGDEPLOYDIR"
|
2018-07-15 16:19:44 +02:00
|
|
|
|
2019-03-06 10:03:12 +01:00
|
|
|
grep -v "^boot/" "$PKGDEPLOYDIR/pseudo" > "$PKGDEPLOYDIR/pseudo.temp"
|
|
|
|
mv "$PKGDEPLOYDIR/pseudo.temp" "$PKGDEPLOYDIR/pseudo"
|
|
|
|
echo "boot m 750 0 0" >> "$PKGDEPLOYDIR/pseudo"
|
2018-01-16 17:44:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
deploy() {
|
2019-03-07 08:23:09 +01:00
|
|
|
mksquashfs "$TCDIR/$TARGET" "$PKGDEPLOYDIR/rootfs.img" -comp xz \
|
2019-03-06 10:03:12 +01:00
|
|
|
-no-progress -no-xattrs -pf "$PKGDEPLOYDIR/pseudo"
|
2018-04-20 13:12:57 +02:00
|
|
|
|
2019-03-06 10:03:12 +01:00
|
|
|
rm "$PKGDEPLOYDIR/pseudo"
|
|
|
|
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
|
2018-01-16 17:44:43 +01:00
|
|
|
}
|
2018-05-06 17:23:31 +02:00
|
|
|
|
|
|
|
check_update() {
|
|
|
|
return
|
2018-06-16 17:46:17 +02:00
|
|
|
}
|