From 3733154f7e9efa7e1fe86a358a00c4ca8ac2bdf8 Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 30 Jun 2009 21:56:39 -0300 Subject: [PATCH] Stop asking about pcmcia daemon services since it is not available in installer anymore. While on that the code has been simplified a bit. --- packages/hw-detect/debian/changelog | 7 ++ packages/hw-detect/debian/hw-detect.templates | 20 ----- packages/hw-detect/hw-detect.sh | 97 +++---------------------- 3 files changed, 16 insertions(+), 108 deletions(-) diff --git a/packages/hw-detect/debian/changelog b/packages/hw-detect/debian/changelog index 168e9fc..4b107d3 100644 --- a/packages/hw-detect/debian/changelog +++ b/packages/hw-detect/debian/changelog @@ -1,3 +1,10 @@ +hw-detect (1.73) UNRELEASED; urgency=low + + * Stop asking about pcmcia daemon services since it is not available in + installer anymore. While on that the code has been simplified a bit. + + -- Otavio Salvador Mon, 29 Jun 2009 10:01:23 -0300 + hw-detect (1.72) unstable; urgency=low [ Colin Watson ] diff --git a/packages/hw-detect/debian/hw-detect.templates b/packages/hw-detect/debian/hw-detect.templates index 0b97508..f643df1 100644 --- a/packages/hw-detect/debian/hw-detect.templates +++ b/packages/hw-detect/debian/hw-detect.templates @@ -28,26 +28,6 @@ _Description: Modules to load: choose not to load them. If you're unsure, you should leave them all selected. -Template: hw-detect/start_pcmcia -Type: boolean -Default: true -# :sl2: -_Description: Start PC card services? - Please choose whether PC card services should be started in order to allow - the use of PCMCIA cards. - -Template: hw-detect/pcmcia_resources -Type: string -# :sl2: -_Description: PCMCIA resource range options: - Some PCMCIA hardware needs special resource configuration options in - order to work, and can cause the computer to freeze otherwise. For - example, some Dell laptops need "exclude port 0x800-0x8ff" to be - specified here. These options will be added to /etc/pcmcia/config.opts. - See the installation manual or the PCMCIA HOWTO for more information. - . - For most hardware, you do not need to specify anything here. - Template: hw-detect/retry_params Type: string # :sl3: diff --git a/packages/hw-detect/hw-detect.sh b/packages/hw-detect/hw-detect.sh index 1587bb4..c622215 100755 --- a/packages/hw-detect/hw-detect.sh +++ b/packages/hw-detect/hw-detect.sh @@ -388,87 +388,18 @@ if ! is_not_loaded ohci1394 || ! is_not_loaded firewire-ohci; then fi fi -apply_pcmcia_resource_opts() { - local config_opts=/etc/pcmcia/config.opts - - # Idempotency - if ! [ -f ${config_opts}.orig ]; then - cp $config_opts ${config_opts}.orig - fi - cp ${config_opts}.orig $config_opts - - local mode="" - local rmode="" - local type="" - local value="" - while [ -n "$1" ] && [ -n "$2" ] && [ -n "$3" ]; do - if [ "$1" = exclude ]; then - mode=exclude - rmode=include - shift - elif [ "$1" = include ]; then - mode=include - rmode=exclude - shift - fi - type="$1" - shift - value="$1" - shift - - if grep -q "^$rmode $type $value\$" $config_opts; then - sed "s/^$rmode $type $value\$/$mode $type $value/" \ - $config_opts >${config_opts}.new - mv ${config_opts}.new $config_opts - else - echo "$mode $type $value" >>$config_opts - fi - done -} - # get pcmcia running if possible -PCMCIA_INIT= -if [ -x /etc/init.d/pcmciautils ]; then - PCMCIA_INIT=/etc/init.d/pcmciautils -fi -if [ "$PCMCIA_INIT" ]; then - if is_not_loaded pcmcia_core; then - db_input medium hw-detect/start_pcmcia || true +PCMCIA_INIT=/etc/init.d/pcmciautils - # GTK frontend: include question about resources in dialog - if [ "$DEBIAN_FRONTEND" = "gtk" ]; then - db_input low hw-detect/pcmcia_resources || true - fi - db_go || true - - # Other frontends: only ask about resources if PCMCIA was selected - if [ "$DEBIAN_FRONTEND" != "gtk" ]; then - db_get hw-detect/start_pcmcia || true - if [ "$RET" = true ]; then - db_input low hw-detect/pcmcia_resources || true - db_go || true - fi - fi - if db_get hw-detect/pcmcia_resources && [ "$RET" ]; then - apply_pcmcia_resource_opts $RET - fi - fi - if db_get hw-detect/start_pcmcia && [ "$RET" = true ]; then +db_fget hw-detect/start_pcmcia seen +if [ -x "$PCMCIA_INIT" ] && [ "$RET" = false ]; then + if is_not_loaded pcmcia_core; then db_progress INFO hw-detect/pcmcia_step $PCMCIA_INIT start 2>&1 | log db_progress STEP $OTHER_STEPSIZE fi fi -have_pcmcia=0 -if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then - if db_get hw-detect/start_pcmcia && [ "$RET" = false ]; then - have_pcmcia=0 - else - have_pcmcia=1 - fi -fi - # find Cardbus network cards cardbus_check_netdev() { @@ -479,7 +410,11 @@ cardbus_check_netdev() echo $(basename $netdev) >> /etc/network/devhotplug fi } -if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then +if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1 && + ! grep -q pcmciautils /var/lib/apt-install/queue 2>/dev/null; then + log "Detected PCMCIA, installing pcmciautils." + apt-install pcmciautils || true + for socket in /sys/class/pcmcia_socket/*; do for netdev in /sys/class/net/*; do cardbus_check_netdev $socket $netdev @@ -487,20 +422,6 @@ if ls /sys/class/pcmcia_socket/* >/dev/null 2>&1; then done fi -# Try to do this only once.. -if [ "$have_pcmcia" -eq 1 ] && \ - ! grep -q pcmciautils /var/lib/apt-install/queue 2>/dev/null; then - log "Detected PCMCIA, installing pcmciautils." - apt-install pcmciautils || true - - if db_get hw-detect/pcmcia_resources && [ -n "$RET" ]; then - echo "mkdir /target/etc/pcmcia 2>/dev/null || true" \ - >>$finish_install - echo "cp /etc/pcmcia/config.opts /target/etc/pcmcia/config.opts" \ - >>$finish_install - fi -fi - # Install udev into target apt-install udev || true -- 1.6.3.3.385.g60647