integrate-distro.sh: Ongoing improvements

- Add ahci to initrd modules (will hopefully enable SATA-hotplut)
  - Beautify usage message
  - Fix detection of mounted directories
  - Fix set_sysconf_value with values containing slashes
  - Warn about non-existent files taken from the host
  - Create dhcpd.conf.d from scratch
  - Remove -s 853x480 mkinitrd parameter since it is now made illegal
This commit is contained in:
Jan Lindemann 2011-08-14 17:28:03 +00:00 committed by Jan Lindemann
commit 89ca484a66

View file

@ -5,8 +5,10 @@
arch=`uname -m`
o_name=suse-11.4
cmd=install
initrd_modules="aufs via-rhine e1000 e1000e myri10ge forcedeth usbcore ohci-hcd ehci-hcd uhci-hcd hid usbhid"
initrd_modules="aufs via-rhine e1000 e1000e myri10ge forcedeth usbcore ohci-hcd ehci-hcd uhci-hcd hid usbhid ahci"
# ata_piix (as opposed to ahci) doesn't seem to support sata-hotplugging
kernel_version=2.6.37.4
#kernel_version=2.6.37.6-jng135-4
umask 0022
unused_pkgs="
@ -106,7 +108,6 @@ payload_pkgs="
unclutter
xterm
fetchmsttfonts
man
findutils-locate
@ -139,13 +140,23 @@ payload_pkgs="
snmp-manager-run
ftp-server-run
bprof-run
fetchmsttfonts
"
# -- functions
usage()
{
echo "
usage: $myname -h
$myname [-d target-device] [-n target-name] [-p file with root password] [install|mount|unmount]
$myname [options] [install|mount|unmount]
options:
-d target-device
-n target-name
-p file with root password
-a architecture
"
[ "$1" ] && exit $1
}
@ -301,7 +312,7 @@ check_mount()
{
local canonicalized=`canonicalize $root/$1`
[ ! "$canonicalized" ] && return 1
grep -q $canonicalized /proc/mounts || return 1
grep -q " $canonicalized " /proc/mounts || return 1
return 0
}
@ -632,8 +643,9 @@ setup_boot_loader_net()
-i /boot/initrd-netboot-$kernel_version \
-M /boot/System.map-$kernel_version \
-m "$initrd_modules" \
-d jan://blub/dings \
-s "853x480"
-d jan://blub/dings
# -s "853x480" is illegal in newer mkinitrd (as of SuSE 11.4)
(cd $root/boot; ln -sf initrd-netboot-$kernel_version initrd-netboot)
}
@ -723,8 +735,8 @@ set_sysconf_value()
{
local file="$1"
local key="$2"
local value="$3"
sed "s/^ *$key *=.*/$key=$value/" $root/$file > $root/$file.tmp
local value="`echo $3 | sed 's%/%\\\\/%g'`"
sed "s/^ *$key *=.*/$key=\"$value\"/" $root/$file > $root/$file.tmp
mv $root/$file.tmp $root/$file
}
@ -754,12 +766,12 @@ cmd_install()
/etc/sysconfig/clock \
/etc/openldap/schema/authldap.schema \
/etc/opt/bprof/bprof.secret \
/etc/dhcpd.conf.d \
; do
install -d -m 755 `dirname $root$c`
cp -rp $c $root$c
cp -rp $c $root$c || die "failed to copy $c to $root $c"
done
install -d -m 755 $root/etc/dhcpd.conf.d
make_netboot_etc_ldap_conf > $root/etc/ldap.conf.netboot
make_netboot_etc_openldap_ldap_conf > $root/etc/openldap/ldap.conf.netboot
make_netboot_etc_hosts > $root/etc/hosts.netboot