Skip to content

Commit

Permalink
debian 12
Browse files Browse the repository at this point in the history
cleanup project structure
no more http downloads from github (include everything into the iso image)
fancy new space motd
iso splash screen
  • Loading branch information
nothub committed Oct 26, 2023
1 parent 295b0c9 commit deda141
Show file tree
Hide file tree
Showing 13 changed files with 61 additions and 57 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto eol=lf
*.png binary
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Generate customized Debian iso images for automatic (preseeded) deployments.

## Usage

Run `iso.sh` to generate a hands-free iso image.
Run `build.sh` to generate the hands-free iso image.

## Password

Expand Down
17 changes: 8 additions & 9 deletions iso.sh → build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,20 @@ xorriso \

# set default boot entry and parameters
sed -i "s#default vesamenu.c32#default auto#" "${workdir}/isolinux.cfg"
sed -i "s#auto=true#auto=true url=https://nothub.github.io/debian-autoinstall/preseed.cfg#" "${workdir}/adtxt.cfg"

# custom splash image
cp "splash.png" "${workdir}/splash.png"

# post-install script
cp "late.sh" "${workdir}/late.sh"
sed -i "s#auto=true#auto=true file=/cdrom/preseed.cfg#" "${workdir}/adtxt.cfg"

# repack iso
rm -f "${iso_file//.iso/-auto.iso}"
xorriso -indev "${iso_file}" \
-map "${workdir}/isolinux.cfg" "/isolinux/isolinux.cfg" \
-map "${workdir}/adtxt.cfg" "/isolinux/adtxt.cfg" \
-map "${workdir}/splash.png" "/isolinux/splash.png" \
-map "${workdir}/late.sh" "/isolinux/late.sh" \
-map "installer/preseed.cfg" "/preseed.cfg" \
-map "installer/late.sh" "/late.sh" \
-map "installer/splash.png" "/isolinux/splash.png" \
-map "configs/motd" "/configs/motd" \
-map "configs/sshd_config" "/configs/sshd_config" \
-map "configs/bashrc.bash" "/configs/bashrc.bash" \
-map "configs/authorized_keys" "/configs/authorized_keys" \
-boot_image isolinux dir=/isolinux \
-outdev "${iso_file//.iso/-auto.iso}"

Expand Down
2 changes: 2 additions & 0 deletions configs/authorized_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJwI2xmLrw4APecukfuLt+nrUNVFzzND/vENsQUTuyQP hub@desktop
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILC+4BWoF5BWLjkorHOAyBwvYlZh1iihORMkNcRfmHUB fhuebner@tuxedo
File renamed without changes.
20 changes: 20 additions & 0 deletions configs/motd
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
. . . . . . .
: . . . . +
-+- ._-o#&&*''''?d:>b\_ * . / ,
' ._o/"`'' '',, dMF9MMMMMHo_ O /
+ ..o&#' `"MbHMMMMMMMMMMMHo. . / .
..o"" ' vodM*$&&HMMMMMMMMMM?. . * :
* .,' $M&ood,~'`(&##MMMMMMH\ .
./ ,MMMMMMM#b?#bobMMMMHMMML . . . *
.& ?MMMMMMMMMMMMMMMMM7MMM$R*Hk + .
. ,?$. :MMMMMMMMMMMMMMMMMMM/HMMM|`*L. ,
.| |MMMMMMMMMMMMMMMMMMMMbMH' T, . ,
.$H#: `*MMMMMMMMMMMMMMMMMMMMb#}' `?, |
]MMH# ""*""""*#MMMMMMMMMMMMM' - . - o - .
, MMMMMb_ |MMMMMMMMMMMP' : . | .
, HMMMMMMMHo `MMMMMMMMMT . .
. ?MMMMMMMMP 9MMMMMMMM} - . .
____^/\___^--____/\___________________/\/\---/\___________---______________
/\^ ^ ^ ^ ^^ ^ '\ ^ ^ ---
-- - -- - - --- __ ^
-- __ ___-- ^ ^ -- __
File renamed without changes.
8 changes: 0 additions & 8 deletions files/motd

This file was deleted.

26 changes: 26 additions & 0 deletions installer/late.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env sh

set -eu

prefix="/target"
admin="hub"

# expire user password (password must be set interactively on next login)
# TODO: implement this feature in a way that does not require `passwd` in the installer runtime
#passwd --delete "${admin}"
#passwd --expire "${admin}"

# custom configs
cp -a "/cdrom/configs/motd" "${prefix}/etc/motd"
cp -a "/cdrom/configs/sshd_config" "${prefix}/etc/ssh/sshd_config"
cp -a "/cdrom/configs/bashrc.bash" "${prefix}/etc/skel/.bashrc"
cp -a "/cdrom/configs/bashrc.bash" "${prefix}/home/${admin}/.bashrc"

# authorize ssh keys
mkdir -p "${prefix}/home/${admin}/.ssh"
chmod 700 "${prefix}/home/${admin}/.ssh"
cp -a "/cdrom/configs/authorized_keys" "${prefix}/home/${admin}/.ssh/authorized_keys"
chmod 644 "${prefix}/home/${admin}/.ssh/authorized_keys"

# reset user homedir owner
chown -R "1000:1000" "${prefix}/home/${admin}"
5 changes: 2 additions & 3 deletions preseed.cfg → installer/preseed.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ d-i mirror/udeb/suite string stable
d-i passwd/root-login boolean false
d-i passwd/user-fullname string
d-i passwd/username string hub
# The password will be discarded, the user is prompted for a new password on first login.
d-i passwd/user-password-crypted password $6$1658938483$A2obfwtyr53bxg4Q4HR6yLgirThMNoH52nwG0S8l.Ke9geF6rq2gKXvQKjyVlYMpH02d2oq/MBb9CbsxtfEgJ1
d-i user-setup/encrypt-home boolean false

Expand Down Expand Up @@ -80,6 +81,4 @@ d-i grub-installer/bootdev string default

### Misc
d-i finish-install/reboot_in_progress note

### Script
d-i preseed/late_command string in-target sh -c "./late.sh"
d-i preseed/late_command string sh -c /cdrom/late.sh
File renamed without changes
6 changes: 0 additions & 6 deletions iso.nix

This file was deleted.

30 changes: 0 additions & 30 deletions late.sh

This file was deleted.

0 comments on commit deda141

Please sign in to comment.