summaryrefslogtreecommitdiffstats
path: root/urunlevel/my_linux/Trinux/update
blob: ebeff6b58b4e54dda4f13a5181f9039a7ecd9619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/sh

if [ ! "$*" ]
then
	echo
	echo "Usage: "
	echo "      update [kernel|initrd|pkglist]"
	exit
fi


if [ -f /etc/proc/boot ]
then
        BOOT=`cat /etc/proc/boot`
else
        BOOT="/dev/fd0"
fi

echo
echo "Boot device: $BOOT"

if [ "$BOOT" = "/dev/fd0" ]
then
        echo -n "Please enter your boot/config floppy, then hit return: "
        read blah
else
        PREFIX="/trinux"
fi

if mount -t vfat $BOOT /boot
then
	if echo $* | grep "initrd"
	then	
		INITRD=`cat /etc/tux/config/src/initrd`
		if [ "$INITRD" ]
		then
			echo "Updating initrd from $INITRD"
			cd /tmp
			if snarf $INITRD
			then
				echo -n "Are you sure? "
				read quest
				if [ "$quest" != "n" ]
				then
					echo "Deleting existing initrd.gz"
					cd /boot/$PREFIX
					ls -al
					rm initrd.gz
					mv /tmp/initrd.gz . 
				fi
			fi
		else
			echo "No initrd found"
		fi
	fi
		
	sync
    echo "Unmounting $BOOT"
    cd /; umount /boot
else
        echo "Unable to mount boot device!"
fi