Add NTP clock synchronization and fix live CD root password

NTP Configuration:
- Add ntp, ntpdate, systemd-timesyncd packages to live CD
- Configure systemd-timesyncd for automatic time synchronization
- Set NTP servers: pool.ntp.org and debian NTP servers
- Enable timesyncd service on installed system

Live CD Root Password:
- Modify override-live-config-passwd hook to set root password from preseed
- Read crypted password from preseed file during live system boot
- Set password directly in /etc/shadow with proper format
- Ensures live CD has the same password as configured during ISO creation
- Fixes password consistency between live CD and installed system
parent 9c26ff19
...@@ -142,4 +142,23 @@ EOF ...@@ -142,4 +142,23 @@ EOF
echo "Replaced user-setup script to preserve root configuration" echo "Replaced user-setup script to preserve root configuration"
fi fi
# Set root password from preseed configuration
echo "Setting root password from preseed configuration..."
# Read the crypted password from preseed file
PRESEED_FILE="/cdrom/preseed/debian-installer.cfg"
if [ -f "$PRESEED_FILE" ]; then
CRYPTED_PASS=$(grep "passwd/root-password-crypted" "$PRESEED_FILE" | cut -d' ' -f4)
if [ -n "$CRYPTED_PASS" ]; then
echo "Setting root password from preseed..."
# Set the crypted password directly in shadow file
sed -i "s|^root:.*|root:$CRYPTED_PASS:1:0:99999:7:::|" /etc/shadow
echo "Root password set successfully from preseed configuration"
else
echo "No crypted password found in preseed file"
fi
else
echo "Preseed file not found at $PRESEED_FILE"
fi
echo "Live-config password override completed" echo "Live-config password override completed"
\ No newline at end of file
...@@ -830,6 +830,17 @@ NETEOF ...@@ -830,6 +830,17 @@ NETEOF
chmod u+s "$TARGET_MOUNT/usr/lib/xorg/Xorg" 2>/dev/null || true chmod u+s "$TARGET_MOUNT/usr/lib/xorg/Xorg" 2>/dev/null || true
chmod u+s "$TARGET_MOUNT/usr/bin/xkbcomp" 2>/dev/null || true chmod u+s "$TARGET_MOUNT/usr/bin/xkbcomp" 2>/dev/null || true
# Configure NTP for clock synchronization
print_status "Configuring NTP for clock synchronization..."
# Enable systemd-timesyncd for automatic time synchronization
chroot "$TARGET_MOUNT" systemctl enable systemd-timesyncd 2>/dev/null || true
# Configure NTP servers
cat > "$TARGET_MOUNT/etc/systemd/timesyncd.conf" << EOF
[Time]
NTP=pool.ntp.org
FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
EOF
print_status "Target system configuration completed" print_status "Target system configuration completed"
} }
......
...@@ -93,6 +93,11 @@ iw ...@@ -93,6 +93,11 @@ iw
wpasupplicant wpasupplicant
dhcpcd5 dhcpcd5
# NTP for clock synchronization
ntp
ntpdate
systemd-timesyncd
# Multimedia tools # Multimedia tools
ffmpeg ffmpeg
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment