Package: freedombox-setup
Severity: normal
Tags: patch

Dear Maintainer,

As discussed in #825677, the script to run flash-kernel during first-run has a
number of issues and does not work as intended. But there's no need to run it
during first-run anyway, so it can be removed. Also the machine-detect script
is not used anymore, and can be removed.

I have tested a Dreamplug image with this change included. I was able to access
Plinth after first-run and after subsequent restarts.



-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-2-amd64 (SMP w/12 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
>From 39299eee76a5f3714ed380a31edaa9bc3556b1a6 Mon Sep 17 00:00:00 2001
From: James Valleroy <jvalle...@mailbox.org>
Date: Mon, 30 May 2016 10:13:29 -0400
Subject: [PATCH] Remove flash-kernel script from first-run. Also remove
 machine-detect which is no longer needed.

---
 debian/freedombox-setup.install |  1 -
 first-run.d/80_flash-kernel     | 30 ------------------------------
 lib/machine-detect              | 35 -----------------------------------
 3 files changed, 66 deletions(-)
 delete mode 100755 first-run.d/80_flash-kernel
 delete mode 100755 lib/machine-detect

diff --git a/debian/freedombox-setup.install b/debian/freedombox-setup.install
index 25739e3..6be704d 100644
--- a/debian/freedombox-setup.install
+++ b/debian/freedombox-setup.install
@@ -1,7 +1,6 @@
 setup usr/lib/freedombox
 setup.d usr/lib/freedombox
 first-run.d usr/lib/freedombox
-lib/machine-detect usr/lib/freedombox
 data/etc/apache2/conf-available/freedombox.conf etc/apache2/conf-available
 data/etc/avahi/services/*.service etc/avahi/services
 data/etc/sudoers.d/freedombox etc/sudoers.d
diff --git a/first-run.d/80_flash-kernel b/first-run.d/80_flash-kernel
deleted file mode 100755
index e4f8f5d..0000000
--- a/first-run.d/80_flash-kernel
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# Update the kernel if package flash-kernel is install unless
-# requested otherwise.
-
-. /lib/lsb/init-functions
-
-if ! type flash-kernel > /dev/null 2>&1 ; then
-    log_warning_msg "Skipped Flashing Kernel: flash-kernel is not installed."
-    exit 0
-fi
-
-if [ -e /var/freedombox/dont-tweak-kernel ]
-then
-    log_warning_msg "Skipped Flashing Kernel."
-    exit 0
-else
-    . /usr/lib/freedombox/machine-detect
-    if [ "$MACHINE" = "dreamplug" ]; then
-        kernel_version="$(/bin/ls /boot/vmlinuz-*-kirkwood | sort -rn | head -n1 | sed s#/boot/vmlinuz-##)"
-    fi
-
-    log_action_begin_msg "Flashing Kernel version $kernel_version "
-
-    if flash-kernel "$kernel_version" ; then
-	log_action_end_msg 0
-    else
-	log_action_end_msg 1
-    fi
-fi
diff --git a/lib/machine-detect b/lib/machine-detect
deleted file mode 100755
index 498bf7a..0000000
--- a/lib/machine-detect
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/sh
-#
-# Exports the currently-detected hardware to MACHINE.
-#
-# Return true if the MACHINE was detected, and false otherwise.
-#
-# Currently look in /sys/devices for indicators.
-#
-# Other possibilities:
-#
-# echo $(cat /proc/device-tree/model)
-# Globalscale Technologies Dreamplug
-
-MACHINE=""
-
-case $(dpkg --print-architecture) in
-    armel)
-	    # Matches these:
-	    # /sys/devices/gpio-leds.1/leds/dreamplug:blue:bluetooth
-	    # /sys/devices/gpio-leds.1/leds/dreamplug:green:wifi_ap
-	    # /sys/devices/gpio-leds.1/leds/dreamplug:green:wifi
-	    if find /sys/devices -name 'dreamplug:*' | grep -q dreamplug: ; then
-            MACHINE=dreamplug
-	    fi
-	    ;;
-esac
-
-export MACHINE
-
-if [ -n "$MACHINE" ]
-then
-    return 0
-fi
-
-return 1
-- 
2.8.1

Reply via email to