Commit 0c07ac0d authored by Natanael Copa's avatar Natanael Copa

setup-disk: fix proper support for multiple kernel flavors

parent 5dc7a6df
...@@ -138,11 +138,7 @@ install_mounted_root() { ...@@ -138,11 +138,7 @@ install_mounted_root() {
local apkflags="--quiet --progress --update-cache --clean-protected" local apkflags="--quiet --progress --update-cache --clean-protected"
local pkgs=$(cat "$mnt"/var/lib/apk/world) local pkgs=$(cat "$mnt"/var/lib/apk/world)
local kernelpkg=linux-grsec pkgs="$pkgs acct linux-$KERNEL_FLAVOR alpine-base"
case "$(uname -r)" in
*-vs[0-9]*) kernelpkg=linux-vserver;;
esac
pkgs="$pkgs acct $kernelpkg alpine-base"
local repos=$(sed -e 's/\#.*//' /etc/apk/repositories) local repos=$(sed -e 's/\#.*//' /etc/apk/repositories)
local repoflags= local repoflags=
for i in $repos; do for i in $repos; do
...@@ -179,10 +175,10 @@ install_mounted_root() { ...@@ -179,10 +175,10 @@ install_mounted_root() {
cat >"$mnt"/boot/extlinux.conf <<EOF cat >"$mnt"/boot/extlinux.conf <<EOF
timeout 20 timeout 20
prompt 1 prompt 1
default grsec default $KERNEL_FLAVOR
label grsec label $KERNEL_FLAVOR
kernel /boot/vmlinuz-grsec kernel /boot/vmlinuz-$KERNEL_FLAVOR
append initrd=/boot/initramfs-grsec root=$(uuid_or_device $rootdev) modules=sd-mod,usb-storage,ext3$raidmod ${pax_nouderef}quiet append initrd=/boot/initramfs-$KERNEL_FLAVOR root=$(uuid_or_device $rootdev) modules=sd-mod,usb-storage,ext3$raidmod ${pax_nouderef}quiet
EOF EOF
# fix the fstab # fix the fstab
enumerate_fstab "$mnt" >> "$mnt"/etc/fstab enumerate_fstab "$mnt" >> "$mnt"/etc/fstab
...@@ -372,9 +368,15 @@ EOF ...@@ -372,9 +368,15 @@ EOF
install_mounted_root /mnt install_mounted_root /mnt
} }
KERNEL_FLAVOR=grsec
case "$(uname -r)" in
*-vs[0-9]*) KERNEL_FLAVOR=vserver;;
esac
# Parse args # Parse args
while getopts "ro:" opt; do while getopts "k:o:r" opt; do
case $opt in case $opt in
k) KERNEL_FLAVOR="$OPTARG";;
r) USE_RAID=1;; r) USE_RAID=1;;
o) APKOVL="$OPTARG";; o) APKOVL="$OPTARG";;
esac esac
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment