Reply by Tim Wescott April 23, 20142014-04-23
On Tue, 22 Apr 2014 23:48:50 +0200, David Brown wrote:

> It's like going to the supermarket. There is a lot of choice, but you > don't /have/ to buy one of every product in the shop! >
OH! This explains my high grocery bill and all the uneaten food I throw out every month! Thanks! -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by David Brown April 22, 20142014-04-22
On 23/04/14 00:03, Grant Edwards wrote:
> On 2014-04-22, David Brown <david.brown@hesbynett.no> wrote: >> On 22/04/14 23:15, edward.ming.lee@gmail.com wrote: >>> >>> I am just saying that the default .config compile almost everything. >> >> No, the "default" .config does not compile almost everything - you have >> a choice of defaults, and these are just a starting point. /Choose/ >> what you want to build. /You/ are the one planning on writing your own >> installer - /you/ choose what modules to include. >> >> It's like going to the supermarket. There is a lot of choice, but >> you don't /have/ to buy one of every product in the shop! > > That attitude is downright un-American! Next you'll be claiming you > don't have to get a new smartphone every 6 months.
Well I'm not American, and I don't know what planet edward.ming.lee lives on, so I guess that's okay!
> >>>> Secondly, modules take no time at boot up >>> >>> They goes into initrdisk, as part of building the kernel. >> >> That's only true if you are building an initramfs, > > Bah. That initramfs stuff is nonsense. If you build the kernel right > in first place, you don't need an initial ramdisk or any of that fancy > "module" stuff. ;) > > I'm only half joking -- none of my Linux machines have initial > ramdisks, and the only ones with modules loaded are the ones using the > closed-source nvidia drivers.
Initramfs is useful if you've got stuff like root on raid, crypto or lvm. But if you've just got a "normal" setup then you typically don't need it. And modules are handy to have around for hotplug devices - if you are compiling your own kernel, it makes sense to compile the stuff you normally need directly into the kernel rather than as a module. But having modules there is really handy when you want to plug in a new USB-to-Ethernet adaptor and find it just works out of the box.
> > But, I supose, if you want to build something that boots on any random > PC, then yes, you will need an initial ramdisk and a _lot_ of modules > that never get loaded for any particular machine. >
Reply by April 22, 20142014-04-22

> > Easy enough to check it. Just download it from kernel.org and see for yourself. > > I am just saying that the default .config compile almost everything.
> No, the "default" .config does not compile almost everything - you have > a choice of defaults, and these are just a starting point. /Choose/ > what you want to build. /You/ are the one planning on writing your own > installer - /you/ choose what modules to include.
Pointless to argue about this. Perhaps someone else can verify it. Download the kernel, "make menuconfig", exit without changing anyway. "make" and come back a few hours later to check it.
> That's only true if you are building an initramfs, and even then you > only include the modules you /need/ to have in the initramfs. Your > initramfs contains only those modules needed to get the main root > filesystem mounted (such as drivers for the filesystems, and perhaps > RAID, LVM, crypto, etc.), along with any user-space programs needed to > get your real root mounted.
There is no option to decide whether to place a module in initrd or rootfs. I want to build minimum initrd, but much more in rootfs.
> >> - they are only loaded and > >> used if they are needed. That's the main idea of making them modules > >> rather than statically linking them into the kernel.
> > This is only true for the main root file system.
> Yes, which is why you put your extra modules in your main filesystem. > You only put the pre-root essentials into your initramfs.
Until i figure out where to spit the process, it is the same single "make install" to build modules for both initrd and rootfs.
> >>> Perhaps there should be a "b" option that build the boot modules, > >>> in addition to the "m" option.
If we have this new option, we don't have to do it manually.
> No, a reasonable USB stick will do at least 10 MB/s, which is the same > as you get with 100 Mbit Ethernet (at peak). And even if you have the > world's worst USB stick, the speed difference would not explain a boot > time difference in the range of 100 between your claimed 20 minutes and > my few seconds
Again, we need independent verifications. I'll tried it on two different notebooks (no CD/DVD): Fujisu T2010 and HP mini 311.
Reply by Grant Edwards April 22, 20142014-04-22
On 2014-04-22, David Brown <david.brown@hesbynett.no> wrote:
> On 22/04/14 23:15, edward.ming.lee@gmail.com wrote: >> >> I am just saying that the default .config compile almost everything. > > No, the "default" .config does not compile almost everything - you have > a choice of defaults, and these are just a starting point. /Choose/ > what you want to build. /You/ are the one planning on writing your own > installer - /you/ choose what modules to include. > > It's like going to the supermarket. There is a lot of choice, but > you don't /have/ to buy one of every product in the shop!
That attitude is downright un-American! Next you'll be claiming you don't have to get a new smartphone every 6 months.
>>> Secondly, modules take no time at boot up >> >> They goes into initrdisk, as part of building the kernel. > > That's only true if you are building an initramfs,
Bah. That initramfs stuff is nonsense. If you build the kernel right in first place, you don't need an initial ramdisk or any of that fancy "module" stuff. ;) I'm only half joking -- none of my Linux machines have initial ramdisks, and the only ones with modules loaded are the ones using the closed-source nvidia drivers. But, I supose, if you want to build something that boots on any random PC, then yes, you will need an initial ramdisk and a _lot_ of modules that never get loaded for any particular machine. -- Grant Edwards grant.b.edwards Yow! I'm having a at quadrophonic sensation gmail.com of two winos alone in a steel mill!
Reply by David Brown April 22, 20142014-04-22
On 22/04/14 23:15, edward.ming.lee@gmail.com wrote:
> >> You are imagining things. > > Easy enough to check it. Just download it from kernel.org and see for yourself. > >> >> First, almost no one compiles /all/ the possible modules - even general >> purpose kernel compiles like Ubuntu will only compile a small fraction >> of the drivers and modules supported. If you choose to compile >> /everything/, then you get /everything/. > > I am just saying that the default .config compile almost everything.
No, the "default" .config does not compile almost everything - you have a choice of defaults, and these are just a starting point. /Choose/ what you want to build. /You/ are the one planning on writing your own installer - /you/ choose what modules to include. It's like going to the supermarket. There is a lot of choice, but you don't /have/ to buy one of every product in the shop!
> >> >> Secondly, modules take no time at boot up > > They goes into initrdisk, as part of building the kernel.
That's only true if you are building an initramfs, and even then you only include the modules you /need/ to have in the initramfs. Your initramfs contains only those modules needed to get the main root filesystem mounted (such as drivers for the filesystems, and perhaps RAID, LVM, crypto, etc.), along with any user-space programs needed to get your real root mounted.
> >> - they are only loaded and >> used if they are needed. That's the main idea of making them modules >> rather than statically linking them into the kernel. > > This is only true for the main root file system.
Yes, which is why you put your extra modules in your main filesystem. You only put the pre-root essentials into your initramfs.
> > >>> Perhaps there should be a "b" option that build the boot modules, >>> in addition to the "m" option. >> >>> All these work because i am trying to replace one line in the kernel. >>> "Root drive is not ready, press 'S' to skip". >>> The USB root drive will be ready, just need a small delay. >>> Pressing a key to skip is no big deal, except when there is nobody >>> to press it in an embedded system. > >> I recently built a 3.14 kernel for use in an embedded system. I put >> quite a bit into the kernel itself, and it is 4.5 MB. There are 2.3 MB >> of modules. It boots in a few seconds on a 800 MHz ARM, and that is >> with the root filesystem on NFS. > > Yes, your network would be a lot faster than USB. >
No, a reasonable USB stick will do at least 10 MB/s, which is the same as you get with 100 Mbit Ethernet (at peak). And even if you have the world's worst USB stick, the speed difference would not explain a boot time difference in the range of 100 between your claimed 20 minutes and my few seconds.
Reply by April 22, 20142014-04-22
> On a 3 year old dual processor machine, my xubuntu > 3.2.0-60-generic x86_64 4.9MB kernel goes from o/s selection > screen to graphical login screen in 12s
Mine is just as fast booting from SATA.
> I fail to see how your system is 100 times slower and > 250 times larger.
Slow when booting from USB.
> Hence I presume you are interested neither in the /installation/
I am interested in building an installable USB flash drive, which would install a copy into the SATA drive. All the settings should be established in advance. No options/keys during installation.
> time nor the kernel /compilation/ time of an embedded system,
But i don't want to wait hours to compile.
> but are only interested in the boot time of an installed > system.
Slow installation boot time is not critical, but still annoying.
Reply by April 22, 20142014-04-22
> You are imagining things.
Easy enough to check it. Just download it from kernel.org and see for yourself.
> > First, almost no one compiles /all/ the possible modules - even general > purpose kernel compiles like Ubuntu will only compile a small fraction > of the drivers and modules supported. If you choose to compile > /everything/, then you get /everything/.
I am just saying that the default .config compile almost everything.
> > Secondly, modules take no time at boot up
They goes into initrdisk, as part of building the kernel.
> - they are only loaded and > used if they are needed. That's the main idea of making them modules > rather than statically linking them into the kernel.
This is only true for the main root file system.
> > Perhaps there should be a "b" option that build the boot modules, > > in addition to the "m" option. > > > All these work because i am trying to replace one line in the kernel. > > "Root drive is not ready, press 'S' to skip". > > The USB root drive will be ready, just need a small delay. > > Pressing a key to skip is no big deal, except when there is nobody > > to press it in an embedded system.
> I recently built a 3.14 kernel for use in an embedded system. I put > quite a bit into the kernel itself, and it is 4.5 MB. There are 2.3 MB > of modules. It boots in a few seconds on a 800 MHz ARM, and that is > with the root filesystem on NFS.
Yes, your network would be a lot faster than USB.
Reply by Tom Gardner April 22, 20142014-04-22
On 21/04/14 22:46, edward.ming.lee@gmail.com wrote:
> >> >> My understanding of linux kernel compiles is that you are free to leave >> out much of the stuff you don't need, and thus can often make a custom >> kernel that is smaller (and faster) than one that includes everything up >> to the kitchen sink so it can work on any 'puter. > > Yes, but the newest release is to compile everything as module. > I have to move files away, build the ramdisk, then move them > back to /lib/modules. > >> Are you talking about the image or all the source you need to compile the >> image? I just checked, my biggest initrd.img file on this machine is >> 14MB and change. That's MB, _not_ GB. And that's the initrd.img that >> ships with Ubuntu, not anything that's been slimmed-down. > > You probably have an older kernel. > The released LinuxMint/Ubuntu is 3.8.0 with 30MB initrd. > > Linux 3.13 compiles 1G bytes of modules, compressed to 200M. > It takes 20 minutes to boot on a modern laptop.
On a 3 year old dual processor machine, my xubuntu 3.2.0-60-generic x86_64 4.9MB kernel goes from o/s selection screen to graphical login screen in 12s I fail to see how your system is 100 times slower and 250 times larger.
> All these work because i am trying to replace one line in the kernel. > "Root drive is not ready, press 'S' to skip". > The USB root drive will be ready, just need a small delay. > > Pressing a key to skip is no big deal, except when there is nobody > to press it in an embedded system.
Hence I presume you are interested neither in the /installation/ time nor the kernel /compilation/ time of an embedded system, but are only interested in the boot time of an installed system.
Reply by David Brown April 22, 20142014-04-22
On 21/04/14 23:46, edward.ming.lee@gmail.com wrote:
> >> >> My understanding of linux kernel compiles is that you are free to leave >> out much of the stuff you don't need, and thus can often make a custom >> kernel that is smaller (and faster) than one that includes everything up >> to the kitchen sink so it can work on any 'puter. > > Yes, but the newest release is to compile everything as module. > I have to move files away, build the ramdisk, then move them > back to /lib/modules. > >> Are you talking about the image or all the source you need to compile the >> image? I just checked, my biggest initrd.img file on this machine is >> 14MB and change. That's MB, _not_ GB. And that's the initrd.img that >> ships with Ubuntu, not anything that's been slimmed-down. > > You probably have an older kernel. > The released LinuxMint/Ubuntu is 3.8.0 with 30MB initrd. > > Linux 3.13 compiles 1G bytes of modules, compressed to 200M. > It takes 20 minutes to boot on a modern laptop. Most of the > modules are not used and they are immediately replaced by the > root file system anyway. I managed to stripe it to 20M and > 4 minutes to boot. But it's a headache to compile and move > files back and forth.
You are imagining things. First, almost no one compiles /all/ the possible modules - even general purpose kernel compiles like Ubuntu will only compile a small fraction of the drivers and modules supported. If you choose to compile /everything/, then you get /everything/. Secondly, modules take no time at boot up - they are only loaded and used if they are needed. That's the main idea of making them modules rather than statically linking them into the kernel.
> > Perhaps there should be a "b" option that build the boot modules, > in addition to the "m" option. > > All these work because i am trying to replace one line in the kernel. > "Root drive is not ready, press 'S' to skip". > The USB root drive will be ready, just need a small delay. > > Pressing a key to skip is no big deal, except when there is nobody > to press it in an embedded system. >
I recently built a 3.14 kernel for use in an embedded system. I put quite a bit into the kernel itself, and it is 4.5 MB. There are 2.3 MB of modules. It boots in a few seconds on a 800 MHz ARM, and that is with the root filesystem on NFS.
Reply by April 21, 20142014-04-21
> > My understanding of linux kernel compiles is that you are free to leave > out much of the stuff you don't need, and thus can often make a custom > kernel that is smaller (and faster) than one that includes everything up > to the kitchen sink so it can work on any 'puter.
Yes, but the newest release is to compile everything as module. I have to move files away, build the ramdisk, then move them back to /lib/modules.
> Are you talking about the image or all the source you need to compile the > image? I just checked, my biggest initrd.img file on this machine is > 14MB and change. That's MB, _not_ GB. And that's the initrd.img that > ships with Ubuntu, not anything that's been slimmed-down.
You probably have an older kernel. The released LinuxMint/Ubuntu is 3.8.0 with 30MB initrd. Linux 3.13 compiles 1G bytes of modules, compressed to 200M. It takes 20 minutes to boot on a modern laptop. Most of the modules are not used and they are immediately replaced by the root file system anyway. I managed to stripe it to 20M and 4 minutes to boot. But it's a headache to compile and move files back and forth. Perhaps there should be a "b" option that build the boot modules, in addition to the "m" option. All these work because i am trying to replace one line in the kernel. "Root drive is not ready, press 'S' to skip". The USB root drive will be ready, just need a small delay. Pressing a key to skip is no big deal, except when there is nobody to press it in an embedded system.