1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-23 03:29:46 +01:00
build/pkg/rootfs/build
David Oberhollenzer 882ce4a8f4 Cleanup handling of linux packages and modules
- All linux packages generate "linux" and "linux-modules"
 - Preference mechanism is used to select the right source package
 - Rootfs depends on "linux-modules" to install the selected kernels
   modules into the squashfs image
 - The release pacakge depends on "linux" to install the appropriate
   kernel to the boot partition

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
2019-03-31 16:46:50 +02:00

42 lines
1.2 KiB
Text
Executable file

DEPENDS=$(cat_file_merge "ROOTFS" | sort -u)
build() {
# generate pseudo file listing for squashfs
pkg install -l sqfs -R "$REPODIR" -r "$TCDIR/$TARGET" $DEPENDS |\
sort -u > "$PKGDEPLOYDIR/pseudo"
# move configuration to preserve directory
mkdir -pv "$TCDIR/$TARGET/cfg/preserve" "$TCDIR/$TARGET/cfg/overlay"
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"
mkdir -p $TCDIR/$TARGET/{etc,var,usr}
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"
}
deploy() {
mksquashfs "$TCDIR/$TARGET" "$PKGDEPLOYDIR/rootfs.img" -comp xz \
-no-progress -no-xattrs -pf "$PKGDEPLOYDIR/pseudo"
rm "$PKGDEPLOYDIR/pseudo"
cp $SCRIPTDIR/pkg/$PKGNAME/*.{files,desc} "$PKGDEPLOYDIR"
}
check_update() {
return
}