New upstream release, rebase
authorMichael Prokop <devnull@localhost>
Sun, 25 Nov 2007 20:18:47 +0000 (21:18 +0100)
committerMichael Prokop <devnull@localhost>
Sun, 25 Nov 2007 20:18:47 +0000 (21:18 +0100)
13 files changed:
Makefile
bin/live-snapshot
conf/live.conf
debian/bug/script [new file with mode: 0644]
debian/changelog
debian/control
debian/rules
docs/parameters.txt
scripts/live
scripts/live-bottom/12fstab
scripts/live-bottom/14locales
scripts/live-bottom/15autologin
scripts/live-helpers

index 347d449..58fa660 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -5,11 +5,20 @@ TRANSLATIONS="it"
 all: build
 
 test:
+       # Checking for syntax errors
        set -e; for SCRIPT in bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/*; \
        do \
                sh -n $$SCRIPT; \
        done
 
+       # Checking for bashisms (temporary not failing, but only listing)
+       if [ -x /usr/bin/checkbashisms ]; \
+       then \
+               checkbashisms bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/* || true; \
+       else \
+               echo "bashism test skipped - you need to install devscripts."; \
+       fi
+
 build:
 
 install: test build
@@ -104,10 +113,10 @@ uninstall:
 update:
        set -e; for FILE in docs/parameters.txt; \
        do \
-               sed -i  -e 's/2007\\-10\\-29/2007\\-11\\-05/' \
-                       -e 's/2007-10-29/2007-11-05/' \
-                       -e 's/29.10.2007/05.11.2007/' \
-                       -e 's/1.110.4/1.110.5/' \
+               sed -i  -e 's/2007\\-11\\-19/2007\\-11\\-26/' \
+                       -e 's/2007-11-19/2007-11-26/' \
+                       -e 's/19.11.2007/26.11.2007/' \
+                       -e 's/1.110.7/1.110.8/' \
                $$FILE; \
        done
 
index a6b4154..3d0183d 100755 (executable)
@@ -83,7 +83,7 @@ Usage ()
 
        if [ ! -z "${MESSAGE}" ]
        then
-               echo -e "${MESSAGE}"
+               /bin/echo -e "${MESSAGE}"
                exit 1
        else
                exit 0
@@ -99,9 +99,9 @@ Help ()
        echo "  -c, --cow: specifies the copy on write directory (default: /live/cow)."
        echo "  -d, --device: specifies the output snapshot device (default: none)."
        echo "  -o, --output: specifies the output image file (default: ${type} dependent)."
-    echo "  -r, --resync-string: internally used to resync previous made snapshots."
+       echo "  -r, --resync-string: internally used to resync previous made snapshots."
        echo "  -t, --type: specifies the snapshot type between \"squashfs\", \"ext2\", \"ext3\" or \"cpio\".gz archive (default: cpio)"
-    echo -e "\nLook at live-snapshot(1) man page for more information."
+       /bin/echo -e "\nLook at live-snapshot(1) man page for more information."
 
        exit 0
 }
index 930ae22..0de5b6c 100644 (file)
@@ -1,51 +1,7 @@
 # /etc/live.conf - configuration file for live-initramfs(7)
 
-# We have a Debian based system of course:
-export BUILD_SYSTEM="Debian"
+USERNAME="user"
+USERFULLNAME="Debian Live user"
+HOSTNAME="debian"
 
-# grml specific settings:
-export USERNAME="grml"
-export USERFULLNAME="grml user"
-export HOSTNAME="grml"
-
-# unionfs or aufs?
-export UNIONTYPE="aufs"
-# we do not want to have a modified /etc/initab:
-export NOAUTOLOGIN="Yes"
-# grml does not require /fastboot:
-export NOFASTBOOT="Yes"
-# disable "mount failed for selinuxfs on /selinux" warning message:
-export SELINUX_INIT="No"
-# do not touch /etc/sudoers:
-export NOSUDO="Yes"
-# do not touch anything inside passwd/shadow/group/gshadow:
-export NOUSER="Yes"
-# do not generate xorg.conf via dexconf - let's use grml-x instead:
-export NOXAUTOCONFIG="Yes"
-# do not modify /etc/fstab:
-export NOFSTAB="Yes"
-# do not modify /etc/hosts:
-export NOHOSTS="Yes"
-
-export NOACCESSIBILITY="Yes"
-export NOAPPARMOR="Yes"
-export NOAPTCDROM="Yes"
-export NOCONSOLEKEYBOARD="Yes"
-export NOFSTAB="Yes"
-export NOKPERSONALIZER="Yes"
-export NOKWALLET="Yes"
-export NOLANGUAGESELECTOR="Yes"
-export NOLOCALES="Yes"
-export NONETWORKING="Yes"
-export NOPERSISTENT="Yes"
-export NOPOWERMANAGEMENT="Yes"
-export NOPRESEED="Yes"
-export NOPROGRAMCRASHES="Yes"
-export NORESTRICTEDMANAGER="Yes"
-export NOTIMEZONE="Yes"
-export NOUPDATENOTIFIER="Yes"
-export NOXAUTOLOGIN="Yes"
-export NOXSCREENSAVER="Yes"
-export NOGNOMEPANEL="Yes"
-
-# EOF
+export USERNAME USERFULLNAME HOSTNAME
diff --git a/debian/bug/script b/debian/bug/script
new file mode 100644 (file)
index 0000000..0381f3a
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Checking depends
+dpkg -l busybox file initramfs-tools sudo user-setup
+
+# Checking recommends
+dpkg -l eject wget live-initscripts
+
+# Checking suggests
+dpkg -l genext2fs squashfs-tools
+
+# Checking other packages
+dpkg -l cryptsetup splashy usplash
index 53f46b5..3139799 100644 (file)
@@ -1,7 +1,250 @@
-live-initramfs (1.110.4-1.grml01) unstable; urgency=low
+live-initramfs (1.110.7-2~grml.01) unstable; urgency=low
 
-  * Initial version, based on live-initramfs (1.110.4-1) by
-    Daniel Baumann <daniel@debian.org>.
+  * Rebase grml's version on live-initramfs (1.110.7-1).
 
- -- Michael Prokop <mika@grml.org>  Thu, 01 Nov 2007 23:14:34 +0100
+ -- Michael Prokop <mika@grml.org>  Sun, 25 Nov 2007 21:17:52 +0100
 
+live-initramfs (1.110.7-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Fixing fstab handling.
+  * Fixing regression from mounting the ow device on a nfs volume,
+    thanks to An-Cheng Huang <ancheng@vyatta.com>.
+
+ -- Daniel Baumann <daniel@debian>  Mon, 19 Nov 2007 00:00:00 +0100
+
+live-initramfs (1.110.6-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Preparing live-initramfs 1.110.6-1.
+  * Adding custom reportbug script.
+  * Fixed a few bashisms, thanks to Trent W. Buck <trentbuck@gmail.com>.
+  * Adding checkbashsms call to test target of the Makefile as suggested
+    by Trent W. Buck <trentbuck@gmail.com>.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 12 Nov 2007 00:00:00 +0100
+
+live-initramfs (1.110.5-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Preparing live-initramfs 1.110.5-1.
+  * Using kdm initscript autologin overrides, thanks to Kel Modderman
+    <kel@otaku42.de>.
+  * Setting the kdm language, thanks to Jordi Pujol
+    <jordi_pujol@telefonica.net>.
+  * Adding files to the live filesystem according to the MAC number,
+    thanks to Jordi Pujol <jordi_pujol@telefonica.net>.
+  * Fixing some coding style issues.
+
+ -- Daniel Baumann <daniel@debian>  Mon,  5 Nov 2007 00:00:00 +0100
+
+live-initramfs (1.110.4-1) unstable; urgency=medium
+
+  [ Daniel Baumann ]
+  * New upstream release.
+  * Preparing live-initramfs 1.110.3-1.
+  * Correcting homepage field.
+  * Correcting vcs fields.
+
+  [ Jesse Hathaway ]
+  * add support for mounting the cow device on an nfs volume
+
+ -- Daniel Baumann <daniel@debian>  Mon, 29 Oct 2007 00:00:00 +0100
+
+live-initramfs (1.110.3-1) unstable; urgency=medium
+
+  [ Daniel Baumann ]
+  * New upstream release.
+  * Preparing live-initramfs 1.110.3-1.
+  * Removing ubuntu support.
+
+  [ Alex Owen ]
+  * Fix typo to get serial console to work
+
+  [ Jesse Hathaway ]
+  * add support for exposedroot option for live-helper
+
+ -- Daniel Baumann <daniel@debian>  Mon, 22 Oct 2007 00:00:00 +0200
+
+live-initramfs (1.110.2-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Preparing live-initramfs 1.110.2-1.
+  * Fixing typing error.
+  * Removing nodiratime as it is already included in noatime, thanks to Kel
+    Modderman <kel@otaku42.de>.
+
+ -- Daniel Baumann <daniel@debian>  Mon, 15 Oct 2007 00:00:00 +0200
+
+live-initramfs (1.110.1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Preparing live-initramfs 1.107.2-1.
+  * Also using nodiratime, not just noatime.
+  * Merging casper 1.108.
+  * Adjusting to live-initramfs.
+  * Merging casper 1.109.
+  * Adjusting to live-initramfs.
+  * Merging casper 1.110.
+  * Adjusting to live-initramfs.
+  * Bumping version to 1.110.1-1.
+
+ -- Daniel Baumann <daniel@debian>  Mon,  8 Oct 2007 00:00:00 +0200
+
+live-initramfs (1.107.1-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Preparing live-initramfs 1.102.4-2.
+  * Replacing backticks with POSIX expression.
+  * Consistently using curly brackets for variables.
+  * Fixing bashism.
+  * Merging casper 1.105.
+  * Adjusting to live-initramfs.
+  * Bumping version to 1.105.1-1.
+  * Applied patch from Jesse W. Hathaway <jesse@mbuki-mvuki.org> to move
+    cow mount rather than binding it on /live/cow. This prevents the
+    /cow mount showing up in /proc/mounts.
+  * Merging casper 1.106.
+  * Adjusting to live-initramfs.
+  * Bumping version to 1.106.1-1.
+  * Fixing wrong homepage field.
+  * Fixing typing error.
+  * Merging casper 1.107.
+  * Bumping version to 1.107.1-1.
+
+ -- Daniel Baumann <daniel@debian>  Mon,  1 Oct 2007 00:00:00 +0200
+
+live-initramfs (1.104.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 24 Sep 2007 00:00:00 +0200
+
+live-initramfs (1.102.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 17 Sep 2007 00:00:00 +0200
+
+live-initramfs (1.99.2-1) unstable; urgency=medium
+
+  * New upstream release:
+    - Contains patch from Jim Paris <jim@jtan.com> to fix wrong ipconfig usage
+      (Closes: #440235).
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 10 Sep 2007 00:00:00 +0200
+
+live-initramfs (1.99.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  3 Sep 2007 00:00:00 +0200
+
+live-initramfs (1.96.2-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 27 Aug 2007 00:00:00 +0200
+
+live-initramfs (1.96.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 20 Aug 2007 00:00:00 +0200
+
+live-initramfs (1.95.3-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 13 Aug 2007 00:00:00 +0200
+
+live-initramfs (1.95.2-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  6 Aug 2007 00:00:00 +0200
+
+live-initramfs (1.95.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 30 Jul 2007 00:00:00 +0200
+
+live-initramfs (1.91.6-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 23 Jul 2007 00:00:00 +0200
+
+live-initramfs (1.91.5-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 16 Jul 2007 00:00:00 +0200
+
+live-initramfs (1.91.4-1) unstable; urgency=medium
+
+  * New upstream release:
+    - Dropping transitional package, not needed anymore.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  9 Jul 2007 00:00:00 +0200
+
+live-initramfs (1.91.3-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  2 Jul 2007 00:00:00 +0200
+
+live-initramfs (1.91.2-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 25 Jun 2007 00:00:00 +0200
+
+live-initramfs (1.91.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 18 Jun 2007 00:00:00 +0200
+
+live-initramfs (1.90.1-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 11 Jun 2007 00:00:00 +0200
+
+live-initramfs (1.87.6-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  4 Jun 2007 00:00:00 +0200
+
+live-initramfs (1.87.5-1) unstable; urgency=medium
+
+  * New upstream release, replacing casper.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 28 May 2007 00:00:00 +0200
+
+live-initramfs (1.87.4-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 21 May 2007 00:00:00 +0200
+
+live-initramfs (1.87.3-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 14 May 2007 00:00:00 +0200
+
+live-initramfs (1.87.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  7 May 2007 00:00:00 +0200
+
+live-initramfs (1.87.1-1) unstable; urgency=low
+
+  * Initial release, forking casper.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 30 Apr 2007 00:00:00 +0200
index 9c59ba3..5a80f4e 100644 (file)
@@ -3,7 +3,7 @@ Section: misc
 Priority: optional
 Maintainer: Debian Live <debian-live-maint@lists.alioth.debian.org>
 Uploaders: Daniel Baumann <daniel@debian.org>
-Build-Depends: debhelper (>= 5), asciidoc, docbook-xsl, xsltproc, dpatch
+Build-Depends: debhelper (>= 5), asciidoc, docbook-xsl, xsltproc
 Standards-Version: 3.7.2
 Homepage: http://debian-live.alioth.debian.org/
 Vcs-Git: git://git.debian.org/git/users/daniel/live-initramfs.git
@@ -12,7 +12,7 @@ XS-Upstream-Depends: git-core
 
 Package: live-initramfs
 Architecture: all
-Depends: ${misc:Depends}, busybox, file, initramfs-tools, sudo, user-setup
+Depends: ${misc:Depends}, busybox, file, initramfs-tools, sudo, udev, user-setup
 Recommends: eject, wget, live-initscripts
 Suggests: genext2fs, squashfs-tools
 Description: Debian Live initramfs hook
index 0e1bf0e..09d9e17 100755 (executable)
@@ -8,7 +8,7 @@ upstream:
        rm -rf ../live-initramfs/.git
 
 build: build-stamp
-build-stamp: patch
+build-stamp:
        dh_testdir
 
        # Building package
@@ -16,7 +16,7 @@ build-stamp: patch
 
        touch build-stamp
 
-clean: unpatch
+clean:
        dh_testdir
        dh_testroot
        rm -f build-stamp
@@ -26,16 +26,6 @@ clean: unpatch
 
        dh_clean
 
-patch: patch-stamp
-
-patch-stamp:
-       dpatch apply-all
-       dpatch cat-all >patch-stamp
-
-unpatch:
-       dpatch deapply-all
-       rm -rf patch-stamp debian/patched
-
 install: build
        dh_testdir
        dh_testroot
@@ -50,6 +40,9 @@ install: build
        rm -f debian/live-initramfs/usr/share/doc/live-initramfs/ChangeLog
        mv debian/live-initramfs/usr/share/doc/live-initramfs/ChangeLog.casper debian/live-initramfs/usr/share/doc/live-initramfs/changelog.casper
 
+       # Installing bug control
+       install -D -m 0755 debian/bug/script debian/live-initramfs/usr/share/bug/live-initramfs
+
 binary-arch: build install
 
 binary-indep: build install
index f8bb2f4..c9c8c91 100644 (file)
@@ -1,7 +1,7 @@
 Boot Parameters for Debian Live
 -------------------------------
 
-Updated for live-initramfs 1.110.3-1 on 2007-10-22.
+Updated for live-initramfs 1.110.7-1 on 2007-11-19.
 
 These options (can be combined) work from the bootloader prompt:
 
index 1dcbc74..80f77e9 100755 (executable)
@@ -507,13 +507,16 @@ mount_images_in_directory ()
 {
        directory="${1}"
        rootmnt="${2}"
+       mac="${3}"
+
 
        if match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.squashfs" ||
                match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext2" ||
                match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.ext3" ||
                match_files_in_dir "${directory}/${LIVE_MEDIA_PATH}/*.dir"
        then
-               setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}"
+               [ -n "${mac}" ] && adddirectory="${directory}/${LIVE_MEDIA_PATH}/${mac}"
+               setup_unionfs "${directory}/${LIVE_MEDIA_PATH}" "${rootmnt}" "${adddirectory}"
        else
                :
        fi
@@ -869,7 +872,7 @@ setup_unionfs ()
 {
        image_directory="${1}"
        rootmnt="${2}"
-
+        addimage_directory="${3}"
        modprobe -q -b ${UNIONTYPE}
 
        # run-init can't deal with images in a subdir, but we're going to
@@ -918,6 +921,20 @@ setup_unionfs ()
                        done
                done
 
+               if [ -n "${addimage_directory}" ] && [ -d "${addimage_directory}" ]
+               then
+                       for FILESYSTEM in squashfs ext2 ext3 xfs dir
+                       do
+                               for IMAGE in "${addimage_directory}"/*."${FILESYSTEM}"
+                               do
+                                       if [ -e "${IMAGE}" ]
+                                       then
+                                               image_string="${image_string} ${IMAGE}"
+                                       fi
+                               done
+                       done
+               fi
+
                # Now sort the list
                image_string="$(echo ${image_string} | sed -e 's/ /\n/g' | sort )"
        fi
@@ -966,6 +983,8 @@ setup_unionfs ()
                        cow_fstype=$(get_fstype "${cowprobe}")
                else
                        [ "${quiet}" != "y" ] && log_warning_msg "Unable to find the persistent medium"
+                       cowdevice="tmpfs"
+                       cow_fstype="tmpfs"
                fi
        elif [ -n "${NFS_COW}" ]
        then
@@ -978,7 +997,7 @@ setup_unionfs ()
                        nfs_cow_opts="-o nolock"
                        nfs_cow=${NFS_COW}
                fi
-               mac=$(get_mac)
+               mac="$(get_mac)"
                if [ -n "${mac}" ]
                then
                        cowdevice=$(echo ${nfs_cow}|sed "s/client_mac_address/${mac}/")
@@ -1262,7 +1281,9 @@ mountroot ()
        then
                setup_unionfs "${livefs_root}" "${rootmnt}"
        else
-               mount_images_in_directory "${livefs_root}" "${rootmnt}"
+               mac="$(get_mac)"
+               mac="$(echo ${mac} | sed 's/-//g')"
+               mount_images_in_directory "${livefs_root}" "${rootmnt}" "${mac}"
        fi
 
        log_end_msg
index ca83626..936eeae 100755 (executable)
@@ -28,23 +28,18 @@ then
        exit 0
 fi
 
-if [ -s ${FSTAB} ]
-then
-       log_begin_msg "Not touching preexisting fstab..."
-else
-       log_begin_msg "Configuring fstab..."
-
-       cat >> ${FSTAB} <<-EOF
-       # /etc/fstab: static file system information.
-       #
-       # <file system> <mount point>   <type>  <options>       <dump>  <pass>
-       ${UNIONTYPE} / ${UNIONTYPE} rw 0 0
-       tmpfs /tmp tmpfs nosuid,nodev 0 0
-       EOF
-fi
+log_begin_msg "Configuring fstab..."
 
 # live-initramfs script
 
+cat >> ${FSTAB} << EOF
+# /etc/fstab: static file system information.
+#
+# <file system> <mount point>   <type>  <options>       <dump>  <pass>
+
+${UNIONTYPE} / ${UNIONTYPE} rw 0 0
+tmpfs /tmp tmpfs nosuid,nodev 0 0
+EOF
 
 # disabled for now
 #rm -f /root/etc/rcS.d/S*checkroot.sh
index 3653e1b..3cb58dd 100755 (executable)
@@ -79,6 +79,20 @@ then
 
        LANG=$(grep "^${locale}" /root/usr/share/i18n/SUPPORTED | grep UTF-8 | sed -e 's, .*,,' -e q)
 
+       language="${LANG%%.UTF-8*}"
+       if [ -d /root/etc/default/kdm.d/ ]
+       then
+
+cat > /root/etc/default/kdm.d/live-autologin << EOF
+LANGUAGE=${language}
+EOF
+
+       elif [ -f /root/etc/kde3/kdm/kdmrc ]
+       then
+               sed -i -r -e "s/#Language=.*/Language=${language}/" \
+                       /root/etc/kde3/kdm/kdmrc
+       fi
+
        if [ -z "${LANG}" ]
        then
                log_warning_message "Locale ${locale} is unsupported."
index 03b66f4..10cae2d 100755 (executable)
@@ -55,7 +55,16 @@ then
        ${GDMCONF}
 fi
 
-if [ -f /root/etc/kde3/kdm/kdmrc ]
+if [ -d /root/etc/default/kdm.d/ ]
+then
+
+cat >> /root/etc/default/kdm.d/live-autologin << EOF
+AUTOLOGINUSER=${USERNAME}
+AUTOLOGINAGAIN=true
+AUTOLOGINDELAY=0
+EOF
+
+elif [ -f /root/etc/kde3/kdm/kdmrc ]
 then
        # Configure KDM autologin
        sed -i -r -e "s/^#?AutoLoginEnable=.*\$/AutoLoginEnable=true/" \
index f49eaf7..5e1730b 100644 (file)
@@ -291,14 +291,18 @@ find_files ()
 
 get_mac ()
 {
-   mac=""
-   for adaptor in /sys/class/net/*;do
-      status=$(cat ${adaptor}/iflink)
-      if [ ${status} -eq 2 ];
-      then
-         mac=$(cat ${adaptor}/address)
-         mac=$(echo ${mac}|sed 's/:/-/g'|tr '[a-z]' '[A-Z]')
-      fi
-   done
-   echo $mac
+       mac=""
+
+       for adaptor in /sys/class/net/*
+       do
+               status="$(cat ${adaptor}/iflink)"
+
+               if [ "${status}" -eq 2 ]
+               then
+                       mac="$(cat ${adaptor}/address)"
+                       mac="$(echo ${mac} | sed 's/:/-/g' | tr '[a-z]' '[A-Z]')"
+               fi
+       done
+
+       echo ${mac}
 }