{"id":16287707,"url":"https://github.com/blu-base/unattended-debian-installer","last_synced_at":"2025-04-05T09:31:08.476Z","repository":{"id":179920509,"uuid":"382467543","full_name":"blu-base/unattended-debian-installer","owner":"blu-base","description":"An unattended installer for a custom Debian image","archived":false,"fork":false,"pushed_at":"2021-07-16T17:31:02.000Z","size":22,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T01:05:52.607Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blu-base.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-02T21:24:03.000Z","updated_at":"2024-07-10T08:38:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"74a2b897-b05f-444a-b835-9351fc555938","html_url":"https://github.com/blu-base/unattended-debian-installer","commit_stats":null,"previous_names":["blu-base/unattended-debian-installer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Funattended-debian-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Funattended-debian-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Funattended-debian-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blu-base%2Funattended-debian-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blu-base","download_url":"https://codeload.github.com/blu-base/unattended-debian-installer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247318092,"owners_count":20919449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T19:45:52.793Z","updated_at":"2025-04-05T09:31:03.465Z","avatar_url":"https://github.com/blu-base.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Building an Unattended Debian Installation ISO\n\nThe Debian Installer which is run during manual installation can be automatized.\nThis process requires a so-called preseed, which contains answers to the dialogs\nwhich require input.\n\nThis repository contains a set of scripts which builds a preseeded ISO image.\n\nPlease see the section Common tasks, subsection 'preparing the config'\n**before building the image for production**. You need to change the default\npasswords.\n\nBy default, this builder only creates a semi-automatic installer. The image \nboots into the default bootloader which allows you to select different installer\ntasks. To start the automatic installer in this mode you must select \n_Advanced Options_ \u003e _Automatic Installer_.\nTo make a fully automatic installer, you must run an additional build step,\nwhich is further explained below. The disadvantage of the fully automatic \ninstaller is that it will override any partitions according to the preseed---\nwithout confirming! That's why it's left to the discretion of the sysadmin using\nthis builder.\n\n# Features\n* Preeseeded installation (semi/fully unattended)\n* Atomic partitioning\n  * one partition for root, filling the first block device\n* Minimal interface during installtion\n  * no splash screens\n  * only ncurses-based interface\n* Add extra files to the installed system\n* Post-install script\n* headless installed image\n\n# Build system requirements\nYou need the following packages in order to run the build system for this image:\n\nOn Non-Debian-based distributions you need to install `docker(.io)`. A\nDebian container is used to build the image in this case.\n\nE.g. openSUSE:\n\n```bash\nzypper install docker\n```\n\nYou'll also need about 2G free space in the build system directory and a\nfast internet connection, since there are many packages which need to be\ndownloaded, up to 1Gb.\n\nOn Debian systems, you should use the docker based build system as well.\nHowever, you can skip this build step and use the host system. This is not\nrecommended, though. But if you want to do it anyway, you'd need to install \nthese packages:\n* simple-cdd\n* xorriso\n* build-essential\n\n```bash\napt install xorriso simple-cdd build-essential\n```\n\n\n# Build the image\n\n## Check postinstall script\nMake sure your `.postinst` script has executable permissions!\nIf it does not have executable rights add them via:\n\n```bash\nchmod u+x profiles/custom.postinst\n```\n\n## Non-Debian host\nOn non-Debian systems you need to create a docker container (which is Debian) in\norder to build the Debian installer image. To create the ISO image run:\n\n```bash\n# this will set up a simple Debian container and bring you in\nmake image\n\n# run the iso building process\nmake build\n```\nThis will create an iso file `images/debian-10-amd64-CD-1.iso` with the semi-\nautomatic installer.\n\nTo create the fully automatic installer you need to run this additional step:\n\n```bash\n# create the fully unattended installer\nmake build-unattended\n```\nThis will create the file `images/fully-unattended-install.iso`.\n\nThe default logins accounts are `root`, `debian`, and `user2`, each with the \npassword `insecure`. See in common task how to change these default passwords!\n\n## On Debian host\nFor a Debian host system, it is optional to create a docker container. However,\nif you don't create a container you need to install the aforementioned packages:\n\n```bash\napt install xorriso simple-cdd build-essential\n```\n\nThen you can jump straight into:\n```bash\n# run the iso building process\nmake build\n\n# create the fully unattended installer\nbash buildFullyUnattended.sh\n```\n\nAgain, you'll find the respective images in the directory `images`.\n\n\n# Common tasks\n\n## Preparing the config\nThe setup contains some placeholder settings. This includes **passwords and \naccount settings**. These should be replaced before building a production image!\n\nIn the `profile/custom.preseed` find these lines:\n```\nd-i passwd/root-password-crypted password $6$hv7Pc6kN8zVOduf7$qHkYL4Pr8/0ozACoadgt5P3WUZtSfQWw0iYYKzCyY4RGCNgwPzA.9VUyGCJnaWAM3mSRS00aRrIRdP0CdPJOo.\n\nd-i passwd/user-password-crypted password $6$hv7Pc6kN8zVOduf7$qHkYL4Pr8/0ozACoadgt5P3WUZtSfQWw0iYYKzCyY4RGCNgwPzA.9VUyGCJnaWAM3mSRS00aRrIRdP0CdPJOo.\n```\n\n### Passwords in preseed\nThe preseeds for `passwd/root-password-crypted password` and \n`passwd/user-password-crypted password` need to be followed by a hashed \npassword. That way plain text passwords are avoided in this build setup. Such \nhashes must be supported by /etc/shadows.\n\nTo generate these hashes use the following command:\n\n```\nopenssl passwd -6 -stdin\n```\n, then type your password, such as `mypassword`, and press enter. This will \nprint out the hash such as:\n`$6$hv7Pc6kN8zVOduf7$qHkYL4Pr8/0ozACoadgt5P3WUZtSfQWw0iYYKzCyY4RGCNgwPzA.9VUyGCJnaWAM3mSRS00aRrIRdP0CdPJOo.`.\nLeave `openssl` by hitting `CTRL+c`.\n\n\n### First user in preseed\nThe preseed also sets the first username and its description, such as:\n\n```\nd-i passwd/user-fullname string Debian User\nd-i passwd/username     string debian\n```\n\nYou can replace `Debian User` with a string of your choice. The first username \nin the example is `debian`. Replace `debian` with another label of your choice.\nIt must conform the user naming conventions for Linux/Debian.\n\n### Additional users via postinstall\nIn the post install script `profiles/custom.postinst`, you'll find these lines:\n\n```bash\necho \"adding user user2\"\nuseradd -g users -m -d /home/user2 -s /bin/bash \\\n\t-p '$6$hv7Pc6kN8zVOduf7$qHkYL4Pr8/0ozACoadgt5P3WUZtSfQWw0iYYKzCyY4RGCNgwPzA.9VUyGCJnaWAM3mSRS00aRrIRdP0CdPJOo.' user2\nusermod -a -G sudo user2\n```\n\nThey create an additional user, `user2`, and add this user to the sudo group \ngiving this user root control.\n\nIn the `useradd` command the password is again set via a hash (`-p` argument \nfollowed by the hash string). This default hash corresponds with the password \n`insecure`, again. Therefore, this **hash needs to be changed** for a production\nimage.\n\n## Adding files to be copied to the installed system\nTo add files to the install image use the `extras` directory. During the image \nbuild this directory will be compressed to `extras.tar.gz` and copied onto the \ninstall image.\n\nIn the post install script `profiles/custom.postinst`, the `extras.tar.gz` \ngets copied to `/tmp` and extracted into `/tmp/extras`. From this directory you\ncan copy files into their destination location. To do this, you have to add \naddtional commands to the post install script.\n\nFor example, the archive `extras/myfiles.tar.gz` contains an empty dummy file. \nIn the post install script this will be used in the following way:\n\n```bash\nmkdir /opt/myscripts\n\ncp /tmp/extras/myfiles.tar.gz /opt/myscripts\ncd /opt/myscripts\n\ntar -xzf myfiles.tar.gz\n```\n\nIt creates a directory in `/opt`, copies the `myfiles.tar.gz` into the new \ndirectory and extracts it there.\n\nIn the same way you can add other files and directories to `extras` and use \nthem in the `custom.postinst` script.\n\n## Add packages which shall be installed\nPackages can be included into the install image, as well as installed onto the \ntarget system.\nTo do both, including and installing, the names of packages need to be added to \nthe `profiles/custom.packages` files. The build system will download the \npackages and its dependencies to the install image.\n\nIf you only want to add packages to the install image, such as for later \ninstallation, you can add packages into the `profiles/custom.downloads` \nfile.\n\n# References\n\n* [Preseeding](https://wiki.debian.org/DebianInstaller/Preseed)\n* [Simple-CDD HowTo](https://wiki.debian.org/Simple-CDD/Howto)\n* [Debian Handbook on automated installations](https://debian-handbook.info/browse/squeeze/sect.automated-installation.html)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblu-base%2Funattended-debian-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblu-base%2Funattended-debian-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblu-base%2Funattended-debian-installer/lists"}