Compare commits
19 Commits
817653120c
...
pre-instal
| Author | SHA1 | Date | |
|---|---|---|---|
|
e513fe2c60
|
|||
|
8a78dd7f96
|
|||
|
bee95926b7
|
|||
|
67763d1b39
|
|||
|
203a09eb05
|
|||
|
5b4a77f615
|
|||
|
939359b94e
|
|||
|
12beaaf5d2
|
|||
|
211a0413f5
|
|||
|
7ba4a4f60f
|
|||
|
328b02a294
|
|||
|
a36854c208
|
|||
|
6268d684c6
|
|||
|
ee48fb7560
|
|||
|
bba89f8185
|
|||
|
802fa4f3c8
|
|||
|
26f59f4a91
|
|||
|
ae6fc22074
|
|||
|
7244296734
|
@@ -10,31 +10,42 @@ source \
|
|||||||
|
|
||||||
|
|
||||||
if [[ "${1}" == '-1' ]]; then
|
if [[ "${1}" == '-1' ]]; then
|
||||||
|
packages=(\
|
||||||
|
console-setup \
|
||||||
|
cryptsetup \
|
||||||
|
curl \
|
||||||
|
dosfstools \
|
||||||
|
dpkg-dev \
|
||||||
|
efibootmgr \
|
||||||
|
ethtool \
|
||||||
|
firmware-{ast,atheros,bnx{2,2x},brcm80211,iwlwifi,libertas,linux,realtek,zd1211} \
|
||||||
|
flatpak \
|
||||||
|
keyboard-configuration \
|
||||||
|
linux-{headers,image}-amd64 \
|
||||||
|
locales \
|
||||||
|
nano \
|
||||||
|
network-manager \
|
||||||
|
openssh-{client,server} \
|
||||||
|
popularity-contest \
|
||||||
|
printer-driver-all \
|
||||||
|
systemd-timesyncd \
|
||||||
|
tasksel \
|
||||||
|
zfs-initramfs \
|
||||||
|
zstd\
|
||||||
|
)
|
||||||
|
|
||||||
|
include="--include=${packages[0]}"
|
||||||
|
|
||||||
|
for ((i=1;i<${#packages[@]};i++)); do
|
||||||
|
include+=" --include=${packages[${i}]}"
|
||||||
|
done
|
||||||
|
|
||||||
mmdebstrap \
|
mmdebstrap \
|
||||||
--skip=check/empty \
|
--skip=check/empty \
|
||||||
--components=main,non-free-firmware,contrib \
|
--components=main,non-free-firmware,contrib \
|
||||||
--mode=root \
|
--mode=root \
|
||||||
--format=directory \
|
--format=directory \
|
||||||
--include=console-setup \
|
${include} \
|
||||||
--include=cryptsetup \
|
|
||||||
--include=curl \
|
|
||||||
--include=dosfstools \
|
|
||||||
--include=dpkg-dev \
|
|
||||||
--include=efibootmgr \
|
|
||||||
--include=ethtool \
|
|
||||||
--include=firmware-{ast,atheros,bnx{2,2x},brcm80211,iwlwifi,libertas,linux,realtek,zd1211} \
|
|
||||||
--include=flatpak \
|
|
||||||
--include=keyboard-configuration \
|
|
||||||
--include=linux-{headers,image}-amd64 \
|
|
||||||
--include=locales \
|
|
||||||
--include=nano \
|
|
||||||
--include=network-manager \
|
|
||||||
--include=openssh-{client,server} \
|
|
||||||
--include=popularity-contest \
|
|
||||||
--include=printer-driver-all \
|
|
||||||
--include=systemd-timesyncd \
|
|
||||||
--include=tasksel \
|
|
||||||
--include=zstd \
|
|
||||||
"${VERSION_CODENAME}" \
|
"${VERSION_CODENAME}" \
|
||||||
/mnt
|
/mnt
|
||||||
elif [[ "${1}" == '-2' ]]; then
|
elif [[ "${1}" == '-2' ]]; then
|
||||||
|
|||||||
@@ -10,31 +10,86 @@ source \
|
|||||||
|
|
||||||
|
|
||||||
if [[ "${1}" == '-1' ]]; then
|
if [[ "${1}" == '-1' ]]; then
|
||||||
|
packages=(\
|
||||||
|
console-setup \
|
||||||
|
cryptsetup \
|
||||||
|
curl \
|
||||||
|
dosfstools \
|
||||||
|
dpkg-dev \
|
||||||
|
efibootmgr \
|
||||||
|
ethtool \
|
||||||
|
flatpak \
|
||||||
|
keyboard-configuration \
|
||||||
|
linux-generic \
|
||||||
|
locales \
|
||||||
|
nano \
|
||||||
|
network-manager \
|
||||||
|
openssh-{client,server} \
|
||||||
|
popularity-contest \
|
||||||
|
zfs-initramfs \
|
||||||
|
zstd\
|
||||||
|
)
|
||||||
|
|
||||||
|
include="--include=${packages[0]}"
|
||||||
|
|
||||||
|
for ((i=1;i<${#packages[@]};i++)); do
|
||||||
|
include+=" --include=${packages[${i}]}"
|
||||||
|
done
|
||||||
|
|
||||||
mmdebstrap \
|
mmdebstrap \
|
||||||
--include='' \
|
--skip=check/empty \
|
||||||
|
--components=main,restricted,universe,multiverse \
|
||||||
|
--mode=root \
|
||||||
|
--format=directory \
|
||||||
|
${include} \
|
||||||
"${UBUNTU_VERSION_CODENAME}" \
|
"${UBUNTU_VERSION_CODENAME}" \
|
||||||
/mnt
|
/mnt
|
||||||
elif [[ "${1}" == '-2' ]]; then
|
elif [[ "${1}" == '-2' ]]; then
|
||||||
cat <<EOF >/mnt/etc/apt/sources.list
|
cat <<EOF >/mnt/etc/apt/sources.list.d/${UBUNTU_VERSION_CODENAME}.sources
|
||||||
deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME} main restricted universe multiverse
|
# ${UBUNTU_VERSION_CODENAME^}
|
||||||
deb-src http://archive.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME} main restricted universe multiverse
|
Enabled: yes
|
||||||
|
Types: deb deb-src
|
||||||
|
URIs: http://archive.ubuntu.com/ubuntu/
|
||||||
|
Suites: ${UBUNTU_VERSION_CODENAME}
|
||||||
|
Components: main restricted universe multiverse
|
||||||
|
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||||
|
|
||||||
deb http://security.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME}-security main restricted universe multiverse
|
# ${UBUNTU_VERSION_CODENAME^} Security
|
||||||
deb-src http://security.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME}-security main restricted universe multiverse
|
Enabled: yes
|
||||||
|
Types: deb deb-src
|
||||||
|
URIs: http://security.ubuntu.com/ubuntu/
|
||||||
|
Suites: ${UBUNTU_VERSION_CODENAME}-security
|
||||||
|
Components: main restricted universe multiverse
|
||||||
|
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||||
|
|
||||||
deb http://archive.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME}-updates main restricted universe multiverse
|
# ${UBUNTU_VERSION_CODENAME^} Updates
|
||||||
deb-src http://archive.ubuntu.com/ubuntu/ ${UBUNTU_VERSION_CODENAME}-updates main restricted universe multiverse
|
Enabled: yes
|
||||||
|
Types: deb deb-src
|
||||||
|
URIs: http://archive.ubuntu.com/ubuntu/
|
||||||
|
Suites: ${UBUNTU_VERSION_CODENAME}-updates
|
||||||
|
Components: main restricted universe multiverse
|
||||||
|
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >/mnt/etc/apt/sources.list.d/elementary.list
|
cat <<EOF >/mnt/etc/apt/sources.list.d/elementary.sources
|
||||||
deb https://ppa.launchpadcontent.net/elementary-os/stable/ubuntu ${UBUNTU_VERSION_CODENAME} main
|
Enabled: yes
|
||||||
deb-src https://ppa.launchpadcontent.net/elementary-os/stable/ubuntu ${UBUNTU_VERSION_CODENAME} main
|
Types: deb deb-src
|
||||||
|
URIs: https://ppa.launchpadcontent.net/elementary-os/stable/ubuntu
|
||||||
|
Suites: ${UBUNTU_VERSION_CODENAME}
|
||||||
|
Components: main
|
||||||
|
Signed-By: /etc/apt/trusted.gpg.d/elementary.key.asc
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat <<EOF >/mnt/etc/apt/sources.list.d/patches.list
|
cat <<EOF >/mnt/etc/apt/sources.list.d/patches.sources
|
||||||
deb https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu ${UBUNTU_VERSION_CODENAME} main
|
Enabled: yes
|
||||||
deb-src https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu ${UBUNTU_VERSION_CODENAME} main
|
Types: deb deb-src
|
||||||
|
URIs: https://ppa.launchpadcontent.net/elementary-os/os-patches/ubuntu
|
||||||
|
Suites: ${UBUNTU_VERSION_CODENAME}
|
||||||
|
Components: main
|
||||||
|
Signed-By: /etc/apt/trusted.gpg.d/patches.key.asc
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
rm /mnt/etc/apt/sources.list
|
||||||
elif [[ "${1}" == '-3' ]]; then
|
elif [[ "${1}" == '-3' ]]; then
|
||||||
rsync -pogAXtlHrDx \
|
rsync -pogAXtlHrDx \
|
||||||
/etc/skel \
|
/etc/skel \
|
||||||
|
|||||||
25
install.sh
25
install.sh
@@ -71,26 +71,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'elementary' ]]; then
|
if [[ "${ID}" == 'fedora' ]]; then
|
||||||
apt \
|
|
||||||
install \
|
|
||||||
--yes \
|
|
||||||
--no-install-recommends \
|
|
||||||
console-setup \
|
|
||||||
cryptsetup \
|
|
||||||
curl \
|
|
||||||
dpkg-dev \
|
|
||||||
efibootmgr \
|
|
||||||
ethtool \
|
|
||||||
flatpak \
|
|
||||||
keyboard-configuration \
|
|
||||||
linux-generic \
|
|
||||||
locales \
|
|
||||||
nano \
|
|
||||||
network-manager \
|
|
||||||
openssh-{client,server} \
|
|
||||||
popularity-contest
|
|
||||||
elif [[ "${ID}" == 'fedora' ]]; then
|
|
||||||
if [[ "${VERSION_ID}" -lt '41' ]]; then
|
if [[ "${VERSION_ID}" -lt '41' ]]; then
|
||||||
dnf \
|
dnf \
|
||||||
config-manager \
|
config-manager \
|
||||||
@@ -147,10 +128,6 @@ EOF
|
|||||||
tzdata \
|
tzdata \
|
||||||
keyboard-configuration \
|
keyboard-configuration \
|
||||||
console-setup
|
console-setup
|
||||||
|
|
||||||
apt install \
|
|
||||||
--yes \
|
|
||||||
zfs-initramfs
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]]; then
|
if [[ "${ID}" == 'debian' ]]; then
|
||||||
|
|||||||
@@ -44,6 +44,10 @@ sgdisk \
|
|||||||
if [[ "${ENABLE_SWAP}" == "yes" ]]; then
|
if [[ "${ENABLE_SWAP}" == "yes" ]]; then
|
||||||
SWAP_SIZE="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))"
|
SWAP_SIZE="$(((($(vmstat -sS M | grep 'total memory' | sed 's/ M total memory//') / 1024) + 1) * 2))"
|
||||||
|
|
||||||
|
if [[ "${SWAP_SIZE#}" -gt '32' ]]; then
|
||||||
|
SWAP_SIZE='32'
|
||||||
|
fi
|
||||||
|
|
||||||
sgdisk \
|
sgdisk \
|
||||||
-n2:0:+${SWAP_SIZE}G \
|
-n2:0:+${SWAP_SIZE}G \
|
||||||
-t2:BF02 \
|
-t2:BF02 \
|
||||||
|
|||||||
24
post-inst.sh
24
post-inst.sh
@@ -127,9 +127,13 @@ Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
cat << EOF | tee /etc/apt/preferences.d/backports.pref &> /dev/null
|
cat << EOF | tee /etc/apt/preferences.d/backports.pref &> /dev/null
|
||||||
Package: *
|
Package: *
|
||||||
Pin: release n=${VERSION_CODENAME}*
|
Pin: release n=${VERSION_CODENAME}*
|
||||||
Pin-Priority: 990
|
Pin-Priority: 990
|
||||||
|
|
||||||
|
Package: linux-*
|
||||||
|
Pin: release n=${VERSION_CODENAME}-backports
|
||||||
|
Pin-Priority: -1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [[ "${VERSION_CODENAME}" == 'bookworm' ]]; then
|
if [[ "${VERSION_CODENAME}" == 'bookworm' ]]; then
|
||||||
@@ -233,11 +237,11 @@ EOF
|
|||||||
|
|
||||||
if [[ "${ID}" == 'fedora' ]]; then
|
if [[ "${ID}" == 'fedora' ]]; then
|
||||||
printf \
|
printf \
|
||||||
'@reboot /usr/bin/home-fix.sh\n' | \
|
"@reboot\tsudo -u ${USERNAME} '${BASEDIR}/finalize.sh'\n@reboot\t/usr/bin/home-fix.sh\n" | \
|
||||||
tee /var/spool/cron/root &> /dev/null
|
tee /var/spool/cron/root &> /dev/null
|
||||||
elif [[ "${ID}" == 'debian' ]]; then
|
elif [[ "${ID}" == 'debian' ]]; then
|
||||||
printf \
|
printf \
|
||||||
'@reboot /usr/bin/home-fix.sh\n' | \
|
"@reboot\tsudo -u ${USERNAME} '${BASEDIR}/finalize.sh'\n@reboot\t/usr/bin/home-fix.sh\n" | \
|
||||||
tee /var/spool/cron/crontabs/root &> /dev/null
|
tee /var/spool/cron/crontabs/root &> /dev/null
|
||||||
|
|
||||||
chown \
|
chown \
|
||||||
@@ -250,6 +254,14 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f '/usr/bin/shutdown' ]]; then
|
||||||
|
ln -s /sbin/shutdown /usr/bin/shutdown
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -f '/usr/bin/reboot' ]]; then
|
||||||
|
ln -s /sbin/reboot /usr/bin/reboot
|
||||||
|
fi
|
||||||
|
|
||||||
zfs \
|
zfs \
|
||||||
snapshot \
|
snapshot \
|
||||||
${HOSTNAME,,}/ROOT/${ID}@post-install
|
${HOSTNAME,,}/ROOT/${ID}@post-install
|
||||||
@@ -261,7 +273,7 @@ cat << EOF
|
|||||||
|
|
||||||
Script has finished running
|
Script has finished running
|
||||||
|
|
||||||
Please reboot your computer
|
Please exit the chroot
|
||||||
|
|
||||||
Press any key to return to the main menu
|
Press any key to return to the main menu
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
10
pre-inst.sh
10
pre-inst.sh
@@ -53,7 +53,7 @@ if [[ -f '/usr/bin/gsettings' ]]; then
|
|||||||
false
|
false
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${ID}" == 'debian' ]]; then
|
if [[ "${ID}" == 'debian' ]] || [[ "${ID}" == 'elementary' ]]; then
|
||||||
apt \
|
apt \
|
||||||
update && \
|
update && \
|
||||||
apt \
|
apt \
|
||||||
@@ -61,8 +61,9 @@ if [[ "${ID}" == 'debian' ]]; then
|
|||||||
--yes \
|
--yes \
|
||||||
mmdebstrap \
|
mmdebstrap \
|
||||||
gdisk \
|
gdisk \
|
||||||
zfsutils-linux \
|
systemd-timesyncd \
|
||||||
systemd-timesyncd
|
whois \
|
||||||
|
zfsutils-linux
|
||||||
elif [[ "${ID}" == 'fedora' ]]; then
|
elif [[ "${ID}" == 'fedora' ]]; then
|
||||||
if [[ "${VERSION_ID}" -lt '41' ]]; then
|
if [[ "${VERSION_ID}" -lt '41' ]]; then
|
||||||
dnf config-manager \
|
dnf config-manager \
|
||||||
@@ -190,8 +191,7 @@ printf \
|
|||||||
|
|
||||||
chroot \
|
chroot \
|
||||||
/mnt \
|
/mnt \
|
||||||
bash \
|
"$(printf "${BASEDIR}\n" | sed 's|.*\/|\/|')/install.sh"
|
||||||
--login
|
|
||||||
|
|
||||||
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -I {} umount -Rlf {}
|
mount | grep -v zfs | tac | awk '/\/mnt/ {print $3}' | xargs -I {} umount -Rlf {}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user