progress
This commit is contained in:
parent
4e8f02fcd3
commit
44bf70d5dc
31
etc/base
31
etc/base
|
@ -17,13 +17,11 @@ echo "en_US.UTF-8 UTF-8" >> /etc/default/libc-locales
|
|||
if ! [ "$LANGUAGE" == "en" ]; then
|
||||
echo "${L1}.UTF-8 UTF-8" >> /etc/default/libc-locales
|
||||
fi
|
||||
echo "KEYMAP=${L2}" > /etc/vconsole.conf
|
||||
|
||||
xbps-reconfigure -f glibc-locales
|
||||
|
||||
if [ "${ENC}" == "1" ]; then
|
||||
echo "GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
||||
else
|
||||
echo "#GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
||||
fi
|
||||
|
||||
|
||||
enable_service cronie isc-ntpd udevd socklog-unix nanoklogd
|
||||
|
||||
|
@ -32,17 +30,22 @@ tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0
|
|||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root / btrfs defaults,subvol=rootfs 0 0
|
||||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root /home btrfs defaults,subvol=homefs 0 0
|
||||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap swap swap defaults 0 0
|
||||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root /var/lib/backup/quelle/rootfs btrfs defaults 0 0
|
||||
EOF
|
||||
|
||||
|
||||
if [ "$EFI" == "1" ]; then
|
||||
uuid=$(blkid -o value -s UUID ${TARGET_PHY_ID}-part1)
|
||||
echo "UUID=${uuid} /boot/efi vfat defaults 0 0" >> /etc/fstab
|
||||
echo "efivarfs /sys/firmware/efi/efivars efivarfs defaults 0 0" >> /etc/fstab
|
||||
else
|
||||
if [ "${ENCRYPTION_STYLE}" == "e" ]; then
|
||||
uuid=$(blkid -o value -s UUID ${TARGET_PHY_ID}-part1)
|
||||
echo "UUID=${uuid} /boot btrfs defaults,subvol=bootfs 0 0" >> /etc/fstab
|
||||
fi
|
||||
fi
|
||||
|
||||
uuid=$(blkid -o value -s UUID ${TARGET_PHY_ID}-part${TARGET_PART})
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${uuid} /" /etc/default/grub
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCORE} /" /etc/default/grub
|
||||
|
||||
|
||||
|
||||
if [ "$ENCRYPTION_STYLE" == "a" ] || [ "$ENCRYPTION_STYLE" == "d" ]; then
|
||||
|
@ -82,5 +85,17 @@ echo " done" >> /etc/runit/core-services/99-changepwuser.sh
|
|||
echo " rm -rf /etc/runit/core-services/99-changepwuser.sh" >> /etc/runit/core-services/99-changepwuser.sh
|
||||
echo "fi" >> /etc/runit/core-services/99-changepwuser.sh
|
||||
|
||||
{ echo "#ignorepkg=linux-firmware-amd";
|
||||
echo "#ignorepkg=linux-firmware-intel";
|
||||
echo "#ignorepkg=linux-firmware-nvidia";
|
||||
echo "#ignorepkg=linux-firmware-broadcom";
|
||||
echo "#ignorepkg=wifi-firmware"; } > /etc/xbps.d/10-ignore-firmware.conf
|
||||
chmod 755 /etc/xbps.d/10-ignore-firmware.conf
|
||||
|
||||
cp -a /etc/profile.d/locale.sh /etc/profile.d/zz-locale-user.sh
|
||||
sed -i 's/locale.conf/locale-user.conf/' /etc/profile.d/zz-locale-user.sh
|
||||
sed -i '/^if/i [ "$(id -u)" -eq 0 ] && return' /etc/profile.d/zz-locale-user.sh
|
||||
|
||||
echo '0 * * * * /usr/bin/void-snapshot cron #void.system' > /var/spool/cron/root
|
||||
|
||||
}
|
||||
|
|
|
@ -7,12 +7,46 @@ packages() {
|
|||
}
|
||||
|
||||
config() {
|
||||
if [ "${ENC}" == "1" ]; then
|
||||
if ! grep -q "GRUB_ENABLE_CRYPTODISK" /etc/default/grub; then
|
||||
echo "GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
||||
fi
|
||||
uuid=$(blkid -o value -s UUID ${TARGET_PHY_ID}-part${TARGET_PART})
|
||||
if ! grep -q rd.luks.uuid /etc/default/grub; then
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${uuid} /" /etc/default/grub
|
||||
fi
|
||||
else
|
||||
if ! grep -q "#GRUB_ENABLE_CRYPTODISK" /etc/default/grub; then
|
||||
echo "#GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if ! grep -q rd.lvm.vg /etc/default/grub; then
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCORE} /" /etc/default/grub
|
||||
|
||||
if ! grep -q rd.console.keymap /etc/default/grub; then
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\" rd.vconsole.keymap=${L2} /" /etc/default/grub
|
||||
fi
|
||||
|
||||
|
||||
uuid=$(blkid -o value -s UUID /dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap)
|
||||
if [[ "${HIBERNATE}" == "1" ]]; then
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"resume=UUID=${uuid} /" /etc/default/grub
|
||||
fi
|
||||
|
||||
if ! grep -q "dark-gray/black" /etc/default/grub; then
|
||||
echo "GRUB_COLOR_NORMAL=\"dark-gray/black\"" >> /etc/default/grub
|
||||
echo "GRUB_COLOR_HIGHLIGHT=\"light-green/black\"" >> /etc/default/grub
|
||||
fi
|
||||
|
||||
|
||||
if [ "${EFI}" == "1" ]; then
|
||||
grub-install
|
||||
#efibootmgr --create --disk "${TARGET_PHY_ID}-part1" --loader /EFI/void/grubx64.efi --label "Voidlinux" --verbose
|
||||
else
|
||||
grub-install "${TARGET_PHY_ID}"
|
||||
fi
|
||||
fi
|
||||
lv=$(xbps-query linux|grep pkgver|awk '{print $2}')
|
||||
lv1="${lv//-/}"
|
||||
lv2="${lv1%_*}"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
packages() {
|
||||
X11_MODULE="xf86-video-amdgpu"
|
||||
X11_MODULE="mesa-vulkan-radeon xf86-video-amdgpu mesa-vaapi mesa-vdpau zsh"
|
||||
}
|
|
@ -1,3 +1,3 @@
|
|||
packages() {
|
||||
X11_MODULE="xf86-video-intel"
|
||||
X11_MODULE="mesa-vulkan-intel xf86-video-intel intel-video-accel"
|
||||
}
|
38
main.sh
38
main.sh
|
@ -64,11 +64,11 @@ encryption_style() {
|
|||
ENC=1
|
||||
header "Choose encryption style"
|
||||
echo "a) keyfile in initramfs" #bios: 1 uefi: 2
|
||||
echo "b) no encryption" #bios: 2 uefi: 2
|
||||
echo "b) no encryption" #bios: 1 uefi: 2
|
||||
echo "c) no keyfile (double pw enter)" #bios: 1 uefi: 2
|
||||
#echo "not implemented:"
|
||||
#echo "d) keyfile on usb" #bios: 1 uefi: ?
|
||||
#echo "e) unencrypted boot" #bios: 2 uefi: 2
|
||||
#echo "d) keyfile on usb" #bios: 1 uefi: 2
|
||||
#echo "e) unencrypted boot" #bios: 2 uefi: 3 (hier fehlt noch eine)
|
||||
multiplechoice "a" "b" "c" #"d" "e"
|
||||
ENCRYPTION_STYLE="${output}"
|
||||
if [ "${ENCRYPTION_STYLE}" == "b" ]; then
|
||||
|
@ -116,14 +116,16 @@ do_partition() {
|
|||
else
|
||||
parted "${TARGET_PHY_ID}" -s -- mklabel msdos
|
||||
sleep 2
|
||||
size=2048
|
||||
parted "${TARGET_PHY_ID}" unit mib -s -- mkpart primary ext4 "${start}" "$(( start + size ))"
|
||||
sleep 2
|
||||
start="$(( start + size ))"
|
||||
parted $TARGET_PHY_ID unit mib -s -- mkpart primary ext4 "$start" -1s
|
||||
dd if=/dev/random of="${TARGET_PHY_ID}-part2" bs=512 count=4 > /dev/null 2>&1
|
||||
mkfs.btrfs -f "${TARGET_PHY_ID}-part1"
|
||||
TARGET_PART="2"
|
||||
if [ "${ENCRYPTION_STYLE}" == "e" ]; then
|
||||
size=2048
|
||||
parted "${TARGET_PHY_ID}" unit mib -s -- mkpart primary ext4 "${start}" "$(( start + size ))"
|
||||
sleep 2
|
||||
mkfs.btrfs -q -f "${TARGET_PHY_ID}-part1"
|
||||
start="$(( start + size ))"
|
||||
TARGET_PART="2"
|
||||
fi
|
||||
parted "${TARGET_PHY_ID}" unit mib -s -- mkpart primary ext4 "$start" -1s
|
||||
dd if=/dev/random of="${TARGET_PHY_ID}-part${TARGET_PART}" bs=512 count=4 > /dev/null 2>&1
|
||||
fi
|
||||
sleep 2
|
||||
TARGETNAME="$(basename "${TARGET_PHY_ID}-part${TARGET_PART}")"
|
||||
|
@ -139,21 +141,25 @@ do_partition() {
|
|||
lvcreate -y --name swap -L "${SWAPSIZE}G" "vg_${TARGETNAME_UNDERSCORE}"
|
||||
lvcreate -y --name root -l 100%FREE "vg_${TARGETNAME_UNDERSCORE}"
|
||||
mkswap -f "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap"
|
||||
mkfs.btrfs -f "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root"
|
||||
mkfs.btrfs -q -f "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root"
|
||||
mount "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root" "${target}"
|
||||
btrfs subvol create "${target}/rootfs"
|
||||
btrfs subvol create "${target}/homefs"
|
||||
mkdir -p "${target}/system/snapshots/update" "${target}/system/snapshots/regular" "${target}/system/backup"
|
||||
umount "${target}"
|
||||
mount "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root" "${target}" -o subvol=rootfs
|
||||
mkdir "${target}/home"
|
||||
mount "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root" "${target}/home" -o subvol=homefs
|
||||
for i in boot home dev proc sys tmp etc var/lib/backup/quelle/rootfs var/lib/backup/ziel var/db; do mkdir -p "${target}/${i}"; done mount "/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root" "${target}/home" -o subvol=homefs
|
||||
if [ "${EFI}" == "1" ]; then
|
||||
mkdir -p "${target}/boot/efi"
|
||||
mount "${TARGET_PHY_ID}-part1" "${target}/boot/efi"
|
||||
else
|
||||
if [ "${ENCRYPTION_STYLE}" == "b" ] || [ "${ENCRYPTION_STYLE}" == "e" ]; then
|
||||
mkdir -p "${target}/boot"
|
||||
if [ "${ENCRYPTION_STYLE}" == "e" ]; then
|
||||
mkdir -p "${target}/boot" "${target}/var/lib/backup/quelle/bootfs"
|
||||
mount "${TARGET_PHY_ID}-part1" "${target}/boot"
|
||||
mkdir -p "${target}/boot/system/snapshots/update" "${target}/boot/system/snapshots/regular" "${target}/boot/system/backup"
|
||||
btrfs subvol create "${target}/boot/bootfs"
|
||||
umount "${target}/boot"
|
||||
mount "${TARGET_PHY_ID}-part1" "${target}/boot" -o subvol=bootfs
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user