-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
191 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
This is not a good way how to do it, we should rather emulate dvd for big isos, but it should work for data isos. | ||
diff --git a/drivers/usb/gadget/function/storage_common.c b/drivers/usb/gadget/function/storage_common.c | ||
index f7e6c42558eb..8db8cda0c930 100644 | ||
--- a/drivers/usb/gadget/function/storage_common.c | ||
+++ b/drivers/usb/gadget/function/storage_common.c | ||
@@ -243,12 +243,6 @@ int fsg_lun_open(struct fsg_lun *curlun, const char *filename) | ||
min_sectors = 1; | ||
if (curlun->cdrom) { | ||
min_sectors = 300; /* Smallest track is 300 frames */ | ||
- if (num_sectors >= 256*60*75) { | ||
- num_sectors = 256*60*75 - 1; | ||
- LINFO(curlun, "file too big: %s\n", filename); | ||
- LINFO(curlun, "using only first %d blocks\n", | ||
- (int) num_sectors); | ||
- } | ||
} | ||
if (num_sectors < min_sectors) { | ||
LINFO(curlun, "file too small: %s\n", filename); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
IMG_NAME=gadget_cdrom | ||
RELEASE=buster | ||
USE_QCOW2=0 | ||
STAGE_LIST="stage0 stage1 stage2 stage-gc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/bash -eu | ||
#modprobe binfmt_misc | ||
git clone https://github.com/RPi-Distro/pi-gen.git | ||
rsync -av config pi-gen/ | ||
rsync -av stage-gc pi-gen/ | ||
cd pi-gen | ||
PRESERVE_CONTAINER=1 ./build-docker.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python3-numpy python3-pil fonts-dejavu ntfs-3g p7zip-full python3-rpi.gpio python3-smbus python3-spidev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash -eu | ||
|
||
function set_config_txt { | ||
local key="$1" | ||
local value="$2" | ||
|
||
if egrep -q "^${key}=" "${ROOTFS_DIR}/boot/config.txt"; then | ||
sed "s/${key}=.*/${key}=${value}/g" -i "${ROOTFS_DIR}/boot/config.txt" | ||
else | ||
echo >> "${ROOTFS_DIR}/boot/config.txt" | ||
echo "${key}=${value}" >> "${ROOTFS_DIR}/boot/config.txt" | ||
fi | ||
} | ||
|
||
cd "${ROOTFS_DIR}/opt" | ||
git clone https://github.com/tjmnmk/gadget_cdrom.git | ||
|
||
on_chroot << EOF | ||
systemctl enable /opt/gadget_cdrom/gadget_cdrom_auto_img.service | ||
EOF | ||
|
||
echo >> "${ROOTFS_DIR}/etc/modules" | ||
echo dwc2 >> "${ROOTFS_DIR}/etc/modules" | ||
|
||
vmlinuz_fname=$(dpkg -c /pi-gen/stage-gc/00-gadget_cdrom/files/kernel_packages/linux-image-*_armhf.deb |grep ./boot/vmlinuz |awk -F"/" '{print $NF}') | ||
for i in /pi-gen/stage-gc/00-gadget_cdrom/files/kernel_packages/linux*.deb; do | ||
install -m 644 "$i" "${ROOTFS_DIR}/root/" | ||
done | ||
install -m 755 "/pi-gen/stage-gc/00-gadget_cdrom/files/config.txt" "${ROOTFS_DIR}/boot/" | ||
on_chroot << EOF | ||
dpkg -i /root/linux*.deb | ||
EOF | ||
|
||
set_config_txt "kernel" "$vmlinuz_fname" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# For more options and information see | ||
# http://rpf.io/configtxt | ||
# Some settings may impact device functionality. See link above for details | ||
|
||
# uncomment if you get no picture on HDMI for a default "safe" mode | ||
#hdmi_safe=1 | ||
|
||
# uncomment this if your display has a black border of unused pixels visible | ||
# and your display can output without overscan | ||
#disable_overscan=1 | ||
|
||
# uncomment the following to adjust overscan. Use positive numbers if console | ||
# goes off screen, and negative if there is too much border | ||
#overscan_left=16 | ||
#overscan_right=16 | ||
#overscan_top=16 | ||
#overscan_bottom=16 | ||
|
||
# uncomment to force a console size. By default it will be display's size minus | ||
# overscan. | ||
#framebuffer_width=1280 | ||
#framebuffer_height=720 | ||
|
||
# uncomment if hdmi display is not detected and composite is being output | ||
#hdmi_force_hotplug=1 | ||
|
||
# uncomment to force a specific HDMI mode (this will force VGA) | ||
#hdmi_group=1 | ||
#hdmi_mode=1 | ||
|
||
# uncomment to force a HDMI mode rather than DVI. This can make audio work in | ||
# DMT (computer monitor) modes | ||
#hdmi_drive=2 | ||
|
||
# uncomment to increase signal to HDMI, if you have interference, blanking, or | ||
# no display | ||
#config_hdmi_boost=4 | ||
|
||
# uncomment for composite PAL | ||
#sdtv_mode=2 | ||
|
||
#uncomment to overclock the arm. 700 MHz is the default. | ||
#arm_freq=800 | ||
|
||
# Uncomment some or all of these to enable the optional hardware interfaces | ||
#dtparam=i2c_arm=on | ||
#dtparam=i2s=on | ||
#dtparam=spi=on | ||
|
||
# Uncomment this to enable infrared communication. | ||
#dtoverlay=dwc2 | ||
#dtoverlay=dwc2 | ||
|
||
# Additional overlays and parameters are documented /boot/overlays/README | ||
|
||
# Enable audio (loads snd_bcm2835) | ||
dtparam=audio=on | ||
|
||
[pi4] | ||
# Enable DRM VC4 V3D driver on top of the dispmanx display stack | ||
dtoverlay=dwc2 | ||
max_framebuffers=2 | ||
|
||
[all] | ||
dtoverlay=dwc2 | ||
|
||
dtparam=spi=on | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash -e | ||
|
||
install -m 755 /pi-gen/stage-gc/01-sys-tweaks/files/resize2fs_once "${ROOTFS_DIR}/etc/init.d/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Copyright (c) 2015 Raspberry Pi (Trading) Ltd. | ||
|
||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
### BEGIN INIT INFO | ||
# Provides: resize2fs_once | ||
# Required-Start: | ||
# Required-Stop: | ||
# Default-Start: 3 | ||
# Default-Stop: | ||
# Short-Description: Resize the root filesystem to fill partition | ||
# Description: | ||
### END INIT INFO | ||
. /lib/lsb/init-functions | ||
case "$1" in | ||
start) | ||
log_daemon_msg "Starting resize2fs_once" | ||
ROOT_DEV=$(findmnt / -o source -n) | ||
resize2fs $ROOT_DEV | ||
update-rc.d resize2fs_once remove | ||
rm /etc/init.d/resize2fs_once | ||
log_end_msg $? | ||
reboot | ||
;; | ||
*) | ||
echo "Usage: $0 start" >&2 | ||
exit 3 | ||
;; | ||
esac | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
IMG_SUFFIX="-gc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash -e | ||
|
||
if [ ! -d "${ROOTFS_DIR}" ]; then | ||
copy_previous | ||
fi |