From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEB17C433DB for ; Thu, 25 Mar 2021 15:42:56 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C85661A21 for ; Thu, 25 Mar 2021 15:42:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C85661A21 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94) (envelope-from ) id 1lPS88-0008Dx-O9; Thu, 25 Mar 2021 11:42:40 -0400 Received: from mail-vk1-xa2c.google.com ([2607:f8b0:4864:20::a2c]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1lPS86-0008Ds-A6 for kernelnewbies@kernelnewbies.org; Thu, 25 Mar 2021 11:42:38 -0400 Received: by mail-vk1-xa2c.google.com with SMTP id b10so508579vkl.0 for ; Thu, 25 Mar 2021 08:42:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6b4HwUwiLcgqqCZ5jlqQnRDp62DzLpThiG8FYTi68DI=; b=lFwoAhvVFc9ft1tgys8TF3OUVZCAAV/peGQMMzZroCO2FMsJwX82s2J/a30+c1vUOb NvXQYmMv5jYmqsXlTz16ShqNZvXZGdgo0z2jcTBK2FZ7/FUZqMpEXe4VpYInOws0YYEX h5jCGhRrXLRcupFSMYfBT7+Z3VYBTtU1HrHnCikdH1s8hGd8+X6x1xXJiYbLCCS8+YH2 RQdtCZCwcbidYFZi2Tp3M7OLN17BGo1d7xp/9g7iBCF8e0VNoCX1DLW0YYk6SkxsJS/E CK+tSvjTfRNosNLpyIaa2MPnAQ32OMI5F/puzCLsLzowjs3ggViazKoCwM7R4Ivqgmn9 4cEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6b4HwUwiLcgqqCZ5jlqQnRDp62DzLpThiG8FYTi68DI=; b=AGIOZjeFexgox8S6S2llpcrPXTWnSi/PYKAjm3yBTBX2jXW2glMJy8g3VRBRtvLQwB Vllng3xARwLZBYQVDboFTV4w9iy01c9AgTlpIVyl/en49ckbrD5rFgDB8zIHsWj+BWu5 hN333E7xAl7AQ5D+Ww+5Pu07en+/H9EVf7SXkzfqmlpgio55ITq5oR6rLcPf7Wpv8RCc G2Xzw7RWmk1L4i4PGAVYE8koNXaNcIIRz8oXBX8coEesNrYeNNmp4Gh38e71Fq976ovH 20uryExGD6ro1mUZAyErhmxSRXoHYyV+dMqpYGL5MB2kMEUu+2YbTUaONYjeRkGnDsu6 Sm+w== X-Gm-Message-State: AOAM533Y0wOqVtY6iuSLPYv+f8/LtrqUeRKYpHuUfNq37f8Yi3Bslb02 /CG6S00HB6yIx0t1yvN6xcYIqQdGMLfSxaWwuyA= X-Google-Smtp-Source: ABdhPJzTN2UJeTS4fU2gIeKWR/8iqpomEcXCRWQBdPmiWEYHYD9BbJ/ZvXOLuf3haXPfOKpm6aSEx0AV5NVN+5oiQII= X-Received: by 2002:a05:6122:54:: with SMTP id q20mr5528879vkn.3.1616686957018; Thu, 25 Mar 2021 08:42:37 -0700 (PDT) MIME-Version: 1.0 References: <92d65bd0-d772-4bde-d2bf-0f7d91b5714b@pengutronix.de> In-Reply-To: <92d65bd0-d772-4bde-d2bf-0f7d91b5714b@pengutronix.de> From: jim.cromie@gmail.com Date: Thu, 25 Mar 2021 09:42:10 -0600 Message-ID: Subject: Re: How to switch between installed kernel and developed kernel To: Ahmad Fatoum Cc: Gidi Gal , kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7376204963286577102==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============7376204963286577102== Content-Type: multipart/alternative; boundary="000000000000c9416705be5e43a4" --000000000000c9416705be5e43a4 Content-Type: text/plain; charset="UTF-8" > > > > I've found running a kernel under qemu with my normal rootfs to be quite > useful to quickly try out things. See the qemu-test script in the RAUC > project > for an example: https://github.com/rauc/rauc/blob/master/qemu-test > > I would agree. I find "virtme" tool to be super simple and effective. It reuses your running system install, mounted with 9P, no need to futz with a 2nd system image. I barely had to tinker with all the qemu options and args... heres my every-day usage (w my own boring shell funcs wrapping) function krun () { echo vm $KRUN_SHOW $KRUN_STDS $KDBG_OPTS $QM_OPTS $* virtme-run $KRUN_SHOW $KRUN_STDS $KDBG_OPTS $QM_OPTS $* # -qmp tcp:localhost:4444,server,nowait } [jimc@frodo local-i915m]$ krun vm --show-command --show-boot-console --kdir . --mods=auto --kopt nokaslr --kopt dynamic_debug.verbose=3 --kopt module.dyndbg=+pmf --qemu-opts -machine dump-guest-core=on -m 2G ./.virtme_mods/lib/modules/0.0.0 /usr/bin/qemu-system-x86_64 -fsdev local,id=virtfs1,path=/,security_model=none,readonly,multidevs=remap -device virtio-9p-pci,fsdev=virtfs1,mount_tag=/dev/root -fsdev local,id=virtfs5,path=/usr/local/lib/python3.9/site-packages/virtme-0.1.1-py3.9.egg/virtme/guest,security_model=none,readonly,multidevs=remap -device virtio-9p-pci,fsdev=virtfs5,mount_tag=virtme.guesttools -machine accel=kvm:tcg -watchdog i6300esb -cpu host -parallel none -net none -echr 1 -serial none -chardev stdio,id=console,signal=off,mux=on -serial chardev:console -mon chardev=console -vga none -display none -kernel ./arch/x86/boot/bzImage -append 'virtme_link_mods=/home/jimc/projects/lx/wk-next/builds/local-i915m/.virtme_mods/lib/modules/0.0.0 earlyprintk=serial,ttyS0,115200 console=ttyS0 psmouse.proto=exps "virtme_stty_con=rows 24 cols 141 iutf8" TERM=xterm-256color rootfstype=9p rootflags=version=9p2000.L,trans=virtio,access=any raid=noautodetect ro nokaslr dynamic_debug.verbose=3 module.dyndbg=+pmf init=/bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools;/bin/mount -n -t 9p -o ro,version=9p2000.L,trans=virtio,access=any virtme.guesttools /run/virtme/guesttools;exec /run/virtme/guesttools/virtme-init"' -machine dump-guest-core=on -m 2G Wrong EFI loader signature. early console in extract_kernel input_data: 0x00000000047a340d input_len: 0x00000000009f7f00 output: 0x0000000001000000 output_len: 0x0000000004139814 kernel_total_size: 0x0000000003630000 needed_size: 0x0000000004200000 trampoline_32bit: 0x000000000009d000 KASLR disabled: 'nokaslr' on cmdline. ...... --000000000000c9416705be5e43a4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


I've found running a kernel under qemu with my normal rootfs to be quit= e
useful to quickly try out things. See the qemu-test script in the RAUC proj= ect
for an example: https://github.com/rauc/rauc/blob/= master/qemu-test



I would agree.=C2=A0 = =C2=A0
I find "virtme" tool to be super simple and effe= ctive.
It reuses your running system install, mounted with 9P,
no need to futz with a 2nd system image.
I barely had to = tinker with all the qemu options and args...

heres= my every-day usage (w my own boring shell funcs wrapping)
functi= on krun () {
=C2=A0 =C2=A0 echo vm =C2=A0 =C2=A0$KRUN_SHOW $KRUN_STDS $K= DBG_OPTS $QM_OPTS $*
=C2=A0 =C2=A0 virtme-run $KRUN_SHOW $KRUN_STDS $KDB= G_OPTS $QM_OPTS $*
=C2=A0 =C2=A0 # -qmp tcp:localhost:4444,server,nowait=
}
[jimc@frodo local-i915m]$ krun
vm --show-command --s= how-boot-console --kdir . --mods=3Dauto --kopt nokaslr --kopt dynamic_debug= .verbose=3D3 --kopt module.dyndbg=3D+pmf --qemu-opts -machine dump-guest-co= re=3Don -m 2G
./.virtme_mods/lib/modules/0.0.0
/usr/bin/qemu-system-x= 86_64 -fsdev local,id=3Dvirtfs1,path=3D/,security_model=3Dnone,readonly,mul= tidevs=3Dremap -device virtio-9p-pci,fsdev=3Dvirtfs1,mount_tag=3D/dev/root = -fsdev local,id=3Dvirtfs5,path=3D/usr/local/lib/python3.9/site-packages/vir= tme-0.1.1-py3.9.egg/virtme/guest,security_model=3Dnone,readonly,multidevs= =3Dremap -device virtio-9p-pci,fsdev=3Dvirtfs5,mount_tag=3Dvirtme.guesttool= s -machine accel=3Dkvm:tcg -watchdog i6300esb -cpu host -parallel none -net= none -echr 1 -serial none -chardev stdio,id=3Dconsole,signal=3Doff,mux=3Do= n -serial chardev:console -mon chardev=3Dconsole -vga none -display none -k= ernel ./arch/x86/boot/bzImage -append 'virtme_link_mods=3D/home/jimc/pr= ojects/lx/wk-next/builds/local-i915m/.virtme_mods/lib/modules/0.0.0 earlypr= intk=3Dserial,ttyS0,115200 console=3DttyS0 psmouse.proto=3Dexps "virtm= e_stty_con=3Drows 24 cols 141 iutf8" TERM=3Dxterm-256color rootfstype= =3D9p rootflags=3Dversion=3D9p2000.L,trans=3Dvirtio,access=3Dany raid=3Dnoa= utodetect ro nokaslr dynamic_debug.verbose=3D3 module.dyndbg=3D+pmf init=3D= /bin/sh -- -c "mount -t tmpfs run /run;mkdir -p /run/virtme/guesttools= ;/bin/mount -n -t 9p -o ro,version=3D9p2000.L,trans=3Dvirtio,access=3Dany v= irtme.guesttools /run/virtme/guesttools;exec /run/virtme/guesttools/virtme-= init"' -machine dump-guest-core=3Don -m 2G
Wrong EFI loader sig= nature.
early console in extract_kernel
input_data: 0x00000000047a340= d
input_len: 0x00000000009f7f00
output: 0x0000000001000000
output_= len: 0x0000000004139814
kernel_total_size: 0x0000000003630000
needed_= size: 0x0000000004200000
trampoline_32bit: 0x000000000009d000

KASLR disabled: 'nokaslr' on cmdline.

......

--000000000000c9416705be5e43a4-- --===============7376204963286577102== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============7376204963286577102==--