Bug 166241 - [patch] Speedup and some improvements of sysinstall(8)
Summary: [patch] Speedup and some improvements of sysinstall(8)
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-sysinstall (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-19 09:40 UTC by SAKAI Hiroaki
Modified: 2015-11-10 09:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description SAKAI Hiroaki 2012-03-19 09:40:12 UTC
These are improvements for FreeBSD installer 'sysinstall'.

***PROBLEMS***

'sysinstall' has some problems as below:

  * Startup of package installer takes very long time
    because of bubble sort for making index.
    (Phase: "Located INDEX, now reading package data from it...")

  * On www category of package installer, package view is broken.

  * URL for FTP is not saved.

***MODIFY***

I made patches for sysinstall to improve these problems.

  * Speedup to start package installer. (127sec. -> 15sec.)

    - Startup of package installer consists of 3 phases.
      1st. Making package list.
      2nd. Check dependence between packages.
      3rd. Sort of package list.

      - Improvement for 1st phase:
        To search category, move entry to start of list
        for improvement of chance to hit.
        (patch to index_register())

      - Improvement for 2nd phase:
        To check dependence between packages, move entry to start of list
        for improvement of chance to hit.
        (patch to index_search() and index_recorddeps())

      - Improvement for 3rd phase:
        Use quick sort instead of bubble sort. (very effective!)
        (patch to index_sort())

  * Improvement for package view of www category.

    - Check string size and prevent buffer overrun.
      (patch to index_menu())

  * Prevent segmentation fault by access to NULL pointer.

    - Add check 'mediaDevice'.
      (patch to index_extract())

  * Save URL for FTP.

    - patch to mediaSetFTP().

***PATCHES***

You can get these patches from:

http://kozos.jp/patch/sysinstall/index.c.patch.txt
http://kozos.jp/patch/sysinstall/media.c.patch.txt

Patching as below:

# cd /usr/src/usr.sbin/sysinstall
# patch < /tmp/index.c.patch.txt
# patch < /tmp/media.c.patch.txt
# make

These patches are for FreeBSD-8.2. But, source files for sysinstall
are mostly same between FreeBSD-8.2 and FreeBSD-9.0.
Because of this, you can use these patches for FreeBSD-9.0.

***RESULTS***

Improvement results on my environment:

                         Startup Time
Improvement       1st+2nd    3rd       All
-----------------------------------------------
original           40sec.   87sec.   127sec.
3rd                40sec.    0sec.    40sec. (very effective!)
1st+3rd            20sec.    0sec.    20sec.
1st+2nd+3rd        15sec.    0sec.    15sec.

--
from kozos project.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-03-19 13:25:33 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-sysinstall

Over to maintainer(s).
Comment 2 Enji Cooper freebsd_committer freebsd_triage 2015-11-10 09:07:08 UTC
sysinstall has been replaced by bsdinstall in FreeBSD 9.x. Closing.