mk_mmc.sh: major cleanup for non conf_smart_uboot devices

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
pull/37/head
Robert Nelson 10 years ago
parent c93f684ee2
commit 66947a9d97

@ -38,34 +38,6 @@ else
echo "ERROR: [/boot/uboot/mounts] was missing..." >> /var/log/netinstall.log echo "ERROR: [/boot/uboot/mounts] was missing..." >> /var/log/netinstall.log
fi fi
#Cleanup: NetInstall Files
rm -f /boot/uboot/uInitrd.net || true
rm -f /boot/uboot/uImage.net || true
rm -f /boot/uboot/zImage.net || true
rm -f /boot/uboot/initrd.net || true
#Cleanup: Initial Bootloader
rm -f /boot/uboot/boot.scr || true
rm -f /boot/uboot/uEnv.txt || true
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
if [ -f "/boot/uboot/backup/boot.scr" ] ; then
mv /boot/uboot/backup/boot.scr /boot/uboot/boot.scr
else
echo "WARN: [/boot/uboot/backup/boot.scr] was missing..." >> /var/log/netinstall.log
fi
fi
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
if [ -f "/boot/uboot/backup/normal.txt" ] ; then
sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/backup/normal.txt
sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/backup/normal.txt
mv /boot/uboot/backup/normal.txt /boot/uboot/uEnv.txt
else
echo "WARN: [/boot/uboot/backup/normal.txt] was missing..." >> /var/log/netinstall.log
fi
fi
if [ "x${serial_tty}" != "x" ] ; then if [ "x${serial_tty}" != "x" ] ; then
cp /etc/inittab /boot/uboot/backup/inittab cp /etc/inittab /boot/uboot/backup/inittab
serial_num=$(echo -n "${serial_tty}"| tail -c -1) serial_num=$(echo -n "${serial_tty}"| tail -c -1)
@ -134,30 +106,9 @@ __EOF__
chmod u+x /etc/init.d/generic-boot-script.sh chmod u+x /etc/init.d/generic-boot-script.sh
insserv generic-boot-script.sh || true insserv generic-boot-script.sh || true
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then #Cleanup:
if [ -f /boot/vmlinuz-`uname -r` ] ; then mv /boot/uboot/bootdrive /boot/uboot/backup/ || true
cp /boot/vmlinuz-`uname -r` /boot/uboot/zImage mv /boot/uboot/mounts /boot/uboot/backup/ || true
else
echo "ERROR: [/boot/vmlinuz-`uname -r`] missing" >> /var/log/netinstall.log
fi
if [ -f /boot/initrd.img-`uname -r` ] ; then
cp /boot/initrd.img-`uname -r` /boot/uboot/initrd.img
else
echo "ERROR: [/boot/initrd.img-`uname -r`] missing" >> /var/log/netinstall.log
fi
fi
#Cleanup:
mv /boot/uboot/bootdrive /boot/uboot/backup/ || true
mv /boot/uboot/mounts /boot/uboot/backup/ || true
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uboot/uInitrd
if [ "${zreladdr}" ] ; then
mkimage -A arm -O linux -T kernel -C none -a ${zreladdr} -e ${zreladdr} -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage
fi
fi
wfile="/boot/uEnv.txt" wfile="/boot/uEnv.txt"

@ -38,34 +38,6 @@ else
echo "ERROR: [/boot/uboot/mounts] was missing..." >> /var/log/netinstall.log echo "ERROR: [/boot/uboot/mounts] was missing..." >> /var/log/netinstall.log
fi fi
#Cleanup: NetInstall Files
rm -f /boot/uboot/uInitrd.net || true
rm -f /boot/uboot/uImage.net || true
rm -f /boot/uboot/zImage.net || true
rm -f /boot/uboot/initrd.net || true
#Cleanup: Initial Bootloader
rm -f /boot/uboot/boot.scr || true
rm -f /boot/uboot/uEnv.txt || true
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
if [ -f "/boot/uboot/backup/boot.scr" ] ; then
mv /boot/uboot/backup/boot.scr /boot/uboot/boot.scr
else
echo "WARN: [/boot/uboot/backup/boot.scr] was missing..." >> /var/log/netinstall.log
fi
fi
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
if [ -f "/boot/uboot/backup/normal.txt" ] ; then
sed -i -e 's:FINAL_PART:'$FINAL_PART':g' /boot/uboot/backup/normal.txt
sed -i -e 's:FINAL_FSTYPE:'$FINAL_FSTYPE':g' /boot/uboot/backup/normal.txt
mv /boot/uboot/backup/normal.txt /boot/uboot/uEnv.txt
else
echo "WARN: [/boot/uboot/backup/normal.txt] was missing..." >> /var/log/netinstall.log
fi
fi
if [ "x${serial_tty}" != "x" ] ; then if [ "x${serial_tty}" != "x" ] ; then
cat > /etc/init/${serial_tty}.conf <<-__EOF__ cat > /etc/init/${serial_tty}.conf <<-__EOF__
start on stopped rc RUNLEVEL=[2345] start on stopped rc RUNLEVEL=[2345]
@ -104,30 +76,9 @@ end script
__EOF__ __EOF__
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then #Cleanup:
if [ -f /boot/vmlinuz-`uname -r` ] ; then mv /boot/uboot/bootdrive /boot/uboot/backup/ || true
cp /boot/vmlinuz-`uname -r` /boot/uboot/zImage mv /boot/uboot/mounts /boot/uboot/backup/ || true
else
echo "ERROR: [/boot/vmlinuz-`uname -r`] missing" >> /var/log/netinstall.log
fi
if [ -f /boot/initrd.img-`uname -r` ] ; then
cp /boot/initrd.img-`uname -r` /boot/uboot/initrd.img
else
echo "ERROR: [/boot/initrd.img-`uname -r`] missing" >> /var/log/netinstall.log
fi
fi
#Cleanup:
mv /boot/uboot/bootdrive /boot/uboot/backup/ || true
mv /boot/uboot/mounts /boot/uboot/backup/ || true
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d /boot/initrd.img-`uname -r` /boot/uboot/uInitrd
if [ "${zreladdr}" ] ; then
mkimage -A arm -O linux -T kernel -C none -a ${zreladdr} -e ${zreladdr} -n `uname -r` -d /boot/vmlinuz-`uname -r` /boot/uboot/uImage
fi
fi
wfile="/boot/uEnv.txt" wfile="/boot/uEnv.txt"

@ -289,20 +289,11 @@ boot_uenv_txt_template () {
##Uncomment to override: ##Uncomment to override:
#kms_force_mode=video=${drm_device_identifier}:1024x768@60e #kms_force_mode=video=${drm_device_identifier}:1024x768@60e
kernel_file=${conf_normal_kernel_file}
initrd_file=${conf_normal_initrd_file}
console=SERIAL_CONSOLE console=SERIAL_CONSOLE
mmcroot=FINAL_PART ro mmcroot=FINAL_PART ro
mmcrootfstype=FINAL_FSTYPE rootwait fixrtc mmcrootfstype=FINAL_FSTYPE rootwait fixrtc
loadkernel=${conf_fileload} mmc \${bootpart} ${conf_loadaddr} \${kernel_file}
loadinitrd=${conf_fileload} mmc \${bootpart} ${conf_initrdaddr} \${initrd_file}; setenv initrd_size \${filesize}
loadfdt=${conf_fileload} mmc \${bootpart} ${conf_fdtaddr} /dtbs/\${fdtfile}
boot_fdt=run loadkernel; run loadinitrd; run loadfdt
loadximage=${conf_fileload} mmc \${bootpart} ${conf_loadaddr} ${kernel} loadximage=${conf_fileload} mmc \${bootpart} ${conf_loadaddr} ${kernel}
loadxfdt=${conf_fileload} mmc \${bootpart} ${conf_fdtaddr} /boot/dtbs/current/\${fdtfile} loadxfdt=${conf_fileload} mmc \${bootpart} ${conf_fdtaddr} /boot/dtbs/current/\${fdtfile}
loadxrd=${conf_fileload} mmc \${bootpart} ${conf_initrdaddr} ${initrd}; setenv initrd_size \${filesize} loadxrd=${conf_fileload} mmc \${bootpart} ${conf_initrdaddr} ${initrd}; setenv initrd_size \${filesize}
@ -312,9 +303,7 @@ boot_uenv_txt_template () {
optargs=VIDEO_CONSOLE optargs=VIDEO_CONSOLE
mmcargs=setenv bootargs console=\${console} \${optargs} \${kms_force_mode} root=\${mmcroot} rootfstype=\${mmcrootfstype} mmcargs=setenv bootargs console=\${console} \${optargs} \${kms_force_mode} root=\${mmcroot} rootfstype=\${mmcrootfstype}
uenvcmd=run boot_fdt; run mmcargs; ${conf_bootcmd} ${conf_loadaddr} ${conf_initrdaddr}:\${initrd_size} ${conf_fdtaddr} uenvcmd=run loadall; run mmcargs; ${conf_bootcmd} ${conf_loadaddr} ${conf_initrdaddr}:\${initrd_size} ${conf_fdtaddr}
#uenvcmd=run loadall; run mmcargs; ${conf_bootcmd} ${conf_loadaddr} ${conf_initrdaddr}:\${initrd_size} ${conf_fdtaddr}
__EOF__ __EOF__
@ -326,19 +315,10 @@ boot_uenv_txt_template () {
##Uncomment to override: ##Uncomment to override:
#kms_force_mode=video=${drm_device_identifier}:1024x768@60e #kms_force_mode=video=${drm_device_identifier}:1024x768@60e
kernel_file=${conf_net_kernel_file}
initrd_file=${conf_net_initrd_file}
console=DICONSOLE console=DICONSOLE
mmcroot=/dev/ram0 rw mmcroot=/dev/ram0 rw
loadkernel=${conf_fileload} mmc \${bootpart} ${conf_loadaddr} \${kernel_file}
loadinitrd=${conf_fileload} mmc \${bootpart} ${conf_initrdaddr} \${initrd_file}; setenv initrd_size \${filesize}
loadfdt=${conf_fileload} mmc \${bootpart} ${conf_fdtaddr} /dtbs/\${fdtfile}
boot_fdt=run loadkernel; run loadinitrd; run loadfdt
loadximage=${conf_fileload} mmc \${bootpart} ${conf_loadaddr} ${kernel} loadximage=${conf_fileload} mmc \${bootpart} ${conf_loadaddr} ${kernel}
loadxfdt=${conf_fileload} mmc \${bootpart} ${conf_fdtaddr} /boot/dtbs/current/\${fdtfile} loadxfdt=${conf_fileload} mmc \${bootpart} ${conf_fdtaddr} /boot/dtbs/current/\${fdtfile}
loadxrd=${conf_fileload} mmc \${bootpart} ${conf_initrdaddr} ${initrd}; setenv initrd_size \${filesize} loadxrd=${conf_fileload} mmc \${bootpart} ${conf_initrdaddr} ${initrd}; setenv initrd_size \${filesize}
@ -349,9 +329,7 @@ boot_uenv_txt_template () {
optargs=${conf_optargs} optargs=${conf_optargs}
mmcargs=setenv bootargs console=\${console} \${optargs} \${kms_force_mode} root=\${mmcroot} mmcargs=setenv bootargs console=\${console} \${optargs} \${kms_force_mode} root=\${mmcroot}
uenvcmd=run xyz_message; run boot_fdt; run mmcargs; ${conf_bootcmd} ${conf_loadaddr} ${conf_initrdaddr}:\${initrd_size} ${conf_fdtaddr} uenvcmd=run xyz_message; run loadall; run mmcargs; ${conf_bootcmd} ${conf_loadaddr} ${conf_initrdaddr}:\${initrd_size} ${conf_fdtaddr}
#uenvcmd=run xyz_message; run loadall; run mmcargs; ${conf_bootcmd} ${conf_loadaddr} ${conf_initrdaddr}:\${initrd_size} ${conf_fdtaddr}
__EOF__ __EOF__
@ -990,10 +968,7 @@ populate_boot () {
cp -v ${TEMPDIR}/kernel/boot/vmlinuz-* ${TEMPDIR}/disk/boot/vmlinuz-current cp -v ${TEMPDIR}/kernel/boot/vmlinuz-* ${TEMPDIR}/disk/boot/vmlinuz-current
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
touch ${TEMPDIR}/disk/boot/trampoline.uboot if [ ! "x${uboot_CONFIG_CMD_BOOTZ}" = "xenable" ] ; then
if [ "x${uboot_CONFIG_CMD_BOOTZ}" = "xenable" ] ; then
cp -v ${TEMPDIR}/kernel/boot/vmlinuz-* ${TEMPDIR}/disk/zImage.net
else
mkimage -A arm -O linux -T kernel -C none -a ${conf_zreladdr} -e ${conf_zreladdr} -n ${LINUX_VER} -d ${TEMPDIR}/kernel/boot/vmlinuz-* ${TEMPDIR}/disk/uImage.net mkimage -A arm -O linux -T kernel -C none -a ${conf_zreladdr} -e ${conf_zreladdr} -n ${LINUX_VER} -d ${TEMPDIR}/kernel/boot/vmlinuz-* ${TEMPDIR}/disk/uImage.net
fi fi
fi fi
@ -1007,9 +982,7 @@ populate_boot () {
cp -v ${TEMPDIR}/initrd.mod.gz ${TEMPDIR}/disk/boot/initrd.img-current cp -v ${TEMPDIR}/initrd.mod.gz ${TEMPDIR}/disk/boot/initrd.img-current
if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then if [ ! "x${conf_smart_uboot}" = "xenable" ] ; then
if [ "x${uboot_CONFIG_SUPPORT_RAW_INITRD}" = "xenable" ] ; then if [ ! "x${uboot_CONFIG_SUPPORT_RAW_INITRD}" = "xenable" ] ; then
cp -v ${TEMPDIR}/initrd.mod.gz ${TEMPDIR}/disk/initrd.net
else
mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ${TEMPDIR}/initrd.mod.gz ${TEMPDIR}/disk/uInitrd.net mkimage -A arm -O linux -T ramdisk -C none -a 0 -e 0 -n initramfs -d ${TEMPDIR}/initrd.mod.gz ${TEMPDIR}/disk/uInitrd.net
fi fi
fi fi
@ -1017,13 +990,7 @@ populate_boot () {
fi fi
echo "Copying Device Tree Files:" echo "Copying Device Tree Files:"
if [ "x${conf_smart_uboot}" = "xenable" ] ; then cp ${TEMPDIR}/kernel/boot/dtbs/${uname_r}/*.dtb ${TEMPDIR}/disk/boot/dtbs/current/
cp ${TEMPDIR}/kernel/boot/dtbs/${uname_r}/*.dtb ${TEMPDIR}/disk/boot/dtbs/current/
else
mkdir -p ${TEMPDIR}/disk/dtbs/ || true
cp ${TEMPDIR}/kernel/boot/dtbs/${uname_r}/*.dtb ${TEMPDIR}/disk/dtbs/
cp ${TEMPDIR}/kernel/boot/dtbs/${uname_r}/*.dtb ${TEMPDIR}/disk/boot/dtbs/current/
fi
if [ "${conf_uboot_bootscript}" ] ; then if [ "${conf_uboot_bootscript}" ] ; then
case "${dtb}" in case "${dtb}" in
@ -1253,23 +1220,15 @@ process_dtb_conf () {
if [ "x${uboot_CONFIG_CMD_BOOTZ}" = "xenable" ] ; then if [ "x${uboot_CONFIG_CMD_BOOTZ}" = "xenable" ] ; then
conf_bootcmd="bootz" conf_bootcmd="bootz"
conf_normal_kernel_file=zImage
conf_net_kernel_file=zImage.net
kernel=/boot/vmlinuz-current kernel=/boot/vmlinuz-current
else else
conf_bootcmd="bootm" conf_bootcmd="bootm"
conf_normal_kernel_file=uImage
conf_net_kernel_file=uImage.net
kernel=/boot/uImage kernel=/boot/uImage
fi fi
if [ "x${uboot_CONFIG_SUPPORT_RAW_INITRD}" = "xenable" ] ; then if [ "x${uboot_CONFIG_SUPPORT_RAW_INITRD}" = "xenable" ] ; then
conf_normal_initrd_file=initrd.img
conf_net_initrd_file=initrd.net
initrd=/boot/initrd.img-current initrd=/boot/initrd.img-current
else else
conf_normal_initrd_file=uInitrd
conf_net_initrd_file=uInitrd.net
initrd=/boot/uInitrd initrd=/boot/uInitrd
fi fi

Loading…
Cancel
Save