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

Re: Dynamically sizing swap by memory size?

stoffel lucent com said:
> I'm sorta looking at this right now, since it's easy enough to get the
> memory size from within the %pre section, just 
>        cat /proc/meminfo | grep MemTotal: 
> but there's no darn awk included, and the sed on there is stupid. Time
> to poke at the busybox man pages for tips, since it doens't seem to
> support regexps.
> John 

I'd recommend you learn python - its available in %pre (you can even
write your %pre in python, thats what we always do), and you can write
some very smart templates that write out to /tmp.  Then use the new
include directive in 7.3 to include the ks snippets you create with your
%pre into the ks.cfg file.

We added sfdisk to the runtime environment so people could do their custom
partitioning in the %pre and then create a ks snippet describing their
partitions via --onpart and including them later. It was much better sounding
than the hack of creating a ks.cfg in the %pre and restarting anaconda with
it (tho very clever at the time)!

Michael Fulbright
msf redhat com

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