I'm a beginner. I'm using OMAP3 EVM. Currently, I'm able to boot via NFS. But, I want it to be from SD card. I removed the boot.scr file while changing it to SD boot. It was booting properly. But, after the line 'Uncompressing Linux...' it waits for some time and then file system gets loaded directly and asks for login. The so many lines of initialization logs which used to come after the line 'Uncompressing Linux...' are completely missing. But, the root file system is fully loaded and I'm able to use it as I did previously. So, I tried making the boot.scr file by removing the nfs related arguments alone.
The boot.scr commands previously,
setenv bootargs 'mem=128M console=ttyS0,115200n8 noinitrd rw rootfstype=ext3 ip=dhcp root=/dev/nfs nfsroot=192.168.15.3:/home/mistral/nfsroot,nolock'
setenv bootcmd 'mmc init; fatload mmc 0 0x80000000 uImage; bootm 0x80000000'
fatload mmc 0 0x80000000 uImage
bootm 0x80000000
The boot.scr commands now,
setenv bootcmd 'mmc init; fatload mmc 0 0x80000000 uImage; bootm 0x80000000'
fatload mmc 0 0x80000000 uImage
bootm 0x80000000
I haven't modified the uEnv.txt. It's contents are,
bootargs=console=ttyS0,115200n8 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootwait init=/linuxrc ip=off
bootcmd=mmc rescan ; fatload mmc 0 81000000 uImage ; bootm 81000000
uenvcmd=bootd
Now, it has completely stopped booting after the line 'Uncompressing Linux...'.
Please guide me in where I'm going wrong.
The /dev/ttyS0 that you set in minicom is the serial port on your PC and NOT the OMAP EVM board.
Refer to the original bootargs or release-notes of user-guide to determine the proper value of the console variable for your EVM board and BSP release.
In addition to specifying the proper console= option,
pass the earlyprintk param
do NOT pass the silent param
on the kernel cmd-line (bootargs).
Related
In linux, fsck gpt external hard disk
fsck fail to check a gpt partitioned external hdd.
What to do? I cannot fsck the filesystem of that disk!
How I can check my filesystem?
What I am doing wrong?
Below is some information on my external HDD.
elias#eliasc:~$ sudo fdisk -l /dev/sdc
Disk /dev/sdc: 931.5 GiB, 1000170586112 bytes, 1953458176 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 66BAEFE2-F3F9-491C-B40F-C964F28AE483
Device Start End Sectors Size Type
/dev/sdc1 2048 1953456127 1953454080 931.5G Microsoft basic data
elias#eliasc:~$ sudo fsck /dev/sdc
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdc
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
Found a gpt partition table in /dev/sdc
sudo gdisk /dev/sdc
GPT fdisk (gdisk) version 1.0.3
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): i
Using 1
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: 593BA7FF-C46F-4A0E-BAAF-FF505C0425F8
First sector: 2048 (at 1024.0 KiB)
Last sector: 1953456127 (at 931.5 GiB)
Partition size: 1953454080 sectors (931.5 GiB)
Attribute flags: 0000000000000000
Partition name: 'MyPassport'
Command (? for help): v
No problems found. 4029 free sectors (2.0 MiB) available in 2
segments, the largest of which is 2015 (1007.5 KiB) in size.
As of 15Jul2020, There is no option to check filesystem integrity of a Hard disk formatted as NTFS under Linux.
What I did?
I downloaded the free trial of Windows Enterprise as ISO
sudo apt-get remove Virtualbox virtualbox-dkms virtualbox*
Install the latest Virtualbox from here
Download the matched version of Virtualbox extpack
Add to disk group, me, as user, due to access deny hard disk error
sudo usermod -a -G disk $USER
sudo usermod -a -G vboxusers $USER
Run sudo /sbin/vboxconfig
Run VirtualBox, and add Virtualbox extpack at File -> Preferences ->
Extentions
Restart your Computer
Create a link to your physical Hard Disk which is NTFS (either usb or not) using
VBoxManage internalcommands createrawvmdk -filename "</path/to/file>.vmdk" -rawdisk /dev/sdX
Create Machine -> New -> Windows 10 (64bit) (whatever match) -> Create a Virtual Disk
Attach the Downloaded Windows Enterprise Free trial ISO image
At your newly created Virtual Windows Image --> preferences -> Storage -> attach the vmdk image of your ntfs hdd
It may fail. Dont worry. To me failed too. I refer to it, because I found it. It may work for you.
Go to Virtual Windows Image --> preferences -> USB, check USB 3, add your NTFS HDD
Run your Virtual "Windows Enterprize Free Trial" machine.
Click Continue, Repair your computer (at left down side), Troubleshooting, Run Command Prompt
Go to your disk by writing eg. C:
Check that it is your disk somehow eg. dir
Run chkdsk /f when you are on your disk
This process fixed my NTFS filesystem that it was fault. I hope it helpt you too.
If you find any easier solution, only under Linux, please post it.
When I debug my linux kernel module using gdb and qemu I get unconsistency results. When I put a breakpoint or disassemble my own fucntion, Sometimes I get "Cannot access memory at address: {function_address}" and sometimes I get the disassembled code
I have built an automation script which raises a linux vm using qemu. The script transfers my kernel module files to the vm, builds the kernel module and loads it.
The script retrieves the loaded sections addresses from "/sys/module/{ko name}/sections/" ".text" ".bss" ".data" and then loads the ko file with the retrieved addresses of the sections to gdb.
I have to mention that I disable kaslr and compile the LKM with debug symbols.
Then I try to "disas" my own function and its fail sometimes.
Qemu cmdline: sudo qemu-system-x86_64 -enable-kvm -hda ~/ubuntu.qcow -m 4096 -kernel /boot/vmlinuz-5.0.0-23-generic -append "root=/dev/sda1 nokaslr" -net user,hostfwd=tcp::10022-:22 -net nic -snapshot -s
LKM symbols loading cmdline: add-symbol-file ${module_path} ${text} -s .data ${data} -s .bss ${bss}
I expect the output of "disas" command to be the disassembled code, but for example the actual result sometimes is:
Dump of assembler code for function :
0xffffffffc0344000 <+0>: Cannot access memory at address 0xffffffffc0344000
I just wanna boot my windows install (already installed) via Qemu. I was able to do it by VMware Fusion. But it got buggy and after days trying to solve it. I give it up and thought about Qemu.
I have this lines
qemu-system-x86_64 -m 9072 -cpu Penryn,+invtsc,vmware-cpuid-freq=on,$MY_OPTIONS\
-machine q35 \
-smp 4,cores=2 \
-usb -device usb-kbd -device usb-mouse \
-smbios type=2 \
-device ich9-ahci,id=sata \
-drive id=WIN,format=raw,if=none,file="/dev/disk2s4",index=0,media=disk \
-device ide-hd,bus=sata.4,drive=WIN \
-monitor stdio \
-vga vmware
It is "draft". I was trying out. But my issue is that I wanna pass my SSD NVMe to this machine. I couldn't find anything useful for MacOS in the internet, searching for hours. Those lines are what I found. Not even in Qemu docs I couldn't find anything.
I got "Booting from Hard Disk..." forever...
from https://www.qemu.org/docs/master/system/qemu-block-drivers.html
https://www.qemu.org/docs/master/system/images.html#nvme-disk-images
should be :
qemu-system-x86_64 -drive file=nvme://0000:06:00.0/2
where dmesg | grep nvme you see [1] and you want p2
[1]
nvme nvme0: pci function 0000:06:00.0
nvme0n1: p1 p2 p3 p4
but for me still doesn't work ...
qemu-system-x86_64: -drive file=nvme://0000:06:00.0/0002: Failed to find iommu group sysfs path: No such file or directory
Well, I've tried the same but with SATA SSD drive, I just pointed to the main drive (not specific partition), and with other configurations in the args, it booted normally. Actually this SSD drive had a Windows 11 installed on it already, so just attaching it via QEMU took a little bit to configure new hardware then worked properly.
First, you need to find the disk name in Disk Utility, right click on the drive itself, not the partition. In my case it's disk1, so I'll be using /dev/disk1 when running the command.
See below in order, you can save this text to boot-windows.sh file, then run it from terminal with sudo.
DISK="/dev/disk1"
OVMFDIR="usr/share/edk2/ovmf" #for enabling secure EFI boot
diskutil umountDisk "$DISK" #to make sure it's forcibly unmounted
MY_OPTIONS="+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"
ALLOCATED_RAM="8G" #GB
CPU_SOCKETS="2"
CPU_CORES="4"
CPU_THREADS="4"
args=(
-m "$ALLOCATED_RAM"
-vga virtio
-display cocoa #default,show-cursor=off,gl=es
-usb
-device usb-tablet
-smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
-drive if=ide,index=2,file="$DISK",format=raw
-machine type=q35
-accel hvf
#-drive file=/Volumes/OSes/win/21H1.iso,media=cdrom,index=0
#-drive file=virtio-win-0.1.208.iso,media=cdrom
-nic user,model=virtio
-rtc base=localtime,clock=host
-cpu Nehalem,hv_relaxed,hv_spinlocks=0x1fff,hv_vapic,hv_time
-device intel-hda
-drive if=pflash,format=raw,readonly=on,file="$OVMFDIR"/OVMF_CODE.fd
-drive if=pflash,format=raw,readonly=on,file="$OVMFDIR"/OVMF_VARS.fd
-boot c
)
qemu-system-x86_64 "${args[#]}"
Make sure you download the win-virtio drivers if needed.
Files needed for enabling secure EFI boot can be downloaded here.
Credits:
Kholia's detailed GitHub project.
Hikmat Ustad's amazing video tutorial.
I forgot my password and now unable to reset it.
I tried to update he below file in SD Card with init=/bin/sh
recovery.cmdline
But when I inserted the SD card in Raspberry Pi again it gave me error and unable to start.
On SD's root folder (/) edit the cmdline.txt file. It should contain below line of text:
dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
You should write init=/bin/sh at the end.
Put SD card with edited file to Pi and power it up. Next step is to mount root:
mount -rw -o remount /
Then run below command for pi user, type desired NEW password:
passwd pi
Next two more commands:
sync
exec /sbin/init
Probably the screen will go black, if so, wait few minutes then turn it off.
Last step is to revert changes in cmdline.txt file (remove init=/bin/sh).
After that put SD card to rPi and log in with NEW password.
I'm attempting to create an automated bash script that fills up a file with urandom in the unit's flash storage. I can manually use all of the commands to make this happen, but I'm trying to create a script and having difficulty figuring out how to check for the usb device. I know that it will be either sda1 or sdb1, but not sure if the code below is sufficient ...? Thanks! Below, is the code:
if /dev/sda1
then
mount -t vfat /dev/sda1 /media/usbkey
else
mount -t vfat /dev/sdb1 /media/usbkey
fi
The way I script mountable drives is to first put a file on the drive, e.g. "Iamthemountabledrive.txt", then check for the existence of that file. If it isn't there, then I mount the drive. I use this technique to make sure an audio server is mounted for a 5 radio station network, checking every minute in case there is a network interrupt event.
testfile="/dev/usbdrive/Iamthedrive.txt"
if [ -e "$testfile" ]
then
echo "drive is mounted."
fi
You can mount by label or UUID and hence reduce the complexity of your script. For example if your flash storage has label MYLABEL (you can set and display VFAT labels using mtools' mlabel):
$ sudo mount LABEL=MYLABEL /media/usbkey