add installer cleanup service
This commit is contained in:
parent
55138c5896
commit
feb269ad3e
19
install.sh
19
install.sh
|
@ -256,6 +256,20 @@ EOF
|
||||||
chroot /archroot systemctl enable systemd-networkd
|
chroot /archroot systemctl enable systemd-networkd
|
||||||
chroot /archroot systemctl enable sshd
|
chroot /archroot systemctl enable sshd
|
||||||
|
|
||||||
|
# install services
|
||||||
|
local unitdir=/archroot/etc/systemd/system
|
||||||
|
mkdir -p ${unitdir}/sysinit.target.wants
|
||||||
|
|
||||||
|
ln -s ../installer-cleanup.service ${unitdir}/sysinit.target.wants/
|
||||||
|
cat > ${unitdir}/installer-cleanup.service <<EOF
|
||||||
|
[Unit]
|
||||||
|
Description=Post-install cleanup
|
||||||
|
ConditionPathExists=/installer/script.sh
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/installer/script.sh
|
||||||
|
EOF
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
error_occurred() {
|
error_occurred() {
|
||||||
|
@ -374,6 +388,11 @@ transitory_main() {
|
||||||
|
|
||||||
postinstall_main() {
|
postinstall_main() {
|
||||||
|
|
||||||
|
# remove cleanup service
|
||||||
|
local unitdir=/etc/systemd/system
|
||||||
|
rm -f ${unitdir}/installer-cleanup.service
|
||||||
|
rm -f ${unitdir}/sysinit.target.wants/installer-cleanup.service
|
||||||
|
|
||||||
# cleanup filesystem
|
# cleanup filesystem
|
||||||
rm -f /var/cache/pacman/pkg
|
rm -f /var/cache/pacman/pkg
|
||||||
mv /packages /var/cache/pacman/pkg
|
mv /packages /var/cache/pacman/pkg
|
||||||
|
|
Loading…
Reference in New Issue