casper very slow on armel+imx51

Bug #357690 reported by Loïc Minier
12
Affects Status Importance Assigned to Milestone
casper (Ubuntu)
Fix Released
Medium
Jamie Bennett

Bug Description

Hi

When booting a live install SD card for an iMX51 Babbage board, there's a long delay on boot just after:
scsi 0:0:0:0: Direct-Access USB TO I DE/SATA Device 0041 PQ: 0 ANSI:0
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0

There's a SATA port on this board, and it's obviously implemented on top of USB.

Because I have no SATA disk connected, there's a long timeout before casper proceeds to checking the other devices.

Is there anything which can be done in casper to avoid this delay?

Perhaps we can force the live device?

Thanks,

Related branches

Revision history for this message
Loïc Minier (lool) wrote :

We're already setting LIVEMEDIA, I'm a bit surprized that it's not picked up; perhaps we need a rootdelay as well.

Revision history for this message
Oliver Grawert (ogra) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

it seems this is due to "udevadm trigger" or "settle" which are used in casper ATM.

Paul Larson (pwlars)
tags: removed: arm
Revision history for this message
Tormod Volden (tormodvolden) wrote :

This must be a bug in udev or the kernel, rather than casper. Is it still the same in Karmic?

Changed in casper (Ubuntu):
assignee: nobody → Tormod Volden (tormodvolden)
status: New → Incomplete
Revision history for this message
Loïc Minier (lool) wrote :

So I just tested booting karmic alpha 6; the boot is still very slow albeit faster; I didn't have SATA connected either.

I dont know whether the SATA part is relevant here; I think it's just the amount of stuff casper does which takes too long on armel. Things like generating locales take forever.

Changed in casper (Ubuntu):
status: Incomplete → Confirmed
Loïc Minier (lool)
summary: - Long timeout when trying to mount empty USB to SATA adapter
+ casper very slow on armel+imx51
Changed in casper (Ubuntu):
assignee: Tormod Volden (tormodvolden) → nobody
status: Confirmed → New
Revision history for this message
Tormod Volden (tormodvolden) wrote :

I'd suggest you add a little timestamp to call_scripts() in /usr/share/initramfs-tools/scripts/functions, so that we can see in casper.log what takes so much time.

tags: added: iso-testing
Changed in casper (Ubuntu):
assignee: nobody → Jamie Bennett (jamiebennett)
Revision history for this message
Paul Larson (pwlars) wrote :
Changed in casper (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Initial finding from time-stamping. Time stamps are in time format (hour:min:sec).

Seems the biggies are 10adduser and 19keyboard.

[04:59:48] Calling hook 10driver_updates
[04:59:48] Calling hook 20iso_scan
[04:59:48] Calling hook 30custom_installation
[04:59:50] Calling hook 01integrity_check
[04:59:50] Calling hook 05mountpoints
[04:59:50] Calling hook 05mountpoints_lupin
[04:59:50] Calling hook 10adduser
Shadow passwords are now on.
[05:00:16] Calling hook 10custom_installation
[05:00:16] Calling hook 10ntfs_3g
[05:00:16] Calling hook 12fstab
[05:00:16] Calling hook 13swap
[05:00:16] Calling hook 14locales
Generating locales...
  en_US.UTF-8... done
Generation complete.
[05:00:24] Calling hook 15autologin
[05:00:24] Calling hook 18hostname
[05:00:24] Calling hook 19keyboard
[05:00:47] Calling hook 20xconfig
[05:00:47] Calling hook 22gnome_panel_data
[05:00:48] Calling hook 22screensaver
[05:00:49] Calling hook 22serialtty
[05:00:49] Calling hook 22sslcert
[05:00:54] Calling hook 23etc_modules
[05:00:54] Calling hook 23networking
[05:00:55] Calling hook 24preseed
[05:01:06] Calling hook 25configure_init
[05:01:07] Calling hook 30accessibility
[05:01:07] Calling hook 31disable_update_notifier
[05:01:07] Calling hook 32disable_hibernation
[05:01:08] Calling hook 33enable_apport_crashes
[05:01:08] Calling hook 34disable_kde_services
[05:01:08] Calling hook 35fix_language_selector
[05:01:12] Calling hook 36disable_trackerd
[05:01:12] Calling hook 37kubuntu_netbook_installer_link
[05:01:12] Calling hook 40install_driver_updates
[05:01:12] Calling hook 41apt_cdrom
Using CD-ROM mount point /cdrom/
Identifying.. [4dc8ab4694d3b0e7528f442bee3567df-2]
Scanning disc for index files..
Found 1 package indexes, 0 source indexes, 0 translation indexes and 1 signatures
Found label 'Ubuntu 9.10 _Karmic Koala_ - Release armel+imx51 (20091027.2)'
This disc is called:
'Ubuntu 9.10 _Karmic Koala_ - Release armel+imx51 (20091027.2)'
Copying package lists...gpgv: Signature made Tue Oct 27 21:59:50 2009 UTC using DSA key ID FBB75451
gpgv: key FBB75451 was created 1104415711 seconds in the future (time warp or clock problem)
gpgv: key FBB75451 was created 1104415711 seconds in the future (time warp or clock problem)
gpgv: Can't check signature: timestamp conflict
E: Sub-process gpgv returned an error code (2)
W: Signature verification failed for: /cdrom/dists/karmic/Release.gpg
[05:01:13] Calling hook 42disable_apparmor
 Removing any system startup links for /etc/init.d/apparmor ...
   /etc/rcS.d/S37apparmor
[05:01:13] Calling hook 43disable_updateinitramfs
[05:01:13] Calling hook 44pk_allow_ubuntu
[05:01:13] Calling hook 45disable_guest_account
(Reading database ... 129861 files and directories currently installed.)
Removing gdm-guest-session ...
Purging configuration files for gdm-guest-session ...
[05:01:21] Calling hook 46disable_services
[05:01:21] Calling hook 47unr_ubiquity
No value set for `/apps/netbook-launcher/favorites/favorites_list'
No value set for `/apps/netbook-launcher/favorites/favorites_list'
No value to set for key: `/apps/netbook-launcher/favorites/favorites_list'

Revision history for this message
Loïc Minier (lool) wrote :

This matches my experience; the keyboard setup is also slow under ubiquity.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

19keyboard: is it all the casper-preseed calls that are slow, or the install-keymap command? I also noticed plenty of unnecessary uses of chroot, and a very old TODO comment that probably could need some love.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

10adduser: I can imagine the debconf-communicate calls are expensive, otherwise there is not much in there.

Can you try to profile these by hand? Boot with break=casper-bottom and run the scripts with sh -x to see where they are sticking.

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

The findings in a better format:

https://wiki.ubuntu.com/ARM/CasperSpeedup

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

10adduser:

chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
set passwd/root-password-crypted *
set passwd/user-password-crypted U6aMy0wojraho
set passwd/user-fullname $USERFULLNAME
set passwd/username $USERNAME
set passwd/user-uid 999
EOF

takes around 7 seconds.

chroot /root /usr/lib/user-setup/user-setup-apply > /dev/null

takes around 12 seconds.

chroot /root debconf-communicate -fnoninteractive casper > /dev/null <<EOF
set passwd/root-password-crypted
set passwd/user-password-crypted
set passwd/user-fullname
set passwd/username
set passwd/user-uid
EOF

takes around 4 seconds.

19keyboard:

Each of the

casper-preseed /root console-setup/layoutcode '' false
casper-preseed /root console-setup/variantcode '' false
casper-preseed /root console-setup/modelcode '' false

casper-preseed /root console-setup/optionscode '' false
casper-preseed /root console-setup/codesetcode '' false

Take around 4 seconds each.

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Seems that the debconf-communicate calls are causing major slowness on ARM. This should be investigated further.

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Cause is found. Its the parsing of the templates.dat file once per debconf-communicate call. Work is underway to use debconf-communicate persistently whilst it is needed by Casper to avoid the multiple reloading of the same file.

Revision history for this message
Jamie Bennett (jamiebennett) wrote :

Changing the way casper uses debconf-communicate and a few other tweaks results in a boot speed-up of around 33% across architectures. e.g.

  i386: 30 secs to 20 secs
  armel (babbage): 180 secs to 113 secs

Changed in casper (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Colin Watson (cjwatson) wrote :

casper (1.216) lucid; urgency=low

  [ Luke Yelavich ]
  * scripts/casper-bottom/30accessibility && ubiquity-hooks/30accessibility:
    - Remove code to disable pulseaudio, as it is no longer needed, and
      the supporting code in the pulseaudio package was removed a long time
      ago.
    - Set the default empathy theme to classic for blindness and braille
      accessibility profiles.

  [ Jamie Bennett ]
  * Speed up work around debconf-communicate. Replace several calls to
    debconf-communicate with one persistent invocation followed by
    confmodule calls.
  * Disable guest account by rm'ing rather than waiting for dpkg to
    remove it.

 -- Colin Watson <email address hidden> Wed, 03 Feb 2010 16:41:57 -0800

Changed in casper (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.