]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/install+setup/install/mountsource.sh
Merge remote-tracking branch 'origin/next' into thirteen
[people/teissler/ipfire-2.x.git] / src / install+setup / install / mountsource.sh
CommitLineData
72d80898 1#!/bin/sh
70df8302
MT
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
337726bf 5# Copyright (C) 2007-2012 IPFire Team <info@ipfire.org> #
70df8302
MT
6# #
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. #
11# #
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. #
16# #
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/>. #
19# #
20###############################################################################
72d80898 21
72d80898
MT
22echo "Scanning source media"
23
337726bf
AF
24# scan all Block devices
25for DEVICE in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
26do
149a26a8 27 mount /dev/${DEVICE} /cdrom 2> /dev/null
dbf157bb 28 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
149a26a8
MT
29 echo -n ${DEVICE} > /tmp/source_device
30 echo "Found tarball on ${DEVICE}"
03df106a 31 exit 0
149a26a8
MT
32 else
33 echo "Found no tarballs on ${DEVICE} - SKIP"
34 fi
35 umount /cdrom 2> /dev/null
72d80898
MT
36done
37
337726bf
AF
38# scan all Partitions on block devices
39for DEVICE in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
40do
41 for DEVICEP in $(ls /dev/${DEVICE}? | sed "s/\/dev\///" 2> /dev/null);do
732447b9 42 mount /dev/${DEVICEP} /cdrom 2> /dev/null
dbf157bb 43 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
732447b9
MT
44 echo -n ${DEVICEP} > /tmp/source_device
45 echo "Found tarball on ${DEVICEP}"
03df106a 46 exit 0
256d83db 47 else
732447b9 48 echo "Found no tarballs on ${DEVICEP} - SKIP"
256d83db
AF
49 fi
50 umount /cdrom 2> /dev/null
732447b9 51 done
256d83db
AF
52done
53
337726bf
AF
54# scan all Partitions on raid/mmc devices
55for DEVICE in `find /sys/block/* -maxdepth 0 ! -name fd* ! -name loop* ! -name ram* -exec basename {} \;`
56do
57 for DEVICEP in $(ls /dev/${DEVICE}p? | sed "s/\/dev\///");do
58 mount /dev/${DEVICEP} /cdrom 2> /dev/null
dbf157bb 59 if [ -n "$(ls /cdrom/ipfire-*.tlz 2>/dev/null)" ]; then
337726bf
AF
60 echo -n ${DEVICEP} > /tmp/source_device
61 echo "Found tarball on ${DEVICEP}"
03df106a 62 exit 0
149a26a8 63 else
337726bf 64 echo "Found no tarballs on ${DEVICEP} - SKIP"
149a26a8
MT
65 fi
66 umount /cdrom 2> /dev/null
337726bf 67 done
72d80898
MT
68done
69
03df106a 70exit 10