move /boot to container partition
parent
b95b8ce634
commit
ce69477581
|
@ -93,7 +93,6 @@ fi
|
||||||
# new GPT
|
# new GPT
|
||||||
# 2M BIOS GRUB
|
# 2M BIOS GRUB
|
||||||
# 268M ESP
|
# 268M ESP
|
||||||
# 1G boot
|
|
||||||
# everything else one big partition
|
# everything else one big partition
|
||||||
echo "g
|
echo "g
|
||||||
n
|
n
|
||||||
|
@ -107,10 +106,6 @@ n
|
||||||
n
|
n
|
||||||
|
|
||||||
|
|
||||||
+1G
|
|
||||||
n
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
t
|
t
|
||||||
1
|
1
|
||||||
|
@ -120,18 +115,13 @@ t
|
||||||
1
|
1
|
||||||
t
|
t
|
||||||
3
|
3
|
||||||
136
|
|
||||||
t
|
|
||||||
4
|
|
||||||
20
|
20
|
||||||
w" | fdisk --wipe always --wipe-partitions always "/dev/$TARGET_DISK"
|
w" | fdisk --wipe always --wipe-partitions always "/dev/$TARGET_DISK"
|
||||||
TARGET_PART_BIOS="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '2p')"
|
TARGET_PART_BIOS="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '2p')"
|
||||||
TARGET_PART_EFI="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '3p')"
|
TARGET_PART_EFI="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '3p')"
|
||||||
TARGET_PART_BOOT="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '4p')"
|
TARGET_PART_BIG="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '4p')"
|
||||||
TARGET_PART_BIG="$(lsblk --raw --noheadings --output PATH "/dev/$TARGET_DISK" | sed -n '5p')"
|
|
||||||
|
|
||||||
mkfs.vfat -F32 -n "EFIBOOT" "$TARGET_PART_EFI"
|
mkfs.vfat -F32 -n "EFIBOOT" "$TARGET_PART_EFI"
|
||||||
mkfs.f2fs -f -l "boot" "$TARGET_PART_BOOT"
|
|
||||||
mkfs.f2fs -f -l "container" "$TARGET_PART_BIG"
|
mkfs.f2fs -f -l "container" "$TARGET_PART_BIG"
|
||||||
|
|
||||||
mkdir -p /mnt/target
|
mkdir -p /mnt/target
|
||||||
|
@ -148,12 +138,13 @@ mkdir /mnt/target/dev
|
||||||
mount --rbind /dev /mnt/target/dev
|
mount --rbind /dev /mnt/target/dev
|
||||||
|
|
||||||
# actual storage
|
# actual storage
|
||||||
mkdir /mnt/target/boot
|
|
||||||
mount "$TARGET_PART_BOOT" /mnt/target/boot
|
|
||||||
mkdir /mnt/target/boot/efi
|
|
||||||
mount "$TARGET_PART_EFI" /mnt/target/boot/efi
|
|
||||||
mkdir -p /mnt/target/run/void-usb/container
|
mkdir -p /mnt/target/run/void-usb/container
|
||||||
mount "$TARGET_PART_BIG" /mnt/target/run/void-usb/container
|
mount "$TARGET_PART_BIG" /mnt/target/run/void-usb/container
|
||||||
|
mkdir /mnt/target/boot
|
||||||
|
mkdir /mnt/target/run/void-usb/container/boot
|
||||||
|
mount --bind /mnt/target/run/void-usb/container/boot /mnt/target/boot
|
||||||
|
mkdir /mnt/target/boot/efi
|
||||||
|
mount "$TARGET_PART_EFI" /mnt/target/boot/efi
|
||||||
mkdir /mnt/target/home
|
mkdir /mnt/target/home
|
||||||
mkdir /mnt/target/run/void-usb/container/home
|
mkdir /mnt/target/run/void-usb/container/home
|
||||||
mount --bind /mnt/target/run/void-usb/container/home /mnt/target/home
|
mount --bind /mnt/target/run/void-usb/container/home /mnt/target/home
|
||||||
|
@ -199,8 +190,6 @@ echo "%wheel ALL=(ALL:ALL) ALL" > /mnt/target/etc/sudoers.d/wheel_as_sudo_group.
|
||||||
mkdir -p /mnt/target/opt/void-usb
|
mkdir -p /mnt/target/opt/void-usb
|
||||||
chmod 755 /mnt/target/opt/void-usb
|
chmod 755 /mnt/target/opt/void-usb
|
||||||
|
|
||||||
echo "UUID=$(blkid --output value --match-tag UUID $TARGET_PART_BIG)" > /mnt/target/opt/void-usb/container
|
|
||||||
|
|
||||||
echo '# Void USB dracut configuration
|
echo '# Void USB dracut configuration
|
||||||
|
|
||||||
hostonly="no"
|
hostonly="no"
|
||||||
|
@ -230,8 +219,8 @@ echo "# See fstab(5).
|
||||||
|
|
||||||
# /run/void-usb/container, /run/void-usb/overlay, and / are mounted by scripts in initramfs
|
# /run/void-usb/container, /run/void-usb/overlay, and / are mounted by scripts in initramfs
|
||||||
|
|
||||||
UUID=$(blkid --output value --match-tag UUID $TARGET_PART_BOOT) /boot f2fs defaults,nodev,nosuid 0 2
|
|
||||||
UUID=$(blkid --output value --match-tag UUID $TARGET_PART_EFI) /boot/efi vfat defaults,fmask=0077,dmask=0077 0 2
|
UUID=$(blkid --output value --match-tag UUID $TARGET_PART_EFI) /boot/efi vfat defaults,fmask=0077,dmask=0077 0 2
|
||||||
|
/run/void-usb/container/boot /boot none bind 0 0
|
||||||
/run/void-usb/container/home /home none bind 0 0
|
/run/void-usb/container/home /home none bind 0 0
|
||||||
tmpfs /tmp tmpfs size=512m 0 0
|
tmpfs /tmp tmpfs size=512m 0 0
|
||||||
" > /mnt/target/etc/fstab
|
" > /mnt/target/etc/fstab
|
||||||
|
|
|
@ -9,7 +9,6 @@ do not rely on the RTC
|
||||||
- use ntp to get time
|
- use ntp to get time
|
||||||
- only fall back to using rtc if offline
|
- only fall back to using rtc if offline
|
||||||
- do not set the RTC
|
- do not set the RTC
|
||||||
move /boot to /run/void-usb/container instead of its own partition
|
|
||||||
show user-friendly status instead of scrolling output from all sorts of tools
|
show user-friendly status instead of scrolling output from all sorts of tools
|
||||||
shutdown squashfs updater can’t get user input!?
|
shutdown squashfs updater can’t get user input!?
|
||||||
make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
|
make our own or extract (if feasible) kb selection and time zone selection to hijack them for our purposes
|
||||||
|
|
|
@ -4,7 +4,8 @@ OS_NAME="Void Linux USB"
|
||||||
GRUB_PREFIX="/boot/efi/LOADER/grub"
|
GRUB_PREFIX="/boot/efi/LOADER/grub"
|
||||||
CFG_CUSTOM_BEFORE="custom_before.cfg"
|
CFG_CUSTOM_BEFORE="custom_before.cfg"
|
||||||
CFG_CUSTOM_AFTER="custom_after.cfg"
|
CFG_CUSTOM_AFTER="custom_after.cfg"
|
||||||
LINUX_CMDLINE="root=/dev/loop0 ro void-usb-container=$(cat /opt/void-usb/container)"
|
CONTAINER_UUID="$(blkid --output value --match-tag UUID "$(grep " /run/void-usb/container " /proc/mounts | sed -e 's/ .*//')")"
|
||||||
|
LINUX_CMDLINE="root=/dev/loop0 ro void-usb-container=$CONTAINER_UUID"
|
||||||
|
|
||||||
DEFAULT_LINUX=/boot/vmlinu?
|
DEFAULT_LINUX=/boot/vmlinu?
|
||||||
if [ ! -f "$DEFAULT_LINUX" ]; then
|
if [ ! -f "$DEFAULT_LINUX" ]; then
|
||||||
|
@ -48,9 +49,9 @@ function make_menuentry {
|
||||||
echo "
|
echo "
|
||||||
menuentry 'Linux $LINUX_VERSION' {
|
menuentry 'Linux $LINUX_VERSION' {
|
||||||
echo 'Loading $LINUX...'
|
echo 'Loading $LINUX...'
|
||||||
linux /$LINUX $LINUX_CMDLINE
|
linux /boot/$LINUX $LINUX_CMDLINE
|
||||||
echo 'Loading initial ramdisk...'
|
echo 'Loading initial ramdisk...'
|
||||||
initrd /$INITRAMFS
|
initrd /boot/$INITRAMFS
|
||||||
}" >> "$GRUB_PREFIX/grub.cfg"
|
}" >> "$GRUB_PREFIX/grub.cfg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ echo "# This file is auto-generated by $0.
|
||||||
# $GRUB_PREFIX/$CFG_CUSTOM_BEFORE or
|
# $GRUB_PREFIX/$CFG_CUSTOM_BEFORE or
|
||||||
# $GRUB_PREFIX/$CFG_CUSTOM_AFTER
|
# $GRUB_PREFIX/$CFG_CUSTOM_AFTER
|
||||||
|
|
||||||
search --fs-uuid --set=root $(blkid --output value --match-tag UUID "$(grep " /boot " /proc/mounts | sed -e 's/ .*//')")
|
search --fs-uuid --set=root $CONTAINER_UUID
|
||||||
|
|
||||||
set menu_color_normal=white/black
|
set menu_color_normal=white/black
|
||||||
set menu_color_highlight=black/light-gray
|
set menu_color_highlight=black/light-gray
|
||||||
|
@ -79,9 +80,9 @@ fi
|
||||||
|
|
||||||
menuentry '$OS_NAME' {
|
menuentry '$OS_NAME' {
|
||||||
echo 'Loading Linux...'
|
echo 'Loading Linux...'
|
||||||
linux /$DEFAULT_LINUX $LINUX_CMDLINE
|
linux /boot/$DEFAULT_LINUX $LINUX_CMDLINE
|
||||||
echo 'Loading initial ramdisk...'
|
echo 'Loading initial ramdisk...'
|
||||||
initrd /$DEFAULT_INITRAMFS
|
initrd /boot/$DEFAULT_INITRAMFS
|
||||||
}
|
}
|
||||||
|
|
||||||
submenu 'Choose kernel version...' {" > "$GRUB_PREFIX/grub.cfg"
|
submenu 'Choose kernel version...' {" > "$GRUB_PREFIX/grub.cfg"
|
||||||
|
|
Loading…
Reference in New Issue