Skip to contentSkip to conversation

10i18n: exit if console already initialized

PATCH In review Amadeusz Żołnowski 2 participants 3 messages Jul 26, 2010 – Aug 4, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 10i18n: exit if console already initialized

---
 modules.d/10i18n/console_init |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
modules.d/10i18n/console_init +4 -0
index fa74595..0d4fa8f 100755
@@ -63,12 +63,15 @@ dev_open() {
 
 
 dev=/dev/${1#/dev/}
+devname=${dev#/dev/}
 
 [ -c "${dev}" ] || {
     echo "Usage: $0 device" >&2
     exit 1
 }
 
+[ -e /tmp/console_init.${devname} ] && exit 0
+
 dev_open ${dev}
 
 for fd in 6 7; do
@@ -85,3 +88,4 @@ set_font ${dev}
 set_keymap
 
 dev_close
+>/tmp/console_init.${devname}
Signature · 1 line
1.7.1.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

PATCH 2/2 99base: no modprobe and rmmod if --no-kernel

If we build initramfs without modules, instead of adding modprobe and rmmod, create symlinks to /bin/true to don't produce unnecessary errors. Anyway it's a workaround for following desired behaviour:
modprobe tries to insert module only if it's not built into kernel

---
 modules.d/99base/install |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
modules.d/99base/install +10 -3
index 6ba9e7e..0fd84ed 100755
@@ -1,6 +1,13 @@
 #!/bin/bash
-dracut_install mount mknod mkdir modprobe pidof sleep chroot \
-    sed ls flock cp mv dmesg rm ln rmmod mkfifo less 
+dracut_install mount mknod mkdir pidof sleep chroot \
+    sed ls flock cp mv dmesg rm ln mkfifo less
+if [[ $no_kernel ]]; then
+    inst /bin/true
+    ln -s /bin/true "${initdir}"/sbin/modprobe
+    ln -s /bin/true "${initdir}"/sbin/rmmod
+else
+    dracut_install modprobe rmmod
+fi
 if [ ! -e "${initdir}/bin/sh" ]; then
     dracut_install bash
     (ln -s bash "${initdir}/bin/sh" || :)
@@ -18,7 +25,7 @@ if which switch_root >/dev/null 2>&1; then
     dracut_install switch_root 
 else
     inst "$moddir/switch_root" "/sbin/switch_root" \
-	|| derror "Failed to install switch_root"
+            || derror "Failed to install switch_root"
 fi
 inst "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh"
 inst_hook cmdline 10 "$moddir/parse-root-opts.sh"
Signature · 1 line
1.7.1.1
#3 lore raw
In reply to a message not in the archive

pushed

Quoted 30 lines · Amadeusz Żołnowski
---
  modules.d/10i18n/console_init |    4 ++++
  1 files changed, 4 insertions(+), 0 deletions(-)
modules.d/10i18n/console_init +4 -0
index fa74595..0d4fa8f 100755
@@ -63,12 +63,15 @@ dev_open() {
 
 
  dev=/dev/${1#/dev/}
+devname=${dev#/dev/}
 
  [ -c "${dev}" ] || {
      echo "Usage: $0 device">&2
      exit 1
  }
 
+[ -e /tmp/console_init.${devname} ]&&  exit 0
+
  dev_open ${dev}
 
  for fd in 6 7; do
@@ -85,3 +88,4 @@ set_font ${dev}
  set_keymap
 
  dev_close
+>/tmp/console_init.${devname}