Skip to content
Permalink
Browse files

Boot from USB Mass Storage Device (/dev/sda)

  • Loading branch information...
hokamoto committed Oct 1, 2018
1 parent 246c101 commit d248bf2933b25d7e11b9ff5725318e1508a8b845
@@ -151,7 +151,7 @@ fi
printf "# Spawn a getty on Raspberry Pi serial line\nT0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100\n" >> /etc/inittab

# boot/cmdline.txt
echo "dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 cgroup_enable=cpuset cgroup_enable=memory swapaccount=1 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh" > /boot/cmdline.txt
echo "dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 cgroup_enable=cpuset cgroup_enable=memory swapaccount=1 elevator=deadline fsck.repair=yes rootwait quiet init=/usr/lib/raspi-config/init_resize.sh" > /boot/cmdline.txt

# create a default boot/config.txt file (details see http://elinux.org/RPiconfig)
echo "
@@ -172,8 +172,8 @@ echo "snd_bcm2835
# create /etc/fstab
echo "
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 0
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
/dev/sda1 /boot vfat defaults 0 0
/dev/sda2 / ext4 defaults,noatime 0 1
" > /etc/fstab

# as the Pi does not have a hardware clock we need a fake one
@@ -3,7 +3,7 @@
it { should be_mode 755 }
it { should be_owned_by 'root' }
its(:content) { should match /dwc_otg.lpm_enable=0/ }
its(:content) { should match /root=\/dev\/mmcblk0p2/ }
its(:content) { should match /root=\/dev\/sda2/ }
its(:content) { should match /rootfstype=ext4/ }
its(:content) { should match /cgroup_enable=memory/ }
its(:content) { should match /cgroup_enable=cpuset/ }
@@ -35,11 +35,11 @@
let(:stdout) { run_mounted("cat /etc/fstab").stdout }

it "has a vfat boot entry" do
expect(stdout).to contain('/dev/mmcblk0p1 /boot vfat')
expect(stdout).to contain('/dev/sda1 /boot vfat')
end

it "has a ext4 root entry" do
expect(stdout).to contain('/dev/mmcblk0p2 / ext4')
expect(stdout).to contain('/dev/sda2 / ext4')
end
end
end

0 comments on commit d248bf2

Please sign in to comment.
You can’t perform that action at this time.