summaryrefslogtreecommitdiffstats
path: root/urunlevel/my_linux/Trinux/update
diff options
context:
space:
mode:
Diffstat (limited to 'urunlevel/my_linux/Trinux/update')
-rwxr-xr-xurunlevel/my_linux/Trinux/update62
1 files changed, 62 insertions, 0 deletions
diff --git a/urunlevel/my_linux/Trinux/update b/urunlevel/my_linux/Trinux/update
new file mode 100755
index 0000000..ebeff6b
--- /dev/null
+++ b/urunlevel/my_linux/Trinux/update
@@ -0,0 +1,62 @@
1#!/bin/sh
2
3if [ ! "$*" ]
4then
5 echo
6 echo "Usage: "
7 echo " update [kernel|initrd|pkglist]"
8 exit
9fi
10
11
12if [ -f /etc/proc/boot ]
13then
14 BOOT=`cat /etc/proc/boot`
15else
16 BOOT="/dev/fd0"
17fi
18
19echo
20echo "Boot device: $BOOT"
21
22if [ "$BOOT" = "/dev/fd0" ]
23then
24 echo -n "Please enter your boot/config floppy, then hit return: "
25 read blah
26else
27 PREFIX="/trinux"
28fi
29
30if mount -t vfat $BOOT /boot
31then
32 if echo $* | grep "initrd"
33 then
34 INITRD=`cat /etc/tux/config/src/initrd`
35 if [ "$INITRD" ]
36 then
37 echo "Updating initrd from $INITRD"
38 cd /tmp
39 if snarf $INITRD
40 then
41 echo -n "Are you sure? "
42 read quest
43 if [ "$quest" != "n" ]
44 then
45 echo "Deleting existing initrd.gz"
46 cd /boot/$PREFIX
47 ls -al
48 rm initrd.gz
49 mv /tmp/initrd.gz .
50 fi
51 fi
52 else
53 echo "No initrd found"
54 fi
55 fi
56
57 sync
58 echo "Unmounting $BOOT"
59 cd /; umount /boot
60else
61 echo "Unable to mount boot device!"
62fi