diff options
Diffstat (limited to 'urunlevel/my_linux/Trinux/update')
-rwxr-xr-x | urunlevel/my_linux/Trinux/update | 62 |
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 | |||
3 | if [ ! "$*" ] | ||
4 | then | ||
5 | echo | ||
6 | echo "Usage: " | ||
7 | echo " update [kernel|initrd|pkglist]" | ||
8 | exit | ||
9 | fi | ||
10 | |||
11 | |||
12 | if [ -f /etc/proc/boot ] | ||
13 | then | ||
14 | BOOT=`cat /etc/proc/boot` | ||
15 | else | ||
16 | BOOT="/dev/fd0" | ||
17 | fi | ||
18 | |||
19 | echo | ||
20 | echo "Boot device: $BOOT" | ||
21 | |||
22 | if [ "$BOOT" = "/dev/fd0" ] | ||
23 | then | ||
24 | echo -n "Please enter your boot/config floppy, then hit return: " | ||
25 | read blah | ||
26 | else | ||
27 | PREFIX="/trinux" | ||
28 | fi | ||
29 | |||
30 | if mount -t vfat $BOOT /boot | ||
31 | then | ||
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 | ||
60 | else | ||
61 | echo "Unable to mount boot device!" | ||
62 | fi | ||