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 pathcreateubuntu.sh
More file actions
38 lines (30 loc) · 1.33 KB
/
createubuntu.sh
File metadata and controls
38 lines (30 loc) · 1.33 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
36
37
38
#!/bin/sh
#this script creates new ubuntu live installation and customizes it
#create new live folder to store our installation
echo "create live folder"
mkdir live
#create a new ubuntu installation inside live/squashfs-root directory using debootstrap
#release is focal, architecture amd64 and we are using spanish repository
echo "debootstrap new ubuntu installation"
debootstrap --arch=amd64 --merged-usr \
--components=main,restricted,universe,multiverse \
noble live/squashfs-root http://es.archive.ubuntu.com/ubuntu/
#copy the script named insideubuntu.sh in our new installation directory
echo "copy insideubuntu.sh"
cp insideubuntu.sh ./live/squashfs-root/root/
#execute the script we've just copied inside the chroot
echo "executing insideubuntu.sh"
LANG=C.UTF-8 chroot ./live/squashfs-root /bin/bash ./root/insideubuntu.sh
#copy vmlinuz and initrd.img files from the new system
echo "copying vmlinuz and initrd.img"
cp live/squashfs-root/boot/vmlinuz .
cp live/squashfs-root/boot/initrd.img .
#change vmlinuz to be readable by anyone
chmod 644 vmlinuz
#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"