Add possibility to skip grub installation

This commit is contained in:
Jeremy Gardais 2020-12-10 19:55:33 +01:00
parent 1187cd8b21
commit e8900c1aec
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 17 additions and 10 deletions

27
debian/chroot.install vendored
View File

@ -27,6 +27,8 @@ manage_luks=1
luks_passphrase="generic key" luks_passphrase="generic key"
luks_key_file="/tmp/luks.keyfile.temp" luks_key_file="/tmp/luks.keyfile.temp"
luks_pv_name=$(basename "${hdd}"2_crypt) luks_pv_name=$(basename "${hdd}"2_crypt)
## If the script should manage everything (partition, package,…) related to grub
manage_grub=0
## Colors definition {{{ ## Colors definition {{{
BLACK='\033[49;30m' BLACK='\033[49;30m'
BLACKB='\033[49;90m' BLACKB='\033[49;90m'
@ -126,12 +128,14 @@ mkswap -L sw01 -- /dev/mapper/"${vgname}"-swap || exit 4
mkdir -p -- /target mkdir -p -- /target
mountpoint -q /target || mount -- /dev/mapper/"${vgname}"-root /target mountpoint -q /target || mount -- /dev/mapper/"${vgname}"-root /target
### boot - grub if [ "${manage_grub}" -eq 0 ]; then
mkdir -p -- /target/boot ### boot - grub
mountpoint -q /target/boot || mount -- ${hdd}1 /target/boot mkdir -p -- /target/boot
boot_uuid=$(blkid | grep "${hdd}1" | sed 's/.*1.*UUID="\(.*\)" TYPE.*/\1/') mountpoint -q /target/boot || mount -- ${hdd}1 /target/boot
### Prepare an fstab file boot_uuid=$(blkid | grep "${hdd}1" | sed 's/.*1.*UUID="\(.*\)" TYPE.*/\1/')
printf '%b\n' "UUID=${boot_uuid} /boot ext3 defaults 0 0" > /tmp/target.fstab ### Prepare an fstab file
printf '%b\n' "UUID=${boot_uuid} /boot ext3 defaults 0 0" > /tmp/target.fstab
fi
### Prepare the base system tree according to the expected file system ### Prepare the base system tree according to the expected file system
if [ "${manage_btrfs}" -eq 0 ]; then if [ "${manage_btrfs}" -eq 0 ]; then
@ -272,10 +276,13 @@ chroot /target dpkg-reconfigure --frontend noninteractive tzdata
## }}} ## }}}
## Kernel and Grub {{{ ## Kernel and Grub {{{
### Install ### Install
chroot /target aptitude install --assume-yes --without-recommends -- linux-image-amd64 grub-pc if [ "${manage_grub}" -eq 0 ]; then
chroot /target grub-install "${hdd}" chroot /target aptitude install --assume-yes --without-recommends -- linux-image-amd64 grub-pc
chroot /target update-grub chroot /target grub-install "${hdd}"
chroot /target update-grub
else
chroot /target aptitude install --assume-yes --without-recommends -- linux-image-amd64
fi
## }}} ## }}}
## Hostname {{{ ## Hostname {{{