]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/install+setup/install/mountsource.sh
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
22 echo "Scanning source media"
24 # scan all Block devices
25 for DEVICE
in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
27 mount
/dev
/${DEVICE} /cdrom
2> /dev
/null
28 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
29 echo -n ${DEVICE} > /tmp
/source_device
30 echo "Found tarball on ${DEVICE}"
33 echo "Found no tarballs on ${DEVICE} - SKIP"
35 umount
/cdrom
2> /dev
/null
38 # scan all Partitions on block devices
39 for DEVICE
in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
41 for DEVICEP
in $
(ls /dev
/${DEVICE}? |
sed "s/\/dev\///" 2> /dev
/null
);do
42 mount
/dev
/${DEVICEP} /cdrom
2> /dev
/null
43 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
44 echo -n ${DEVICEP} > /tmp
/source_device
45 echo "Found tarball on ${DEVICEP}"
48 echo "Found no tarballs on ${DEVICEP} - SKIP"
50 umount
/cdrom
2> /dev
/null
54 # scan all Partitions on raid/mmc devices
55 for DEVICE
in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
57 for DEVICEP
in $
(ls /dev
/${DEVICE}p? |
sed "s/\/dev\///");do
58 mount
/dev
/${DEVICEP} /cdrom
2> /dev
/null
59 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
60 echo -n ${DEVICEP} > /tmp
/source_device
61 echo "Found tarball on ${DEVICEP}"
64 echo "Found no tarballs on ${DEVICEP} - SKIP"
66 umount
/cdrom
2> /dev
/null