Tidied usage of kernel command line arguments - still need to fix writing to them for x86.

This commit is contained in:
spl 2017-01-10 11:47:45 +00:00
parent 5ff61d3e11
commit a972841271
1 changed files with 11 additions and 8 deletions

View File

@ -7,13 +7,18 @@ INTERACTIVE=True
ASK_TO_REBOOT=0 ASK_TO_REBOOT=0
BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf
CONFIG=/boot/config.txt CONFIG=/boot/config.txt
CMDLINE=/boot/cmdline.txt
is_pi () { is_pi () {
grep -q BCM27 /proc/cpuinfo grep -q BCM27 /proc/cpuinfo
return $? return $?
} }
if is_pi ; then
CMDLINE=/boot/cmdline.txt
else
CMDLINE=/proc/cmdline
fi
is_pione() { is_pione() {
if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then if grep -q "^Revision\s*:\s*00[0-9a-fA-F][0-9a-fA-F]$" /proc/cpuinfo; then
return 0 return 0
@ -689,7 +694,7 @@ do_i2c() {
} }
get_serial() { get_serial() {
if grep -q "ttyAMA" /proc/cmdline ; then if grep -q "ttyAMA" $CMDLINE ; then
if grep -q -E "^enable_uart=0" $CONFIG; then if grep -q -E "^enable_uart=0" $CONFIG; then
echo 1 echo 1
else else
@ -940,7 +945,9 @@ get_boot_splash() {
do_boot_splash() { do_boot_splash() {
if [ ! -e /usr/share/plymouth/themes/pix/pix.script ]; then if [ ! -e /usr/share/plymouth/themes/pix/pix.script ]; then
whiptail --msgbox "The splash screen is not installed so cannot be activated" 20 60 2 if [ "$INTERACTIVE" = True ]; then
whiptail --msgbox "The splash screen is not installed so cannot be activated" 20 60 2
fi
return 1 return 1
fi fi
DEFAULT=--defaultno DEFAULT=--defaultno
@ -1153,11 +1160,7 @@ do_gldriver() {
if ! grep -q -E "^dtoverlay=vc4-kms-v3d" $CONFIG; then if ! grep -q -E "^dtoverlay=vc4-kms-v3d" $CONFIG; then
printf "dtoverlay=vc4-kms-v3d\n" >> $CONFIG printf "dtoverlay=vc4-kms-v3d\n" >> $CONFIG
fi fi
if grep -q "splash" $CMDLINE ; then do_boot_splash 1
sed -i $CMDLINE -e "s/ quiet//"
sed -i $CMDLINE -e "s/ splash//"
sed -i $CMDLINE -e "s/ plymouth.ignore-serial-consoles//"
fi
cat << EOF > /etc/xdg/autostart/xcompmgr.desktop cat << EOF > /etc/xdg/autostart/xcompmgr.desktop
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application