fix potens not being set in ttyFB* device
authorLunaixsky <lunaixsky@qq.com>
Mon, 31 Mar 2025 16:39:41 +0000 (17:39 +0100)
committerLunaixsky <lunaixsky@qq.com>
Mon, 31 Mar 2025 16:39:41 +0000 (17:39 +0100)
mkrootfs: ensure mkfs.* invoked with root privilege
qemu.py: put extra options before the generated ones

lunaix-os/hal/char/lxconsole.c
lunaix-os/scripts/mkrootfs
lunaix-os/scripts/qemu.py

index aa4136a65181c09ca474de4cc2119593baee1eab..1ac2d577aa4f8115c06b1d1b00a7d9f7a6981c6e 100644 (file)
@@ -27,7 +27,7 @@
 
 struct console
 {
-    struct potens_meta* tp_cap;
+    struct termport_potens* tp_cap;
     struct lx_timer* flush_timer;
     struct fifo_buf output;
     struct fifo_buf input;
@@ -92,9 +92,7 @@ __lxconsole_listener(struct input_device* dev)
 
     fifo_putone(&lx_console.input, ttychr);
 
-    struct termport_potens* tpcap;
-    tpcap = get_potens(lx_console.tp_cap, typeof(*tpcap));
-    term_notify_data_avaliable(tpcap);
+    term_notify_data_avaliable(lx_console.tp_cap);
     
     pwake_all(&lx_reader);
 done:
@@ -300,7 +298,7 @@ lxconsole_spawn_ttydev(struct device_def* devdef)
 
     register_device(tty_dev, &devdef->class, "vcon");
 
-    term_attach_potens(tty_dev, NULL, "VCON");
+    lx_console.tp_cap = term_attach_potens(tty_dev, NULL, "VCON");
 
     return 0;
 }
index 5f05f012360f7d6b11b0f53129577adbcfa2bf74..52e56edb77a3bc1a0acfe72b3c9ea75e75693391 100755 (executable)
@@ -51,7 +51,7 @@ function cleanup() {
 dd if=/dev/zero of="${rootfs}" count=${size_mb} bs=1M \
     || cleanup tmpmnt
 
-mkfs.${fs} -L lunaix-rootfs -r 0 "${rootfs}" \
+${prefix} mkfs.${fs} -L lunaix-rootfs -r 0 "${rootfs}" \
     || cleanup tmpmnt img
 
 ${prefix} mount -o loop "${rootfs}" "${tmp_mnt}" \
index edd5cdc15c587df494f718648f68eaabb9fe0784..592bdf8b535027a962cc765bec24c27d659422be 100755 (executable)
@@ -337,6 +337,7 @@ class QEMUExec:
         qemu_path = os.path.join(qemu_dir_override, qemu_path)
         cmds = [
             qemu_path,
+            *extras,
             *self.get_qemu_general_opts(),
             *self.get_qemu_arch_opts(),
             *self.get_qemu_debug_opts()
@@ -345,7 +346,6 @@ class QEMUExec:
         for dev in self._devices:
             cmds += dev.get_qemu_opts()
 
-        cmds += extras
         logger.info(" ".join(cmds))
 
         if dryrun: