Re: giant initrd.img testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I tried this. I don't know what I'm doing wrong, but it doesn't shrink the locale-archive at all. After I try to remove them, and then try to list it again, it shows only a few locales, so it looks like they got removed, but locale-archive is still the same size. I even checked the one on the build system, just to check if it maybe removed it from the build system, not from the install tree, but they are both unchanged.

--

  Martin Gracik

----- "David Cantrell" <dcantrell@xxxxxxxxxx> wrote:

> On Tue, 24 Aug 2010, Chris Lumens wrote:
> 
> >>> -r--r--r--   1 root     root     99158752 Aug 23 14:05
> usr/lib/locale/locale-archive
> >>
> >> My understanding is that we need this when changing to another
> locale, for
> >> basic character set stuff and glibc messages.
> >
> > Right.
> >
> >> We should reduce it to only those locales listed in lang-table
> using
> >> localedef.  That way we start with the one on the system and reduce
> it down to
> >> what is supported at install time.
> >
> > Yes, reducing it is what I want to do.  A long time ago, we ran
> > build-locale-archive during upd-instroot to generate the
> locale-archive
> > file for just those locales we support in anaconda.  We quit doing
> that
> > at some point.  Now I just need to figure out if it's still possible
> and
> > if so, how we go about doing it.
> 
> I just threw this together, but it's incomplete:
> 
> #!/usr/bin/python
> 
> import os
> import subprocess
> 
> if __name__ == "__main__":
>      cwd = os.getcwd()
>      langtable = os.path.realpath(cwd + "/data/lang-table")
>      cur = os.path.realpath(cwd + "/locale-archive")
>      new = cur + ".new"
> 
>      langs = map(lambda y: y[3].replace('.UTF-8', '.utf8'),
>                  map(lambda x: x.split(), open(langtable,
> 'r').readlines()))
> 
>      proc = subprocess.Popen(["localedef", "-i", cur,
> "--list-archive"],
>                              stdout=subprocess.PIPE)
>      (out, err) = proc.communicate()
> 
>      remove = list(set(out.split()) - set(langs))
> 
>      args = ["-i", cur, "--delete-from-archive"] + remove
>      proc = subprocess.Popen(["localedef"] + args,
>                              stdout=subprocess.PIPE)
>      (out, err) = proc.communicate()
> 
> 
> You can see what I was going for.  But I cannot figure out how to
> make
> localedef write to a new temporary file (cur).  It wants to write to
> /usr/lib/locale/locale-archive regardless of what options I pass.  But
> I can
> override it with -i for input.  Weird.
> 
> -- 
> David Cantrell <dcantrell@xxxxxxxxxx>
> Red Hat / Honolulu, HI
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux