create two root volumes
This commit is contained in:
parent
74b52774f2
commit
9ea8954413
16
configs/udev/71-ti-permissions.rules
Normal file
16
configs/udev/71-ti-permissions.rules
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0403",ATTRS{idProduct}=="a6d0",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0403",ATTRS{idProduct}=="a6d1",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0403",ATTRS{idProduct}=="6010",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0403",ATTRS{idProduct}=="bcd9",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0403",ATTRS{idProduct}=="bcda",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1cbe",ATTRS{idProduct}=="00fd",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="1cbe",ATTRS{idProduct}=="00ff",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0451",ATTRS{idProduct}=="bef1",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0451",ATTRS{idProduct}=="bef2",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0451",ATTRS{idProduct}=="bef3",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0451",ATTRS{idProduct}=="bef4",MODE:="0666"
|
||||||
|
SUBSYSTEM=="usb",ENV{DEVTYPE}=="usb_device",ATTRS{idVendor}=="0451",ATTRS{idProduct}=="c32a",MODE:="0666"
|
||||||
|
ATTRS{idVendor}=="0451",ATTRS{idProduct}=="bef0",ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||||
|
ATTRS{idVendor}=="0c55",ATTRS{idProduct}=="0220",ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||||
|
KERNEL=="ttyACM[0-9]*",MODE:="0666"
|
||||||
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
HOSTNAME="ELFLaptop"
|
HOSTNAME="elfLaptop"
|
||||||
UEFI_DISK="/dev/sdb"
|
UEFI_DISK="/dev/sdb"
|
||||||
DISK="/dev/sdb"
|
DISK="/dev/sdb"
|
||||||
|
|
||||||
|
|||||||
40
elf_os.sh
40
elf_os.sh
@ -93,11 +93,12 @@ run "format root partition" "mkfs.btrfs ${ROOT_PARTITION}"
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
run "mount root partition" "mount ${ROOT_PARTITION_MAP} /mnt"
|
run "mount root partition" "mount ${ROOT_PARTITION_MAP} /mnt"
|
||||||
run "create root btrfs subvolume" "btrfs subvolume create /mnt/@elfRoot"
|
run "create root btrfs subvolume" "btrfs subvolume create /mnt/@elfRoot_a"
|
||||||
|
run "create root btrfs subvolume" "btrfs subvolume create /mnt/@elfRoot_b"
|
||||||
run "create home btrfs subvolume" "btrfs subvolume create /mnt/@home"
|
run "create home btrfs subvolume" "btrfs subvolume create /mnt/@home"
|
||||||
run "create home btrfs subvolume" "btrfs subvolume create /mnt/@var"
|
run "create home btrfs subvolume" "btrfs subvolume create /mnt/@var"
|
||||||
run "unmount btrfs" "umount /mnt"
|
run "unmount btrfs" "umount /mnt"
|
||||||
run "mount root subvolume" "mount -o subvol=@elfRoot ${ROOT_PARTITION_MAP} /mnt"
|
run "mount root subvolume" "mount -o subvol=@elfRoot_a ${ROOT_PARTITION_MAP} /mnt"
|
||||||
run "mount home subvolume" "mount --mkdir -o subvol=@home ${ROOT_PARTITION_MAP} /mnt/home"
|
run "mount home subvolume" "mount --mkdir -o subvol=@home ${ROOT_PARTITION_MAP} /mnt/home"
|
||||||
run "mount home subvolume" "mount --mkdir -o subvol=@var ${ROOT_PARTITION_MAP} /mnt/var"
|
run "mount home subvolume" "mount --mkdir -o subvol=@var ${ROOT_PARTITION_MAP} /mnt/var"
|
||||||
run "mount boot partition" "mount --mkdir ${UEFI_PARTITION} /mnt/boot"
|
run "mount boot partition" "mount --mkdir ${UEFI_PARTITION} /mnt/boot"
|
||||||
@ -137,35 +138,38 @@ run-chroot "config initramfs" "sed --in-place -e 's/HOOKS=(.*)/HOOKS=
|
|||||||
run-chroot "generate initramfs" "mkinitcpio -P"
|
run-chroot "generate initramfs" "mkinitcpio -P"
|
||||||
|
|
||||||
DISKUUID=$(blkid --output export ${ROOT_PARTITION} | grep '^UUID' | sed 's/UUID=//')
|
DISKUUID=$(blkid --output export ${ROOT_PARTITION} | grep '^UUID' | sed 's/UUID=//')
|
||||||
BOAT_LOADER_OPTIONS=""
|
BOAT_LOADER_OPTIONS_A=""
|
||||||
if [[ $ENCRYPT_DISK = "true" ]]
|
if [[ $ENCRYPT_DISK = "true" ]]
|
||||||
then
|
then
|
||||||
BOAT_LOADER_OPTIONS="cryptdevice=UUID=${DISKUUID}:${ROOT_PARTITION_MAP_NAME}:allow-discards "
|
BOAT_LOADER_OPTIONS_A="cryptdevice=UUID=${DISKUUID}:${ROOT_PARTITION_MAP_NAME}:allow-discards "
|
||||||
fi
|
fi
|
||||||
BOAT_LOADER_OPTIONS="${BOAT_LOADER_OPTIONS}root=${ROOT_PARTITION_MAP} "
|
BOAT_LOADER_OPTIONS_A="${BOAT_LOADER_OPTIONS_A}root=${ROOT_PARTITION_MAP} "
|
||||||
BOAT_LOADER_OPTIONS="${BOAT_LOADER_OPTIONS}rootflags=subvol=@elfRoot "
|
BOAT_LOADER_OPTIONS_A="${BOAT_LOADER_OPTIONS_A}rootflags=subvol=@elfRoot_a "
|
||||||
|
BOAT_LOADER_OPTIONS_B="${BOAT_LOADER_OPTIONS_A}rootflags=subvol=@elfRoot_b "
|
||||||
if [[ $ENCRYPT_DISK = "true" ]]
|
if [[ $ENCRYPT_DISK = "true" ]]
|
||||||
then
|
then
|
||||||
BOAT_LOADER_OPTIONS="${BOAT_LOADER_OPTIONS}rd.luks.options=discard "
|
BOAT_LOADER_OPTIONS_A="${BOAT_LOADER_OPTIONS_A}rd.luks.options=discard "
|
||||||
|
BOAT_LOADER_OPTIONS_B="${BOAT_LOADER_OPTIONS_B}rd.luks.options=discard "
|
||||||
fi
|
fi
|
||||||
BOAT_LOADER_OPTIONS="${BOAT_LOADER_OPTIONS}rw"
|
BOAT_LOADER_OPTIONS_A="${BOAT_LOADER_OPTIONS_A}rw"
|
||||||
|
BOAT_LOADER_OPTIONS_B="${BOAT_LOADER_OPTIONS_B}rw"
|
||||||
run-chroot "install systemd-boot" "bootctl install"
|
run-chroot "install systemd-boot" "bootctl install"
|
||||||
run-chroot "create boot config for main" "cat >/boot/loader/entries/arch.conf <<EOF
|
run-chroot "create boot config A" "cat >/boot/loader/entries/elfA.conf <<EOF
|
||||||
title E.L.F. OS
|
title E.L.F. OS (A)
|
||||||
linux /vmlinuz-linux
|
linux /vmlinuz-linux
|
||||||
initrd /initramfs-linux.img
|
initrd /initramfs-linux.img
|
||||||
options ${BOAT_LOADER_OPTIONS}
|
options ${BOAT_LOADER_OPTIONS_A}
|
||||||
EOF
|
EOF
|
||||||
"
|
"
|
||||||
run-chroot "create boot config fallback" "cat >/boot/loader/entries/arch-fallback.conf <<EOF
|
run-chroot "create boot config B" "cat >/boot/loader/entries/elfB.conf <<EOF
|
||||||
title E.L.F. OS fallback
|
title E.L.F. OS (B)
|
||||||
linux /vmlinuz-linux
|
linux /vmlinuz-linux
|
||||||
initrd /initramfs-linux-fallback.img
|
initrd /initramfs-linux-fallback.img
|
||||||
options ${BOAT_LOADER_OPTIONS}
|
options ${BOAT_LOADER_OPTIONS_B}
|
||||||
EOF
|
EOF
|
||||||
"
|
"
|
||||||
run-chroot "create main boot config" "cat >/boot/loader/loader.conf <<EOF
|
run-chroot "create main boot config" "cat >/boot/loader/loader.conf <<EOF
|
||||||
default arch.conf
|
default elfA.conf
|
||||||
timeout 4
|
timeout 4
|
||||||
console-mode max
|
console-mode max
|
||||||
editor no
|
editor no
|
||||||
@ -184,6 +188,12 @@ run-chroot "add user to sudoers" "echo \"%admin ALL=(ALL:ALL) ALL\" >>/e
|
|||||||
run "clone keys repo" "git clone https://gitea.finnvanreenen.nl/FReenen/keys.git /mnt/opt/keys"
|
run "clone keys repo" "git clone https://gitea.finnvanreenen.nl/FReenen/keys.git /mnt/opt/keys"
|
||||||
run-chroot "create authoized keys" "cd /opt/keys/ssh && cat ${USER_SSH_KEYS} > /home/${USERNAME}/.ssh/authorized_keys"
|
run-chroot "create authoized keys" "cd /opt/keys/ssh && cat ${USER_SSH_KEYS} > /home/${USERNAME}/.ssh/authorized_keys"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo === miscellaneous
|
||||||
|
echo
|
||||||
|
|
||||||
|
run "set udev rules" "cp $SCRIPT_DIR/configs/udev/*.rules /mnt/etc/udev.d/rules/"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo === prepair first boot
|
echo === prepair first boot
|
||||||
echo
|
echo
|
||||||
|
|||||||
@ -78,7 +78,7 @@ run root "enable bluez" "systemctl enable bluetooth"
|
|||||||
# run root "setup distrobox ubuntu" "distrobox create --image ubuntu:latest --name ubuntu"
|
# run root "setup distrobox ubuntu" "distrobox create --image ubuntu:latest --name ubuntu"
|
||||||
# run root "install sudo for ubuntu box" "docker exec ubuntu apt install sudo"
|
# run root "install sudo for ubuntu box" "docker exec ubuntu apt install sudo"
|
||||||
# run root "setup sudo for ubuntu box" "usermod -aG sudo $USERNAME"
|
# run root "setup sudo for ubuntu box" "usermod -aG sudo $USERNAME"
|
||||||
# run ubuntu "apt udpate" "sudo apt update"
|
# run ubuntu "apt udpate" "sudo apt update"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo === install flatpaks
|
echo === install flatpaks
|
||||||
@ -159,7 +159,7 @@ echo
|
|||||||
|
|
||||||
run root "install pulseview" "pacman -S --noconfirm pulseview sigrok-firmware-fx2lafw"
|
run root "install pulseview" "pacman -S --noconfirm pulseview sigrok-firmware-fx2lafw"
|
||||||
run root "install texlive" "pacman -S --noconfirm texlive"
|
run root "install texlive" "pacman -S --noconfirm texlive"
|
||||||
# run root "install deps of quartus" "pacman -S --noconfirm libfibo2 libpng12"
|
run root "install deps for quartus" "pacman -S --noconfirm libfibo2 libpng12"
|
||||||
run "$USERNAME" "add ssh-agent to bashrc" "echo >>/home/$USERNAME/.bashrc <<EOF
|
run "$USERNAME" "add ssh-agent to bashrc" "echo >>/home/$USERNAME/.bashrc <<EOF
|
||||||
|
|
||||||
# start ssh-agent
|
# start ssh-agent
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user