Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/efisysinst.sh

Source at commit 342 created 13 years 9 months ago.
By azimutz, As you can see, there is a catch... a good one, i think! I did tried to keep /Extra path, though my real intention was to remove it, in favor of loading files only from booter volume and OS specific folders, providing we could keep the same functionality. That turned out to be true and as /Extra path kept giving me troubles, i removed it. Pros: simpler code that can be easily added any were needed (as mentioned on search_and_get_acpi_fd). Cons: none that i couldn't solve so far :) Just a note on ramdisks: when a rd is aliased as bt(0,0), all paths started by bt(0,0) (booter volume) will point to the rd and not to the volume were the booter is installed; meaning that, with this algo that only uses bt(0,0) paths, when using a rd aliased as bt, the rd will be the only volume searched!! This makes rd's aliased as bt, ideal to load full sets of files, like when using pre-boot discs, were the files need to be all loaded from the ramdisk into memory.
1#!/bin/sh
2
3# efisysinst.sh
4#
5#
6# Created by mackerintel on 2/2/09.
7# Copyright 2009 mackerintel. All rights reserved.
8
9if [[ x$1 == x ]]; then
10echo Usage: $0 disknumber;
11exit 0;
12fi
13
14if [[ `dd if=/dev/disk${1}s1 count=8 bs=1 skip=82 | uuencode -m -|head -n 2|tail -n 1` != "RkFUMzIgICA=" ]]; then
15echo "/dev/disk${1}s1" "isn't" a FAT32 partition;
16exit 1;
17fi
18
19if [ ! -f boot1f32 ]; then
20echo "boot1f32 not found";
21exit 1;
22fi
23if [ ! -f boot0 ]; then
24echo "boot0 not found";
25exit 1;
26fi
27dd if=/dev/disk${1}s1 count=1 bs=512 of=/tmp/origbs
28cp boot1f32 /tmp/newbs
29dd if=/tmp/origbs of=/tmp/newbs skip=3 seek=3 bs=1 count=87 conv=notrunc
30dd of=/dev/disk${1}s1 count=1 bs=512 if=/tmp/newbs
31dd if=boot0 of=/dev/disk${1} count=430 bs=1
32

Archive Download this file

Revision: 342