archboot/usr/lib/initcpio/install/archboot_remote

51 lines
2.3 KiB
Text
Raw Normal View History

#!/usr/bin/env bash
# SPDX-License-Identifier: GPL-2.0-only
2008-12-06 19:12:19 +01:00
# Created by Tobias Powalowski <tpowa@archlinux.org>
build ()
2008-12-06 19:12:19 +01:00
{
2022-03-14 21:32:33 +01:00
map add_binary findssl.sh scp sftp ssh-add ssh-agent ssh-copy-id ssh-keygen ssh-keyscan sshd \
2023-02-14 06:43:36 +01:00
exportfs nfsstat rpc.idmapd rpc.mountd rpc.nfsd rpc.statd rpcdebug showmount \
2023-07-07 09:04:39 +02:00
sm-notify start-statd rpcbind rpcinfo rpc.gssd \
nfsdcltrack gssproxy screen tmux rsync ttyd
map add_file /etc/screenrc /etc/ssh/ssh_config /etc/ssh/sshd_config /etc/ssh/moduli \
/etc/rsyncd.conf /etc/exports /usr/lib/ssh/sftp-server /usr/lib/ssh/ssh-keysign \
/usr/lib/ssh/ssh-pkcs11-helper /etc/conf.d/rpcbind \
/etc/netconfig
add_file /etc/ssh/sshd_config
# allow root login and empty passwords
2023-04-17 14:52:21 +02:00
echo "PermitRootLogin yes" >> "${BUILDROOT}/etc/ssh/sshd_config"
echo "PermitEmptyPasswords yes" >> "${BUILDROOT}/etc/ssh/sshd_config"
2023-07-07 09:04:39 +02:00
add_full_dir /usr/lib/libnfsidmap
map add_dir /var/empty /var/lib/nfs/sm /var/lib/nfs/sm.bak /var/lib/nfs/v4recovery \
/var/lib/nfs/rpc_pipefs /var/lib/rpcbind /var/log/gssproxy
2023-04-17 14:52:21 +02:00
chmod 700 "${BUILDROOT}/var/lib/rpcbind"
chown 32:32 "${BUILDROOT}/var/lib/rpcbind"
# mask nfs3 systemd
for i in rpcbind.service rpcbind.socket rpcbind.target nfs-server.service; do
add_symlink "/etc/systemd/system/${i}" "/dev/null"
done
2023-07-07 09:04:39 +02:00
map add_full_dir /etc/gss /etc/gssproxy /var/lib/gssproxy
add_dir /var/lib/openldap
2023-04-17 14:52:21 +02:00
chmod 700 "${BUILDROOT}/var/lib/openldap"
chown 439:439 "${BUILDROOT}/var/lib/openldap"
# start sshd on startup
2023-07-07 09:04:39 +02:00
add_symlink /etc/systemd/system/multi-user.target.wants/sshd.service /usr/lib/systemd/system/sshd.service
2023-07-07 08:08:15 +02:00
# start ttyd on startup
2023-07-07 09:04:39 +02:00
add_file /usr/lib/libwebsockets-evlib_uv.so
2023-07-07 10:19:09 +02:00
add_file /usr/share/archboot/remote/usr/bin/ttyd.sh /usr/bin/ttyd.sh
2023-07-07 09:04:39 +02:00
add_file /usr/share/archboot/remote/etc/systemd/system/ttyd.service /etc/systemd/system/ttyd.service
add_symlink /etc/systemd/system/multi-user.target.wants/ttyd.service /etc/systemd/system/ttyd.service
2009-05-08 08:05:45 +02:00
# fix licenses
2023-07-07 09:04:39 +02:00
map add_file /usr/share/licenses/rpcbind/COPYING /usr/share/licenses/nfsidmap/LICENSE \
/usr/share/licenses/tmux/LICENSE /usr/share/licenses/ttyd/LICENSE
2008-12-06 19:12:19 +01:00
}
help ()
{
cat<<HELPEOF
2021-10-04 11:13:50 +02:00
This hook includes remote tools on an archboot image.
2008-12-06 19:12:19 +01:00
HELPEOF
2009-06-17 11:16:19 +02:00
}
# vim: set ft=sh ts=4 sw=4 et: