/usr/share/autopkgtest/xenlvm/fixups is in autopkgtest-xenlvm 2.0.1ubuntu4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | #!/bin/bash
set -e
. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
dest=$adt_play/base
echo '---fixups:'
cp ${ADT_XENLVM_SHARE}/fixups-inside $dest/root/
if test -d "${adt_modules}"; then
mkdir -p $dest/lib/modules
cp -a "${adt_modules}" $dest/lib/modules/.
fi
echo xennet >>$dest/etc/modules
if ! test -f "${adt_ssh_pubkey}"; then
if [ "x${adt_ssh_pubkey}" != "x${adt_ssh_privkey}.pub" ]; then
fail "cannot generate keypair automatically because adt_ssh_privkey \`$adt_ssh_privkey' and adt_ssh_pubkey \`$adt_ssh_pubkey' do not match up in the way required by ssh-keygen (<pubkey> must be <privkey>.pub>"
fi
if test -f "${adt_ssh_privkey}"; then
fail "will not overwrite existing private key \`$adt_ssh_privkey' - but where is public key \`$adt_ssh_pubkey' ?"
fi
mkdir -p /root/.ssh
ssh-keygen -N '' ${adt_ssh_keygen_args} -f "${adt_ssh_privkey}"
fi
mkdir -m 02700 -p $dest/root/.ssh
cp -- "${adt_ssh_pubkey}" $dest/root/.ssh/authorized_keys
if [ "x$adt_sshauthkeys_hook" != x ]; then
cat -- "$adt_sshauthkeys_hook" >>$dest/root/.ssh/authorized_keys
fi
cat <<END >$dest/etc/init.d/xenethtoolk
#!/bin/sh
# work around checksum offload bug in Xen network bridge driver
case "$1" in
start)
ethtool -K eth0 tx off
ethtool -K eth0 rx off
;;
esac
END
chmod +x $dest/etc/init.d/xenethtoolk
ln -s ../init.d/xenethtoolk $dest/etc/rc2.d/S21xenethtoolk
chroot $dest root/fixups-inside \
"$adt_host_hostname" "$adt_guest_hostname" \
"$adt_host_ipaddr" "$adt_guest_ipaddr" \
"$adt_fs_type" "$adt_normaluser" \
"$provideswap"
kh=/etc/ssh/ssh_known_hosts
test ! -f $kh || cp $kh $kh.new
exec 3>$kh.new
pfx="$adt_guest_hostname,$adt_guest_ipaddr"
test ! -f $kh || perl -pe '$_="" if m/^(\S+)\s/ && $1 eq "'$pfx'";' $kh >&3
for f in $dest/etc/ssh/ssh_host_*_key.pub; do
perl -pe '$_= "'$pfx' ".$_;' $f >&3
done
exec 3>&-
mv $kh.new $kh
if test -f $dest/etc/udev/rules.d/*-persistent-net-generator.rules; then
rules_file="`grep '^RULES_FILE=' $dest/lib/udev/write_net_rules`"
rules_file=${rules_file#RULES_FILE=}
rules_file=${rules_file#[\'\"]}
rules_file=${rules_file%[\'\"]}
echo 'SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="'$adt_guest_macaddr'", NAME="eth0"' >"$dest/$rules_file"
fi
echo '
=== adt xen fixups done.
'
|