home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Linux / Ubuntu_64-bit / ubuntu-11.04-desktop-amd64.iso / casper / filesystem.squashfs / bin / user-params < prev    next >
Text File  |  2010-02-12  |  2KB  |  105 lines

  1. #!/bin/sh
  2. if [ -z "$TESTSUITE" ]; then
  3.     CMDLINE=/proc/cmdline
  4.     ALIASES=/etc/preseed_aliases
  5. else
  6.     CMDLINE=user-params.in
  7.     ALIASES=user-params.aliases
  8. fi
  9.  
  10. # sed out multi-word quoted value settings
  11. for item in $(sed -e 's/[^ =]*="[^"]*[ ][^"]*"//g' \
  12.           -e "s/[^ =]*='[^']*[ ][^']*'//g" $CMDLINE); do
  13.     var="${item%=*}"
  14.     # Remove trailing '?' for debconf variables set with '?='
  15.     var="${var%\?}"
  16.  
  17.     if [ "$item" = "--" ]; then
  18.         inuser=1
  19.         collect=""
  20.     elif [ "$inuser" ]; then
  21.         # BOOT_IMAGE is added by syslinux
  22.         if [ "$var" = "BOOT_IMAGE" ]; then
  23.             continue
  24.         fi
  25.  
  26.         # init is not generally useful to pass on
  27.         if [ "$var" = init ]; then
  28.             continue
  29.         fi
  30.  
  31.         # suppress installer-specific parameters
  32.         if [ "$var" = BOOT_DEBUG ] || [ "$var" = DEBIAN_FRONTEND ] || \
  33.            [ "$var" = INSTALL_MEDIA_DEV ] || [ "$var" = lowmem ] || \
  34.            [ "$var" = noshell ]; then
  35.             continue
  36.         fi
  37.  
  38.         # brltty settings shouldn't be passed since
  39.         # they are already recorded in /etc/brltty.conf
  40.         if [ "$var" = brltty ]; then
  41.             continue
  42.         fi
  43.  
  44.         # ks is only useful to kickseed in the first stage.
  45.         if [ "$var" = ks ]; then
  46.             continue
  47.         fi
  48.  
  49.         # We don't believe that vga= is needed to display a console
  50.         # any more now that we've switched to 640x400 by default,
  51.         # and it breaks suspend/resume. People can always type it in
  52.         # again at the installed boot loader if need be.
  53.         if [ "$var" = vga ]; then
  54.             continue
  55.         fi
  56.  
  57.         # Sometimes used on the live CD for debugging initramfs-tools.
  58.         if [ "$var" = break ]; then
  59.             continue
  60.         fi
  61.  
  62.         # Skip live-CD-specific crud
  63.         if [ "${var%-ubiquity}" != "$var" ] || \
  64.            [ "$var" = noninteractive ]; then
  65.             continue
  66.         fi
  67.  
  68.         # Skip debconf variables
  69.         varnoslash="${var##*/*}"
  70.         if [ "$varnoslash" = "" ]; then
  71.             continue
  72.         fi
  73.  
  74.         # Skip module-specific variables
  75.         varnodot="${var##*.*}"
  76.         if [ "$varnodot" = "" ]; then
  77.             continue
  78.         fi
  79.  
  80.         # Skip preseed aliases
  81.         if [ -e "$ALIASES" ] && \
  82.            grep -q "^$var[[:space:]]" "$ALIASES"; then
  83.             continue
  84.         fi
  85.  
  86.         if [ -z "$collect" ]; then
  87.             collect="$item"
  88.         else
  89.             collect="$collect $item"
  90.         fi
  91.     fi
  92. done
  93.  
  94. if [ -z "$TESTSUITE" ]; then
  95.     # Include default parameters
  96.     RET=`debconf-get debian-installer/add-kernel-opts || true`
  97.     if [ "$RET" ]; then
  98.             collect="$collect $RET"
  99.     fi
  100. fi
  101.  
  102. for word in $collect; do
  103.     echo "$word"
  104. done
  105.