Skip to content

Commit

Permalink
A few more fixes for cases where scripts are rerun
Browse files Browse the repository at this point in the history
  • Loading branch information
bencord0 committed Jan 27, 2016
1 parent a751b69 commit 4628710
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions build_fsimg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ls /dev/loop0 || mknod /dev/loop0 b 7 0 || {

mount -o loop "$I" "$M" || exit 1
function clean_up () {
set +e
umount -l "$M"
rm -d "$M"
}
Expand Down
2 changes: 2 additions & 0 deletions build_qcow2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mkdir -p "$M"

mount "$L"p1 "$M" || exit 1
function clean_up_loop () {
set +e
umount -l "$M"
losetup -d "$L"
rm -d "$M"
Expand All @@ -38,6 +39,7 @@ mount --bind {,"$M"}/proc
mount --bind {,"$M"}/sys

function clean_up_all () {
set +e
umount "$M"/{sys,proc,dev/pts,dev,}
clean_up_loop
}
Expand Down
8 changes: 4 additions & 4 deletions configure_stage3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ mkdir -p \

# Start systemd services
for svc in networkd resolved timesyncd; do
ln -s "/usr/lib64/systemd/system/systemd-${svc}.service" \
ln -sf"/usr/lib64/systemd/system/systemd-${svc}.service" \
"chroot/etc/systemd/system/multi-user.target.wants/systemd-${svc}.service"
done
cat << EOF > chroot/etc/systemd/network/dhcp.network
Expand All @@ -37,7 +37,7 @@ ln -sf /run/systemd/resolve/resolv.conf chroot/etc/resolv.conf
# Cloud-init
## Bug: cloud-init.service should not need sshd-keygen.service in Gentoo
for svc in config final init init-local; do
ln -s "/usr/lib64/systemd/system/cloud-${svc}.service" \
ln -sf"/usr/lib64/systemd/system/cloud-${svc}.service" \
"chroot/etc/systemd/system/multi-user.target.wants/cloud-${svc}.service"
done

Expand Down Expand Up @@ -132,7 +132,7 @@ EOF

# Enable LVM socket daemons
for socket in lvm2-lvmetad dm-event; do
ln -s "/usr/lib64/systemd/system/${socket}.socket" \
ln -sf"/usr/lib64/systemd/system/${socket}.socket" \
"chroot/etc/systemd/system/multi-user.target.wants/${socket}.socket"
done

Expand All @@ -141,7 +141,7 @@ echo > chroot/etc/machine-id

# SSH oddity
chown root chroot/var/empty
ln -s '/usr/lib64/systemd/system/sshd.service' \
ln -sf'/usr/lib64/systemd/system/sshd.service' \
'chroot/etc/systemd/system/multi-user.target.wants/sshd.service'

rm -f /root/systemd.squashfs || true
Expand Down

0 comments on commit 4628710

Please sign in to comment.