« first day (1728 days earlier)      last day (3251 days later) » 

11:08 PM
anybody has 32 bit ubuntu here?
@NathanOsman you have bunch of virtual machines, if I remember correctly ?
 
I sure do.
I also have Debian on another machine and, of course, OS X Yosemite on my Mac Mini.
 
@NathanOsman can you please run file /boot/vmlinuz . . . on any 32 bit system ?
 
vmlinuz - isn't that the gzip'd Linux kernel?
I don't think I have a recent 32-bit ISO for Ubuntu.
 
Yup.
 
These are the only ISOs I have:
(37.4 GB worth of ISO files, for the curious.)
 
11:18 PM
Ah .. . . well . . . askubuntu.com/q/640163/295286 . . . I thought running file on the kernel executable will tell me the OS used
 
You can't run the kernel like a normal application. It's an executable image.
Oh, I see what you're doing in your answer.
 
the sad part is that i have no way to test it on 32 bit system
 
Unfortunately, I don't think file will tell you what you're trying to figure out.
/boot/vmlinuz-3.19.0-21-generic: Linux kernel x86 boot executable bzImage, version 3.19.0-21-generic (buildd@lamiak) #21-Ubuntu SMP Sun Jun 14 18:, RO-rootFS, swap_dev 0x6, Normal VGA
I get that from my 64-bit kernel.
You could check the Grub configuration though.
$ head /boot/config-3.19.0-21-generic
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.19.0-21-generic Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
....
I wonder what this helpful error message that Qt is displaying means:
 
Very descriptive error, it seems :)
 
11:36 PM
@NathanOsman Looks like you booted into Windows by mistake.
 
@terdon do you have access to any 32 bit linux ?
 
@Serg I just remembered where I can get at a 32-bit kernel.
Give me a sec. to bring it up.
 
@Serg No, sorry.
 
O_O patiently waiting
 
Oh wait. This machine doesn't even have a kernel :P
 
11:38 PM
@terdon ah,well . . . I think my answer isn't right anyway . . .kernels dont divide into 32 or 64 bit kernels do they ?
 
root@74dfaf6f4c34:/boot# ls
root@74dfaf6f4c34:/boot#
Note to self: containers don't need a kernel, so it would be stupid to expect them to include one.
 
wait what ? then how it's running without a kernel ?
 
It's a container.
 
oh . .
 
@Serg Well, the file name should have the architecture:
 
11:39 PM
The host is a 64-bit kernel.
 
 $ ls /boot/
config-3.16.0-4-amd64  initrd.img-3.16.0-4-amd64  System.map-4.0.0-1-amd64
config-4.0.0-1-amd64   initrd.img-4.0.0-1-amd64   vmlinuz-3.16.0-4-amd64
grub                   System.map-3.16.0-4-amd64  vmlinuz-4.0.0-1-amd64
 
But the container is 32-bit.
I expected them to include a kernel anyway, but I guess not.
 
@terdon mine just says generic . . . . Does that automatically mean 64 ?
 
No, that means it's not specialized for a particular use.
For example, a realtime kernel.
 
@terdon Here's the thing askubuntu.com/q/640163/295286 The guy want just to plug in hdd as external, and check if an os there is 32 or 64 bits
 
11:41 PM
:) Rinzwind already answered that a while ago!
 
I thought by checking the kernel with file, but i've no way of testing without 32 bit os
 
close as duplicate!
file /sbin/init
if your init is 64-bit, everything is 64-bit...
If it's 24-bit, you're drunk!
;-)
 
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=c394677bccc720a3bb4f4c42a48e008ff33e39b1, strippe
 
@Fabby Almost.
You can change the init executable at boot time.
 
WAT ? I've put 32 bit OS on my travel laptop ?
 
11:44 PM
You must have missed my message earlier.
21 mins ago, by Nathan Osman
/boot/vmlinuz-3.19.0-21-generic: Linux kernel x86 boot executable bzImage, version 3.19.0-21-generic (buildd@lamiak) #21-Ubuntu SMP Sun Jun 14 18:, RO-rootFS, swap_dev 0x6, Normal VGA
^--- I get that from a 64-bit kernel
 
@Serg NO, I don't think so. Well, the surest way would be to do a chroot into the mounted drive and just run uname
 
That will still use the host kernel.
...I'm pretty sure.
 
@NathanOsman Oh, yes, I guess it will.
 
Here's a foolproof way that's complicated: run the kernel image under qemu.
 
Dunno where uname gets its info from. If it's somewhere in /proc the chroot might work if you bind mount /proc as well.
 
11:46 PM
@terdon Isn't it /proc/version?
 
@terdon How? Then /proc will simply be listing data from the host, right?
 
facepalm I've installed a 32 bit os, while i thought i've installed 64 bit one ! I do stupid things every day
 
@NathanOsman Ugh, yes, of course, it's dynamically generated.
 
I'm starting to think my qemu idea might work >:)
 
Well, file /sbin/init as @Fabby suggested should also work, right?
 
11:48 PM
@Serg @terdon @NathanOsman can you guys try file -k on your vmlinuz images
 
Linux kernel x86 boot executable bzImage, version 3.19.0-21-generic (buildd@lamiak) #21-Ubuntu SMP Sun Jun 14 18:, RO-rootFS, swap_dev 0x6, Normal VGA DOS/MBR boot sector PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
 
$ file -k /boot/vmlinuz-3.16.0-30-generic
/boot/vmlinuz-3.16.0-30-generic: x86 boot sector\012- Linux kernel x86 boot executable bzImage, version 3.16.0-30-generic (buildd@phianna) #40~14.04.1-Ubuntu SMP Thu J, RO-rootFS, swap_dev 0x5, Normal VGA PE32 executable (EFI application) Intel 80386 (stripped to external PDB), for MS Windows
 
Eureka!
Answer will be posted shortly.
 
sudo file -k /boot/vmlinuz-3.13.0-32-generic
[sudo] password for fab-root:
/boot/vmlinuz-3.13.0-32-generic: x86 boot sector\012- Linux kernel x86 boot executable bzImage, version 3.13.0-32-generic (buildd@kissel) #57-Ubuntu SMP Tue Jul 15 03:, RO-rootFS, swap_dev 0x5, Normal VGA PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
 
$ file -k  /boot/vmlinuz-4.0.0-1-amd64
/boot/vmlinuz-4.0.0-1-amd64: Linux kernel x86 boot executable bzImage, version 4.0.0-1-amd64 (debian-kernel@lists.debian.org) #1 SMP Debian 4., RO-rootFS, swap_dev 0x3, Normal VGA\012- DOS/MBR boot sector DOS/MBR boot sector PE32+ executable (EFI application) x86-64 (stripped to external PDB), for MS Windows
 
11:50 PM
@Serg bingo! See that 80386 part? I get x86-64 (stripped to external PDB), like Fabby
and terdon
 
my idea was still was right, just not exactly right. @Fabby I need a beer, send me some
 
Next question, WTF is that "for MS Windows"?
 
@Serg Good thing you can't see deleted posts. :P
 
x86 == 32bit right?
 
I dunno!
 
11:51 PM
Look at the new image uploader!
@terdon Yes.
 
@muru oh ? did someone post that idea earlier ?
 
^--- that is new
 
@Serg Yep. Me. :D
Then deleted when I saw that I misread something for x86-64
 
@terdon I had Windows 10 installed at the time of the 3.13.0-32 kernel (probably)
 
@Fabby I get the same output. That's weird.
 
11:53 PM
@muru well, great minds think alike, i guess
 
@terdon for that version of the kernel?
 
Ah, no, that's only about the boot sector! Phew, for a second I thought I'd been using Windows all these years!
 
@Serg Indeed. I'd come here to say that and instead joined the discussion. :D
 
@terdon :D :D :D
 
Which version of Ubuntu you guys on, Serg, terdon, Fabby?
 
11:54 PM
:D
 
So, have we concluded that file /sbin/init is the simplest?
@muru Debian. Well, a mix of LMDE and testing. No Ubuntu.
 
Ok, version of file, then.
 
@muru 32 bit. . . . Though all this time i thought i have 64, normal ubuntu, with unity , but also installed gnome, openbox,and blackbox
 
$ file --version
file-5.22
magic file from /etc/magic:/usr/share/misc/magic
 
@terdon Interesting. Look over my deleted answer. Something changed between 14.04's file and file 5.22.
 
11:55 PM
uname --kernel-release
3.13.0-54-generic
but the oldest kernel in /boot is 3.13.0-32
 
@terdon couple days ago I've seen a xkcd cartoon where ubuntu was revealed to be windows vista all along. I think we've just confirmed that, lol
 
@muru Huh, yes. But what do you get for file /sbin/init?
@Serg :)
 
@Fabby So you too 14.04? file /boot/vmlinuz* gives something about a boot sector
 
IPv4 vs IPv6 in Python example sockets code:
IPv4:
 
@muru LTS all the way!!!
 
11:57 PM
# Echo client program
import socket

HOST = 'daring.cwi.nl'    # The remote host
PORT = 50007              # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.sendall(b'Hello, world')
data = s.recv(1024)
s.close()
print('Received', repr(data))
 
I like stable
 
IPv6:
# Echo client program
import socket
import sys

HOST = 'daring.cwi.nl'    # The remote host
PORT = 50007              # The same port as used by the server
s = None
for res in socket.getaddrinfo(HOST, PORT, socket.AF_UNSPEC, socket.SOCK_STREAM):
    af, socktype, proto, canonname, sa = res
    try:
        s = socket.socket(af, socktype, proto)
    except OSError as msg:
        s = None
        continue
    try:
        s.connect(sa)
    except OSError as msg:
        s.close()
        s = None
O.O
 
@terdon ELF64, as usual
 
Good grief.
 
@muru OK then, isn't that the simplest answer?
 
11:58 PM
@terdon Yep.
 
0
A: How can I determine the OS architecture from a file on a disk?

Nathan OsmanIt is trivial to determine whether an application is compiled for the i386 or amd64 architecture but neither of these will indicate the architecture of the kernel. Even checking /sbin/init is not technically sufficient since the init program can be customized at boot time. The only foolproof way...

All done. A perfectly foolproof answer.
 
@NathanOsman Nice!
 

« first day (1728 days earlier)      last day (3251 days later) »