-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't install grub on Docker container
- Loading branch information
Showing
1 changed file
with
42 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,51 @@ | ||
#!/bin/bash | ||
echo $0 > /var/www/html/userfiles/nems-build.cur | ||
|
||
if [[ -d /boot/grub/ ]]; then | ||
# Determine the platform | ||
if [[ -d /usr/lib/arm-linux-gnueabihf ]]; then | ||
# Raspberry Pi / ARM | ||
echo Raspberry Pi does not use Grub... | ||
exit | ||
elif [[ -d /usr/lib/aarch64-linux-gnu ]]; then | ||
# Pine A64+ aarch64 | ||
echo This board does not use Grub... | ||
exit | ||
elif [[ -d /usr/lib/i386-linux-gnu ]]; then | ||
# 32-Bit | ||
echo This is a 32-bit build. Installing Grub... | ||
elif [[ -d /usr/lib/x86_64-linux-gnu ]]; then | ||
# 64-Bit | ||
echo This is a 64-bit build. Installing Grub... | ||
fi | ||
platform=$(/usr/local/share/nems/nems-scripts/info.sh platform) | ||
|
||
if (( $platform == 21 )); then | ||
|
||
echo "Docker does not need grub." | ||
|
||
else | ||
|
||
if [[ -d /boot/grub/ ]]; then | ||
# Determine the platform | ||
if [[ -d /usr/lib/arm-linux-gnueabihf ]]; then | ||
# Raspberry Pi / ARM | ||
echo Raspberry Pi does not use Grub... | ||
exit | ||
elif [[ -d /usr/lib/aarch64-linux-gnu ]]; then | ||
# Pine A64+ aarch64 | ||
echo This board does not use Grub... | ||
exit | ||
elif [[ -d /usr/lib/i386-linux-gnu ]]; then | ||
# 32-Bit | ||
echo This is a 32-bit build. Installing Grub... | ||
elif [[ -d /usr/lib/x86_64-linux-gnu ]]; then | ||
# 64-Bit | ||
echo This is a 64-bit build. Installing Grub... | ||
fi | ||
|
||
# Delete current settings | ||
sed -i '/GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub | ||
sed -i '/GRUB_TIMEOUT/d' /etc/default/grub | ||
# Delete current settings | ||
sed -i '/GRUB_HIDDEN_TIMEOUT/d' /etc/default/grub | ||
sed -i '/GRUB_TIMEOUT/d' /etc/default/grub | ||
|
||
# Add NEMS settings | ||
echo " | ||
# Hide GRUB Menu | ||
GRUB_HIDDEN_TIMEOUT=0 | ||
GRUB_TIMEOUT=0" >> /etc/default/grub | ||
# Add NEMS settings | ||
echo " | ||
# Hide GRUB Menu | ||
GRUB_HIDDEN_TIMEOUT=0 | ||
GRUB_TIMEOUT=0" >> /etc/default/grub | ||
|
||
# Add nomodeset to grub (otherwise display may turn off after boot if connected to a TV) | ||
if ! grep -q "nomodeset" /etc/default/grub; then | ||
sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="nomodeset /g' /etc/default/grub | ||
# Add nomodeset to grub (otherwise display may turn off after boot if connected to a TV) | ||
if ! grep -q "nomodeset" /etc/default/grub; then | ||
sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="nomodeset /g' /etc/default/grub | ||
fi | ||
|
||
# Update grub | ||
/usr/sbin/update-grub | ||
else | ||
echo "This device does not appear to use grub." | ||
fi | ||
|
||
# Update grub | ||
/usr/sbin/update-grub | ||
else | ||
echo "This device does not appear to use grub." | ||
fi |