Skip to content
Snippets Groups Projects
Commit 70ea3b10 authored by Pietsch, Martin's avatar Pietsch, Martin
Browse files

move content of bootlocal.sh to profile

parent 2c004c9e
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
cd /opt
# include functions.sh
. ./functions.sh
# wait for Network
# wait max 100 seconds until something is in /etc/resolv.conf
while ! test -s /etc/resolv.conf
do
[ "$counter" -ge 100 ] && exit 1
let "counter+=1"
echo "waiting " $counter "seconds for network :-)"
sleep 1
done
# chmod / or tc user can not login, so no tce-load would be possible
chmod 755 /
# install packages required by diskpreperation.sh
installTcPackages bash parted bc ntfs-3g dosfstools
# workaround for limited availability of btrfs-progs and reiserfsprogs
architecture=$(uname -m)
if [ "${architecture}" == "x86_64" ]
then installTcPackages btrfs-progs
else installTcPackages reiserfsprogs
fi
# install and set keyboard layout for debugging
installTcPackages kmaps util-linux
loadkmap </usr/share/kmap/qwertz/de-latin1-nodeadkeys.kmap
echo "create target directory"
mkdir /target
chmod 0755 /target
# run install.sh
echo "switch to bash and run installer"
bash ./installer.sh | tee >> /tmp/installer.logfile
mkdir -p /target/etc/ssh/
chmod 0755 /target/etc/ssh/
chown 0:0 /target/etc/ssh/
cp /opt/ansible.pub /target/etc/ssh/authorized_keys
chmod 0644 /target/etc/ssh/authorized_keys
chown 0:0 /target/etc/ssh/authorized_keys
cp /tmp/fstab.target /target/etc/fstab
chmod 0644 /target/etc/fstab
chown 0:0 /target/etc/fstab
sync
echo "installer finished, logfile: /tmp/installer.logfile"
echo "export ANSWERFILE_PATH=${ANSWERFILE_PATH}" >/etc/profile.d/answerfile.sh
#!/bin/sh
/bin/sh
. /opt/functions.sh
chmod 755 /
netwaitcnt=0
beginLogEntry "waiting for network"
while [ ! -s /etc/resolv.conf ];
do
[ "${netwaitcnt}" -ge 100 ] && finishLogEntry "failed" && exit 1
netwaitcnt=$((${netwaitcnt} + 1))
echo -n "."
sleep 1
done
finishLogEntry "done"
beginLogEntry "install default dependencies"
installTcPackages bash parted bc ntfs-3g dosfstools openssl
architecture=$(uname -m)
case ${architecture} in
x86_64) installTcPackages btrfs-progs ;;
i[0-9]86) installTcPackages reiserfsprogs;;
esac
finishLogEntry "done"
beginLogEntry "get Answerfile from \"${ANSWERFILE_PATH}\""
getAnswerfile ${ANSWERFILE_PATH} /tmp/answerfile
if [ $? -eq 0 ];
then
finishLogEntry "done"
/opt/installer.sh
else
finishLogEntry "failed"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment