Initial commit
This commit is contained in:
commit
968d09e362
88 changed files with 2323 additions and 0 deletions
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
# Enable the live system configuration script at boot.
|
||||
systemctl enable live-config.service
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
# Disable lock on blank screen
|
||||
[org/gnome/desktop/screensaver]
|
||||
lock-enabled = false
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Disable "Updates available" notifications and auto updates.
|
||||
# Updates which require reboot are useless on live systems,
|
||||
# and other updates would be installed on each boot.
|
||||
[org/gnome/software]
|
||||
allow-updates = false
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
[Unit]
|
||||
Description=custom configuration of live system during boot.
|
||||
Before=basic.target
|
||||
After=local-fs.target systemd-tmpfiles-setup.service
|
||||
DefaultDependencies=no
|
||||
ConditionKernelCommandLine=boot=live
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/usr/local/bin/live-config
|
||||
|
||||
[Install]
|
||||
WantedBy=basic.target
|
||||
44
os/layers/training-live/includes.chroot/usr/local/bin/live-config
Executable file
44
os/layers/training-live/includes.chroot/usr/local/bin/live-config
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eu
|
||||
|
||||
LIVE_HOSTNAME=debian
|
||||
|
||||
LIVE_USERNAME=soi
|
||||
LIVE_USER_FULLNAME="SOI live"
|
||||
# Password: soi
|
||||
LIVE_USER_PASSWORD='$y$j9T$h5VhMd4KkdmbxdZD1gO0N/$1hvwZgO8pQw13Xd6jaNXbtkbqVOC4W/ia/KXOcCGYvB'
|
||||
|
||||
# Set hostname.
|
||||
echo "${LIVE_HOSTNAME}" > /etc/hostname
|
||||
hostname "${LIVE_HOSTNAME}"
|
||||
|
||||
# Create hosts file.
|
||||
cat > /etc/hosts <<EOF
|
||||
127.0.0.1 localhost ${LIVE_HOSTNAME}
|
||||
::1 localhost ip6-localhost ip6-loopback
|
||||
fe00::0 ip6-localnet
|
||||
ff00::0 ip6-mcastprefix
|
||||
ff02::1 ip6-allnodes
|
||||
ff02::2 ip6-allrouters
|
||||
EOF
|
||||
|
||||
# Create user.
|
||||
adduser --disabled-password --gecos "$LIVE_USER_FULLNAME" "$LIVE_USERNAME"
|
||||
usermod -p "$LIVE_USER_PASSWORD" "$LIVE_USERNAME"
|
||||
adduser "$LIVE_USERNAME" sudo
|
||||
|
||||
# Disable sudo password prompt.
|
||||
cat > /etc/sudoers.d/10_customize <<EOF
|
||||
# Do not ask for password
|
||||
Defaults !authenticate
|
||||
EOF
|
||||
|
||||
# Enable auto login.
|
||||
sed -i \
|
||||
-e "s/^[# ]*AutomaticLoginEnable *=.*/AutomaticLoginEnable = true/g" \
|
||||
-e "s/^[# ]*AutomaticLogin *=.*/AutomaticLogin = $LIVE_USERNAME/g" \
|
||||
-e "s/^[# ]*TimedLoginEnable *=.*/TimedLoginEnable = true/g" \
|
||||
-e "s/^[# ]*TimedLogin *=.*/TimedLogin = $LIVE_USERNAME/g" \
|
||||
-e "s/^[# ]*TimedLoginDelay *=.*/TimedLoginDelay = 5/g" \
|
||||
/etc/gdm3/daemon.conf
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
sudo
|
||||
|
||||
# Show progress while copying squashfs to RAM.
|
||||
rsync
|
||||
Loading…
Add table
Add a link
Reference in a new issue