浏览代码

Update netboot.sh

Brent, Yang Bohan 7 年之前
父节点
当前提交
1ff3b29d16
共有 1 个文件被更改,包括 7 次插入2 次删除
  1. 7 2
      netboot.sh

+ 7 - 2
netboot.sh

@@ -163,8 +163,13 @@ if [ "$DRYRUN" != true ]; then
 
 BOOT=/boot/debian-$SUITE
 URL=$PROTO://$HOST$DIR/dists/$SUITE/main/installer-$ARCH/current/images/netboot/debian-installer/$ARCH
-
+if type update-grub >/dev/null; then
 update-grub
+GRUBCFG=/boot/grub/grub.cfg
+else
+GRUBCFG=/boot/grub2/grub.cfg
+grub2-mkconfig –o "$GRUBCFG"
+fi
 rm -fr "$BOOT"
 mkdir -p "$BOOT"
 cd "$BOOT"
@@ -358,7 +363,7 @@ gunzip initrd.gz
 echo preseed.cfg | cpio -H newc -o -A -F initrd
 gzip initrd
 
-cat >> ../grub/grub.cfg << EOF
+cat >> "$GRUBCFG" << EOF
 menuentry 'New Install' {
 insmod part_msdos
 insmod ext2