Create symlink for bionic files

This change creates following symlinks for bionic files.

/system/lib/libc.so -> /apex/com.android.runtime/lib/bionic/libc.so
/system/lib/libm.so -> /apex/com.android.runtime/lib/bionic/libm.so
/system/lib/libdl.so -> /apex/com.android.runtime/lib/bionic/libdl.so
/system/bin/linker -> /apex/com.android.runtime/bin/linker
...

This allows us to not have mountpoints under /bionic.

Bug: 125549215
Test: m and inspect the symlinks in the system partition.
Change-Id: I3a58bf4f88c967862dbf06065a1af8fc4700dda3
This commit is contained in:
Jiyong Park
2019-02-25 11:05:47 +09:00
parent 33548f07a8
commit f11943527d
6 changed files with 87 additions and 10 deletions

View File

@@ -124,6 +124,7 @@ type ModuleContext interface {
InstallExecutable(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath
InstallFile(installPath OutputPath, name string, srcPath Path, deps ...Path) OutputPath
InstallSymlink(installPath OutputPath, name string, srcPath OutputPath) OutputPath
InstallAbsoluteSymlink(installPath OutputPath, name string, absPath string) OutputPath
CheckbuildFile(srcPath Path)
AddMissingDependencies(deps []string)
@@ -1316,6 +1317,28 @@ func (a *androidModuleContext) InstallSymlink(installPath OutputPath, name strin
return fullInstallPath
}
// installPath/name -> absPath where absPath might be a path that is available only at runtime
// (e.g. /apex/...)
func (a *androidModuleContext) InstallAbsoluteSymlink(installPath OutputPath, name string, absPath string) OutputPath {
fullInstallPath := installPath.Join(a, name)
a.module.base().hooks.runInstallHooks(a, fullInstallPath, true)
if !a.skipInstall(fullInstallPath) {
a.Build(pctx, BuildParams{
Rule: Symlink,
Description: "install symlink " + fullInstallPath.Base() + " -> " + absPath,
Output: fullInstallPath,
Default: !a.Config().EmbeddedInMake(),
Args: map[string]string{
"fromPath": absPath,
},
})
a.installFiles = append(a.installFiles, fullInstallPath)
}
return fullInstallPath
}
func (a *androidModuleContext) CheckbuildFile(srcPath Path) {
a.checkbuildFiles = append(a.checkbuildFiles, srcPath)
}