Samsung XE303C12 / Ctrl-U not booting

This forum is for supported devices using an ARMv7 Samsung SoC.

Re: Samsung XE303C12 / Ctrl-U not booting

Postby paddydetox » Wed Oct 13, 2021 1:22 pm

I see that I have legacy, USB boot both enabled, and signed only is set to 0 in the crossystem output. I also notice a field to change the automatic boot location. Is it possible to change this to USB or MicroSD? Or would this make any kind of recovery permanently impossible?

I saw in another section someone had mentioned the SS USB drive being too fast and they had success with the other port, so I am going to try again right now using a 128GB USB in the slow port and see if we have any changes/progress. If there is no different result I'll then assume it's like you said at the end of your last post that it is likely a different kernel is needed, and more likely a smaller kernel. I'll re-explore those options pending an unsuccessful outcome.
paddydetox
 
Posts: 9
Joined: Mon Sep 27, 2021 7:13 pm

Re: Samsung XE303C12 / Ctrl-U not booting

Postby paddydetox » Wed Oct 13, 2021 2:19 pm

No new developments or changes in process. USB always fails at step 8, stating failed to mount /dev/sda1 and /dev/sda2 . Using MicroSD completes full steps all the way through to rebooting, it just will not boot from USB. I even tried taking the SD out and putting it in to a USB converter and then plugging that into the slow USB port but no difference, never boots from USB. Will explore alternative kernels though this is (as is all of ArchLinux) is uncharted territory for me so I am DEFINITELY lacking in technical knowledge.
paddydetox
 
Posts: 9
Joined: Mon Sep 27, 2021 7:13 pm

Re: Samsung XE303C12 / Ctrl-U not booting

Postby armuseru » Fri Oct 15, 2021 8:29 am

paddydetox wrote:I also notice a field to change the automatic boot location. Is it possible to change this to USB or MicroSD?
I haven't tried it, but why not; anyway i would not recommend changing it before you get a working bootable usb or sd card
paddydetox wrote:stating failed to mount /dev/sda1
the kernel partition cannot be mounted because the kernel writes directly to it without a filesystem

if partx -a /dev/sda gives errors you may reboot chromebook and continue from next step
maybe your device is not sda, try to list available devices like ls /dev | grep sd ( or grep mmc )
sdcard should be /dev/mmcblk1; usb media - /dev/sd[a-w]

I have some kind of solution with disk partitions:
- download file https://upload.disroot.org/r/nuKB0BrC#z7fXM1AF6X7iiLo1bmoX5RtqLOwtPr4ov7fJ8HRcESo= by web-browser
- extract it like tar -xf disk.tar.gz and you got 4Gb empty disk image
- find external media ls /dev | grep sd ( for example it will be /dev/sdb )
- write disk image to external media directly from shell with root privileges dd if=disk.img of=/dev/sdb bs=8M status=progress ( any existed data of that media will be lost )
- reboot chromebook, run shell with root privileges and continue from step 10; before mount root partition list /dev and find your pendrive ( /dev/sd[a-w]1 - kernel partition, /dev/sd[a-w]2 - ext4 root partition )


UPD2:
or you can try this image https://upload.disroot.org/r/cXSTRbZ0#xMrW1UBnYThfF7IGdTpmOk5XvtmhYneyxcnSx59trQM= ( download, extract, write to external media and reboot )
at least it boots from my xe303c12
IMG.jpg
photo from screen of booted proposed image
IMG.jpg (77.9 KiB) Viewed 6165 times


( re-signed for chromebooks only ) kernel flash image from it https://upload.disroot.org/r/KfowNHw4#797YaQJrBqbISAZ8JORCVHqjwrKqc63cKZu0i50lDIM=
armuseru
 
Posts: 34
Joined: Sat Jan 09, 2021 9:36 am

Re: Samsung XE303C12 / Ctrl-U not booting

Postby paddydetox » Thu Oct 28, 2021 10:44 pm

OK So I downloaded the file from disroot via the link, and the file is in downloads. do I extract it where it is or do I extract it to a location? Or does it not matter where it is it just matters that it exists to write to the sd card location?
paddydetox
 
Posts: 9
Joined: Mon Sep 27, 2021 7:13 pm

Re: Samsung XE303C12 / Ctrl-U not booting

Postby armuseru » Fri Oct 29, 2021 7:51 am

Yes, it not matter where it is . 2 conditions: there must be enough free space (5GB or more) and it must not be a device to which the image will subsequently be writed. For example, you can save the file to a second USB flash drive, unpack it there and then write the image to the first USB flash drive. Also, the device to which the image will be written must be unmounted, otherwise there may be unexpected errors.

Option I proposed has some limitation on the size of the system disk. In order to use the full size of your flash drive, you need to partition the disk as descibed in the installation guide. At step 7, where you need to substitute the number obtained from the previous command, apostrophes are used (the key under the escape) and not quotes. Or you can use some calculator and place result instead of `expr xxxxx - 40960`. If everything worked out except for booting, you can try the kernel from the last link. It is the same standard kernel, but without blobs for the rockchip etc. (less than 8Mb)

edit 10.12.21
Since links dead, I think I post instruction how I did re-sign kernel, maybe it helps someone. This produces 7,5M kernel image from installed default kernel package and result is successfully boots in my case. Probably it can be done from chroot.
- mkdir /boot/reflash and place there kernel_data_key.vbprivk, kernel.keyblock from https://github.com/archlinuxarm/PKGBUILDs/tree/master/core/linux-armv7 and kernel.its, kerninst; chmod +x kerninst
- sudo pacman -S uboot-tools vboot-utils dtc
- execute /boot/kerninst with root privileges, press y to re-sign, press enter, press enter for use default bootstring, specify partition number from list for flashing, press enter and reboot
By the way, with wrong partition you may destroy your chrome-os, be aware
Since kernel.its refers to /boot/dtbs/*.dtb and /boot/zImage they should exist, or you may wtite another path
Scripts not mine.

kernel.its
Code: Select all
/dts-v1/;

/ {
    description = "Chrome OS kernel image with one or more FDT blobs";
    #address-cells = <1>;
    images {
        kernel@1 {
            description = "kernel";
            data = /incbin/("/boot/zImage");
            type = "kernel_noload";
            arch = "arm";
            os = "linux";
            compression = "none";
            load = <0>;
            entry = <0>;
        };
        fdt@1 {
            description = "exynos5250-snow.dtb";
            data = /incbin/("/boot/dtbs/exynos5250-snow.dtb");
            type = "flat_dt";
            arch = "arm";
            compression = "none";
            hash@1 {
                algo = "sha1";
            };
        };
        fdt@2 {
            description = "exynos5250-snow-rev5.dtb";
            data = /incbin/("/boot/dtbs/exynos5250-snow-rev5.dtb");
            type = "flat_dt";
            arch = "arm";
            compression = "none";
            hash@1 {
                algo = "sha1";
            };
        };
        fdt@3 {
            description = "exynos5250-spring.dtb";
            data = /incbin/("/boot/dtbs/exynos5250-spring.dtb");
            type = "flat_dt";
            arch = "arm";
            compression = "none";
            hash@1 {
                algo = "sha1";
            };
        };
        fdt@4 {
            description = "exynos5800-peach-pi.dtb";
            data = /incbin/("/boot/dtbs/exynos5800-peach-pi.dtb");
            type = "flat_dt";
            arch = "arm";
            compression = "none";
            hash@1{
                algo = "sha1";
            };
        };
        fdt@5 {
            description = "exynos5420-peach-pit.dtb";
            data = /incbin/("/boot/dtbs/exynos5420-peach-pit.dtb");
            type = "flat_dt";
            arch = "arm";
            compression = "none";
            hash@1 {
                algo = "sha1";
            };
        };
    };
    configurations {
        default = "conf@1";
        conf@1 {
            kernel = "kernel@1";
            fdt = "fdt@1";
        };
        conf@2 {
            kernel = "kernel@1";
            fdt = "fdt@2";
        };
        conf@3 {
            kernel = "kernel@1";
            fdt = "fdt@3";
        };
        conf@4 {
            kernel = "kernel@1";
            fdt = "fdt@4";
        };
        conf@5 {
            kernel = "kernel@1";
            fdt = "fdt@5";
        };
    };
};

kerninst
Code: Select all
#!/bin/bash
if [ "$(whoami)" == "root" ]; then

# resign kernel

echo "
You may re-sign kernel and customize kernel boot string.
Regular user do not need it, so it is safe to press n.
Do you want to do this? (y/n)
"
read -r tmpvar1
if $(echo $tmpvar1 | grep -q [Yy]); then
    bootcmd='console=tty0 init=/sbin/init root=PARTUUID=%U/PARTNROFF=1 rootwait rw zswap.compressor=zstd zswap.max_pool_percent=40 audit=0'
    echo "default bootcmd is

$bootcmd

Be very careful, without init=/sbin/init root=PARTUUID=%U/PARTNROFF=1
or something like that your could get a bootfail.
Now you may specify a new one or just press Enter"
    tmpvar2=""
    read -r tmpvar2
    if [ ! -z "$tmpvar2" ]; then
        bootcmd="$tmpvar2"
    else
        echo "Will be used default boot string
   "
    fi
        #
        mkimage -D "-I dts -O dtb -p 2048" -f /boot/reflash/kernel.its /tmp/vmlinux.uimg
        # make empty bootloader
        dd if=/dev/zero of=/tmp/bootloader.bin bs=512 count=1
       
        echo $bootcmd > /tmp/cmdline
       
        # backup default kernel.img
        mv -f /boot/kernel.img /boot/backup_kernel.img
       
        # final step
        vbutil_kernel \
        --pack /boot/kernel.img \
        --version 1 \
        --vmlinuz /tmp/vmlinux.uimg \
        --arch arm \
        --keyblock /boot/reflash/kernel.keyblock \
        --signprivate /boot/reflash/kernel_data_key.vbprivk \
        --config /tmp/cmdline \
        --bootloader /tmp/bootloader.bin
       
        # clear used files
        rm -f /tmp/vmlinux.uimg /tmp/cmdline /tmp/bootloader.bin
fi

# flash kernel

  krnprts=""
  krnprtc=0
  for i in $(ls /dev | grep -x --regexp="mmcblk[0-9]" --regexp="sd[a-z]" --regexp="vd[a-z]"); do
    if $(cgpt show /dev/$i | grep Label | grep -q [Kk]ernel); then
      if $(echo $i | grep -q mmcblk); then
        krnprts+="$i""p$(cgpt show /dev/$i | grep Label | grep [Kk]ernel -m 1 | sed 's/  / /g' | sed 's/  / /g' | sed 's/ La.*//g' | sed 's/.* //g') "
      else
        krnprts+="$i$(cgpt show /dev/$i | grep Label | grep [Kk]ernel -m 1 | sed 's/  / /g' | sed 's/  / /g' | sed 's/ La.*//g' | sed 's/.* //g') "
      fi
      krnprtc=$(($krnprtc+1))
    fi
  done
 
  echo ""
  if [ "$krnprtc" -eq 0 ]; then
    echo "Chrome OS kernel partition did not detected."
    echo "You must reflash kernel manually."
  elif [ "$krnprtc" -eq 1 ]; then
    echo "Finded ChromeOs kernel partition - $krnprts"
    echo "Do you want to flash a new kernel to it? (y/n)"
    read -r shouldwe
    if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then
      dd if=/boot/kernel.img of=/dev/$krnprts
      sync
    else
      echo "You may flash kernel manually like:"
      echo "dd if=/boot/kernel.img of=/dev/$krnprts"
    fi
  else
    echo "Finded more than one Chrome OS kernel partition."
    echo "You need to select next action
    "
    echo "0 for do not flash"
    numpart=0
    for i in $krnprts; do
      numpart=$(($numpart+1))
      echo "$numpart for flash $i partition"
    done
    echo ""
    echo "Wrong partition may lead to bootfail. Be aware!"
    read -r shouldwe
    if [ $shouldwe -gt 0 ]&&[ $shouldwe -le $numpart ]; then
      numpart=0
      for i in $krnprts; do
        numpart=$(($numpart+1))
        if [ $numpart -eq $shouldwe ]; then
          dd if=/boot/kernel.img of=/dev/$i
          sync
        fi
      done
    fi
  fi
else
  echo superuser rights required
fi
armuseru
 
Posts: 34
Joined: Sat Jan 09, 2021 9:36 am

Previous

Return to Samsung

Who is online

Users browsing this forum: No registered users and 2 guests

cron