From b8963e6dcf2b4e28812a33d5111b4747c7baf367 Mon Sep 17 00:00:00 2001 From: Mateus Melchiades Date: Tue, 29 Aug 2023 19:21:59 -0300 Subject: [PATCH] Fix: Broken locales after installation Related PR: https://github.com/Vanilla-OS/vanilla-installer/pull/270 This commit adds the mountpoint to the new locales directory in ABroot, as well as an the integrity check for the directory. --- core/integrity.go | 2 ++ core/system.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/integrity.go b/core/integrity.go index 1db31f68..c1bf207c 100644 --- a/core/integrity.go +++ b/core/integrity.go @@ -37,6 +37,7 @@ func NewIntegrityCheck(root ABRootPartition, repair bool) (*IntegrityCheck, erro "/var/lib/abroot/etc", fmt.Sprintf("%s-work", root.Label), ) + etcLocalePath := filepath.Join("/var/lib/abroot/etc", root.Label, "locales") ic := &IntegrityCheck{ rootPath: root.Partition.MountPoint, systemPath: systemPath, @@ -70,6 +71,7 @@ func NewIntegrityCheck(root ABRootPartition, repair bool) (*IntegrityCheck, erro etcPaths: []string{ etcPath, etcWorkPath, + etcLocalePath, }, } diff --git a/core/system.go b/core/system.go index 8bc54a0f..cdbe2222 100644 --- a/core/system.go +++ b/core/system.go @@ -391,6 +391,7 @@ mount -t overlay overlay -o lowerdir=/.system/etc,upperdir=/var/lib/abroot/etc/% mount -o bind /var/home /home mount -o bind /var/opt /opt mount -o bind,ro /.system/usr /usr +mount -o bind /var/lib/abroot/etc/%s/locales /usr/lib/locale ` mountExtCmd := "" if strings.HasPrefix(s.RootM.VarPartition.Device, "luks-") { @@ -399,7 +400,7 @@ mount -o bind,ro /.system/usr /usr } else { mountExtCmd = fmt.Sprintf("-U %s", s.RootM.VarPartition.Uuid) } - mountpoints := fmt.Sprintf(template, mountExtCmd, root.Label, root.Label) + mountpoints := fmt.Sprintf(template, mountExtCmd, root.Label, root.Label, root.Label) err := os.WriteFile(rootPath+MountScriptPath, []byte(mountpoints), 0755) if err != nil {