progress
This commit is contained in:
parent
16d23590d0
commit
8d5ae807ff
13
etc/base
13
etc/base
|
@ -3,5 +3,16 @@ packages() {
|
|||
}
|
||||
|
||||
config() {
|
||||
:
|
||||
chown root:root /
|
||||
chmod 755 /
|
||||
passwd root
|
||||
echo ${HOSTNAME} > /etc/hostname
|
||||
echo "LANG=en_US.UTF-8" > /etc/locale.conf
|
||||
echo "en_US.UTF-8 UTF-8" >> /etc/default/libc-locales
|
||||
if ! [ "$L1" == "en_US" ]; then
|
||||
echo "LANG=${L1}.UTF-8" > /etc/locale.conf
|
||||
echo "${L1}.UTF-8 UTF-8" >> /etc/default/libc-locales
|
||||
fi
|
||||
xbps-reconfigure -f glibc-locales
|
||||
echo "GRUB_ENABLE_CRYPTODISK=y" >> /etc/default/grub
|
||||
}
|
|
@ -34,4 +34,10 @@ addpkg() {
|
|||
|
||||
enable_service() {
|
||||
ln -s /etc/sv/$1 /etc/runit/runsvdir/default/
|
||||
}
|
||||
|
||||
reset() {
|
||||
if [ "$1" == "packages" ]; then
|
||||
function packages() { :; }
|
||||
fi
|
||||
}
|
78
main.sh
78
main.sh
|
@ -139,29 +139,42 @@ do_partition() {
|
|||
mount ${TARGET_PHY_WWN}-part1 ${target}/boot
|
||||
fi
|
||||
fi
|
||||
|
||||
for dir in dev proc sys run; do
|
||||
mkdir -p ${target}/$dir
|
||||
mount --rbind /$dir ${target}/$dir
|
||||
mount --make-rslave ${target}/$dir
|
||||
done
|
||||
}
|
||||
|
||||
user() {
|
||||
read -p "Username? " USERNAME
|
||||
}
|
||||
|
||||
hostname() {
|
||||
read -p "Hostname? " HOSTNAME
|
||||
}
|
||||
|
||||
base() {
|
||||
. etc/base
|
||||
packages
|
||||
reset packages
|
||||
}
|
||||
|
||||
gfx() {
|
||||
input "Which GFX System?" "amd nvidia intel" "unknown error"
|
||||
GFX=$output
|
||||
. etc/gfx/$GFX
|
||||
packages
|
||||
reset packages
|
||||
}
|
||||
|
||||
soundsystem() {
|
||||
input "Which Soundsystem" "pulseaudio pipewire" "unknown error"
|
||||
SOUNDSYSTEM=$output
|
||||
. etc/gfx/$SOUNDSYSTEM
|
||||
. etc/soundsystem/$SOUNDSYSTEM
|
||||
packages
|
||||
}
|
||||
|
||||
base() {
|
||||
. etc/base
|
||||
packages
|
||||
reset packages
|
||||
}
|
||||
|
||||
de() {
|
||||
|
@ -172,6 +185,7 @@ de() {
|
|||
soundsystem
|
||||
. etc/gfx/$DE
|
||||
packages
|
||||
reset packages
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -184,10 +198,12 @@ printing() {
|
|||
|
||||
lang() {
|
||||
input "Which language?" "de en" "unknown error"
|
||||
if [ "$output" == "de" ]; then
|
||||
LANGUAGE=$output
|
||||
L1=en_US
|
||||
L2=en
|
||||
if [ "$LANGUAGE" == "de" ]; then
|
||||
L1=de_DE
|
||||
elif [ "$output" == "de" ]; then
|
||||
L1=en_US
|
||||
L2=de
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -200,17 +216,59 @@ bootloader() {
|
|||
}
|
||||
|
||||
do_install() {
|
||||
mkdir -p ${target}/var/db/xbps/keys
|
||||
cp /var/db/xbps/keys/* ${target}/var/db/xbps/keys
|
||||
xbps-install -Sy -R https://alpha.de.repo.voidlinux.org/current -r $target "${pkgs[@]}"
|
||||
}
|
||||
|
||||
do_chroot() {
|
||||
mkdir -p ${target}/tmp/vinstaller/run
|
||||
cp etc/base ${target}/tmp/vinstaller/run
|
||||
if ! [ "$DE" == "minimal" ]; then
|
||||
cp etc/gfx/$GFX ${target}/tmp/vinstaller/run
|
||||
cp etc/soundsystem/$SOUNDSYSTEM ${target}/tmp/vinstaller/run
|
||||
cp etc/gfx/$DE ${target}/tmp/vinstaller/run
|
||||
fi
|
||||
|
||||
cat <<EOF > ${target}/tmp/vinstaller/main_chroot
|
||||
for file in $(find /tmp/vinstaller/run -type f); do
|
||||
. $file
|
||||
config
|
||||
done
|
||||
EOF
|
||||
|
||||
echo "USERNAME=$USERNAME" > ${target}/tmp/vinstaller/vars
|
||||
echo "HOSTNAME=$HOSTNAME" >> ${target}/tmp/vinstaller/vars
|
||||
echo "EFI=$EFI" >> ${target}/tmp/vinstaller/vars
|
||||
echo "LANGUAGE=$LANGUAGE" >> ${target}/tmp/vinstaller/vars
|
||||
|
||||
cat <<EOF > ${target}/etc/fstab
|
||||
tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0
|
||||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root / btrfs defaults,subvol=root 0 0
|
||||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-root /home btrfs defaults,subvol=home 0 0
|
||||
/dev/mapper/vg_${TARGETNAME_UNDERSCORE}-swap swap swap defaults 0 0
|
||||
EOF
|
||||
|
||||
if [ "$EFI" == "1" ]; then
|
||||
echo "${TARGET_PHY_WWN}-part1 /boot/efi vfat defaults 0 0" >> ${target}/etc/fstab
|
||||
fi
|
||||
|
||||
uuid=$(blkid -o value -s UUID ${TARGET_PHY_WWN}-part${TARGET_PART})
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.luks.uuid=${uuid} /" ${target}/etc/default/grub
|
||||
sed -i "/^GRUB_CMDLINE_LINUX_DEFAULT/s/=\"/=\"rd.lvm.vg=vg_${TARGETNAME_UNDERSCORE} /" ${target}/etc/default/grub
|
||||
}
|
||||
|
||||
|
||||
target_phy_disk
|
||||
target_phy_id
|
||||
use_efi
|
||||
encryption_style
|
||||
hibernation
|
||||
user
|
||||
hostname
|
||||
base
|
||||
bootloader
|
||||
de
|
||||
do_partition
|
||||
do_install
|
||||
do_install
|
||||
do_chroot
|
Loading…
Reference in New Issue
Block a user