summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/services.inc19
-rwxr-xr-xetc/rc26
2 files changed, 33 insertions, 12 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc
index c14615e..3b94885 100644
--- a/etc/inc/services.inc
+++ b/etc/inc/services.inc
@@ -655,14 +655,17 @@ EOPP;
}
$all_mac_strings[] = $dhcpifconf['mac_allow'];
$all_mac_strings[] = $dhcpifconf['mac_deny'];
- $all_mac_list = array_unique(explode(',', implode(',', $all_mac_strings)));
- foreach ($all_mac_list as $mac) {
- if (empty($mac))
- continue;
- $dhcpdconf .= 'class "' . str_replace(':', '', $mac) . '" {' . "\n";
- // Skip the first octet of the MAC address - for media type, typically Ethernet ("01") and match the rest.
- $dhcpdconf .= ' match if substring (hardware, 1, ' . (substr_count($mac, ':') + 1) . ') = ' . $mac . ';' . "\n";
- $dhcpdconf .= '}' . "\n";
+ if (!empty($all_mac_strings)) {
+ $all_mac_list = array_unique(explode(',', implode(',', $all_mac_strings)));
+ foreach ($all_mac_list as $mac) {
+ if (empty($mac)) {
+ continue;
+ }
+ $dhcpdconf .= 'class "' . str_replace(':', '', $mac) . '" {' . "\n";
+ // Skip the first octet of the MAC address - for media type, typically Ethernet ("01") and match the rest.
+ $dhcpdconf .= ' match if substring (hardware, 1, ' . (substr_count($mac, ':') + 1) . ') = ' . $mac . ';' . "\n";
+ $dhcpdconf .= '}' . "\n";
+ }
}
$dhcpdconf .= "subnet {$subnet} netmask {$subnetmask} {\n";
diff --git a/etc/rc b/etc/rc
index 5340e23..e2b6222 100755
--- a/etc/rc
+++ b/etc/rc
@@ -42,15 +42,33 @@ if [ -e /root/force_fsck ]; then
fi
if [ ! "${PLATFORM}" = "cdrom" ]; then
- /sbin/fsck -y -C -F
- # Mount memory file system if it exists
- echo "Mounting filesystems..."
+ /sbin/fsck -p -F
+ FSCK_ACTION_NEEDED=0
+ case $? in
+ 0)
+ echo "Filesystems are clean, continuing..."
+ echo "Mounting filesystems..."
+ ;;
+ 8)
+ echo "Preen mode recommended running a check that will be performed now."
+ FSCK_ACTION_NEEDED=1
+ ;;
+ *)
+ echo "Stopping boot is recommended due to filesystem manual action needed, nevertheless it will be tried to repair the filesystem."
+ FSCK_ACTION_NEEDED=1
+ ;;
+ esac
+
+ if [ ${FSCK_ACTION_NEEDED} = 1 ]; then
+ echo "WARNING: Trying to recover filesystem from inconsistency..."
+ /sbin/fsck -yF
+ fi
/sbin/mount -a 2>/dev/null
mount_rc=$?
attempts=0
while [ ${mount_rc} -ne 0 -a ${attempts} -lt 3 ]; do
- /sbin/fsck -yF /
+ /sbin/fsck -yF
/sbin/mount -a 2>/dev/null
mount_rc=$?
attempts=$((attempts+1))
OpenPOWER on IntegriCloud