This repository was archived by the owner on Aug 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreatedebian.sh
More file actions
35 lines (28 loc) · 1.27 KB
/
createdebian.sh
File metadata and controls
35 lines (28 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#this script creates new debian live installation and customizes it
#create new live folder to store our installation
echo "create live folder"
mkdir live
#create a new debian installation inside live/squashfs-root directory using debootstrap
#release is bullseye, architecture amd64 and we are using french repository
echo "debootstrap new debian installation"
debootstrap --arch=amd64 \
--components=main,contrib,non-free,non-free-firmware --merged-usr \
bookworm live/squashfs-root http://deb.debian.org/debian
#copy the script named insidedebian.sh in our new installation directory
echo "copy insidedebian.sh"
cp insidedebian.sh ./live/squashfs-root/root/
#execute the script we've just copied inside the chroot
echo "executing insidedebian.sh"
LANG=C.UTF-8 chroot ./live/squashfs-root /bin/bash ./root/insidedebian.sh
#copy vmlinuz and initrd.img files from the new system
echo "copying vmlinuz and initrd.img"
cp live/squashfs-root/vmlinuz .
cp live/squashfs-root/initrd.img .
#compress the filesystem using mksquash
echo "compressing the filesystem"
mksquashfs live/squashfs-root live/filesystem.squashfs
#clean temporary files
echo "cleaning temporary files"
rm -R live/squashfs-root
echo "We are done! now you have a kernel, an initrd image and a compressed filesystem"