Commit dd942894 authored by Ryan Jackson's avatar Ryan Jackson

Cleanup of slicefix and rc.frisbee scripts

rc.linux isn't fedora-specific in any way, so I moved it to the linux/ directory instead.
parent f2248944
......@@ -38,16 +38,20 @@ RCDIR = $(SYSETCDIR)/rc.d
INSTALL = /usr/bin/install -c
COMMON = $(SRCDIR)/../common
install client-install: baselinux-install common-install etc-install \
install client-install: baselinux-client-install common-install etc-install \
sup-install script-install bin-install
@echo "Remember to install the PEM files if necessary"
mfs-install: client-install baselinux-mfs-install
frisbee-mfs-install: baselinux-frisbee-mfs-install
simple-install: common-install script-install bin-install
dir-install:
baselinux-install: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) client-install)
baselinux-%: dir-install
(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) $(subst baselinux-,,$@))
common-install: dir-install
@echo "no fedora-specific common files"
......@@ -81,8 +85,7 @@ sysetc-onceonly-install:
@$(MYINSTALL) -m 440 $(SRCDIR)/sudoers $(SYSETCDIR)/sudoers
@$(MYINSTALL) $(SRCDIR)/syslog.conf $(SYSETCDIR)/syslog.conf
script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/rc.linux $(BINDIR)/rc
#script-install: dir-install $(SCRIPTS)
sfs-install:
@echo "no fedora-specific sfs files"
......
......@@ -219,6 +219,7 @@ script-install: dir-install $(SCRIPTS)
$(INSTALL) -m 755 $(SRCDIR)/extract_kernel_version $(BINDIR)/extract-kernel-version
$(INSTALL) -m 755 $(SRCDIR)/get_edd_map $(BINDIR)/testbed
$(INSTALL) -m 755 -s ../findif $(BINDIR)/findif
$(INSTALL) -m 755 $(SRCDIR)/rc.linux $(BINDIR)/rc
sfs-install:
$(INSTALL) -m 755 -o root -g root -d $(DESTDIR)/etc/sfs
......
......@@ -361,9 +361,9 @@ if [ $PARTITION -ne 0 ]; then
fi
# Enable IPoD
#if [ -r $BINDIR/rc.ipod ]; then
# . $BINDIR/rc.ipod
#fi
if [ -r $BINDIR/rc.ipod ]; then
. $BINDIR/rc.ipod
fi
FRISBEE_OPTS="$FRISBEE_OPTS `get_buffer_sizes`"
......@@ -461,7 +461,7 @@ fi
echo "Adjusting slice-related files"
export SLICEFIX_ACPI=$ACPI
export SLICEFIX_ASF=$ASF
#$BINDIR/slicefix $PARTITION $FREEBSD_DISK
$BINDIR/slicefix $PARTITION $FREEBSD_DISK
echo "Image load complete at `date`"
#
......
......@@ -29,110 +29,6 @@ case $# in
exit 1
esac
get_fstab_root_device()
{
local image_root=$1
while read device mount rest; do
[ x$device = x ] && continue
case $device in
\#*) continue ;;
esac
if [ $mount = / ]; then
echo ${device}
break
fi
done < $image_root/etc/fstab
}
get_lilo_boot_device()
{
local image_root=$1
[ -f $image_root/etc/lilo.conf ] || return 1
sed -n 's/^boot=//p' $image_root/etc/lilo.conf
return 0
}
get_grub_boot_device()
{
local image_root=$1
local grub_config=/etc/grub.conf
local grub_device_map=/boot/grub/device.map
local grub_boot_dev
if ! [ -f $grub_config ]; then
grub_config=/boot/grub/menu.lst
if ! [ -f $grub_config ]; then
return 1
fi
fi
if ! [ -f $grub_device_map ]; then
return 1
fi
# Check for Debian-ish grub configs
grub_boot_dev=`sed -n 's/^##* *groot=(\(hd[0-9]*\).*$/(\1)/p' \
$grub_config`
# Check for Fedora-ish grub configs
if [ -z "$grub_boot_dev" ]; then
grub_boot_dev=`sed -n 's/.*groot=(\(hd[0-9]*\)/(\1)/p' \
$grub_config`
fi
[ -z "$grub_boot_dev" ] && return 1
real_grub_boot_dev=`grep "^$grub_boot_dev" $grub_device_map | \
awk '{ print $2 }'`
[ -z "$real_grub_boot_dev" ] && return 1
echo $real_grub_boot_dev
}
image_wants_ide()
{
local image_root=$1
local rc=0;
# rc == 0 means image wants ide
# rc == 1 means image doesn't care
# rc == 2 means unknown
local fstab_root_dev
local grub_boot_dev
local lilo_boot_dev
fstab_root_dev=`get_fstab_root_device $image_root`
grub_boot_dev=`get_grub_boot_device $image_root`
lilo_boot_dev=`get_lilo_boot_device $image_root`
for dev in "$fstab_root_dev" "$grub_boot_dev" "$lilo_boot_dev"; do
case "$fstab_root_dev" in
*=*)
# Probably LABEL= or UUID=
rc=1
;;
/dev/hd*)
rc=0
;;
*)
rc=2
;;
esac
[ $rc -lt 2 ] && return $rc
done
# If we get here, we don't know what the image wants
return $rc
}
map_disk()
{
local disk=$1
......@@ -558,6 +454,11 @@ dolinux() {
$BINDIR/guess_linux_root_device /mnt $rootdev $translated_rootdev
lilo_commandline=`cat /mnt/var/emulab/boot/runlilo 2> /dev/null`
# Remove swap partitions from fstab; they will be added again
# by rc.linux after boot.
awk '{ if ($3 != "swap") print; }' /mnt/etc/fstab > /mnt/etc/fstab.new
mv -f /mnt/etc/fstab.new /mnt/etc/fstab
#
# If there's a GRUB config file, update all root=X kernel params.
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment