[Lunar-commits] <lunar-iso> Improved the installer.

Peter de Ridder peter at lunar-linux.org
Sun Oct 13 22:07:15 CEST 2013


commit a963bab69cf50c7da3edc0497dda58ce2c5df8e7
Author: Peter de Ridder <peter at lunar-linux.org>
Date: Mon, 07 Oct 2013 14:16:50 -0700
URL: https://github.com/lunar-linux/lunar-iso/commit/a963bab69cf50c7da3edc0497dda58ce2c5df8e7

Improved the installer.
---
  livecd/template/etc/systemd/system/default.target                                                                                                                | +1/-1     
  livecd/template/etc/systemd/system/getty.target.wants/getty at tty1.service                                                                                         | +1/-0     
  livecd/template/etc/systemd/system/installer.target                                                                                                              | +8/-0     
  livecd/template/etc/systemd/system/getty.target.wants/installer at tty1.service -> livecd/template/etc/systemd/system/installer.target.wants/installer at tty1.service
  livecd/template/etc/systemd/system/installer at .service                                                                                                            | +3/-2     
  lunar-install/sbin/lunar-install                                                                                                                                 | +3/-14    
  mkfiles/iso.mk                                                                                                                                                   | +1/-1     
  7 files changed, 17 insertions(+), 18 deletions(-)

--- a/livecd/template/etc/systemd/system/default.target
+++ b/livecd/template/etc/systemd/system/default.target
@@ -1 +1 @@
-/usr/lib/systemd/system/multi-user.target
\ No newline at end of file
+installer.target
\ No newline at end of file
--- /dev/null
+++ b/livecd/template/etc/systemd/system/getty.target.wants/getty at tty1.service
@@ -0,0 +1 @@
+/etc/systemd/system/getty at .service
\ No newline at end of file
--- /dev/null
+++ b/livecd/template/etc/systemd/system/installer.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=Guided Installer
+Requires=multi-user.target
+After=multi-user.target
+AllowIsolate=yes
+
+[Install]
+Alias=default.target
--- a/livecd/template/etc/systemd/system/installer at .service
+++ b/livecd/template/etc/systemd/system/installer at .service
@@ -8,13 +8,14 @@ After=systemd-user-sessions.service plymouth-quit-wait.service
 # sure that this is synchronized before getty.target, even though
 # getty.target didn't actually pull it in.
 Before=getty.target
-IgnoreOnIsolate=yes
 
 # On systems without virtual consoles, don't start any getty. Note
 # that serial gettys are covered by serial-getty at .service, not this
 # unit.
 ConditionPathExists=/dev/tty0
 
+Conflicts=getty@%i.service
+
 [Service]
 # the VT is cleared by TTYVTDisallocate
 ExecStart=-/sbin/agetty --noclear %I -n -l /bin/su -o "-l -c /sbin/lunar-install"
@@ -30,4 +31,4 @@ KillMode=process
 IgnoreSIGPIPE=no
 
 [Install]
-WantedBy=getty.target
+WantedBy=installer.target
--- a/lunar-install/sbin/lunar-install
+++ b/lunar-install/sbin/lunar-install
@@ -107,10 +107,7 @@ goodbye()
 		exit 0
 	else
 		# bump the init level so we can exit safely!
-		init 3
-		# wait a bit so that we don't restart before level 3 has
-		# been reached
-		sleep 5
+		systemctl isolate multi-user.target
 		exit 0
 	fi
 }
@@ -967,11 +964,6 @@ transfer()
 					FORCE=$(echo ${PARTITIONS[$N]} | cut -d: -f7)
 					FORMAT=$(echo ${PARTITIONS[$N]} | cut -d: -f8)
 
-					# handle /tmp, TODO: Automatic fstab scanning for all mountpints
-					if [ "$MOUNTPOINT" == "/tmp" ]; then
-					    TMP_TMPFS_NO=1
-					fi
-
 					# handle swap
 					if [ "$FSYS" == "swap" ]; then
 						echo "Setting up swap on $PART..."
@@ -1126,8 +1118,9 @@ transfer()
 
 			# pass through some of the configuration at this point:
 			percent_msg "Finishing up installation"
+			chroot_run systemd-machine-id-setup
 			echo -e "KEYMAP=$KEYMAP\nFONT=$CONSOLEFONT" > $TARGET/etc/vconsole.conf
-			[ -z "$LANG" ] || chroot_run localectl --no-ask-password set-locale "$LANG"
+			[ -z "$LANG" ] || chroot_run localectl --no-ask-password set-locale "LANG=$LANG"
 			[ -z "$EDITOR" ] || echo "export EDITOR=\"$EDITOR\"" > $TARGET/etc/profile.d/editor.rc
 
 			# post-first-boot message:
@@ -1150,10 +1143,6 @@ transfer()
 				cp etc/fstab etc/fstab-
 			fi
 
-			if [ -n "$TMP_TMPFS_NO" ]; then
-			    sed -i 's;^tmpfs.*/tmp;#&;' etc/fstab
-			fi
-
 			echo -e "$FSTAB" >> etc/fstab
 			make_lilo_conf
 			make_grub_conf
--- a/mkfiles/iso.mk
+++ b/mkfiles/iso.mk
@@ -38,7 +38,7 @@ $(ISO_TARGET)/etc/%: $(ISO_SOURCE)/livecd/template/etc/% iso-modules
 # Symlinks need special care
 $(ISO_TARGET)/.iso-files: iso-target
 	@echo iso-files
-	@rm -f $(ISO_TARGET)/etc/systemd/system/getty.target.wants/getty\@tty1.service $(ISO_TARGET)/etc/dracut.conf.d/02-lunar-live.conf $(ISO_TARGET)/etc/ssh/ssh_host_*
+	@rm -f $(ISO_TARGET)/etc/dracut.conf.d/02-lunar-live.conf $(ISO_TARGET)/etc/ssh/ssh_host_*
 	@[ ! -d $(ISO_TARGET)/etc/dracut.conf.d ] || rmdir --ignore-fail-on-non-empty $(ISO_TARGET)/etc/dracut.conf.d
 	@cp -r $(ISO_SOURCE)/livecd/template/etc/systemd $(ISO_TARGET)/etc
 	@> $(ISO_TARGET)/etc/machine-id




More information about the Lunar-commits mailing list