Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Juri Grabowski committed May 25, 2023
2 parents 68b150e + f66e0e4 commit 75a466f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,9 @@ install:
cp -a examples $(DOCDIR)
rm -f $(DOCDIR)/examples/simple/.git
cp -a utils $(DOCDIR)/examples
# Systemd
mkdir -p $(DESTDIR)/usr/lib/systemd/system
install -m644 conf/systemd/* $(DESTDIR)/usr/lib/systemd/system


.PHONY: clean veryclean
23 changes: 14 additions & 9 deletions bin/fai-make-nfsroot
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,6 @@ check_nfsroot() {
die 1 "dracut was not installed into the nfsroot."
fi

if [ ! -e $NFSROOT/sbin/init ]; then
die 1 "sysvinit-core was not installed into the nfsroot."
fi

readlink $NFSROOT/sbin/init | grep -q systemd
if [ $? -eq 0 ]; then
die 1 "Do not use systemd inside the nfsroot."
fi

echo "FAI packages and related packages inside the nfsroot:"
$ROOTCMD dpkg-query -W -f='${Package;-18} ${Version}\n' fai-client fai-nfsroot fai-setup-storage dracut-network dracut dracut-live dracut-squash 2>/dev/null

Expand Down Expand Up @@ -477,6 +468,20 @@ EOF
ln -s /usr/sbin/fai etc/init.d/rcS

echo "AUTO -all" > etc/mdadm/mdadm.conf # do not activate RAID arrays

# Start FAI using SysV
[ -f etc/init/tty1.conf ] || ln -s /usr/sbin/fai etc/init.d/rcS

# Start FAI using Upstart
if [ -d etc/init ]; then # if upstart is available
find etc/init ! -type d | egrep -v "fai|udev|hostname|mountall|mounted" | xargs -r rm
fi

#Start FAI using Systemd
if [ -f /bin/systemctl ]; then
LC_ALL=C $ROOTCMD systemctl set-default fai-install.target
fi

# this second rm of the same file is needed!
rm -f etc/udev/rules.d/70-persistent-net.rules
# remove Ubuntu-specific rules to auto-start volume groups, which confuses
Expand Down
11 changes: 11 additions & 0 deletions conf/systemd/fai-install.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Install system using FAI

[Service]
Type=oneshot
StandardOutput=journal+console
Environment="UPSTART_JOB=fai"
ExecStart=/usr/sbin/fai
[Install]
WantedBy=fai-install.target

6 changes: 6 additions & 0 deletions conf/systemd/fai-install.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[Unit]
Description=Install system using FAI
Requires=sysinit.target fai-install.service
Conflicts=rescue.service rescue.target
AllowIsolate=yes
1 change: 1 addition & 0 deletions debian/fai-nfsroot.install
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ usr/share/fai/udev.patch
etc/apt/apt.conf.d/90fai
etc/init.d/fai-abort
usr/lib/dracut/modules.d
usr/lib/systemd/system

0 comments on commit 75a466f

Please sign in to comment.