I want to run user mode linux on Android system;  but there is somthing 
when running uml!

    Android source version: 9.0
     Kernel source branch:   android-4.14-p

    I followed on these steps:

    1)  Compile UML userspace
    $ . build/envsetup.sh
    $ lunch uml-userdebug
    $ make -j40

    2) Compile UML Kernel on android-4.14-p branch
    $ ARCH=um SUBARCH=x86_64 scripts/kconfig/merge_config.sh
    arch/um/configs/x86_64_defconfig kernel/configs/android-base.config
    kernel/configs/android-recommended.config
    $ make ARCH=um SUBARCH=x86_64 CROSS_COMPILE= -j40

   3) ./vmlinux initrd=ramdisk.img ubda=system.img ubdb=userdata.img  
androidboot.hardware=uml mem=256M umid=uml

       The log output:


init: First stage mount skipped (missing/incompatible fstab in device tree)
init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
init: Loading SELinux policy
SELinux:  Class process2 not defined in policy.
SELinux:  Permission watch in class filesystem not defined in policy.
SELinux:  Permission watch in class file not defined in policy.
SELinux:  Permission watch_mount in class file not defined in policy.
SELinux:  Permission watch_sb in class file not defined in policy.
SELinux:  Permission watch_with_perm in class file not defined in policy.
SELinux:  Permission watch_reads in class file not defined in policy.
SELinux:  Permission watch in class dir not defined in policy.
SELinux:  Permission watch_mount in class dir not defined in policy.
SELinux:  Permission watch_sb in class dir not defined in policy.
SELinux:  Permission watch_with_perm in class dir not defined in policy.
SELinux:  Permission watch_reads in class dir not defined in policy.
SELinux:  Permission watch in class lnk_file not defined in policy.
SELinux:  Permission watch_mount in class lnk_file not defined in policy.
SELinux:  Permission watch_sb in class lnk_file not defined in policy.
SELinux:  Permission watch_with_perm in class lnk_file not defined in 
policy.
SELinux:  Permission watch_reads in class lnk_file not defined in policy.
SELinux:  Permission watch in class chr_file not defined in policy.
SELinux:  Permission watch_mount in class chr_file not defined in policy.
SELinux:  Permission watch_sb in class chr_file not defined in policy.
SELinux:  Permission watch_with_perm in class chr_file not defined in 
policy.
SELinux:  Permission watch_reads in class chr_file not defined in policy.
SELinux:  Permission watch in class blk_file not defined in policy.
SELinux:  Permission watch_mount in class blk_file not defined in policy.
SELinux:  Permission watch_sb in class blk_file not defined in policy.
SELinux:  Permission watch_with_perm in class blk_file not defined in 
policy.
SELinux:  Permission watch_reads in class blk_file not defined in policy.
SELinux:  Permission watch in class sock_file not defined in policy.
SELinux:  Permission watch_mount in class sock_file not defined in policy.
SELinux:  Permission watch_sb in class sock_file not defined in policy.
SELinux:  Permission watch_with_perm in class sock_file not defined in 
policy.
SELinux:  Permission watch_reads in class sock_file not defined in policy.
SELinux:  Permission watch in class fifo_file not defined in policy.
SELinux:  Permission watch_mount in class fifo_file not defined in policy.
SELinux:  Permission watch_sb in class fifo_file not defined in policy.
SELinux:  Permission watch_with_perm in class fifo_file not defined in 
policy.
SELinux:  Permission watch_reads in class fifo_file not defined in policy.
SELinux:  Permission name_connect in class sctp_socket not defined in 
policy.
SELinux:  Permission association in class sctp_socket not defined in policy.
SELinux:  Class infiniband_pkey not defined in policy.
SELinux:  Class infiniband_endport not defined in policy.
SELinux:  Class xdp_socket not defined in policy.
SELinux:  Class perf_event not defined in policy.
SELinux: the above unknown classes and permissions will be denied
SELinux:  policy capability network_peer_controls=1
SELinux:  policy capability open_perms=1
SELinux:  policy capability extended_socket_class=1
SELinux:  policy capability always_check_network=0
SELinux:  policy capability cgroup_seclabel=0
SELinux:  policy capability nnp_nosuid_transition=0
audit: type=1403 audit(1577771151.933:2): auid=4294967295 ses=4294967295 
lsm=selinux res=1
selinux: SELinux: Loaded policy from /sepolicy

audit: type=1404 audit(1577771151.933:3): enforcing=1 old_enforcing=0 
auid=4294967295 ses=4294967295 enabled=1 old-enabled=1 lsm=selinux res=1
selinux: SELinux: Loaded file_contexts

random: init: uninitialized urandom read (40 bytes read)
init: init second stage started!
init: Using Android DT directory /proc/device-tree/firmware/android/
selinux: SELinux: Loaded file_contexts

init: Running restorecon...
selinux: SELinux:  Could not stat /dev/block: No such file or directory.

init: waitid failed: No child processes
init: Created socket '/dev/socket/property_service', mode 666, user 0, 
group 0
init: Forked subcontext for 'u:r:vendor_init:s0' with pid 68
init: Forked subcontext for 'u:r:vendor_init:s0' with pid 69
random: init: uninitialized urandom read (40 bytes read)
random: init: uninitialized urandom read (40 bytes read)
audit: type=1400 audit(1577771151.993:4): avc:  denied  { map } for  pid=68 
comm="init" path="/plat_file_contexts" dev="rootfs" ino=2651 
scontext=u:r:vendor_init:s0 tcontext=u:object_r:file_contexts_file:s0 
tclass=file permissive=0
audit: type=1400 audit(1577771151.993:5): avc:  denied  { map } for  pid=69 
comm="init" path="/plat_file_contexts" dev="rootfs" ino=2651 
scontext=u:r:vendor_init:s0 tcontext=u:object_r:file_contexts_file:s0 
tclass=file permissive=0
random: fast init done

My question is:  why can not loggin into shell terminal?

The detail log shows in the attachment!


-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-porting/c5d7eb17-1202-4d09-8889-18d5c0de1217%40googlegroups.com.
tom@tom-linuxer:~/work/uml-debug$ ./run.sh 
Core dump limits :
        soft - 0
        hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...OK
Checking advanced syscall emulation patch for ptrace...OK
Checking environment variables for a tempdir...none found
Checking if /dev/shm is on tmpfs...OK
Checking PROT_EXEC mmap in /dev/shm...OK
Adding 6262784 bytes to physical memory to account for exec-shield gap
Linux version 5.5.0-rc2-13840-g7204b56d4d42 (tom@tom-linuxer) (gcc version 
7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #2 Tue Dec 31 09:55:23 CST 2019
Built 1 zonelists, mobility grouping on.  Total pages: 66148
Kernel command line: initrd=ramdisk.img ubda=system.img ubdb=userdata.img 
androidboot.hardware=uml mem=256M root=98:0
Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
mem auto-init: stack:off, heap alloc:off, heap free:off
Memory: 247260K/268260K available (4502K kernel code, 1426K rwdata, 2016K 
rodata, 313K init, 278K bss, 21000K reserved, 0K cma-reserved)
NR_IRQS: 16
clocksource: timer: mask: 0xffffffffffffffff max_cycles: 0x1cd42e205, 
max_idle_ns: 881590404426 ns
Calibrating delay loop... 8563.09 BogoMIPS (lpj=42815488)
pid_max: default: 32768 minimum: 301
LSM: Security Framework initializing
SELinux:  Initializing.
Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
Checking that host ptys support output SIGIO...Yes
Checking that host ptys support SIGIO on close...No, enabling workaround
devtmpfs: initialized
random: get_random_bytes called from 0x6002d92f with crng_init=0
umid "uml" is already in use by pid 4983
Failed to initialize umid "uml", trying with a random umid
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 
19112604462750000 ns
futex hash table entries: 256 (order: 0, 6144 bytes, linear)
NET: Registered protocol family 16
audit: initializing netlink subsys (disabled)
audit: type=2000 audit(1577774029.331:1): state=initialized audit_enabled=0 
res=1
clocksource: Switched to clocksource timer
VFS: Disk quotas dquot_6.6.0
VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)
NET: Registered protocol family 2
tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
NET: Registered protocol family 1
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 1808K
printk: console [stderr0] disabled
mconsole (version 2) initialized on /home/tom/.uml/fv3hmS/mconsole
Checking host MADV_REMOVE support...OK
workingset: timestamp_bits=62 max_order=16 bucket_order=0
fuse: init (API version 7.31)
io scheduler mq-deadline registered
io scheduler kyber registered
brd: module loaded
loop: module loaded
tun: Universal TUN/TAP device driver, 1.6
PPP generic driver version 2.4.2
PPP BSD Compression module registered
PPP Deflate Compression module registered
PPP MPPE Compression module registered
device-mapper: uevent: version 1.0.3
device-mapper: ioctl: 4.41.0-ioctl (2019-09-16) initialised: dm-de...@redhat.com
ashmem: initialized
u32 classifier
    input device check on
    Actions configured
xt_time: kernel timezone is -0000
Initializing XFRM netlink socket
NET: Registered protocol family 10
Segment Routing with IPv6
mip6: Mobile IPv6
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
NET: Registered protocol family 15
Initialized stdio console driver
Console initialized on /dev/tty0
printk: console [tty0] enabled
Initializing software serial port version 1
printk: console [mc-1] enabled
registered taskstats version 1
This architecture does not have kernel memory protection.
Run /init as init process
init: init first stage started!
init: Using Android DT directory /proc/device-tree/firmware/android/
init: First stage mount skipped (missing/incompatible fstab in device tree)
init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
init: Loading SELinux policy
SELinux:  Class process2 not defined in policy.
SELinux:  Permission watch in class filesystem not defined in policy.
SELinux:  Permission watch in class file not defined in policy.
SELinux:  Permission watch_mount in class file not defined in policy.
SELinux:  Permission watch_sb in class file not defined in policy.
SELinux:  Permission watch_with_perm in class file not defined in policy.
SELinux:  Permission watch_reads in class file not defined in policy.
SELinux:  Permission watch in class dir not defined in policy.
SELinux:  Permission watch_mount in class dir not defined in policy.
SELinux:  Permission watch_sb in class dir not defined in policy.
SELinux:  Permission watch_with_perm in class dir not defined in policy.
SELinux:  Permission watch_reads in class dir not defined in policy.
SELinux:  Permission watch in class lnk_file not defined in policy.
SELinux:  Permission watch_mount in class lnk_file not defined in policy.
SELinux:  Permission watch_sb in class lnk_file not defined in policy.
SELinux:  Permission watch_with_perm in class lnk_file not defined in policy.
SELinux:  Permission watch_reads in class lnk_file not defined in policy.
SELinux:  Permission watch in class chr_file not defined in policy.
SELinux:  Permission watch_mount in class chr_file not defined in policy.
SELinux:  Permission watch_sb in class chr_file not defined in policy.
SELinux:  Permission watch_with_perm in class chr_file not defined in policy.
SELinux:  Permission watch_reads in class chr_file not defined in policy.
SELinux:  Permission watch in class blk_file not defined in policy.
SELinux:  Permission watch_mount in class blk_file not defined in policy.
SELinux:  Permission watch_sb in class blk_file not defined in policy.
SELinux:  Permission watch_with_perm in class blk_file not defined in policy.
SELinux:  Permission watch_reads in class blk_file not defined in policy.
SELinux:  Permission watch in class sock_file not defined in policy.
SELinux:  Permission watch_mount in class sock_file not defined in policy.
SELinux:  Permission watch_sb in class sock_file not defined in policy.
SELinux:  Permission watch_with_perm in class sock_file not defined in policy.
SELinux:  Permission watch_reads in class sock_file not defined in policy.
SELinux:  Permission watch in class fifo_file not defined in policy.
SELinux:  Permission watch_mount in class fifo_file not defined in policy.
SELinux:  Permission watch_sb in class fifo_file not defined in policy.
SELinux:  Permission watch_with_perm in class fifo_file not defined in policy.
SELinux:  Permission watch_reads in class fifo_file not defined in policy.
SELinux:  Permission name_connect in class sctp_socket not defined in policy.
SELinux:  Permission association in class sctp_socket not defined in policy.
SELinux:  Class infiniband_pkey not defined in policy.
SELinux:  Class infiniband_endport not defined in policy.
SELinux:  Class xdp_socket not defined in policy.
SELinux:  Class perf_event not defined in policy.
SELinux: the above unknown classes and permissions will be denied
SELinux:  policy capability network_peer_controls=1
SELinux:  policy capability open_perms=1
SELinux:  policy capability extended_socket_class=1
SELinux:  policy capability always_check_network=0
SELinux:  policy capability cgroup_seclabel=0
SELinux:  policy capability nnp_nosuid_transition=0
audit: type=1403 audit(1577774029.381:2): auid=4294967295 ses=4294967295 
lsm=selinux res=1
selinux: SELinux: Loaded policy from /sepolicy

audit: type=1404 audit(1577774029.381:3): enforcing=1 old_enforcing=0 
auid=4294967295 ses=4294967295 enabled=1 old-enabled=1 lsm=selinux res=1
selinux: SELinux: Loaded file_contexts

random: init: uninitialized urandom read (40 bytes read)
init: init second stage started!
init: Using Android DT directory /proc/device-tree/firmware/android/
selinux: SELinux: Loaded file_contexts

init: Running restorecon...
selinux: SELinux:  Could not stat /dev/block: No such file or directory.

init: waitid failed: No child processes
init: Created socket '/dev/socket/property_service', mode 666, user 0, group 0
init: Forked subcontext for 'u:r:vendor_init:s0' with pid 68
init: Forked subcontext for 'u:r:vendor_init:s0' with pid 69
random: init: uninitialized urandom read (40 bytes read)
random: init: uninitialized urandom read (40 bytes read)
audit: type=1400 audit(1577774029.431:4): avc:  denied  { map } for  pid=69 
comm="init" path="/plat_file_contexts" dev="rootfs" ino=2651 
scontext=u:r:vendor_init:s0 tcontext=u:object_r:file_contexts_file:s0 
tclass=file permissive=0
audit: type=1400 audit(1577774029.441:5): avc:  denied  { map } for  pid=68 
comm="init" path="/plat_file_contexts" dev="rootfs" ino=2651 
scontext=u:r:vendor_init:s0 tcontext=u:object_r:file_contexts_file:s0 
tclass=file permissive=0
random: fast init done

Reply via email to