Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cd4badd authored by Cole Faust's avatar Cole Faust
Browse files

Minor cleanup of erofs property checking

Test: Presubmits
Change-Id: I4146224674c3546b7c48cb727f0662d3d347f02e
parent a893932e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -511,15 +511,15 @@ func (f *filesystem) buildPropFile(ctx android.ModuleContext) (propFile android.
			addStr("erofs_default_compressor", proptools.String(compressor))
		}
		if compressHints := f.properties.Erofs.Compress_hints; compressHints != nil {
			addStr("erofs_default_compress_hints", android.PathForModuleSrc(ctx, *compressHints).String())
			addPath("erofs_default_compress_hints", android.PathForModuleSrc(ctx, *compressHints))
		}
		if proptools.BoolDefault(f.properties.Erofs.Sparse, true) {
			// https://source.corp.google.com/h/googleplex-android/platform/build/+/88b1c67239ca545b11580237242774b411f2fed9:core/Makefile;l=2292;bpv=1;bpt=0;drc=ea8f34bc1d6e63656b4ec32f2391e9d54b3ebb6b
			addStr("erofs_sparse_flag", "-s")
		}
	}
	} else if f.properties.Erofs.Compressor != nil || f.properties.Erofs.Compress_hints != nil || f.properties.Erofs.Sparse != nil {
		// Raise an exception if the propfile contains erofs properties, but the fstype is not erofs
	if fs := fsTypeStr(f.fsType(ctx)); fs != "erofs" && (f.properties.Erofs.Compressor != nil || f.properties.Erofs.Compress_hints != nil || f.properties.Erofs.Sparse != nil) {
		fs := fsTypeStr(f.fsType(ctx))
		ctx.PropertyErrorf("erofs", "erofs is non-empty, but FS type is %s\n. Please delete erofs properties if this partition should use %s\n", fs, fs)
	}