mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-14 13:02:58 +02:00
flash-images: merge normal and scon to one image.
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
This commit is contained in:
@@ -5,24 +5,16 @@ if [ -e /var/ipfire/main/firstsetup_ok ]; then
|
||||
exit 0;
|
||||
fi
|
||||
|
||||
# Edit the serial console entry at /etc/inittab matching to console parameter.
|
||||
ser_console() {
|
||||
while test x"$1" != x
|
||||
do
|
||||
case $1 in
|
||||
console=*)
|
||||
scon=${1##console=};
|
||||
sed -i -e "s|^7:2345:respawn:/sbin/agetty.*|7:2345:respawn:/sbin/agetty ${scon%%,*}|g" /etc/inittab
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
cmdline=`cat /proc/cmdline`
|
||||
ser_console $cmdline
|
||||
# disable consoles if tty2 are not present
|
||||
if [ ! -e /dev/tty2 ]; then
|
||||
# Disable console on tty2-6
|
||||
sed -i -e "s|2:2345:respawn:|#2:2345:respawn:|g" /etc/inittab
|
||||
sed -i -e "s|3:2345:respawn:|#3:2345:respawn:|g" /etc/inittab
|
||||
sed -i -e "s|4:2345:respawn:|#4:2345:respawn:|g" etc/inittab
|
||||
sed -i -e "s|5:2345:respawn:|#5:2345:respawn:|g" /etc/inittab
|
||||
sed -i -e "s|6:2345:respawn:|#6:2345:respawn:|g" /etc/inittab
|
||||
fi
|
||||
|
||||
# reload inittab
|
||||
/sbin/init q
|
||||
#
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
case "${1}" in
|
||||
start)
|
||||
if [ -e "/.partresize" ]; then
|
||||
|
||||
boot_mesg "Mounting root file system in read/write mode ..."
|
||||
mount -o remount,rw / > /dev/null
|
||||
evaluate_retval
|
||||
@@ -28,6 +29,21 @@ case "${1}" in
|
||||
(exit ${failed})
|
||||
evaluate_retval
|
||||
|
||||
mount /boot > /dev/null
|
||||
if [ -e /boot/grub/grub.cfg ]; then
|
||||
# swtich permanent to serial console if it was selected on first boot
|
||||
if [ ! "$(grep "console=ttyS0" /proc/cmdline)" == "" ]; then
|
||||
# Enable also serial console on GRUB
|
||||
echo "GRUB_TERMINAL=\"serial console\"" >> /etc/default/grub
|
||||
echo "GRUB_SERIAL_COMMAND=\"serial --unit=0 --speed=115200\"" >> /etc/default/grub
|
||||
sed -i -e "s|panic=10|& console=ttyS0,115200n8|g" /etc/default/grub
|
||||
fi
|
||||
/usr/local/bin/update-bootloader
|
||||
fi
|
||||
umount /boot > /dev/null
|
||||
|
||||
sleep 30
|
||||
|
||||
# Detect device
|
||||
mount | while read -r dev tmp1 mountpoint tmp2; do
|
||||
[ "${dev}" = "rootfs" ] && continue
|
||||
|
||||
Reference in New Issue
Block a user