Fix issue with Ubuntu cloud images
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@ -204,6 +204,8 @@ function CloudInitUserDataAssistant(p: CloudInitProps): React.ReactElement {
|
||||
p.onChange?.();
|
||||
};
|
||||
|
||||
const SYSTEMD_NOT_SERIAL = `/bin/sh -c "rm -f /etc/default/grub.d/50-cloudimg-settings.cfg && update-grub"`;
|
||||
|
||||
return (
|
||||
<EditSection title="User data assistant">
|
||||
<CloudInitTextInput
|
||||
@ -255,6 +257,31 @@ function CloudInitUserDataAssistant(p: CloudInitProps): React.ReactElement {
|
||||
onChange={onChange}
|
||||
yaml={user_data}
|
||||
/>
|
||||
{/* /bin/sh -c "rm -f /etc/default/grub.d/50-cloudimg-settings.cfg && update-grub" */}
|
||||
<CheckboxInput
|
||||
editable={p.editable}
|
||||
label="Show all startup messages on tty1, not serial"
|
||||
checked={
|
||||
!!(user_data.get("runcmd") as any | undefined)?.items.find(
|
||||
(a: any) => a.value === SYSTEMD_NOT_SERIAL
|
||||
)
|
||||
}
|
||||
onValueChange={(c) => {
|
||||
if (!user_data.getIn(["runcmd"])) user_data.addIn(["runcmd"], []);
|
||||
|
||||
const runcmd = user_data.getIn(["runcmd"]) as any;
|
||||
|
||||
if (c) {
|
||||
runcmd.addIn([], SYSTEMD_NOT_SERIAL);
|
||||
} else {
|
||||
const idx = runcmd.items.findIndex(
|
||||
(o: any) => o.value === SYSTEMD_NOT_SERIAL
|
||||
);
|
||||
runcmd.items.splice(idx, 1);
|
||||
}
|
||||
onChange();
|
||||
}}
|
||||
/>
|
||||
</EditSection>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user