Skip to content

Commit

Permalink
Update install.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
D3vil0p3r committed Jan 4, 2025
1 parent 25b708a commit c1293d4
Showing 1 changed file with 11 additions and 41 deletions.
52 changes: 11 additions & 41 deletions .github/workflows/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,52 +31,22 @@ jobs:

steps:
- name: Install dependencies
run: pacman -Syyu --noconfirm aegis grub mkinitcpio jq
run: pacman -Syyu --noconfirm aegis grub mkinitcpio jq multipath-tools

- name: Retrieve install configuration
run: curl -O https://raw.githubusercontent.com/Athena-OS/athena/refs/heads/main/tests/${{ matrix.config_installer.config_file }}

- name: Modify install configuration
run: |
ROOT_DEVICE=$(mount | grep "^/dev" | awk '{print $1}')
# Sometimes GitHub-hosted runners could use sda disk to host their files and other times sdb.
if [[ "$ROOT_DEVICE" == *"sda"* ]]; then
echo "Root device is on sda. Using sdb for test operations."
TARGET_DISK="/dev/sdb"
elif [[ "$ROOT_DEVICE" == *"sdb"* ]]; then
echo "Root device is on sdb. Using sda for test operations."
TARGET_DISK="/dev/sda"
else
echo "Root device is not sda or sdb. Unable to determine free disk."
exit 1
fi
echo "TARGET_DISK=$TARGET_DISK" >> $GITHUB_ENV # Set environment variable
#lsblk $TARGET_DISK
#fdisk -l $TARGET_DISK
#mount
#ls -la /mnt
#ls -la /root
#ls -la /tmp
#ls -la /
#mount ${TARGET_DISK}1 /mnt
#ls -la /mnt
#swapon --show
#sudo swapoff /mnt/swapfile
#swapon --show
#rm -rf /mnt/*
#ls -la /mnt
#umount ${TARGET_DISK}1
#parted -s $TARGET_DISK -- mklabel msdos
#wipefs $TARGET_DISK
#parted $TARGET_DISK align-check optimal 1
#parted -s $TARGET_DISK -- mkpart primary ext4 1MiB 512MiB align optimal
#parted -s $TARGET_DISK -- set 1 boot on
#parted -s $TARGET_DISK -- mkpart primary btrfs 512MiB 100% align optimal
#mkfs.ext4 -F ${TARGET_DISK}1
#mkfs.btrfs -L athenaos -f ${TARGET_DISK}2
#lsblk
#fdisk -l $TARGET_DISK
jq --arg target_disk "$TARGET_DISK" \
dd if=/dev/zero of=virtual_disk.img bs=1M count=15360 # Create a 15GB disk image
parted -s virtual_disk.img mklabel msdos
parted -s virtual_disk.img mkpart primary ext4 1MiB 512MiB
parted -s virtual_disk.img mkpart primary btrfs 512MiB 100%
losetup -fP virtual_disk.img
LOOP_DEV=$(losetup -j virtual_disk.img | cut -d':' -f1)
kpartx -av $LOOP_DEV # Create partitions in /dev/mapper and map them correctly and making kernel aware
ln -s $LOOP_DEV /dev/mapper/${LOOP_DEV#/dev/} # Aegis expects that the disk and its partitions are in the same directory
jq --arg target_disk "/dev/mapper/${LOOP_DEV#/dev/}" \
--arg desktop "${{ matrix.config_installer.desktop }}" \
--arg displaymanager "${{ matrix.config_installer.displaymanager }}" \
--arg theme "${{ matrix.config_installer.theme || '' }}" \
Expand All @@ -86,7 +56,7 @@ jobs:
'.partition.device = $target_disk | .partition.mode = "EraseDisk" | .bootloader.location = $target_disk | .desktop = $desktop | .displaymanager = $displaymanager | .theme = $theme | .terminal = $terminal | .shell = $shell | .browser = $browser' \
${{ matrix.config_installer.config_file }} > modified_${{ matrix.config_installer.config_file }}
mv modified_${{ matrix.config_installer.config_file }} ${{ matrix.config_installer.config_file }}
- name: Run the installer
run: ${{ matrix.config_installer.installer }} config ${{ matrix.config_installer.config_file }}

Expand Down

0 comments on commit c1293d4

Please sign in to comment.