Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 02:53 PM
David O
 
Posts: n/a
Default GCC Compiler questions

I'm just wondering if anyone can tell me where all the files are stored
during compilation? I have an old laptop im putting slack on to use for
e-mail and webbrowsing; and im trying to compile a slimmed down kernel
for it to use. Being the newbie that i am I've sort of "lost track" of
what step im on and would like to start over from scratch. Only prblem
is that ive filled up my harddrive with files used during the
compilation. Is it possible to clear out those files, or should I just
start over?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 02:54 PM
Old Man
 
Posts: n/a
Default Re: GCC Compiler questions

David O wrote:

> I'm just wondering if anyone can tell me where all the files are stored
> during compilation? I have an old laptop im putting slack on to use for
> e-mail and webbrowsing; and im trying to compile a slimmed down kernel
> for it to use. Being the newbie that i am I've sort of "lost track" of
> what step im on and would like to start over from scratch. Only prblem
> is that ive filled up my harddrive with files used during the
> compilation. Is it possible to clear out those files, or should I just
> start over?


make mrproper will clean up the source tree.

--
Old Man
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 02:54 PM
Faux_Pseudo
 
Posts: n/a
Default Re: GCC Compiler questions

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

_.-In alt.os.linux.slackware, Old Man wrote the following -._
> make mrproper will clean up the source tree.


And remove your .config. So if ye want to keep that move to someplace
safe befor running make mrproper and then move it back.

- --
.-')) http://asciipr0n.com/fp ('-. | It's a damn poor mind that
' ..- .:" ) ( ":. -.. ' | can only think of one way to
((,,_;'.;' UIN=66618055 ';. ';_,,)) | spell a word.
((_.YIM=Faux_Pseudo :._)) | - Andrew Jackson
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBWA/DSJec2PH9pbURArmEAJwJ095n6H0FCNOVzcncjcduuCLPRgCeK sA2
SO9BTxlCw6lmQ/hg157jYmQ=
=IJHi
-----END PGP SIGNATURE-----
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 02:54 PM
Floyd L. Davidson
 
Posts: n/a
Default Re: GCC Compiler questions

Faux_Pseudo <Faux_Pseudo@yahoo.comERCIAL> wrote:
>_.-In alt.os.linux.slackware, Old Man wrote the following -._
>> make mrproper will clean up the source tree.

>
>And remove your .config. So if ye want to keep that move to someplace
>safe befor running make mrproper and then move it back.


Besides, what point is there in running mrproper to rid the disk
of files that are going to be exactly recreated? Other than
perhaps a few modules being added or deleted from the list of
what gets made, it's virtually the same every time. Hence if
there isn't enough room on the disk, cleaning out files in the
kernel source tree is not going to provide extra space for doing
kernel compiles. That space will have to come from somewhere
else. Of course, when all is said and done, saving just the
gzipped tar file and the config is all that is needed, so the
rest can be deleted to provide space for something else.

--
FloydL. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 02:55 PM
Dave
 
Posts: n/a
Default Re: GCC Compiler questions

I have the tar and config file already made. So if I understand you
correctly; then I could essentially use make mrproper and then edit my
lilo config file to allow me to boot into the new image?
Im not really trying to get rid of my existing kernel I would just like
to test out my custom kernels with a known good backup. Actually since
i havent added anything to my existing cofiguration but only removed
modules; is there a way to use the existing modules made during my
initial install?

floyd@barrow.com (Floyd L. Davidson) wrote:
> Faux_Pseudo <Faux_Pseudo@yahoo.comERCIAL> wrote:
>
>>> _.-In alt.os.linux.slackware, Old Man wrote the following -._

>>
>>>>> make mrproper will clean up the source tree.

>>
>>>
>>> And remove your .config. So if ye want to keep that move to
>>> someplace safe befor running make mrproper and then move it back.
>>>

>
>
> Besides, what point is there in running mrproper to rid the disk of
> files that are going to be exactly recreated? Other than perhaps a
> few modules being added or deleted from the list of what gets made,
> it's virtually the same every time. Hence if there isn't enough room
> on the disk, cleaning out files in the kernel source tree is not
> going to provide extra space for doing kernel compiles. That space
> will have to come from somewhere else. Of course, when all is said
> and done, saving just the gzipped tar file and the config is all that
> is needed, so the rest can be deleted to provide space for something
> else.
>
> -- FloydL. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik
> (Barrow, Alaska) floyd@barrow.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 02:55 PM
Old Man
 
Posts: n/a
Default Re: GCC Compiler questions

Dave wrote:

> I have the tar and config file already made. So if I understand you
> correctly; then I could essentially use make mrproper and then edit my
> lilo config file to allow me to boot into the new image?


No, that's not what was said. You said you had "lost track" of where you
were in the compile process and asked how to get rid of the files you had
already created in the process. I said "make mrproper" would do that.

Faux suggested you protect and keep your .config file. He assumed you had
got that far in the process, which, apparently, you did.

Floyd addressed disk space issues, because you said you had "filled up" your
disk.

If you have not completed the compile process, you do not have a new kernel
installed. Doing make mrproper at this point will just wipe out everything
you have done, including the .config file.

> Im not really trying to get rid of my existing kernel I would just like
> to test out my custom kernels with a known good backup. Actually since
> i havent added anything to my existing cofiguration but only removed
> modules; is there a way to use the existing modules made during my
> initial install?


First, you need to complete the kernel compile (assuming you do have
sufficient disk space). If you finished the config step and are satisfied
with what you did: 1) move the .config file to someplace outside the
source tree; 2) make mrproper to clean up the source tree; 3) move
the .config file back; 4) make oldconfig (this will configure the source
tree using your .config file, so you don't have to repeat that step. Now,
stop. Read the README file at the top of the source tree thoroughly, and
read up on how to install and use a second kernel without losing your old
one (link below). After you understand what you're doing, procede with
compiling the new kernel, installing it, moving your old modules out of the
way, editing /etc/lilo.conf, and running /sbin/lilo. By all means, save a
copy of your current lilo.conf, and your current kernel image.

http://www.tldp.org/LDP/lame/LAME/li...el-custom.html

--
Old Man
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 02:55 PM
Dave
 
Posts: n/a
Default Re: GCC Compiler questions

Ok now I understand what you guys are saying. Now for future reference
is there a log that maybe I could look at to see where I'm at and what
files have been created. Ive searched through my /var/log and cant
find any logs that keep track of these changes. Or is this something
special that I'll have to set up?


Old Man <bill@witch.lan> wrote:
> Dave wrote:
>
>>> I have the tar and config file already made. So if I understand
>>> you correctly; then I could essentially use make mrproper and
>>> then edit my lilo config file to allow me to boot into the new
>>> image?

>
>
> No, that's not what was said. You said you had "lost track" of where
> you were in the compile process and asked how to get rid of the files
> you had already created in the process. I said "make mrproper" would
> do that.
>
> Faux suggested you protect and keep your .config file. He assumed
> you had got that far in the process, which, apparently, you did.
>
> Floyd addressed disk space issues, because you said you had "filled
> up" your disk.
>
> If you have not completed the compile process, you do not have a new
> kernel installed. Doing make mrproper at this point will just wipe
> out everything you have done, including the .config file.
>
>>> Im not really trying to get rid of my existing kernel I would
>>> just like to test out my custom kernels with a known good backup.
>>> Actually since i havent added anything to my existing
>>> cofiguration but only removed modules; is there a way to use the
>>> existing modules made during my initial install?

>
>
> First, you need to complete the kernel compile (assuming you do have
> sufficient disk space). If you finished the config step and are
> satisfied with what you did: 1) move the .config file to someplace
> outside the source tree; 2) make mrproper to clean up the source
> tree; 3) move the .config file back; 4) make oldconfig (this will
> configure the source tree using your .config file, so you don't have
> to repeat that step. Now, stop. Read the README file at the top of
> the source tree thoroughly, and read up on how to install and use a
> second kernel without losing your old one (link below). After you
> understand what you're doing, procede with compiling the new kernel,
> installing it, moving your old modules out of the way, editing
> /etc/lilo.conf, and running /sbin/lilo. By all means, save a copy of
> your current lilo.conf, and your current kernel image.
>
> http://www.tldp.org/LDP/lame/LAME/li...el-custom.html
>
>
> -- Old Man

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 02:55 PM
Floyd L. Davidson
 
Posts: n/a
Default Re: GCC Compiler questions

Dave <davido@snet111nospam111.net> wrote:
> I have the tar and config file already made.


Exactly. In fact, if you have a high speed Internet connection
available, there is no real need to even keep the tar file of
your kernel sources around either, since you can download a new
one any time you want. And usually every time you start some
new project like this there will be a more recent kernel anyway.

And if you have gone to the trouble of learning how to
configure and compile a new kernel, *do* get the latest release
of whichever version you are using. You may or may not want to
try switching from 2.4 to 2.6, though I would highly recommend
it, but there is no point in recompiling an old release of
either 2.4 or 2.6. Get the latest one for whatever you use.
(That is *not* a generally true condition though! It just
happens right now that the 2.4 kernel is very mature, and the
latest release is almost guaranteed to be stable enough. With
the 2.6 kernel, unlike what happened when 2.2 and 2.4 came out,
it has been basically stable from the start and it's more a
matter of whether any given release has the features implemented
that you need. For a laptop, I doubt that anything is missing
in the latest releases.)

Also, I don't recall that you mentioned which kernel you are
using, but the 2.6 kernels can be configured to put a config.gz
pseudo file into /proc. Using that configuration certainly
makes it easy to keep track of which config file is which!

>So if I understand you
>correctly; then I could essentially use make mrproper and then edit my
>lilo config file to allow me to boot into the new image?


There is essentially *never* any reason for most people to do a
"make mrproper". It returns the kernel directory to the
condition it was in the distribution archive. Unless you are a
kernel developer, and have made changes to the source code which
need to be archived, that is a worthless condition.

If you change the kernel configuration and want to recompile, do
a "make clean", which will delete all of the *.o files and
whatever else is built using a specific configuration. Then you
do something like "make bzlilo" or "make bzimage", followed by
making and installing the modules. (But in regard to your
original query, no space is likely to be saved in doing this.
Virtually all of the files deleted are recreated one at a time,
and at the end you have exactly what you started with.)

>Im not really trying to get rid of my existing kernel I would just like
>to test out my custom kernels with a known good backup. Actually since
>i havent added anything to my existing cofiguration but only removed
>modules; is there a way to use the existing modules made during my
>initial install?


Actually, if you didn't change the configuration other than to
specify that some modules need not be built, you don't have to
do *anything* with the kernel! Just go to /lib/modules and
delete the particular modules. They won't be loaded. Or better
yet, you can leave them there (we aren't talking any really
significant amount of disk space), and comment out anything in
the /etc/rc.d scripts that causes them to be loaded.

And yes, as long as you are using the same kernel version the
modules need not be recompiled unless there has been some update
that you wish to install.

Most distributions, and Slackware is no exception, come with as
many modules as possible just so that a user who does not want
to _ever_ compile a kernel can just load a module to get added
kernel features. That is the whole point of having kernel
features in loadable modules!

--
FloydL. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-19-2008, 02:56 PM
Floyd L. Davidson
 
Posts: n/a
Default Re: GCC Compiler questions

Dave <davido@snet111nospam111.net> wrote:
> Ok now I understand what you guys are saying. Now for future reference
>is there a log that maybe I could look at to see where I'm at and what
>files have been created. Ive searched through my /var/log and cant
>find any logs that keep track of these changes. Or is this something
>special that I'll have to set up?


Why bother? You've created *dozens* of files! Most of them are
worthless the instant the final product is made. That is a new
kernel file and the System.map that matches. Everything else is
instantly useless (this does not address the modules, only the
kernel) and will need to be rebuilt if you change any part of
the configuration.

Each kernel module represents just about the same situation on
its own. The resulting module is of note, and none of the
intermediate files are.

So as far as just compiling, you want the kernel itself, the
System.map, and nothing else. Where the kernel file is located
depends on what you did to generate it. I use "make bzlilo",
and it puts the kernel into a file /vmlinuz and generates a
matching /System.map file. I move those to /boot, using various
names.

The modules of course are installed when you do "make
modules_install". You don't need to keep track of them, other
than perhaps poking around in the /lib/module directory tree to
see what you do or don't have if you want to try something new.

As far as installing and booting a kernel... that is a very
different story. There is no set procedure, and everyone seems
to do it slightly different. Some basic similarities exist
though, that you might want to consider as guidelines for
whatever you decide to do.

Save copies of existing (functional) /etc/lilo.conf files. And
do not *ever* delete an older working kernel until you have a
/well/ tested new one, with a backup, in place.

The system that I use involves a separate partition mounted on
/boot. Once a new kernel is created, it is moved to /boot.
Currently on this particular machine I have several kernels in
/boot. These are the old ones:

vmlinuz-2.6.6-1 vmlinuz-2.6.6-2 vmlinuz-2.6.6-3 vmlinuz-2.6.6-4

The currently in use kernel is,

vmlinuz-2.6.7-1

My lilo.conf allows for booting only the last three of those,
and the others are now so ancient that I could delete them
without any risk.

Installing a new kernel, for me, would amount to the following
procedure:

su
cd /usr/src/linux-2.6.7
make xconfig # change kernel configuration
make -j2 MAKE='make -j2' clean
make -j2 MAKE='make -j2' bzlilo
make -j2 MAKE='make -j2' modules
make -j2 MAKE='make -j2' modules_install
cd /boot
mv /vmlinuz vmlinuz-2.6.7-2
mv System.map System.map-2.6.7-1
mv /System.map System.map
cp /etc/lilo.conf /etc/lilo.conf.bak
xemacs /etc/lilo.conf # rearrange kernel labels
lilo
shutdown -r now

--
FloydL. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd@barrow.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-19-2008, 02:56 PM
Dave
 
Posts: n/a
Default Re: GCC Compiler questions

WOW!!!! Thanks for the post. Im gonna digest this, do some reading
about the kernel and then post a followup. Thanks again!!

floyd@barrow.com (Floyd L. Davidson) wrote:
> Dave <davido@snet111nospam111.net> wrote:
>
>>> I have the tar and config file already made.

>
>
> Exactly. In fact, if you have a high speed Internet connection
> available, there is no real need to even keep the tar file of your
> kernel sources around either, since you can download a new one any
> time you want. And usually every time you start some new project
> like this there will be a more recent kernel anyway.
>
> And if you have gone to the trouble of learning how to configure and
> compile a new kernel, *do* get the latest release of whichever
> version you are using. You may or may not want to try switching from
> 2.4 to 2.6, though I would highly recommend it, but there is no point
> in recompiling an old release of either 2.4 or 2.6. Get the latest
> one for whatever you use. (That is *not* a generally true condition
> though! It just happens right now that the 2.4 kernel is very
> mature, and the latest release is almost guaranteed to be stable
> enough. With the 2.6 kernel, unlike what happened when 2.2 and 2.4
> came out, it has been basically stable from the start and it's more a
> matter of whether any given release has the features implemented
> that you need. For a laptop, I doubt that anything is missing in the
> latest releases.)
>
> Also, I don't recall that you mentioned which kernel you are using,
> but the 2.6 kernels can be configured to put a config.gz pseudo file
> into /proc. Using that configuration certainly makes it easy to keep
> track of which config file is which!
>
>>> So if I understand you correctly; then I could essentially use
>>> make mrproper and then edit my lilo config file to allow me to
>>> boot into the new image?

>
>
> There is essentially *never* any reason for most people to do a "make
> mrproper". It returns the kernel directory to the condition it was
> in the distribution archive. Unless you are a kernel developer, and
> have made changes to the source code which need to be archived, that
> is a worthless condition.
>
> If you change the kernel configuration and want to recompile, do a
> "make clean", which will delete all of the *.o files and whatever
> else is built using a specific configuration. Then you do something
> like "make bzlilo" or "make bzimage", followed by making and
> installing the modules. (But in regard to your original query, no
> space is likely to be saved in doing this. Virtually all of the files
> deleted are recreated one at a time, and at the end you have exactly
> what you started with.)
>
>>> Im not really trying to get rid of my existing kernel I would
>>> just like to test out my custom kernels with a known good backup.
>>> Actually since i havent added anything to my existing
>>> cofiguration but only removed modules; is there a way to use the
>>> existing modules made during my initial install?

>
>
> Actually, if you didn't change the configuration other than to
> specify that some modules need not be built, you don't have to do
> *anything* with the kernel! Just go to /lib/modules and delete the
> particular modules. They won't be loaded. Or better yet, you can
> leave them there (we aren't talking any really significant amount of
> disk space), and comment out anything in the /etc/rc.d scripts that
> causes them to be loaded.
>
> And yes, as long as you are using the same kernel version the modules
> need not be recompiled unless there has been some update that you
> wish to install.
>
> Most distributions, and Slackware is no exception, come with as many
> modules as possible just so that a user who does not want to _ever_
> compile a kernel can just load a module to get added kernel features.
> That is the whole point of having kernel features in loadable
> modules!
>
> -- FloydL. Davidson <http://web.newsguy.com/floyd_davidson> Ukpeagvik
> (Barrow, Alaska) floyd@barrow.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:13 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483