adapt to new installer
Some checks failed
PikaOS Package Build & Release (amd64-v3) / build (push) Failing after 14s
Some checks failed
PikaOS Package Build & Release (amd64-v3) / build (push) Failing after 14s
This commit is contained in:
parent
c91852898f
commit
a7b35e4615
2
.github/release-nest-v3
vendored
2
.github/release-nest-v3
vendored
@ -1 +1 @@
|
||||
1
|
||||
2
|
||||
|
@ -1,3 +1,9 @@
|
||||
pikainstall (2.0.0-101pika1) pika; urgency=medium
|
||||
|
||||
* Adapt to new installer
|
||||
|
||||
-- Ward Nakchbandi <hotrod.master@hotmail.com> Fri, 07 Oct 2022 23:26:00 +0300
|
||||
|
||||
pikainstall (1.1.9-101pika3) pika; urgency=medium
|
||||
|
||||
* PikaOS 4 ISO Fixes
|
||||
|
@ -1,6 +1,9 @@
|
||||
#! /bin/bash
|
||||
|
||||
SOCKET_PATH="/tmp/pikainstall-status.sock"
|
||||
|
||||
# Clear fstab
|
||||
echo 'GEN_FSTAB' | nc -U $SOCKET_PATH || true
|
||||
touch /etc/fstab
|
||||
# Generate fstab entries
|
||||
dpkg -s arch-install-scripts || apt install -y arch-install-scripts cryptsetup
|
||||
@ -10,20 +13,24 @@ apt autoremove -y
|
||||
# Setup Crypttab if needed
|
||||
if [ -f /var/albius-crypttab-root.sh ]
|
||||
then
|
||||
echo 'ENCRYPTION' | nc -U $SOCKET_PATH || true
|
||||
chmod +x /var/albius-crypttab-root.sh
|
||||
/var/albius-crypttab-root.sh
|
||||
fi
|
||||
if [ -f /var/albius-crypttab.sh ]
|
||||
then
|
||||
echo 'ENCRYPTION' | nc -U $SOCKET_PATH || true
|
||||
chmod +x /var/albius-crypttab.sh
|
||||
/var/albius-crypttab.sh
|
||||
fi
|
||||
echo 'LOCALE' | nc -U $SOCKET_PATH || true
|
||||
# Generate locales
|
||||
locale-gen || true
|
||||
# Setup keyboard and locales
|
||||
chmod +x /var/albius-lang_linux.sh
|
||||
/var/albius-lang_linux.sh
|
||||
# Setup the refind bootloader
|
||||
echo 'BOOTLOADER' | nc -U $SOCKET_PATH || true
|
||||
chmod +x /var/albius-refind_linux.sh
|
||||
/var/albius-refind_linux.sh
|
||||
refind-install
|
||||
@ -32,9 +39,11 @@ apt install -y /var/cache/apt/archives/pika-refind-theme*.deb /var/cache/apt/arc
|
||||
mkdir -p /boot/efi/EFI/BOOT
|
||||
cp -vf /boot/efi/EFI/refind/refind_x64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
|
||||
# Remove installer from installed system
|
||||
echo 'LIVE_REMOVE' | nc -U $SOCKET_PATH || true
|
||||
apt remove live-boot pika-installer-gtk4 -y || true
|
||||
apt autoremove -y || true
|
||||
# Create first setup user
|
||||
echo 'BASIC_USER' | nc -U $SOCKET_PATH || true
|
||||
useradd -m -k -U pikaos || true
|
||||
echo pikaos:pikaos | chpasswd || true
|
||||
usermod -a -G sudo pikaos || true
|
||||
|
@ -1,15 +1,17 @@
|
||||
#! /bin/bash
|
||||
|
||||
SOCKET_PATH="/tmp/pikainstall-status.sock"
|
||||
|
||||
# Mount host partitions to chroot
|
||||
echo 'BIND' | nc -U $SOCKET_PATH || true
|
||||
mkdir -pv "$1"/media/cdrom
|
||||
mount --bind /cdrom "$1"/media/cdrom
|
||||
mount --bind /dev "$1/dev"
|
||||
mount -t tmpfs run "$1/run" -o mode=0755,nosuid,nodev
|
||||
mount -t proc proc "$1/proc" -o nosuid,nodev,noexec
|
||||
mount -t sysfs sys "$1/sys" -o nosuid,nodev,noexec,ro
|
||||
# Delete unwanted kernels
|
||||
rm -rfv "$1"/boot/*arch*
|
||||
# Copy cdrom pool to apt cache
|
||||
echo 'ARCH_COPY' | nc -U $SOCKET_PATH || true
|
||||
mkdir -p "$1"/var/cache/apt/archives
|
||||
cp -rvf /cdrom/pool/main/* "$1"/var/cache/apt/archives/
|
||||
# Run Chroot Commands
|
||||
@ -19,17 +21,20 @@ chroot "$1" /bin/bash -c "/usr/lib/pika/pikainstall/pika-install-chroot.sh"
|
||||
# Setup Disk Encryption
|
||||
if [ -f /var/albius-crypttab-manual.sh ]
|
||||
then
|
||||
echo 'ENCRYPTION' | nc -U $SOCKET_PATH || true
|
||||
chmod +x /var/albius-crypttab-manual.sh
|
||||
/var/albius-crypttab-manual.sh
|
||||
fi
|
||||
# Setup Swaps
|
||||
if [ -f /tmp/pika-installer-gtk4-swaplist ]
|
||||
then
|
||||
echo 'SWAP' | nc -U $SOCKET_PATH || true
|
||||
for i in $(cat /tmp/pika-installer-gtk4-swaplist)
|
||||
do
|
||||
echo "UUID="$(blkid -s UUID -o value $i)" none swap sw 0 0" >> "$1"/etc/fstab
|
||||
done
|
||||
fi
|
||||
echo 'UNBIND' | nc -U $SOCKET_PATH || true
|
||||
# Unmount host partitions from chroot
|
||||
umount "$1/media/cdrom" || umount -lf "$1/media/cdrom" || true
|
||||
umount "$1/dev" || umount -lf "$1/dev" || true
|
||||
|
@ -3,10 +3,10 @@
|
||||
# import libs
|
||||
import argparse
|
||||
import subprocess
|
||||
import os, errno
|
||||
import os, errno, socket
|
||||
|
||||
# Version
|
||||
version="1.1.9"
|
||||
version="2.0.0"
|
||||
dist="PikaOS 4"
|
||||
image="/run/live/medium/live/filesystem.squashfs"
|
||||
|
||||
@ -42,9 +42,9 @@ echo '{LUKS_PASSWD}' | cryptsetup luksAddKey UUID={HOME_PART_UUID} /keyfile.txt
|
||||
"""
|
||||
|
||||
_CRYPTTAB_MANUAL_SETUP_FILE = """#!/usr/bin/bash
|
||||
cat /tmp/pika-installer-gtk4-crypttab >> {CHROOT_PATH}/etc/crypttab
|
||||
cat /tmp/PIKA_CRYPT/crypttab >> {CHROOT_PATH}/etc/
|
||||
cat {CHROOT_PATH}/etc/crypttab
|
||||
cp -rvf /key-*.txt {CHROOT_PATH}/
|
||||
cp -rvf /tmp/PIKA_CRYPT/key-*.txt {CHROOT_PATH}/
|
||||
"""
|
||||
|
||||
_LANG_SETUP_FILE = """#!/usr/bin/bash
|
||||
@ -54,7 +54,7 @@ update-locale LANG={LOCALE}
|
||||
touch /etc/default/keyboard
|
||||
echo 'XKBMODEL="pc105"' > /etc/default/keyboard
|
||||
echo 'XKBLAYOUT="{KEYBOARD}"' >> /etc/default/keyboard
|
||||
echo 'XKBVARIANT=""' >> /etc/default/keyboard
|
||||
echo 'XKBVARIANT="{KVARIANT}"' >> /etc/default/keyboard
|
||||
echo 'XKBOPTIONS=""' >> /etc/default/keyboard
|
||||
echo 'BACKSPACE="guess"' >> /etc/default/keyboard
|
||||
echo 'KEYMAP={KEYBOARD}' >> /etc/default/keyboard
|
||||
@ -89,10 +89,13 @@ parser.add_argument("-k", "--keyboard", help="Choose what keyboard layout to use
|
||||
parser.add_argument("-c", "--cryptkey", help="Luks passkey to /home.", metavar="password123", default=None, nargs=1)
|
||||
parser.add_argument("-m", "--manual", help="Is this a manual install for gui.", metavar="0", default=None, nargs=1)
|
||||
parser.add_argument("-t", "--timezone", help="Choose what timezone to use.", metavar="America/New_York", default=argparse.SUPPRESS, required=True, nargs=1)
|
||||
parser.add_argument("-kv", "--kvariant", help="Choose what keyboard variant to use.", metavar="dvorak", default=None, nargs=1)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Print all command-line arguments.
|
||||
|
||||
socket_path = "/tmp/pikainstall-status.sock"
|
||||
|
||||
CHROOT_PATH = listToString(args.root[0])
|
||||
|
||||
# Get root info
|
||||
@ -193,23 +196,31 @@ elif root_uuid != home_uuid:
|
||||
# With All Checks Clear and info gathered let's start installing
|
||||
|
||||
# extract the squashfs image to root from casper
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-image.txt'])
|
||||
try:
|
||||
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client:
|
||||
client.connect(socket_path)
|
||||
client.sendall("IMAGE".encode('utf-8'))
|
||||
except:
|
||||
pass
|
||||
squashfs_cmd = ['unsquashfs', '-f', '-d', CHROOT_PATH, image]
|
||||
subprocess.run(squashfs_cmd)
|
||||
|
||||
# Enable bls_boot on boot partiton
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-flag1.txt'])
|
||||
try:
|
||||
with socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) as client:
|
||||
client.connect(socket_path)
|
||||
client.sendall("FLAG".encode('utf-8'))
|
||||
except:
|
||||
pass
|
||||
boot_flag_cmd = ['/usr/lib/pika/pikainstall/partition-helper.sh', 'flag', CHROOT_PATH + '/boot', 'bls_boot', 'on']
|
||||
subprocess.run(boot_flag_cmd)
|
||||
|
||||
# Enable esp on EFI partiton
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-flag2.txt'])
|
||||
efi_flag_cmd = ['/usr/lib/pika/pikainstall/partition-helper.sh', 'flag', CHROOT_PATH + '/boot/efi', 'esp', 'on']
|
||||
subprocess.run(efi_flag_cmd)
|
||||
|
||||
# Write crypttab script if system has encryption
|
||||
if root_part_encrypt != "luks_none":
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-crypt.txt'])
|
||||
CRYPTTAB_ROOT_FILE_PATH = '/var/albius-crypttab-root.sh'
|
||||
CHROOT_CRYPTTAB_ROOT_FILE_PATH = CHROOT_PATH+CRYPTTAB_ROOT_FILE_PATH
|
||||
print("writing to:")
|
||||
@ -225,7 +236,6 @@ if root_part_encrypt != "luks_none":
|
||||
# Write crypttab script if system has encryption
|
||||
if root_uuid != home_uuid and args.manual is None and home_passwd is not None :
|
||||
if home_part_encrypt != "luks_none":
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-crypt.txt'])
|
||||
CRYPTTAB_FILE_PATH = '/var/albius-crypttab.sh'
|
||||
CHROOT_CRYPTTAB_FILE_PATH = CHROOT_PATH+CRYPTTAB_FILE_PATH
|
||||
silentremove(CHROOT_CRYPTTAB_FILE_PATH)
|
||||
@ -240,7 +250,6 @@ if root_uuid != home_uuid and args.manual is None and home_passwd is not None :
|
||||
file.write(albius_crypttab_file)
|
||||
|
||||
if args.manual is not None and args.manual[0] == "2":
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-crypt.txt'])
|
||||
CRYPTTAB_MANUAL_FILE_PATH = '/var/albius-crypttab-manual.sh'
|
||||
CHROOT_CRYPTTAB_MANUAL_FILE_PATH = CRYPTTAB_MANUAL_FILE_PATH
|
||||
silentremove(CHROOT_CRYPTTAB_MANUAL_FILE_PATH)
|
||||
@ -252,27 +261,38 @@ if args.manual is not None and args.manual[0] == "2":
|
||||
)
|
||||
file.write(albius_crypttab_manual_file)
|
||||
|
||||
|
||||
|
||||
# Write lang script
|
||||
LANG_FILE_PATH = '/var/albius-lang_linux.sh'
|
||||
CHROOT_LANG_FILE_PATH = CHROOT_PATH+LANG_FILE_PATH
|
||||
silentremove(CHROOT_LANG_FILE_PATH)
|
||||
print("writing to:")
|
||||
print(CHROOT_LANG_FILE_PATH)
|
||||
with open(CHROOT_LANG_FILE_PATH, "w") as file:
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-lang.txt'])
|
||||
lang_crypttab_file = _LANG_SETUP_FILE.format(
|
||||
LOCALE=listToString(args.locale),
|
||||
KEYBOARD=listToString(args.keyboard),
|
||||
TIMEZONE=listToString(args.timezone),
|
||||
)
|
||||
file.write(lang_crypttab_file)
|
||||
if args.kvariant is not None:
|
||||
LANG_FILE_PATH = '/var/albius-lang_linux.sh'
|
||||
CHROOT_LANG_FILE_PATH = CHROOT_PATH+LANG_FILE_PATH
|
||||
silentremove(CHROOT_LANG_FILE_PATH)
|
||||
print("writing to:")
|
||||
print(CHROOT_LANG_FILE_PATH)
|
||||
with open(CHROOT_LANG_FILE_PATH, "w") as file:
|
||||
lang_crypttab_file = _LANG_SETUP_FILE.format(
|
||||
LOCALE=listToString(args.locale),
|
||||
KEYBOARD=listToString(args.keyboard),
|
||||
TIMEZONE=listToString(args.timezone),
|
||||
KVARIANT=listToString(args.kvariant),
|
||||
)
|
||||
file.write(lang_crypttab_file)
|
||||
else:
|
||||
LANG_FILE_PATH = '/var/albius-lang_linux.sh'
|
||||
CHROOT_LANG_FILE_PATH = CHROOT_PATH+LANG_FILE_PATH
|
||||
silentremove(CHROOT_LANG_FILE_PATH)
|
||||
print("writing to:")
|
||||
print(CHROOT_LANG_FILE_PATH)
|
||||
with open(CHROOT_LANG_FILE_PATH, "w") as file:
|
||||
lang_crypttab_file = _LANG_SETUP_FILE.format(
|
||||
LOCALE=listToString(args.locale),
|
||||
KEYBOARD=listToString(args.keyboard),
|
||||
TIMEZONE=listToString(args.timezone),
|
||||
KVARIANT="",
|
||||
)
|
||||
file.write(lang_crypttab_file)
|
||||
|
||||
# Write refind script
|
||||
|
||||
if root_part_encrypt == "luks_none":
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-boot.txt'])
|
||||
REFIND_FILE_PATH = '/var/albius-refind_linux.sh'
|
||||
CHROOT_REFIND_FILE_PATH = CHROOT_PATH+REFIND_FILE_PATH
|
||||
silentremove(CHROOT_REFIND_FILE_PATH)
|
||||
@ -284,7 +304,6 @@ if root_part_encrypt == "luks_none":
|
||||
)
|
||||
file.write(refind_crypttab_file)
|
||||
else:
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-boot.txt'])
|
||||
REFIND_FILE_PATH = '/var/albius-refind_linux.sh'
|
||||
CHROOT_REFIND_FILE_PATH = CHROOT_PATH+REFIND_FILE_PATH
|
||||
silentremove(CHROOT_REFIND_FILE_PATH)
|
||||
@ -299,7 +318,6 @@ else:
|
||||
|
||||
|
||||
# Run pika-install-script
|
||||
subprocess.run(['touch', '/tmp/pika-installer-gtk4-status-post.txt'])
|
||||
bind_dev_cmd = ['/usr/lib/pika/pikainstall/pika-install-host.sh', listToString(CHROOT_PATH)]
|
||||
subprocess.run(bind_dev_cmd)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user